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