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