NCEPLIBS-g2  3.4.7
getpoly.f
Go to the documentation of this file.
1 
5 
20  subroutine getpoly(csec3,lcsec3,jj,kk,mm)
21  implicit none
22 
23  character(len=1),intent(in) :: csec3(*)
24  integer,intent(in) :: lcsec3
25  integer,intent(out) :: jj,kk,mm
26 
27  integer,pointer,dimension(:) :: igdstmpl,list_opt
28  integer :: igds(5)
29  integer iofst,igdtlen,num_opt,jerr
30 
31  interface
32  subroutine gf_unpack3(cgrib,lcgrib,iofst,igds,igdstmpl,
33  & mapgridlen,ideflist,idefnum,ierr)
34  character(len=1),intent(in) :: cgrib(lcgrib)
35  integer,intent(in) :: lcgrib
36  integer,intent(inout) :: iofst
37  integer,pointer,dimension(:) :: igdstmpl,ideflist
38  integer,intent(out) :: igds(5)
39  integer,intent(out) :: ierr,idefnum
40  end subroutine gf_unpack3
41  end interface
42 
43  nullify(igdstmpl,list_opt)
44 
45  iofst=0 ! set offset to beginning of section
46  call gf_unpack3(csec3,lcsec3,iofst,igds,igdstmpl,
47  & igdtlen,list_opt,num_opt,jerr)
48  if (jerr.eq.0) then
49  selectcase( igds(5) ) ! Template number
50  case (50:53) ! Spherical harmonic coefficients
51  jj=igdstmpl(1)
52  kk=igdstmpl(2)
53  mm=igdstmpl(3)
54  case default
55  jj=0
56  kk=0
57  mm=0
58  end select
59  else
60  jj=0
61  kk=0
62  mm=0
63  endif
64 
65  if (associated(igdstmpl)) deallocate(igdstmpl)
66  if (associated(list_opt)) deallocate(list_opt)
67 
68  end
subroutine getpoly(csec3, lcsec3, jj, kk, mm)
Return the J, K, and M pentagonal resolution parameters specified in a GRIB2 Grid Definition Section ...
Definition: getpoly.f:21
subroutine gf_unpack3(cgrib, lcgrib, iofst, igds, igdstmpl, mapgridlen, ideflist, idefnum, ierr)
Unpack Section 3 (Grid Definition Section) of a GRIB2 message, starting at octet 6 of that Section.
Definition: gf_unpack3.F90:52