NCEPLIBS-g2  3.4.5
getpoly.f
Go to the documentation of this file.
1 
6 
22 
23  subroutine getpoly(csec3,lcsec3,jj,kk,mm)
24 
25 ! use grib_mod
26 
27  character(len=1),intent(in) :: csec3(*)
28  integer,intent(in) :: lcsec3
29  integer,intent(out) :: jj,kk,mm
30 
31  integer,pointer,dimension(:) :: igdstmpl,list_opt
32  integer :: igds(5)
33  integer iofst,igdtlen,num_opt,jerr
34 
35  interface
36  subroutine gf_unpack3(cgrib,lcgrib,iofst,igds,igdstmpl,
37  & mapgridlen,ideflist,idefnum,ierr)
38  character(len=1),intent(in) :: cgrib(lcgrib)
39  integer,intent(in) :: lcgrib
40  integer,intent(inout) :: iofst
41  integer,pointer,dimension(:) :: igdstmpl,ideflist
42  integer,intent(out) :: igds(5)
43  integer,intent(out) :: ierr,idefnum
44  end subroutine gf_unpack3
45  end interface
46 
47  nullify(igdstmpl,list_opt)
48  !
49  iofst=0 ! set offset to beginning of section
50  call gf_unpack3(csec3,lcsec3,iofst,igds,igdstmpl,
51  & igdtlen,list_opt,num_opt,jerr)
52  if (jerr.eq.0) then
53  selectcase( igds(5) ) ! Template number
54  case (50:53) ! Spherical harmonic coefficients
55  jj=igdstmpl(1)
56  kk=igdstmpl(2)
57  mm=igdstmpl(3)
58  case default
59  jj=0
60  kk=0
61  mm=0
62  end select
63  else
64  jj=0
65  kk=0
66  mm=0
67  endif
68  !
69  if (associated(igdstmpl)) deallocate(igdstmpl)
70  if (associated(list_opt)) deallocate(list_opt)
71 
72  return
73  end
gf_unpack3
subroutine gf_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: gf_unpack3.f:54
getpoly
subroutine getpoly(csec3, lcsec3, jj, kk, mm)
This subroutine returns the J, K, and M pentagonal resolution parameters specified in a GRIB Grid Def...
Definition: getpoly.f:24