NCEPLIBS-g2  3.5.0
pdstemplates.F90
Go to the documentation of this file.
1 
6 
40 
41  integer, parameter :: maxlen = 200
42  integer, parameter :: maxtemp = 43
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 contains
345 
355  integer function getpdsindex(number)
356  implicit none
357 
358  integer, intent(in) :: number
359  integer :: j
360 
361  getpdsindex = -1
362 
363  do j = 1, maxtemp
364  if (number .eq. templates(j)%template_num) then
365  getpdsindex = j
366  return
367  endif
368  enddo
369 
370  end function getpdsindex
371 
390  subroutine getpdstemplate(number, nummap, map, needext, iret)
391  implicit none
392 
393  integer, intent(in) :: number
394  integer, intent(out) :: nummap, map(*), iret
395  logical, intent(out) :: needext
396  integer :: index
397 
398  iret = 0
399 
400  index = getpdsindex(number)
401 
402  if (index.ne.-1) then
403  nummap = templates(index)%mappdslen
404  needext = templates(index)%needext
405  map(1:nummap) = templates(index)%mappds(1:nummap)
406  else
407  nummap = 0
408  needext = .false.
409  print *, 'getpdstemplate: PDS Template ', number, &
410  ' not defined.'
411  iret = 1
412  endif
413 
414  end subroutine getpdstemplate
415 
430  subroutine extpdstemplate(number, list, nummap, map)
431  implicit none
432 
433  integer, intent(in) :: number, list(*)
434  integer, intent(out) :: nummap, map(*)
435  integer :: i, index, k, n, j
436 
437  index = getpdsindex(number)
438  if (index .eq. -1) return
439 
440  if (.not. templates(index)%needext) return
441  nummap = templates(index)%mappdslen
442  map(1:nummap) = templates(index)%mappds(1:nummap)
443 
444  if (number .eq. 3) then
445  n = list(27)
446  do i = 1, n
447  map(nummap + i) = 1
448  enddo
449  nummap = nummap + n
450  elseif (number .eq. 4) then
451  n = list(26)
452  do i = 1, n
453  map(nummap + i) = 1
454  enddo
455  nummap = nummap + n
456  elseif (number .eq. 8) then
457  if (list(22).gt.1) then
458  do j = 2, list(22)
459  do k = 1, 6
460  map(nummap + k) = map(23 + k)
461  enddo
462  nummap = nummap + 6
463  enddo
464  endif
465  elseif (number .eq. 9) then
466  if (list(29).gt.1) then
467  do j = 2, list(29)
468  do k = 1, 6
469  map(nummap + k) = map(30 + k)
470  enddo
471  nummap = nummap + 6
472  enddo
473  endif
474  elseif (number .eq. 10) then
475  if (list(23).gt.1) then
476  do j = 2, list(23)
477  do k = 1, 6
478  map(nummap + k) = map(24 + k)
479  enddo
480  nummap = nummap + 6
481  enddo
482  endif
483  elseif (number .eq. 11) then
484  if (list(25).gt.1) then
485  do j = 2, list(25)
486  do k = 1, 6
487  map(nummap + k) = map(26 + k)
488  enddo
489  nummap = nummap + 6
490  enddo
491  endif
492  elseif (number .eq. 12) then
493  if (list(24).gt.1) then
494  do j = 2, list(24)
495  do k = 1, 6
496  map(nummap + k) = map(25 + k)
497  enddo
498  nummap = nummap + 6
499  enddo
500  endif
501  elseif (number .eq. 13) then
502  if (list(38).gt.1) then
503  do j = 2, list(38)
504  do k = 1, 6
505  map(nummap + k) = map(39 + k)
506  enddo
507  nummap = nummap + 6
508  enddo
509  endif
510  n = list(27)
511  do i = 1, n
512  map(nummap + i) = 1
513  enddo
514  nummap = nummap + n
515  elseif (number .eq. 14) then
516  if (list(37).gt.1) then
517  do j = 2, list(37)
518  do k = 1, 6
519  map(nummap + k) = map(38 + k)
520  enddo
521  nummap = nummap + 6
522  enddo
523  endif
524  n = list(26)
525  do i = 1, n
526  map(nummap + i) = 1
527  enddo
528  nummap = nummap + n
529  elseif (number .eq. 30) then
530  do j = 1, list(5)
531  map(nummap + 1) = 2
532  map(nummap + 2) = 2
533  map(nummap + 3) = 1
534  map(nummap + 4) = 1
535  map(nummap + 5) = 4
536  nummap = nummap + 5
537  enddo
538  elseif (number .eq. 31) then
539  do j = 1, list(5)
540  map(nummap + 1) = 2
541  map(nummap + 2) = 2
542  map(nummap + 3) = 2
543  map(nummap + 4) = 1
544  map(nummap + 5) = 4
545  nummap = nummap + 5
546  enddo
547  elseif (number .eq. 32) then
548  do j = 1, list(10)
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. 33) then
557  n = list(10)
558  do i = 1, n
559  map(nummap + i) = 1
560  enddo
561  nummap = nummap + n
562  elseif (number .eq. 34) then
563  if (list(25).gt.1) then
564  do j = 2, list(25)
565  do k = 1, 6
566  map(nummap + k) = map(26 + k)
567  enddo
568  nummap = nummap + 6
569  enddo
570  endif
571  n = list(10)
572  do i = 1, n
573  map(nummap + i) = 1
574  enddo
575  nummap = nummap + n
576  elseif (number .eq. 42) then
577  if (list(23).gt.1) then
578  do j = 2, list(23)
579  do k = 1, 6
580  map(nummap + k) = map(24 + k)
581  enddo
582  nummap = nummap + 6
583  enddo
584  endif
585  elseif (number .eq. 43) then
586  if (list(26).gt.1) then
587  do j = 2, list(26)
588  do k = 1, 6
589  map(nummap + k) = map(27 + k)
590  enddo
591  nummap = nummap + 6
592  enddo
593  endif
594  elseif (number .eq. 46) then
595  if (list(28).gt.1) then
596  do j = 2, list(28)
597  do k = 1, 6
598  map(nummap + k) = map(29 + k)
599  enddo
600  nummap = nummap + 6
601  enddo
602  endif
603  elseif (number .eq. 47) then
604  if (list(31).gt.1) then
605  do j = 2, list(31)
606  do k = 1, 6
607  map(nummap + k) = map(32 + k)
608  enddo
609  nummap = nummap + 6
610  enddo
611  endif
612  elseif (number .eq. 51) then
613  do j = 1, list(16)
614  map(nummap + 1) = 1
615  map(nummap + 2) = 1
616  map(nummap + 3) = -1
617  map(nummap + 4) = -4
618  map(nummap + 5) = -1
619  map(nummap + 6) = -4
620  nummap = nummap + 6
621  enddo
622  elseif (number .eq. 53) then
623  n = list(4)
624  do i = 1, n
625  map(nummap + i) = 1
626  enddo
627  nummap = nummap + n
628  elseif (number .eq. 54) then
629  n = list(4)
630  do i = 1, n
631  map(nummap + i) = 1
632  enddo
633  nummap = nummap + n
634  elseif (number .eq. 91) then
635  if (list(29).gt.1 ) then
636  do j = 2, list(29)
637  do k = 1, 6
638  map(nummap + k) = map(30 + k)
639  enddo
640  nummap = nummap + 6
641  enddo
642  endif
643  n = list(16)
644  do i = 1, n
645  map(nummap + i) = 1
646  enddo
647  nummap = nummap + n
648  endif
649  end subroutine extpdstemplate
650 
660  integer function getpdtlen(number)
661  implicit none
662 
663  integer, intent(in) :: number
664  integer :: index
665 
666  getpdtlen = 0
667  index = getpdsindex(number)
668  if (index .ne. -1) then
669  getpdtlen=templates(index)%mappdslen
670  endif
671  end function getpdtlen
672 end 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.