122 & IGFLAG,IGRID,IGDS,ICOMP,
123 & IBFLAG,IBMAP,IBLEN,IBDSFL,
124 & NPTS,KBUF,ITOT,JERR)
126 parameter(mxsize=260000)
128 parameter(mxsiz3=mxsize*3)
129 parameter(mxsizb=mxsize/8+6)
131 parameter(mxsizi=mxsiz3/8)
142 INTEGER IPFLD(MXSIZI)
145 CHARACTER * 1 BDS11(11)
146 CHARACTER * 1 KBUF(*)
148 CHARACTER * 1 GDS(200)
149 CHARACTER * 1 BMS(MXSIZB)
150 CHARACTER * 1 PFLD(MXSIZ3)
154 equivalence(ipfld(1),pfld(1))
155 equivalence(bds11(1),idummy)
159 DATA ib / 71, 82, 73, 66/
179 IF (ipflag .EQ.0)
THEN
181 if (igflag .eq. 2)
then
185 ELSE IF (ipflag .EQ. 1)
THEN
186 IF (iand(
mova2i(pds(8)),64) .EQ. 64)
THEN
189 ELSE IF (
mova2i(pds(8)) .EQ. 0)
THEN
211 IF (igflag .EQ. 0)
THEN
212 CALL w3fi71(igrid,igds,igerr)
213 IF (igerr .EQ. 1)
THEN
219 IF (igflag .EQ. 0 .OR. igflag .EQ.1)
THEN
221 IF (igerr .EQ. 1)
THEN
227 IF (npts .GT. mxsize)
THEN
233 else if (igflag .eq. 2)
then
235 if (igrid.eq.21)
then
237 else if (igrid.eq.22)
then
239 else if (igrid.eq.23)
then
241 else if (igrid.eq.24)
then
243 else if (igrid.eq.25)
then
245 else if (igrid.eq.26)
then
247 else if ((igrid.ge.61).and.(igrid.le.64))
then
261 IF (
mova2i(pds(8)) .EQ. 64 .OR.
262 &
mova2i(pds(8)) .EQ. 192)
THEN
264 IF (ibflag .EQ. 0)
THEN
265 IF (iblen .NE. npts)
THEN
270 CALL w3fi73(ibflag,ibmap,iblen,bms,lenbms,ier)
286 IF (iand(jscale,32768).NE.0)
THEN
287 jscale = - iand(jscale,32767)
289 scale = 10.0 ** jscale
290 IF (itype .EQ. 0)
THEN
292 fld(i) = fld(i) * scale
296 ifld(i) = nint(float(ifld(i)) * scale)
302 CALL w3fi75(ibitl,itype,itoss,fld,ifld,ibmap,ibdsfl,
303 & npts,bds11,ipfld,pfld,len,lenbds,iberr,pds,igds)
304 IF (iberr .EQ. 1)
THEN
311 IF (jscale.NE.0)
THEN
315 fld(i) = fld(i) * dscale
319 fld(i) = nint(float(ifld(i)) * dscale)
329 itot = igribl + ipdsl +
lengds + lenbms + lenbds + 4
346 CALL xstore(kbuf,0,iwords)
347 IF (mod(itot,lw).NE.0)
THEN
348 ibytes = itot - iwords * lw
350 kbuf(iwords * lw + i) = zero
358 kbuf(i) = char(ib(i))
361 kbuf(5) = char(mod(itot / 65536,256))
362 kbuf(6) = char(mod(itot / 256,256))
363 kbuf(7) = char(mod(itot ,256))
368 istart = istart + igribl
370 CALL xmovex(kbuf(istart+1),pds,ipdsl)
377 istart = istart + ipdsl
385 IF (lenbms .GT. 0)
THEN
386 CALL xmovex(kbuf(istart+1),bms,lenbms)
393 istart = istart + lenbms
394 CALL xmovex(kbuf(istart+1),bds11,11)
400 CALL xmovex(kbuf(istart+1),pfld,len)
409 kbuf(istart+i) = seven
function lengds(kgds)
Program history log:
integer function mova2i(a)
This Function copies a bit string from a Character*1 variable to an integer variable.
subroutine w3fi01(lw)
Determines the number of bytes in a full word for the particular machine (IBM or cray).
subroutine w3fi68(id, pds)
Converts an array of 25, or 27 integer words into a grib product definition section (pds) of 28 bytes...
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...
subroutine w3fi73(ibflag, ibmap, iblen, bms, lenbms, ier)
This subroutine constructs a grib bit map section.
subroutine w3fi74(igds, icomp, gds, lengds, npts, igerr)
This subroutine constructs a GRIB grid definition section.
subroutine w3fi75(ibitl, itype, itoss, fld, ifld, ibmap, ibdsfl, npts, bds11, ipfld, pfld, len, lenbds, iberr, pds, igds)
This routine packs a grib field and forms octets(1-11) of the binary data section (bds).
subroutine w3nogds(itype, fld, ifld, ibitl, ipflag, id, pds, igflag, igrid, igds, icomp, ibflag, ibmap, iblen, ibdsfl, npts, kbuf, itot, jerr)
Makes a complete grib message from a user supplied array of floating point or integer data.
subroutine xmovex(out, in, ibytes)
subroutine xstore(cout, con, mwords)
Stores an 8-byte (fullword) value through consecutive storage locations.