NCEPLIBS-g2  3.4.7
getfield.F90
Go to the documentation of this file.
1 
5 
106 subroutine getfield(cgrib, lcgrib, ifldnum, igds, igdstmpl, &
107  igdslen, ideflist, idefnum, ipdsnum, ipdstmpl, ipdslen, &
108  coordlist, numcoord, ndpts, idrsnum, idrstmpl, idrslen, &
109  ibmap, bmap, fld, ierr)
110 
111  implicit none
112 
113  character(len = 1), intent(in) :: cgrib(lcgrib)
114  integer, intent(in) :: lcgrib, ifldnum
115  integer, intent(out) :: igds(*), igdstmpl(*), ideflist(*)
116  integer, intent(out) :: ipdsnum, ipdstmpl(*)
117  integer, intent(out) :: idrsnum, idrstmpl(*)
118  integer, intent(out) :: ndpts, ibmap, idefnum, numcoord
119  integer, intent(out) :: ierr
120  logical*1, intent(out) :: bmap(*)
121  real, intent(out) :: fld(*), coordlist(*)
122 
123  character(len = 4), parameter :: grib = 'GRIB', c7777 = '7777'
124  character(len = 4) :: ctemp
125  integer :: listsec0(2)
126  integer :: iofst, istart
127  integer(4) :: ieee
128  logical :: have3, have4, have5, have6, have7
129 
130  !implicit none additions
131  integer, intent(out) :: igdslen, ipdslen, idrslen
132  integer :: numfld, j, lengrib, lensec0, ipos
133  integer :: lensec, isecnum, jerr, ier, numlocal
134 
135  have3 = .false.
136  have4 = .false.
137  have5 = .false.
138  have6 = .false.
139  have7 = .false.
140  ierr = 0
141  numfld = 0
142  numlocal = 0
143 
144  ! Check for valid request number
145  if (ifldnum .le. 0) then
146  print *, 'getfield: Request for field number ' &
147  ,'must be positive.'
148  ierr = 3
149  return
150  endif
151 
152  ! Check for beginning of GRIB message in the first 100 bytes
153  istart = 0
154  do j = 1, 100
155  ctemp = cgrib(j) // cgrib(j + 1) // cgrib(j + 2) // cgrib(j + 3)
156  if (ctemp .eq. grib) then
157  istart = j
158  exit
159  endif
160  enddo
161  if (istart .eq. 0) then
162  print *, 'getfield: Beginning characters GRIB not found.'
163  ierr = 1
164  return
165  endif
166 
167  ! Unpack Section 0 - Indicator Section
168  iofst = 8 * (istart + 5)
169  call g2_gbytec(cgrib, listsec0(1), iofst, 8) ! Discipline
170  iofst = iofst + 8
171  call g2_gbytec(cgrib, listsec0(2), iofst, 8) ! GRIB edition number
172  iofst = iofst + 8
173  iofst = iofst + 32
174  call g2_gbytec(cgrib, lengrib, iofst, 32) ! Length of GRIB message
175  iofst = iofst + 32
176  lensec0 = 16
177  ipos = istart + lensec0
178 
179  ! Currently handles only GRIB Edition 2.
180  if (listsec0(2) .ne. 2) then
181  print *, 'getfield: can only decode GRIB edition 2.'
182  ierr = 2
183  return
184  endif
185 
186  ! Loop through the remaining sections keeping track of the length of
187  ! each. Also keep the latest Grid Definition Section info. Unpack
188  ! the requested field number.
189  do
190  ! Check to see if we are at end of GRIB message
191  ctemp = cgrib(ipos) // cgrib(ipos + 1) // cgrib(ipos + 2) // &
192  cgrib(ipos + 3)
193  if (ctemp .eq. c7777) then
194  ipos = ipos + 4
195  ! If end of GRIB message not where expected, issue error
196  if (ipos.ne.(istart + lengrib)) then
197  print *, 'getfield: "7777" found, but not ' &
198  ,'where expected.'
199  ierr = 4
200  return
201  endif
202  exit
203  endif
204  ! Get length of Section and Section number
205  iofst = (ipos - 1) * 8
206  call g2_gbytec(cgrib, lensec, iofst, 32) ! Get Length of Section
207  iofst = iofst + 32
208  call g2_gbytec(cgrib, isecnum, iofst, 8) ! Get Section number
209  iofst = iofst + 8
210 
211  ! If found Section 3, unpack the GDS info using the appropriate
212  ! template. Save in case this is the latest grid before the
213  ! requested field.
214  if (isecnum .eq. 3) then
215  iofst = iofst - 40 ! reset offset to beginning of section
216  call unpack3(cgrib, lcgrib, iofst, igds, igdstmpl, &
217  igdslen, ideflist, idefnum, jerr)
218  if (jerr .eq. 0) then
219  have3 = .true.
220  else
221  ierr = 10
222  return
223  endif
224  endif
225 
226  ! If found Section 4, check to see if this field is the one
227  ! requested.
228  if (isecnum .eq. 4) then
229  numfld = numfld + 1
230  if (numfld .eq. ifldnum) then
231  iofst = iofst - 40 ! reset offset to beginning of section
232  call unpack4(cgrib, lcgrib, iofst, ipdsnum, ipdstmpl, &
233  ipdslen, coordlist, numcoord, jerr)
234  if (jerr .eq. 0) then
235  have4 = .true.
236  else
237  ierr = 11
238  return
239  endif
240  endif
241  endif
242 
243  ! If found Section 5, check to see if this field is the one
244  ! requested.
245  if ((isecnum .eq. 5) .and. (numfld .eq. ifldnum)) then
246  iofst = iofst - 40 ! reset offset to beginning of section
247  call unpack5(cgrib, lcgrib, iofst, ndpts, idrsnum, &
248  idrstmpl, idrslen, jerr)
249  if (jerr .eq. 0) then
250  have5 = .true.
251  else
252  ierr = 12
253  return
254  endif
255  endif
256 
257  ! If found Section 6, Unpack bitmap. Save in case this is the
258  ! latest bitmap before the requested field.
259  if (isecnum .eq. 6) then
260  iofst = iofst - 40 ! reset offset to beginning of section
261  call unpack6(cgrib, lcgrib, iofst, igds(2), ibmap, bmap, &
262  jerr)
263  if (jerr .eq. 0) then
264  have6 = .true.
265  else
266  ierr = 13
267  return
268  endif
269  endif
270 
271  ! If found Section 7, check to see if this field is the one
272  ! requested.
273  if ((isecnum .eq. 7) .and. (numfld .eq. ifldnum)) then
274  if (idrsnum .eq. 0) then
275  call simunpack(cgrib(ipos + 5), lensec - 6, idrstmpl, &
276  ndpts, fld)
277  have7 = .true.
278  elseif (idrsnum .eq. 2 .or. idrsnum .eq. 3) then
279  call comunpack(cgrib(ipos + 5), lensec - 6, lensec, &
280  idrsnum,idrstmpl, ndpts, fld, ier)
281  if (ier .ne. 0) then
282  ierr = 14
283  return
284  endif
285  have7 = .true.
286  elseif (idrsnum .eq. 50) then
287  call simunpack(cgrib(ipos + 5), lensec - 6, idrstmpl, &
288  ndpts - 1, fld(2))
289  ieee = idrstmpl(5)
290  call rdieee(ieee, fld(1), 1)
291  have7 = .true.
292  elseif (idrsnum .eq. 40 .or. idrsnum .eq. 40000) then
293  call jpcunpack(cgrib(ipos + 5), lensec - 5, idrstmpl, &
294  ndpts, fld)
295  have7 = .true.
296  elseif (idrsnum .eq. 41 .or. idrsnum .eq. 40010) then
297  call pngunpack(cgrib(ipos + 5), lensec - 5, idrstmpl, &
298  ndpts, fld)
299  have7 = .true.
300  else
301  print *, 'getfield: Data Representation Template ', &
302  idrsnum, ' not yet implemented.'
303  ierr = 9
304  return
305  endif
306  endif
307 
308  ! Check to see if we read pass the end of the GRIB message and
309  ! missed the terminator string '7777'.
310  ipos = ipos + lensec ! Update beginning of section pointer
311  if (ipos .gt. (istart + lengrib)) then
312  print *, 'getfield: "7777" not found at end' &
313  ,' of GRIB message.'
314  ierr = 7
315  return
316  endif
317 
318  if (have3 .and. have4 .and. have5 .and. have6 .and. have7) &
319  return
320 
321  enddo
322 
323  ! If exited from above loop, the end of the GRIB message was reached
324  ! before the requested field was found.
325  print *, 'getfield: GRIB message contained ', numlocal, &
326  ' different fields.'
327  print *, 'getfield: The request was for the ', ifldnum, &
328  ' field.'
329  ierr = 6
330 
331 end subroutine getfield
332 
343 
374 subroutine unpack3(cgrib, lcgrib, iofst, igds, igdstmpl, &
375  mapgridlen, ideflist, idefnum, ierr)
376 
377  use gridtemplates
378  implicit none
379 
380  character(len = 1), intent(in) :: cgrib(lcgrib)
381  integer, intent(in) :: lcgrib
382  integer, intent(inout) :: iofst
383  integer, intent(out) :: igds(*), igdstmpl(*), ideflist(*)
384  integer, intent(out) :: ierr, idefnum
385 
386  integer, allocatable :: mapgrid(:)
387  integer :: mapgridlen, ibyttem
388  logical needext
389 
390  !implicit none additions
391  integer :: lensec, iret, i, nbits, isign, newmapgridlen
392 
393  ierr = 0
394 
395  call g2_gbytec(cgrib, lensec, iofst, 32) ! Get Length of Section
396  iofst = iofst + 32
397  iofst = iofst + 8 ! skip section number
398 
399  call g2_gbytec(cgrib, igds(1), iofst, 8) ! Get source of Grid def.
400  iofst = iofst + 8
401  call g2_gbytec(cgrib, igds(2), iofst, 32) ! Get number of grid pts.
402  iofst = iofst + 32
403  call g2_gbytec(cgrib, igds(3), iofst, 8) ! Get num octets for opt. list
404  iofst = iofst + 8
405  call g2_gbytec(cgrib, igds(4), iofst, 8) ! Get interpret. for opt. list
406  iofst = iofst + 8
407  call g2_gbytec(cgrib, igds(5), iofst, 16) ! Get Grid Def Template num.
408  iofst = iofst + 16
409  if (igds(1) .eq. 0) then
410  ! if (igds(1).eq.0.OR.igds(1).eq.255) then ! FOR ECMWF TEST ONLY
411  allocate(mapgrid(lensec))
412  ! Get Grid Definition Template
413  call getgridtemplate(igds(5), mapgridlen, mapgrid, needext, &
414  iret)
415  if (iret .ne. 0) then
416  ierr = 5
417  return
418  endif
419  else
420  ! igdstmpl = -1
421  mapgridlen = 0
422  needext = .false.
423  endif
424 
425  ! Unpack each value into array igdstmpl from the the appropriate
426  ! number of octets, which are specified in corresponding entries in
427  ! array mapgrid.
428  ibyttem = 0
429  do i = 1, mapgridlen
430  nbits = iabs(mapgrid(i)) * 8
431  if (mapgrid(i) .ge. 0) then
432  call g2_gbytec(cgrib, igdstmpl(i), iofst, nbits)
433  else
434  call g2_gbytec(cgrib, isign, iofst, 1)
435  call g2_gbytec(cgrib, igdstmpl(i), iofst + 1, nbits-1)
436  if (isign .eq. 1) igdstmpl(i) = -igdstmpl(i)
437  endif
438  iofst = iofst + nbits
439  ibyttem = ibyttem + iabs(mapgrid(i))
440  enddo
441 
442  ! Check to see if the Grid Definition Template needs to be
443  ! extended. The number of values in a specific template may vary
444  ! depending on data specified in the "static" part of the template.
445  if (needext) then
446  call extgridtemplate(igds(5), igdstmpl, newmapgridlen, &
447  mapgrid)
448  ! Unpack the rest of the Grid Definition Template
449  do i = mapgridlen + 1, newmapgridlen
450  nbits = iabs(mapgrid(i)) * 8
451  if (mapgrid(i) .ge. 0) then
452  call g2_gbytec(cgrib, igdstmpl(i), iofst, nbits)
453  else
454  call g2_gbytec(cgrib, isign, iofst, 1)
455  call g2_gbytec(cgrib, igdstmpl(i), iofst + 1, nbits - &
456  1)
457  if (isign .eq. 1) igdstmpl(i) = -igdstmpl(i)
458  endif
459  iofst = iofst + nbits
460  ibyttem = ibyttem + iabs(mapgrid(i))
461  enddo
462  mapgridlen = newmapgridlen
463  endif
464 
465  ! Unpack optional list of numbers defining number of points in each
466  ! row or column, if included. This is used for non regular grids.
467  if (igds(3) .ne. 0) then
468  nbits = igds(3) * 8
469  idefnum = (lensec - 14 - ibyttem) / igds(3)
470  call g2_gbytesc(cgrib, ideflist, iofst, nbits, 0, idefnum)
471  iofst = iofst + (nbits * idefnum)
472  else
473  idefnum = 0
474  endif
475  if (allocated(mapgrid)) deallocate(mapgrid)
476 end subroutine unpack3
477 
504 subroutine unpack4(cgrib, lcgrib, iofst, ipdsnum, ipdstmpl, &
505  mappdslen, coordlist, numcoord, ierr)
506 
507  use pdstemplates
508  implicit none
509 
510  character(len = 1), intent(in) :: cgrib(lcgrib)
511  integer, intent(in) :: lcgrib
512  integer, intent(inout) :: iofst
513  real, intent(out) :: coordlist(*)
514  integer, intent(out) :: ipdsnum, ipdstmpl(*)
515  integer, intent(out) :: ierr, numcoord
516 
517  real(4), allocatable :: coordieee(:)
518  integer, allocatable :: mappds(:)
519  integer :: mappdslen
520  logical needext
521 
522  !implicit none additions
523  integer :: lensec, iret, i, nbits, isign, newmappdslen
524 
525  ierr = 0
526 
527  call g2_gbytec(cgrib, lensec, iofst, 32) ! Get Length of Section
528  iofst = iofst + 32
529  iofst = iofst + 8 ! skip section number
530  allocate(mappds(lensec))
531 
532  call g2_gbytec(cgrib, numcoord, iofst, 16) ! Get num of coordinate values
533  iofst = iofst + 16
534  call g2_gbytec(cgrib, ipdsnum, iofst, 16) ! Get Prod. Def Template num.
535  iofst = iofst + 16
536  ! Get Product Definition Template.
537  call getpdstemplate(ipdsnum, mappdslen, mappds, needext, iret)
538  if (iret.ne.0) then
539  ierr = 5
540  return
541  endif
542 
543  ! Unpack each value into array ipdstmpl from the the appropriate
544  ! number of octets, which are specified in corresponding entries in
545  ! array mappds.
546  do i = 1, mappdslen
547  nbits = iabs(mappds(i))*8
548  if (mappds(i).ge.0) then
549  call g2_gbytec(cgrib, ipdstmpl(i), iofst, nbits)
550  else
551  call g2_gbytec(cgrib, isign, iofst, 1)
552  call g2_gbytec(cgrib, ipdstmpl(i), iofst + 1, nbits-1)
553  if (isign.eq.1) ipdstmpl(i) = -ipdstmpl(i)
554  endif
555  iofst = iofst + nbits
556  enddo
557 
558  ! Check to see if the Product Definition Template needs to be
559  ! extended. The number of values in a specific template may vary
560  ! depending on data specified in the "static" part of the template.
561  if (needext) then
562  call extpdstemplate(ipdsnum, ipdstmpl, newmappdslen, mappds)
563 
564  ! Unpack the rest of the Product Definition Template
565  do i = mappdslen + 1, newmappdslen
566  nbits = iabs(mappds(i))*8
567  if (mappds(i).ge.0) then
568  call g2_gbytec(cgrib, ipdstmpl(i), iofst, nbits)
569  else
570  call g2_gbytec(cgrib, isign, iofst, 1)
571  call g2_gbytec(cgrib, ipdstmpl(i), iofst + 1, nbits-1)
572  if (isign.eq.1) ipdstmpl(i) = -ipdstmpl(i)
573  endif
574  iofst = iofst + nbits
575  enddo
576  mappdslen = newmappdslen
577  endif
578 
579  ! Get Optional list of vertical coordinate values after the Product
580  ! Definition Template, if necessary.
581  if (numcoord .ne. 0) then
582  allocate (coordieee(numcoord))
583  call g2_gbytesc(cgrib, coordieee, iofst, 32, 0, numcoord)
584  call rdieee(coordieee, coordlist, numcoord)
585  deallocate (coordieee)
586  iofst = iofst + (32*numcoord)
587  endif
588  if (allocated(mappds)) deallocate(mappds)
589 end subroutine unpack4
590 
613 subroutine unpack5(cgrib, lcgrib, iofst, ndpts, idrsnum, &
614  idrstmpl, mapdrslen, ierr)
615 
616  use drstemplates
617  implicit none
618 
619  character(len = 1), intent(in) :: cgrib(lcgrib)
620  integer, intent(in) :: lcgrib
621  integer, intent(inout) :: iofst
622  integer, intent(out) :: ndpts, idrsnum, idrstmpl(*)
623  integer, intent(out) :: ierr
624 
625  ! integer, allocatable :: mapdrs(:)
626  integer, allocatable :: mapdrs(:)
627  integer :: mapdrslen
628  logical needext
629 
630  !implicit none additions
631  integer :: lensec, i, nbits, isign, newmapdrslen, iret
632 
633  ierr = 0
634 
635  call g2_gbytec(cgrib, lensec, iofst, 32) ! Get Length of Section
636  iofst = iofst + 32
637  iofst = iofst + 8 ! skip section number
638  allocate(mapdrs(lensec))
639 
640  call g2_gbytec(cgrib, ndpts, iofst, 32) ! Get num of data points
641  iofst = iofst + 32
642  call g2_gbytec(cgrib, idrsnum, iofst, 16) ! Get Data Rep Template Num.
643  iofst = iofst + 16
644  ! Gen Data Representation Template
645  call getdrstemplate(idrsnum, mapdrslen, mapdrs, needext, iret)
646  if (iret.ne.0) then
647  ierr = 7
648  return
649  endif
650 
651  ! Unpack each value into array ipdstmpl from the the appropriate
652  ! number of octets, which are specified in corresponding entries in
653  ! array mappds.
654  do i = 1, mapdrslen
655  nbits = iabs(mapdrs(i))*8
656  if (mapdrs(i).ge.0) then
657  call g2_gbytec(cgrib, idrstmpl(i), iofst, nbits)
658  else
659  call g2_gbytec(cgrib, isign, iofst, 1)
660  call g2_gbytec(cgrib, idrstmpl(i), iofst + 1, nbits-1)
661  if (isign.eq.1) idrstmpl(i) = -idrstmpl(i)
662  endif
663  iofst = iofst + nbits
664  enddo
665 
666  ! Check to see if the Data Representation Template needs to be
667  ! extended. The number of values in a specific template may vary
668  ! depending on data specified in the "static" part of the template.
669  if (needext) then
670  call extdrstemplate(idrsnum, idrstmpl, newmapdrslen, mapdrs)
671  ! Unpack the rest of the Data Representation Template
672  do i = mapdrslen + 1, newmapdrslen
673  nbits = iabs(mapdrs(i))*8
674  if (mapdrs(i).ge.0) then
675  call g2_gbytec(cgrib, idrstmpl(i), iofst, nbits)
676  else
677  call g2_gbytec(cgrib, isign, iofst, 1)
678  call g2_gbytec(cgrib, idrstmpl(i), iofst + 1, nbits - 1)
679  if (isign.eq.1) idrstmpl(i) = -idrstmpl(i)
680  endif
681  iofst = iofst + nbits
682  enddo
683  mapdrslen = newmapdrslen
684  endif
685  if (allocated(mapdrs)) deallocate(mapdrs)
686 end subroutine unpack5
687 
709 subroutine unpack6(cgrib, lcgrib, iofst, ngpts, ibmap, bmap, ierr)
710  implicit none
711 
712  character(len = 1), intent(in) :: cgrib(lcgrib)
713  integer, intent(in) :: lcgrib, ngpts
714  integer, intent(inout) :: iofst
715  integer, intent(out) :: ibmap
716  integer, intent(out) :: ierr
717  logical*1, intent(out) :: bmap(ngpts)
718 
719  integer :: intbmap(ngpts)
720 
721  !implicit none additions
722  integer :: j
723 
724  ierr = 0
725 
726  iofst = iofst + 32 ! skip Length of Section
727  iofst = iofst + 8 ! skip section number
728 
729  call g2_gbytec(cgrib, ibmap, iofst, 8) ! Get bit-map indicator
730  iofst = iofst + 8
731 
732  if (ibmap.eq.0) then ! Unpack bitmap
733  call g2_gbytesc(cgrib, intbmap, iofst, 1, 0, ngpts)
734  iofst = iofst + ngpts
735  do j = 1, ngpts
736  bmap(j) = .true.
737  if (intbmap(j).eq.0) bmap(j) = .false.
738  enddo
739  elseif (ibmap.eq.254) then ! Use previous bitmap
740  return
741  elseif (ibmap.eq.255) then ! No bitmap in message
742  bmap(1:ngpts) = .true.
743  else
744  print *, 'unpack6: Predefined bitmap ', ibmap, &
745  ' not recognized.'
746  ierr = 4
747  endif
748 end subroutine unpack6
subroutine comunpack(cpack, len, lensec, idrsnum, idrstmpl, ndpts, fld, ier)
Unpack a data field that was packed using a complex packing algorithm as defined in the GRIB2 documen...
Definition: comunpack.f:33
subroutine g2_gbytesc(in, iout, iskip, nbits, nskip, n)
Extract arbitrary size values from a packed bit string, right justifying each value in the unpacked a...
Definition: g2_gbytesc.F90:63
subroutine g2_gbytec(in, iout, iskip, nbits)
Extract arbitrary size values from a packed bit string, right justifying each value in the unpacked a...
Definition: g2_gbytesc.F90:20
subroutine getfield(cgrib, lcgrib, ifldnum, igds, igdstmpl, igdslen, ideflist, idefnum, ipdsnum, ipdstmpl, ipdslen, coordlist, numcoord, ndpts, idrsnum, idrstmpl, idrslen, ibmap, bmap, fld, ierr)
This subroutine returns the Grid Definition, Product Definition, Bit-map (if applicable),...
Definition: getfield.F90:110
subroutine unpack6(cgrib, lcgrib, iofst, ngpts, ibmap, bmap, ierr)
This subroutine unpacks Section 6 (Bit-Map Section) starting at octet 6 of that Section.
Definition: getfield.F90:710
subroutine unpack4(cgrib, lcgrib, iofst, ipdsnum, ipdstmpl, mappdslen, coordlist, numcoord, ierr)
This subroutine unpacks Section 4 (Product Definition Section) starting at octet 6 of that Section.
Definition: getfield.F90:506
subroutine unpack3(cgrib, lcgrib, iofst, igds, igdstmpl, mapgridlen, ideflist, idefnum, ierr)
This subroutine unpacks Section 3 (Grid Definition Section) starting at octet 6 of that Section.
Definition: getfield.F90:376
subroutine unpack5(cgrib, lcgrib, iofst, ndpts, idrsnum, idrstmpl, mapdrslen, ierr)
This subroutine unpacks Section 5 (Data Representation Section) starting at octet 6 of that Section.
Definition: getfield.F90:615
subroutine jpcunpack(cpack, len, idrstmpl, ndpts, fld)
Unpack a data field from a JPEG2000 code stream.
Definition: jpcunpack.F90:20
Handles Data Representation Templates used in Section 5.
subroutine getdrstemplate(number, nummap, map, needext, iret)
Return DRS template information for a specified Data Representation Template.
subroutine extdrstemplate(number, list, nummap, map)
Generate the remaining octet map for a given Data Representation Template, if required.
This Fortran module contains info on all the available GRIB2 Grid Definition Templates used in [Secti...
subroutine getgridtemplate(number, nummap, map, needext, iret)
Get the grid template information for a specified Grid Definition Template.
subroutine extgridtemplate(number, list, nummap, map)
Generate the remaining octet map for a given Grid Definition Template, if required.
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,...
subroutine getpdstemplate(number, nummap, map, needext, iret)
This subroutine returns PDS template information for a specified Product Definition Template.
subroutine pngunpack(cpack, len, idrstmpl, ndpts, fld)
Unpack a data field packed into a PNG image format.
Definition: pngunpack.F90:20
subroutine rdieee(rieee, a, num)
Copy array of 32-bit IEEE floating point values to local floating point representation.
Definition: rdieee.F90:16
subroutine simunpack(cpack, len, idrstmpl, ndpts, fld)
This subroutine unpacks a data field that was packed using a simple packing algorithm as defined in t...
Definition: simunpack.F90:19