NCEPLIBS-bufr 11.7.1
nemock.f
Go to the documentation of this file.
1C> @file
2C> @author WOOLLEN @date 1994-01-06
3
4C> THIS FUNCTION CHECKS A MNEMONIC TO VERIFY THAT IT HAS A
5C> LENGTH OF BETWEEN ONE AND EIGHT CHARACTERS AND THAT IT ONLY
6C> CONTAINS CHARACTERS FROM THE ALLOWABLE CHARACTER SET.
7C>
8C> PROGRAM HISTORY LOG:
9C> 1994-01-06 J. WOOLLEN -- ORIGINAL AUTHOR
10C> 2003-11-04 J. ATOR -- ADDED DOCUMENTATION
11C> 2003-11-04 S. BENDER -- ADDED REMARKS/BUFRLIB ROUTINE
12C> INTERDEPENDENCIES
13C> 2003-11-04 D. KEYSER -- SPLIT NON-ZERO RETURN INTO -1 FOR LENGTH
14C> NOT 1-8 CHARACTERS AND -2 FOR INVALID
15C> CHARACTERS (RETURN ONLY -1 BEFORE FOR ALL
16C> PROBLEMATIC CASES); UNIFIED/PORTABLE FOR
17C> WRF; ADDED HISTORY DOCUMENTATION
18C>
19C> USAGE: NEMOCK (NEMO)
20C> INPUT ARGUMENT LIST:
21C> NEMO - CHARACTER*(*): MNEMONIC TO BE CHECKED
22C>
23C> OUTPUT ARGUMENT LIST:
24C> NEMOCK - INTEGER: INDICATOR AS TO WHETHER NEMO IS VALID:
25C> 0 = yes
26C> -1 = no, length not between 1 and 8 characters
27C> -2 = no, it does not contain characters from the
28C> allowable character set
29C>
30C> REMARKS:
31C> THIS ROUTINE CALLS: None
32C> THIS ROUTINE IS CALLED BY: RDUSDX SEQSDX SNTBBE SNTBDE
33C> Normally not called by any application
34C> programs.
35C>
36 FUNCTION nemock(NEMO)
37
38
39
40 CHARACTER*(*) nemo
41 CHARACTER*38 chrset
42
43 DATA chrset /'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_.'/
44 DATA nchr /38/
45
46C-----------------------------------------------------------------------
47C-----------------------------------------------------------------------
48
49C GET THE LENGTH OF NEMO
50C ----------------------
51
52 lnemo = 0
53
54 DO i=len(nemo),1,-1
55 IF(nemo(i:i).NE.' ') THEN
56 lnemo = i
57 GOTO 1
58 ENDIF
59 ENDDO
60
611 IF(lnemo.LT.1 .OR. lnemo.GT.8) THEN
62 nemock = -1
63 GOTO 100
64 ENDIF
65
66C SCAN NEMO FOR ALLOWABLE CHARACTERS
67C ----------------------------------
68
69 DO 10 i=1,lnemo
70 DO j=1,nchr
71 IF(nemo(i:i).EQ.chrset(j:j)) GOTO 10
72 ENDDO
73 nemock = -2
74 GOTO 100
7510 ENDDO
76
77 nemock = 0
78
79C EXIT
80C ----
81
82100 RETURN
83 END
function nemock(NEMO)
THIS FUNCTION CHECKS A MNEMONIC TO VERIFY THAT IT HAS A LENGTH OF BETWEEN ONE AND EIGHT CHARACTERS AN...
Definition: nemock.f:37