NCEPLIBS-g2 4.0.0
Loading...
Searching...
No Matches
pdstemplates.F90
Go to the documentation of this file.
1
6
40
41 integer, parameter :: maxlen = 200
42 integer, parameter :: maxtemp = 48
43
47 integer :: template_num
48 integer :: mappdslen
49 integer, dimension(MAXLEN) :: mappds
50 logical :: needext
51 end type pdstemplate
52
53 type(pdstemplate), dimension(MAXTEMP) :: templates
54
55 data templates(1)%template_num /0/ ! Fcst at Level/Layer
56 data templates(1)%mappdslen /15/
57 data templates(1)%needext /.false./
58 data (templates(1)%mappds(j), j = 1, 15) &
59 /1, 1, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4/
60
61 data templates(2)%template_num /1/ ! Ens fcst at level/layer
62 data templates(2)%mappdslen /18/
63 data templates(2)%needext /.false./
64 data (templates(2)%mappds(j), j = 1, 18) &
65 /1, 1, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4, 1, 1, 1/
66
67 data templates(3)%template_num /2/ ! Derived Ens fcst at level/layer
68 data templates(3)%mappdslen /17/
69 data templates(3)%needext /.false./
70 data (templates(3)%mappds(j), j = 1, 17) &
71 /1, 1, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4, 1, 1/
72
73 data templates(4)%template_num /3/ ! Ens cluster fcst rect. area
74 data templates(4)%mappdslen /31/
75 data templates(4)%needext /.true./
76 data (templates(4)%mappds(j), j = 1, 31) &
77 /1, 1, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4, 1, 1, 1, 1, 1, 1, 1, -4, -4, 4, 4, &
78 1, -1, 4, -1, 4/
79
80 data templates(5)%template_num /4/ ! Ens cluster fcst circ. area
81 data templates(5)%mappdslen /30/
82 data templates(5)%needext /.true./
83 data (templates(5)%mappds(j), j = 1, 30) &
84 /1, 1, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4, 1, 1, 1, 1, 1, 1, 1, -4, 4, 4, &
85 1, -1, 4, -1, 4/
86
87 data templates(6)%template_num /5/ ! Prob fcst at level/layer
88 data templates(6)%mappdslen /22/
89 data templates(6)%needext /.false./
90 data (templates(6)%mappds(j), j = 1, 22) &
91 /1, 1, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4, 1, 1, 1, -1, -4, -1, -4/
92
93 data templates(7)%template_num /6/ ! Percentile fcst at level/layer
94 data templates(7)%mappdslen /16/
95 data templates(7)%needext /.false./
96 data (templates(7)%mappds(j), j = 1, 16) &
97 /1, 1, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4, 1/
98
99 data templates(8)%template_num /7/ ! Error at level/layer
100 data templates(8)%mappdslen /15/
101 data templates(8)%needext /.false./
102 data (templates(8)%mappds(j), j = 1, 15) &
103 /1, 1, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4/
104
105 data templates(9)%template_num /8/ ! Ave or Accum at level/layer
106 data templates(9)%mappdslen /29/
107 data templates(9)%needext /.true./
108 data (templates(9)%mappds(j), j = 1, 29) &
109 /1, 1, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4, 2, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 4, 1, 4/
110
111 data templates(10)%template_num /9/ ! Prob over time interval
112 data templates(10)%mappdslen /36/
113 data templates(10)%needext /.true./
114 data (templates(10)%mappds(j), j = 1, 36) &
115 /1, 1, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4, 1, 1, 1, -1, -4, -1, -4, 2, 1, 1, 1, &
116 1, 1, 1, 4, 1, 1, 1, 4, 1, 4/
117
118 data templates(11)%template_num /10/ ! Percentile over time interval
119 data templates(11)%mappdslen /30/
120 data templates(11)%needext /.true./
121 data (templates(11)%mappds(j), j = 1, 30) &
122 /1, 1, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4, 1, 2, 1, 1, 1, 1, 1, 1, 4, &
123 1, 1, 1, 4, 1, 4/
124
125 data templates(12)%template_num /11/ ! Ens member over time interval
126 data templates(12)%mappdslen /32/
127 data templates(12)%needext /.true./
128 data (templates(12)%mappds(j), j = 1, 32) &
129 /1, 1, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, &
130 4, 1, 1, 1, 4, 1, 4/
131
132 data templates(13)%template_num /12/ ! Derived Ens fcst over time int
133 data templates(13)%mappdslen /31/
134 data templates(13)%needext /.true./
135 data (templates(13)%mappds(j), j = 1, 31) &
136 /1, 1, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4, 1, 1, &
137 2, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 4, 1, 4/
138
139 data templates(14)%template_num /13/ ! Ens cluster fcst rect. area
140 data templates(14)%mappdslen /45/
141 data templates(14)%needext /.true./
142 data (templates(14)%mappds(j), j = 1, 45) &
143 /1, 1, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4, 1, 1, 1, 1, 1, 1, 1, -4, -4, 4, 4, &
144 1, -1, 4, -1, 4, 2, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 4, 1, 4/
145
146 data templates(15)%template_num /14/ ! Ens cluster fcst circ. area
147 data templates(15)%mappdslen /44/
148 data templates(15)%needext /.true./
149 data (templates(15)%mappds(j), j = 1, 44) &
150 /1, 1, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4, 1, 1, 1, 1, 1, 1, 1, -4, 4, 4, &
151 1, -1, 4, -1, 4, 2, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 4, 1, 4/
152
153 data templates(16)%template_num /20/ ! Radar Product
154 data templates(16)%mappdslen /19/
155 data templates(16)%needext /.false./
156 data (templates(16)%mappds(j), j = 1, 19) &
157 /1, 1, 1, 1, 1, -4, 4, 2, 4, 2, 1, 1, 1, 1, 1, 2, 1, 3, 2/
158
159 data templates(17)%template_num /30/ ! Satellite Product
160 data templates(17)%mappdslen /5/
161 data templates(17)%needext /.true./
162 data (templates(17)%mappds(j), j = 1, 5) &
163 /1, 1, 1, 1, 1/
164
165 data templates(18)%template_num /254/ ! CCITTIA5 Character String
166 data templates(18)%mappdslen /3/
167 data templates(18)%needext /.false./
168 data (templates(18)%mappds(j), j = 1, 3) &
169 /1, 1, 4/
170
171 data templates(19)%template_num /1000/ ! Cross section
172 data templates(19)%mappdslen /9/
173 data templates(19)%needext /.false./
174 data (templates(19)%mappds(j), j = 1, 9) &
175 /1, 1, 1, 1, 1, 2, 1, 1, -4/
176
177 data templates(20)%template_num /1001/ ! Cross section over time
178 data templates(20)%mappdslen /16/
179 data templates(20)%needext /.false./
180 data (templates(20)%mappds(j), j = 1, 16) &
181 /1, 1, 1, 1, 1, 2, 1, 1, -4, 4, 1, 1, 1, 4, 1, 4/
182
183 data templates(21)%template_num /1002/ ! Cross section processed time
184 data templates(21)%mappdslen /15/
185 data templates(21)%needext /.false./
186 data (templates(21)%mappds(j), j = 1, 15) &
187 /1, 1, 1, 1, 1, 2, 1, 1, -4, 1, 1, 1, 4, 4, 2/
188
189 data templates(22)%template_num /1100/ ! Hovmoller grid
190 data templates(22)%mappdslen /15/
191 data templates(22)%needext /.false./
192 data (templates(22)%mappds(j), j = 1, 15) &
193 /1, 1, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4/
194
195 data templates(23)%template_num /1101/ ! Hovmoller with stat proc
196 data templates(23)%mappdslen /22/
197 data templates(23)%needext /.false./
198 data (templates(23)%mappds(j), j = 1, 22) &
199 /1, 1, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4, 4, 1, 1, 1, 4, 1, 4/
200
201 data templates(24)%template_num /31/ ! Satellite Product
202 data templates(24)%mappdslen /5/
203 data templates(24)%needext /.true./
204 data (templates(24)%mappds(j), j = 1, 5) &
205 /1, 1, 1, 1, 1/
206
207 data templates(25)%template_num /15/ ! Ave or Accum at level/layer
208 data templates(25)%mappdslen /18/ ! For ICAO WAFS products
209 data templates(25)%needext /.false./
210 data (templates(25)%mappds(j), j = 1, 18) &
211 /1, 1, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4, 1, 1, 1/
212
213 data templates(26)%template_num /40/ ! Analysis or Forecast at a horizontal or in a
214 data templates(26)%mappdslen /16/ ! horizontal layer at a point in time for
215 data templates(26)%needext /.false./ ! atmospheric chemical constituents
216 data (templates(26)%mappds(j), j = 1, 16) &
217 /1, 1, 2, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4/
218
219 data templates(27)%template_num /41/ ! Individual ensemble forecast, control and
220 data templates(27)%mappdslen /19/ ! perturbed, at horizontal level or
221 data templates(27)%needext /.false./ ! in a horizontal layer at a point in time for
222 data (templates(27)%mappds(j), j = 1, 19) & ! atmospheric chemical constituents
223 /1, 1, 2, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4, 1, 1, 1/
224
225 data templates(28)%template_num /42/ ! Average, Accumulation, and/or extreme values or other
226 data templates(28)%mappdslen /30/ ! statistically-processed values at horizontal level or
227 data templates(28)%needext /.true./ ! in a horizontal layer in contnunuous or non-continuous time
228 data (templates(28)%mappds(j), j = 1, 30) & ! interval for atmospheric chemical constituents
229 /1, 1, 2, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4, 2, 1, 1, 1, 1, 1, 1, 4, &
230 1, 1, 1, 4, 1, 4/
231
232 data templates(29)%template_num /43/ ! Individual ensemble forecast, control and
233 data templates(29)%mappdslen /33/ ! perturbed, at horizontal level or in a horizontal
234 data templates(29)%needext /.true./ ! layer at a point in a continuous or non-continuous time
235 data (templates(29)%mappds(j), j = 1, 33) & ! interval for atmospheric chemical constituents
236 /1, 1, 2, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 4, &
237 1, 1, 1, 4, 1, 4/
238
239 data templates(30)%template_num /44/ ! Analysis or Forecast at a horizontal or in a
240 data templates(30)%mappdslen /21/ ! horizontal layer at a point in time for
241 data templates(30)%needext /.false./ ! Aerosol
242 data (templates(30)%mappds(j), j = 1, 21) &
243 /1, 1, 2, 1, -1, -4, -1, -4, 1, 1, 1, 2, 1, 1, -2, 1, -1, -4, 1, -1, -4/
244
245 data templates(31)%template_num /45/ ! Individual ensemble forecast, control and
246 data templates(31)%mappdslen /24/ ! perturbed, at horizontal level or in a horizontal
247 data templates(31)%needext /.false./ ! layer at a point in time for Aerosol
248 data (templates(31)%mappds(j), j = 1, 24) &
249 /1, 1, 2, 1, -1, -4, -1, -4, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4, 1, 1, 1/
250
251 data templates(32)%template_num /46/ ! Ave or Accum or Extreme value at level/layer
252 data templates(32)%mappdslen /35/ ! in a continuous or non-continuous time interval
253 data templates(32)%needext /.true./ ! for Aerosol
254 data (templates(32)%mappds(j), j = 1, 35) &
255 /1, 1, 2, 1, -1, -4, -1, -4, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4, 2, 1, 1, 1, 1, &
256 1, 1, 4, 1, 1, 1, 4, 1, 4/
257
258 data templates(33)%template_num /47/ ! Individual ensemble forecast, control and
259 data templates(33)%mappdslen /38/ ! perturbed, at horizontal level or in a horizontal
260 data templates(33)%needext /.true./ ! in a continuous or non-continuous time interval
261 data (templates(33)%mappds(j), j = 1, 38) & ! for Aerosol
262 /1, 1, 1, 2, 1, -1, -4, -1, -4, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4, 1, 1, 1, 2, 1, &
263 1, 1, 1, 1, 1, 4, 1, 1, 1, 4, 1, 4/
264
265 data templates(34)%template_num /51/ ! Categorical forecasts at a horizontal level or
266 data templates(34)%mappdslen /16/ ! in a horizontal layer at a point in time
267 data templates(34)%needext /.true./
268 data (templates(34)%mappds(j), j = 1, 16) &
269 /1, 1, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4, 1/
270 !
271 ! PDT 4.91
272 !
273 data templates(35)%template_num /91/ ! Categorical forecasts at a horizontal level or
274 data templates(35)%mappdslen /36/ ! in a horizontal layer in a continuous or
275 data templates(35)%needext /.true./ ! non-continuous time interval
276 data (templates(35)%mappds(j), j = 1, 36) &
277 /1, 1, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4, 1, 1, 1, -1, -4, -1, -4, &
278 2, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 4, 1, 4/
279
280 data templates(36)%template_num /32/ ! Analysis or forecast at a horizontal level or
281 data templates(36)%mappdslen /10/ ! in a horizontal layer at a point in time for
282 data templates(36)%needext /.true./ ! for simulate (synthetic) Satellite data
283 data (templates(36)%mappds(j), j = 1, 10) &
284 /1, 1, 1, 1, 1, 2, 1, 1, -4, 1/
285 !
286 ! PDT 4.48
287 !
288 data templates(37)%template_num /48/ ! Analysis or forecast at a horizontal level or
289 data templates(37)%mappdslen /26/ ! in a horizontal layer at a point in time for
290 data templates(37)%needext /.false./ ! Optical Properties of Aerosol
291 data (templates(37)%mappds(j), j = 1, 26) &
292 /1, 1, 2, 1, -1, -4, -1, -4, 1, -1, -4, -1, -4, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, &
293 1, -1, -4/
294 !
295 ! PDT 4.50 VALIDATION
296 !
297 data templates(38)%template_num /50/ ! Analysis or Forecast of a multi component
298 data templates(38)%mappdslen /21/ ! parameter or matrix element at a point in time
299 data templates(38)%needext /.false./ !
300 data (templates(38)%mappds(j), j = 1, 21) &
301 /1, 1, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4, 1, 1, 4, 4, 4, 4/
302 !
303 ! PDT 4.52 VALIDATION
304 !
305 data templates(39)%template_num /52/ ! Analysis or forecast of Wave parameters
306 data templates(39)%mappdslen /15/ ! at the Sea surface at a point in time
307 data templates(39)%needext /.false./ !
308 data (templates(39)%mappds(j), j = 1, 15) &
309 /1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4/
310 !
311 ! PDT 4.33 (07/29/2013)
312 !
313 data templates(40)%template_num /33/ ! Individual ensemble forecast, control, perturbed,
314 data templates(40)%mappdslen /18/ ! at a horizontal level or in a horizontal layer
315 data templates(40)%needext /.true./ ! at a point in time for simulate (synthetic) Satellite data
316 data (templates(40)%mappds(j), j = 1, 18) &
317 /1, 1, 1, 1, 1, 2, 1, 1, -4, 1, 2, 2, 2, -1, -4, 1, 1, 1/
318 !
319 ! PDT 4.34 (07/29/2013)
320 !
321 data templates(41)%template_num /34/ ! Individual ensemble forecast, control, perturbed,
322 data templates(41)%mappdslen /32/ ! at a horizontal level or in a horizontal layer,
323 data templates(41)%needext /.true./ ! in a continuous or non-continuous interval
324 data (templates(41)%mappds(j), j = 1, 32) & ! for simulate (synthetic) Satellite data
325 /1, 1, 1, 1, 1, 2, 1, 1, -4, 1, 2, 2, 2, -1, -4, 1, 1, 1, 2, 1, 1, 1, &
326 1, 1, 1, 4, 1, 1, 1, 4, 1, 4/
327 !
328 ! PDT 4.53 (07/30/2013)
329 !
330 data templates(42)%template_num /53/ ! Partitioned parameters at
331 data templates(42)%mappdslen /19/ ! horizontal level or horizontal layer
332 data templates(42)%needext /.true./ ! at a point in time
333 data (templates(42)%mappds(j), j = 1, 19) &
334 /1, 1, 1, 1, 4, 2, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4/
335 !
336 ! PDT 4.54 (07/30/2013)
337 !
338 data templates(43)%template_num /54/ ! Individual ensemble forecast, controli and perturbed,
339 data templates(43)%mappdslen /22/ ! at a horizontal level or in a horizontal layer
340 data templates(43)%needext /.true./ ! at a point in time for partitioned parameters
341 data (templates(43)%mappds(j), j = 1, 22) &
342 /1, 1, 1, 1, 4, 2, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4, 1, 1, 1/
343
344 !
345 ! PDT 4.49
346 !
347 data templates(44)%template_num /49/ ! Individual Ensemble Forecast, Control and Perturbed,
348 data templates(44)%mappdslen /29/ ! at a horizontal level or in a horizontal layer at a
349 data templates(44)%needext /.false./ ! point in time for Optical Properties of Aerosol for
350 data (templates(44)%mappds(j), j = 1, 29) & ! Optical Properties of Aerosol
351 /1, 1, 2, 1, -1, -4, -1, -4, 1, -1, -4, -1, -4, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, &
352 1, -1, -4, 1, 1, 1/
353 !
354 ! PDT 4.57 (10/07/2015)
355 !
356 data templates(45)%template_num /57/ ! Analysis or Forecast at a horizontal level or in a
357 data templates(45)%mappdslen /7/ ! horizontal layer at a point in time for
358 data templates(45)%needext /.true./ ! atmospheric chemical constituents based on
359 data (templates(45)%mappds(j), j = 1, 7) & ! a distribution function.
360 /1, 1, 2, 2, 2, 2, 1/
361 !
362 ! PDT 4.60 (10/07/2015)
363 !
364 data templates(46)%template_num /60/ ! Individual ensemble reforecast, control and perturbed,
365 data templates(46)%mappdslen /24/ ! at a horizontal level or in a horizontal layer
366 data templates(46)%needext /.false./ ! at a point in time.
367 data (templates(46)%mappds(j), j = 1, 24) &
368 /1, 1, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4, 1, 1, 1, 2, 1, 1, 1, 1, 1/
369 !
370 ! PDT 4.61 (10/07/2015)
371 !
372 data templates(47)%template_num /61/ ! Individual ensemble reforecast, control and perturbed,
373 data templates(47)%mappdslen /38/ ! at a horizontal level or in a horizontal layer
374 data templates(47)%needext /.true./ ! in a continuous or non-continuous time interval.
375 data (templates(47)%mappds(j), j = 1, 38) &
376 /1, 1, 1, 1, 1, 2, 1, 1, -4, 1, -1, -4, 1, -1, -4, 1, 1, 1, 2, 1, 1, 1, 1, &
377 1, 2, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 4, 1, 4/
378 !
379 ! VALIDATION --- PDT 4.35 (10/07/2015)
380 !
381 data templates(48)%template_num /35/ ! Satellite product with or without associated
382 data templates(48)%mappdslen /6/ ! quality values
383 data templates(48)%needext /.true./
384 data (templates(48)%mappds(j), j = 1, 6) &
385 /1, 1, 1, 1, 1, 1/
386
387contains
388
398 integer function getpdsindex(number)
399 implicit none
400
401 integer, intent(in) :: number
402 integer :: j
403
404 getpdsindex = -1
405
406 do j = 1, maxtemp
407 if (number .eq. templates(j)%template_num) then
408 getpdsindex = j
409 return
410 endif
411 enddo
412
413 end function getpdsindex
414
433 subroutine getpdstemplate(number, nummap, map, needext, iret)
434 implicit none
435
436 integer, intent(in) :: number
437 integer, intent(out) :: nummap, map(*), iret
438 logical, intent(out) :: needext
439 integer :: index
440
441 iret = 0
442
443 index = getpdsindex(number)
444
445 if (index.ne.-1) then
446 nummap = templates(index)%mappdslen
447 needext = templates(index)%needext
448 map(1:nummap) = templates(index)%mappds(1:nummap)
449 else
450 nummap = 0
451 needext = .false.
452 print *, 'getpdstemplate: PDS Template ', number, &
453 ' not defined.'
454 iret = 1
455 endif
456
457 end subroutine getpdstemplate
458
473 subroutine extpdstemplate(number, list, nummap, map)
474 implicit none
475
476 integer, intent(in) :: number, list(*)
477 integer, intent(out) :: nummap, map(*)
478 integer :: i, index, k, n, j
479
480 index = getpdsindex(number)
481 if (index .eq. -1) return
482
483 if (.not. templates(index)%needext) return
484 nummap = templates(index)%mappdslen
485 map(1:nummap) = templates(index)%mappds(1:nummap)
486
487 if (number .eq. 3) then
488 n = list(27)
489 do i = 1, n
490 map(nummap + i) = 1
491 enddo
492 nummap = nummap + n
493 elseif (number .eq. 4) then
494 n = list(26)
495 do i = 1, n
496 map(nummap + i) = 1
497 enddo
498 nummap = nummap + n
499 elseif (number .eq. 8) then
500 if (list(22).gt.1) then
501 do j = 2, list(22)
502 do k = 1, 6
503 map(nummap + k) = map(23 + k)
504 enddo
505 nummap = nummap + 6
506 enddo
507 endif
508 elseif (number .eq. 9) then
509 if (list(29).gt.1) then
510 do j = 2, list(29)
511 do k = 1, 6
512 map(nummap + k) = map(30 + k)
513 enddo
514 nummap = nummap + 6
515 enddo
516 endif
517 elseif (number .eq. 10) then
518 if (list(23).gt.1) then
519 do j = 2, list(23)
520 do k = 1, 6
521 map(nummap + k) = map(24 + k)
522 enddo
523 nummap = nummap + 6
524 enddo
525 endif
526 elseif (number .eq. 11) then
527 if (list(25).gt.1) then
528 do j = 2, list(25)
529 do k = 1, 6
530 map(nummap + k) = map(26 + k)
531 enddo
532 nummap = nummap + 6
533 enddo
534 endif
535 elseif (number .eq. 12) then
536 if (list(24).gt.1) then
537 do j = 2, list(24)
538 do k = 1, 6
539 map(nummap + k) = map(25 + k)
540 enddo
541 nummap = nummap + 6
542 enddo
543 endif
544 elseif (number .eq. 13) then
545 if (list(38).gt.1) then
546 do j = 2, list(38)
547 do k = 1, 6
548 map(nummap + k) = map(39 + k)
549 enddo
550 nummap = nummap + 6
551 enddo
552 endif
553 n = list(27)
554 do i = 1, n
555 map(nummap + i) = 1
556 enddo
557 nummap = nummap + n
558 elseif (number .eq. 14) then
559 if (list(37).gt.1) then
560 do j = 2, list(37)
561 do k = 1, 6
562 map(nummap + k) = map(38 + k)
563 enddo
564 nummap = nummap + 6
565 enddo
566 endif
567 n = list(26)
568 do i = 1, n
569 map(nummap + i) = 1
570 enddo
571 nummap = nummap + n
572 elseif (number .eq. 30) then
573 do j = 1, list(5)
574 map(nummap + 1) = 2
575 map(nummap + 2) = 2
576 map(nummap + 3) = 1
577 map(nummap + 4) = 1
578 map(nummap + 5) = 4
579 nummap = nummap + 5
580 enddo
581 elseif (number .eq. 31) then
582 do j = 1, list(5)
583 map(nummap + 1) = 2
584 map(nummap + 2) = 2
585 map(nummap + 3) = 2
586 map(nummap + 4) = 1
587 map(nummap + 5) = 4
588 nummap = nummap + 5
589 enddo
590 elseif (number .eq. 32) then
591 do j = 1, list(10)
592 map(nummap + 1) = 2
593 map(nummap + 2) = 2
594 map(nummap + 3) = 2
595 map(nummap + 4) = -1
596 map(nummap + 5) = -4
597 nummap = nummap + 5
598 enddo
599 elseif (number .eq. 33) then
600 n = list(10)
601 do i = 1, n
602 map(nummap + i) = 1
603 enddo
604 nummap = nummap + n
605 elseif (number .eq. 34) then
606 if (list(25).gt.1) then
607 do j = 2, list(25)
608 do k = 1, 6
609 map(nummap + k) = map(26 + k)
610 enddo
611 nummap = nummap + 6
612 enddo
613 endif
614 n = list(10)
615 do i = 1, n
616 map(nummap + i) = 1
617 enddo
618 nummap = nummap + n
619 elseif (number .eq. 35) then
620 do j = 1, list(6)
621 map(nummap + 1) = 2
622 map(nummap + 2) = 2
623 map(nummap + 3) = 2
624 map(nummap + 4) = 1
625 map(nummap + 5) = 4
626 nummap = nummap + 5
627 enddo
628 elseif (number .eq. 42) then
629 if (list(23).gt.1) then
630 do j = 2, list(23)
631 do k = 1, 6
632 map(nummap + k) = map(24 + k)
633 enddo
634 nummap = nummap + 6
635 enddo
636 endif
637 elseif (number .eq. 43) then
638 if (list(26).gt.1) then
639 do j = 2, list(26)
640 do k = 1, 6
641 map(nummap + k) = map(27 + k)
642 enddo
643 nummap = nummap + 6
644 enddo
645 endif
646 elseif (number .eq. 46) then
647 if (list(28).gt.1) then
648 do j = 2, list(28)
649 do k = 1, 6
650 map(nummap + k) = map(29 + k)
651 enddo
652 nummap = nummap + 6
653 enddo
654 endif
655 elseif (number .eq. 47) then
656 if (list(31).gt.1) then
657 do j = 2, list(31)
658 do k = 1, 6
659 map(nummap + k) = map(32 + k)
660 enddo
661 nummap = nummap + 6
662 enddo
663 endif
664 elseif (number .eq. 51) then
665 do j = 1, list(16)
666 map(nummap + 1) = 1
667 map(nummap + 2) = 1
668 map(nummap + 3) = -1
669 map(nummap + 4) = -4
670 map(nummap + 5) = -1
671 map(nummap + 6) = -4
672 nummap = nummap + 6
673 enddo
674 elseif (number .eq. 53) then
675 n = list(4)
676 do i = 1, n
677 map(nummap + i) = 1
678 enddo
679 nummap = nummap + n
680 elseif (number .eq. 54) then
681 n = list(4)
682 do i = 1, n
683 map(nummap + i) = 1
684 enddo
685 nummap = nummap + n
686 elseif (number .eq. 57) then
687 do j = 1, list(7)
688 map(nummap + 1) = 1
689 map(nummap + 2) = -4
690 map(nummap + 3) = 1
691 map(nummap + 4) = 1
692 map(nummap + 5) = 1
693 map(nummap + 6) = 2
694 map(nummap + 7) = 1
695 map(nummap + 8) = 1
696 map(nummap + 9) = -4
697 map(nummap + 10) = 1
698 map(nummap + 11) = -1
699 map(nummap + 12) = -4
700 map(nummap + 13) = 1
701 map(nummap + 14) = -1
702 map(nummap + 15) = -4
703 nummap = nummap + 15
704 enddo
705 elseif (number .eq. 61) then
706 if (list(31) .gt. 1) then
707 do j = 2, list(31)
708 do k = 1, 6
709 map(nummap + k) = map(32 +k)
710 end do
711 nummap = nummap + 6
712 enddo
713 endif
714 elseif (number .eq. 91) then
715 if (list(29).gt.1 ) then
716 do j = 2, list(29)
717 do k = 1, 6
718 map(nummap + k) = map(30 + k)
719 enddo
720 nummap = nummap + 6
721 enddo
722 endif
723 n = list(16)
724 do i = 1, n
725 map(nummap + i) = 1
726 enddo
727 nummap = nummap + n
728 endif
729 end subroutine extpdstemplate
730
740 integer function getpdtlen(number)
741 implicit none
742
743 integer, intent(in) :: number
744 integer :: index
745
746 getpdtlen = 0
747 index = getpdsindex(number)
748 if (index .ne. -1) then
749 getpdtlen=templates(index)%mappdslen
750 endif
751 end function getpdtlen
752end module pdstemplates
Information on all GRIB2 Product Definition Templates used in Section 4 - the Product Definition Sect...
subroutine extpdstemplate(number, list, nummap, map)
This subroutine generates the remaining octet map for a given Product Definition Template,...
integer function getpdsindex(number)
This function returns the index of specified Product Definition Template in array templates.
integer function getpdtlen(number)
This function returns the initial length (number of entries) in the static part of specified Product ...
integer, parameter maxtemp
MAXTEMP maximum number of templates.
integer, parameter maxlen
MAXLEN max length of entries.
type(pdstemplate), dimension(maxtemp) templates
template in type of pdstemplate
subroutine getpdstemplate(number, nummap, map, needext, iret)
This subroutine returns PDS template information for a specified Product Definition Template.
This is the defined type for a Product Definition Section (PDS) template.