NCEPLIBS-w3emc 2.12.0
Loading...
Searching...
No Matches
iw3pds.f
Go to the documentation of this file.
1C> @file
2C> @brief Test two pds (grib product definition section) to see
3C> if all equal; otherwise .false.
4C> @author Ralph Jones @date 1988-02-22
5
6C> Test two pds (grib product definition section) to see
7C> if all equal; otherwise .false. if key = 1, all 24 characters
8C> are tested, if key = 0 , the date (characters 13-17) are not
9C> tested. If key = 2, 11 of 1st 12 bytes are tested. Byte 4 is
10C> is not tested, so table version number can change and your
11C> program will still work. If key=3, test bytes 1-3, 7-12.
12C>
13C> Program history log:
14C> - Ralph Jones 1988-02-22
15C> - Ralph Jones 1989-08-29 Add entry iw3pds, an alias name.
16C> - Ralph Jones 1989-08-29 Change to cray cft77 fortran, make iw3pds
17C> the function name, iw3pdb the alias.
18C> - Ralph Jones 1994-02-10 Add key=2, test only 11 of 1st 12 bytes.
19C> Byte 4 (table version no.) is not tested.
20C> - Ralph Jones 1994-07-07 Add key=3, test bytes 1-3, 7-12.
21C>
22C> USAGE: II = IW3PDS(L1,L2,KEY)
23C> II = IW3PDB(L1,L2,KEY) ALIAS
24C>
25C> @param[in] L1 character array to match with l2,
26C> l1 can also be a 3 word integer array.
27C> @param[in] L2 character array to match with l1,
28C> l2 can also be a 3 word integer array.
29C> @param[in] KEY 0, DO NOT INCLUDE THE DATE (BYTES 13-17) IN MATCH.
30C> - 1, match 24 bytes of pds
31C> - 2, match bytes 1-3, 5-12 of pds
32C> - 3, match bytes 1-3, 7-12 of pds
33C>
34C> @return logical .true. if l1 and l2 match on all char.,
35C> logical .false. if not match on any char.
36C>
37C> @note Alias added because of name change in grib write up.
38C> Name of pdb (product definition block) was changd to pds
39C> (product definition section).
40C>
41C> @author Ralph Jones @date 1988-02-22
42 LOGICAL FUNCTION iw3pds(L1, L2, KEY)
43C
44 CHARACTER*1 l1(24)
45 CHARACTER*1 l2(24)
46C
47 LOGICAL iw3pdb
48C
49 SAVE
50C
51 iw3pds = .true.
52C
53 IF (key.EQ.1) THEN
54 DO 10 i = 1,3
55 IF (l1(i).NE.l2(i)) GO TO 70
56 10 CONTINUE
57C
58 DO 20 i = 5,24
59 IF (l1(i).NE.l2(i)) GO TO 70
60 20 CONTINUE
61C
62 ELSE
63C
64 DO 30 i = 1,3
65 IF (l1(i).NE.l2(i)) GO TO 70
66 30 CONTINUE
67C
68C DO NOT TEST BYTE 4, 5, 6 PDS VER. NO., COUNTRY
69C MODEL NUMBER. U.S., U.K., FNOC WAFS DATA WILL
70C WORK.
71C
72 IF (key.EQ.3) THEN
73 DO i = 7,12
74 IF (l1(i).NE.l2(i)) GO TO 70
75 END DO
76 GO TO 60
77 END IF
78C
79C DO NOT TEST PDS VERSION NUMBER, IT MAY BE 1 O 2
80C
81 DO 40 i = 5,12
82 IF (l1(i).NE.l2(i)) GO TO 70
83 40 CONTINUE
84 IF (key.EQ.2) GO TO 60
85C
86 DO 50 i = 18,24
87 IF (l1(i).NE.l2(i)) GO TO 70
88 50 CONTINUE
89 ENDIF
90C
91 60 CONTINUE
92 RETURN
93C
94 70 CONTINUE
95 iw3pds = .false.
96 RETURN
97C
98 entry iw3pdb(l1, l2, key)
99C
100 iw3pdb = .true.
101C
102 IF (key.EQ.1) THEN
103 DO 80 i = 1,3
104 IF (l1(i).NE.l2(i)) GO TO 140
105 80 CONTINUE
106C
107 DO 90 i = 5,24
108 IF (l1(i).NE.l2(i)) GO TO 140
109 90 CONTINUE
110C
111 ELSE
112C
113 DO 100 i = 1,3
114 IF (l1(i).NE.l2(i)) GO TO 140
115 100 CONTINUE
116C
117C DO NOT TEST BYTE 4, 5, 6 PDS VER. NO., COUNTRY
118C MODEL NUMBER. U.S., U.K., FNOC WAFS DATA WILL
119C WORK.
120C
121 IF (key.EQ.3) THEN
122 DO i = 7,12
123 IF (l1(i).NE.l2(i)) GO TO 140
124 END DO
125 GO TO 130
126 END IF
127C
128C DO NOT TEST PDS VERSION NUMBER, IT MAY BE 1 O 2
129C
130 DO 110 i = 5,12
131 IF (l1(i).NE.l2(i)) GO TO 140
132 110 CONTINUE
133 IF (key.EQ.2) GO TO 130
134C
135 DO 120 i = 18,24
136 IF (l1(i).NE.l2(i)) GO TO 140
137 120 CONTINUE
138 ENDIF
139C
140 130 CONTINUE
141 RETURN
142C
143 140 CONTINUE
144 iw3pdb = .false.
145 RETURN
146 END
logical function iw3pds(l1, l2, key)
Test two pds (grib product definition section) to see if all equal; otherwise .false.
Definition iw3pds.f:43