NCEPLIBS-w3emc  2.11.0
makgds.f90
1 
107 SUBROUTINE makgds(IOPT,KGDS,GDS,LENGDS,IRET)
108  IMPLICIT NONE
109  !
110  CHARACTER, INTENT(INOUT) :: GDS(400)
111  !
112  INTEGER, INTENT(IN ) :: IOPT
113  INTEGER, INTENT(INOUT) :: KGDS(200)
114  INTEGER, INTENT( OUT) :: IRET, LENGDS
115  !
116  INTEGER :: ICOMP, IPDS(200), IGDS(200)
117  INTEGER :: KPTR(200), KPDS(200), NPTS
118  !
119  DATA kptr/200*0/, kpds/200*0/
120  ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
121  ! UNPACK GDS INTO KGDS
122  IF(iopt.EQ.-1) THEN
123  CALL fi633(gds,kptr,kgds,iret)
124  ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
125  ! USE KGDS TO PACK GDS
126  ELSEIF(iopt.EQ.255) THEN
127  CALL r63w72(kpds,kgds,ipds,igds)
128  icomp=mod(igds(8)/8,2)
129  CALL w3fi74(igds,icomp,gds,lengds,npts,iret)
130  ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
131  ! USE NCEP GRID ID TO MAKE GDS AND KGDS
132  ELSEIF(iopt.GT.0.AND.iopt.LT.255) THEN
133  CALL w3fi71(iopt,igds,iret)
134  IF(iret.EQ.0) THEN
135  icomp=mod(igds(8)/8,2)
136  CALL w3fi74(igds,icomp,gds,lengds,npts,iret)
137  IF(iret.EQ.0) CALL fi633(gds,kptr,kgds,iret)
138  ENDIF
139  ENDIF
140  ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
141 END SUBROUTINE makgds
subroutine r63w72(KPDS, KGDS, IPDS, IGDS)
Determines the integer PDS and GDS parameters for the GRIB1 packing routine w3fi72() given the parame...
Definition: r63w72.f:27
subroutine fi633(MSGA, KPTR, KGDS, KRET)
Extract info from grib-gds.
Definition: w3fi63.f:981
subroutine w3fi71(IGRID, IGDS, IERR)
Makes a 18, 37, 55, 64, or 91 word integer array used by w3fi72() GRIB packer to make the grid descri...
Definition: w3fi71.f:187
subroutine w3fi74(IGDS, ICOMP, GDS, LENGDS, NPTS, IGERR)
This subroutine constructs a GRIB grid definition section.
Definition: w3fi74.f:19