NCEPLIBS-g2 3.5.1
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 = 44
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/
353contains
354
364 integer function getpdsindex(number)
365 implicit none
366
367 integer, intent(in) :: number
368 integer :: j
369
370 getpdsindex = -1
371
372 do j = 1, maxtemp
373 if (number .eq. templates(j)%template_num) then
374 getpdsindex = j
375 return
376 endif
377 enddo
378
379 end function getpdsindex
380
399 subroutine getpdstemplate(number, nummap, map, needext, iret)
400 implicit none
401
402 integer, intent(in) :: number
403 integer, intent(out) :: nummap, map(*), iret
404 logical, intent(out) :: needext
405 integer :: index
406
407 iret = 0
408
409 index = getpdsindex(number)
410
411 if (index.ne.-1) then
412 nummap = templates(index)%mappdslen
413 needext = templates(index)%needext
414 map(1:nummap) = templates(index)%mappds(1:nummap)
415 else
416 nummap = 0
417 needext = .false.
418 print *, 'getpdstemplate: PDS Template ', number, &
419 ' not defined.'
420 iret = 1
421 endif
422
423 end subroutine getpdstemplate
424
439 subroutine extpdstemplate(number, list, nummap, map)
440 implicit none
441
442 integer, intent(in) :: number, list(*)
443 integer, intent(out) :: nummap, map(*)
444 integer :: i, index, k, n, j
445
446 index = getpdsindex(number)
447 if (index .eq. -1) return
448
449 if (.not. templates(index)%needext) return
450 nummap = templates(index)%mappdslen
451 map(1:nummap) = templates(index)%mappds(1:nummap)
452
453 if (number .eq. 3) then
454 n = list(27)
455 do i = 1, n
456 map(nummap + i) = 1
457 enddo
458 nummap = nummap + n
459 elseif (number .eq. 4) then
460 n = list(26)
461 do i = 1, n
462 map(nummap + i) = 1
463 enddo
464 nummap = nummap + n
465 elseif (number .eq. 8) then
466 if (list(22).gt.1) then
467 do j = 2, list(22)
468 do k = 1, 6
469 map(nummap + k) = map(23 + k)
470 enddo
471 nummap = nummap + 6
472 enddo
473 endif
474 elseif (number .eq. 9) then
475 if (list(29).gt.1) then
476 do j = 2, list(29)
477 do k = 1, 6
478 map(nummap + k) = map(30 + k)
479 enddo
480 nummap = nummap + 6
481 enddo
482 endif
483 elseif (number .eq. 10) then
484 if (list(23).gt.1) then
485 do j = 2, list(23)
486 do k = 1, 6
487 map(nummap + k) = map(24 + k)
488 enddo
489 nummap = nummap + 6
490 enddo
491 endif
492 elseif (number .eq. 11) then
493 if (list(25).gt.1) then
494 do j = 2, list(25)
495 do k = 1, 6
496 map(nummap + k) = map(26 + k)
497 enddo
498 nummap = nummap + 6
499 enddo
500 endif
501 elseif (number .eq. 12) then
502 if (list(24).gt.1) then
503 do j = 2, list(24)
504 do k = 1, 6
505 map(nummap + k) = map(25 + k)
506 enddo
507 nummap = nummap + 6
508 enddo
509 endif
510 elseif (number .eq. 13) then
511 if (list(38).gt.1) then
512 do j = 2, list(38)
513 do k = 1, 6
514 map(nummap + k) = map(39 + k)
515 enddo
516 nummap = nummap + 6
517 enddo
518 endif
519 n = list(27)
520 do i = 1, n
521 map(nummap + i) = 1
522 enddo
523 nummap = nummap + n
524 elseif (number .eq. 14) then
525 if (list(37).gt.1) then
526 do j = 2, list(37)
527 do k = 1, 6
528 map(nummap + k) = map(38 + k)
529 enddo
530 nummap = nummap + 6
531 enddo
532 endif
533 n = list(26)
534 do i = 1, n
535 map(nummap + i) = 1
536 enddo
537 nummap = nummap + n
538 elseif (number .eq. 30) then
539 do j = 1, list(5)
540 map(nummap + 1) = 2
541 map(nummap + 2) = 2
542 map(nummap + 3) = 1
543 map(nummap + 4) = 1
544 map(nummap + 5) = 4
545 nummap = nummap + 5
546 enddo
547 elseif (number .eq. 31) then
548 do j = 1, list(5)
549 map(nummap + 1) = 2
550 map(nummap + 2) = 2
551 map(nummap + 3) = 2
552 map(nummap + 4) = 1
553 map(nummap + 5) = 4
554 nummap = nummap + 5
555 enddo
556 elseif (number .eq. 32) then
557 do j = 1, list(10)
558 map(nummap + 1) = 2
559 map(nummap + 2) = 2
560 map(nummap + 3) = 2
561 map(nummap + 4) = -1
562 map(nummap + 5) = -4
563 nummap = nummap + 5
564 enddo
565 elseif (number .eq. 33) then
566 n = list(10)
567 do i = 1, n
568 map(nummap + i) = 1
569 enddo
570 nummap = nummap + n
571 elseif (number .eq. 34) then
572 if (list(25).gt.1) then
573 do j = 2, list(25)
574 do k = 1, 6
575 map(nummap + k) = map(26 + k)
576 enddo
577 nummap = nummap + 6
578 enddo
579 endif
580 n = list(10)
581 do i = 1, n
582 map(nummap + i) = 1
583 enddo
584 nummap = nummap + n
585 elseif (number .eq. 42) then
586 if (list(23).gt.1) then
587 do j = 2, list(23)
588 do k = 1, 6
589 map(nummap + k) = map(24 + k)
590 enddo
591 nummap = nummap + 6
592 enddo
593 endif
594 elseif (number .eq. 43) then
595 if (list(26).gt.1) then
596 do j = 2, list(26)
597 do k = 1, 6
598 map(nummap + k) = map(27 + k)
599 enddo
600 nummap = nummap + 6
601 enddo
602 endif
603 elseif (number .eq. 46) then
604 if (list(28).gt.1) then
605 do j = 2, list(28)
606 do k = 1, 6
607 map(nummap + k) = map(29 + k)
608 enddo
609 nummap = nummap + 6
610 enddo
611 endif
612 elseif (number .eq. 47) then
613 if (list(31).gt.1) then
614 do j = 2, list(31)
615 do k = 1, 6
616 map(nummap + k) = map(32 + k)
617 enddo
618 nummap = nummap + 6
619 enddo
620 endif
621 elseif (number .eq. 51) then
622 do j = 1, list(16)
623 map(nummap + 1) = 1
624 map(nummap + 2) = 1
625 map(nummap + 3) = -1
626 map(nummap + 4) = -4
627 map(nummap + 5) = -1
628 map(nummap + 6) = -4
629 nummap = nummap + 6
630 enddo
631 elseif (number .eq. 53) then
632 n = list(4)
633 do i = 1, n
634 map(nummap + i) = 1
635 enddo
636 nummap = nummap + n
637 elseif (number .eq. 54) then
638 n = list(4)
639 do i = 1, n
640 map(nummap + i) = 1
641 enddo
642 nummap = nummap + n
643 elseif (number .eq. 91) then
644 if (list(29).gt.1 ) then
645 do j = 2, list(29)
646 do k = 1, 6
647 map(nummap + k) = map(30 + k)
648 enddo
649 nummap = nummap + 6
650 enddo
651 endif
652 n = list(16)
653 do i = 1, n
654 map(nummap + i) = 1
655 enddo
656 nummap = nummap + n
657 endif
658 end subroutine extpdstemplate
659
669 integer function getpdtlen(number)
670 implicit none
671
672 integer, intent(in) :: number
673 integer :: index
674
675 getpdtlen = 0
676 index = getpdsindex(number)
677 if (index .ne. -1) then
678 getpdtlen=templates(index)%mappdslen
679 endif
680 end function getpdtlen
681end 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.