1 subroutine getdim
(csec3
,lcsec3
,width
,height
,iscan
)
2 !$$$ SUBPROGRAM DOCUMENTATION BLOCK
5 ! PRGMMR
: Gilbert ORG
: W
/NP11
DATE: 2002-12-11
7 ! ABSTRACT
: This
subroutine returns the dimensions and scanning mode of
8 ! a grid definition packed in GRIB2 Grid Definition Section
3 format.
10 ! PROGRAM HISTORY LOG
:
13 ! USAGE
: CALL getdim
(csec3
,lcsec3
,width
,height
,iscan
)
14 ! INPUT ARGUMENT LIST
:
15 ! csec3
- Character array that contains the packed GRIB2 GDS
16 ! lcsec3
- Length
(in octets
) of section
3
18 ! OUTPUT ARGUMENT LIST
:
19 ! width
- x
(or i
) dimension of the grid
.
20 ! height
- y
(or j
) dimension of the grid
.
21 ! iscan
- Scanning mode
( see Code Table
3.4 )
23 ! REMARKS
: Returns width and height set
to zero
, if grid template
27 ! LANGUAGE
: Fortran
90
33 character(len
=1),intent
(in
) :: csec3
(*)
34 integer,intent
(in
) :: lcsec3
35 integer,intent
(out
) :: width
,height
,iscan
37 integer,pointer
,dimension(:) :: igdstmpl
,list_opt
39 integer iofst
,igdtlen
,num_opt
,jerr
42 subroutine gf_unpack3
(cgrib
,lcgrib
,iofst
,igds
,igdstmpl
,
43 & mapgridlen
,ideflist
,idefnum
,ierr
)
44 character(len
=1),intent
(in
) :: cgrib
(lcgrib
)
45 integer,intent
(in
) :: lcgrib
46 integer,intent
(inout
) :: iofst
47 integer,pointer
,dimension(:) :: igdstmpl
,ideflist
48 integer,intent
(out
) :: igds
(5)
49 integer,intent
(out
) :: ierr
,idefnum
50 end subroutine gf_unpack3
53 nullify
(igdstmpl
,list_opt
)
55 iofst
=0 ! set offset
to beginning of section
56 call gf_unpack3
(csec3
,lcsec3
,iofst
,igds
,igdstmpl
,
57 & igdtlen
,list_opt
,num_opt
,jerr
)
59 selectcase
( igds
(5) ) ! Template number
68 case
(20) ! Polar Stereographic
72 case
(30) ! Lambert Conformal
76 case
(40:43) ! Gaussian
80 case
(90) ! Space View
/Orthographic
84 case
(110) ! Equatorial Azimuthal
98 if (associated
(igdstmpl
)) deallocate
(igdstmpl
)
99 if (associated
(list_opt
)) deallocate
(list_opt
)