NCEPLIBS-bufr  12.0.1
nemock.f
Go to the documentation of this file.
1 C> @file
2 C> @brief Check the validity of a mnemonic.
3 C>
4 C> @author J. Woollen @date 1994-01-06
5 
6 C> This function checks a mnemonic to verify that it has a
7 C> length of between 1 and 8 characters and that it only
8 C> contains characters from the allowable character set.
9 C>
10 C> @param[in] NEMO - character*(*): mnemonic to be checked
11 C> @returns - integer: indicator as to whether NEMO is valid:
12 C> - 0 yes
13 C> - -1 no, the length is not between 1 and 8 characters
14 C> - -2 no, it contains characters from outside of the allowable character set
15 C>
16 C> @author J. Woollen @date 1994-01-06
17  FUNCTION nemock(NEMO)
18 
19  CHARACTER*(*) nemo
20  CHARACTER*38 chrset
21 
22  DATA chrset /'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_.'/
23  DATA nchr /38/
24 
25 C-----------------------------------------------------------------------
26 C-----------------------------------------------------------------------
27 
28 C GET THE LENGTH OF NEMO
29 C ----------------------
30 
31  lnemo = 0
32 
33  DO i=len(nemo),1,-1
34  IF(nemo(i:i).NE.' ') THEN
35  lnemo = i
36  GOTO 1
37  ENDIF
38  ENDDO
39 
40 1 IF(lnemo.LT.1 .OR. lnemo.GT.8) THEN
41  nemock = -1
42  GOTO 100
43  ENDIF
44 
45 C SCAN NEMO FOR ALLOWABLE CHARACTERS
46 C ----------------------------------
47 
48  DO 10 i=1,lnemo
49  DO j=1,nchr
50  IF(nemo(i:i).EQ.chrset(j:j)) GOTO 10
51  ENDDO
52  nemock = -2
53  GOTO 100
54 10 ENDDO
55 
56  nemock = 0
57 
58 C EXIT
59 C ----
60 
61 100 RETURN
62  END
function nemock(NEMO)
This function checks a mnemonic to verify that it has a length of between 1 and 8 characters and that...
Definition: nemock.f:18