NCEPLIBS-w3emc 2.12.0
Loading...
Searching...
No Matches
w3nogds.f File Reference

Make a complete grib message. More...

Go to the source code of this file.

Functions/Subroutines

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.
 

Detailed Description

Make a complete grib message.

Author
Farley
Date
1997-02-24

Definition in file w3nogds.f.

Function/Subroutine Documentation

◆ w3nogds()

subroutine w3nogds (   itype,
real, dimension(*)  fld,
integer, dimension(*)  ifld,
  ibitl,
  ipflag,
integer, dimension(*)  id,
character * 1, dimension(*)  pds,
  igflag,
  igrid,
integer, dimension(*)  igds,
  icomp,
  ibflag,
integer, dimension(*)  ibmap,
  iblen,
integer, dimension(*)  ibdsfl,
  npts,
character * 1, dimension(*)  kbuf,
  itot,
  jerr 
)

Makes a complete grib message from a user supplied array of floating point or integer data.

The user has the option of supplying the pds or an integer array that will be used to create a pds (with w3fi68()). The user must also supply other necessary info; see usage section below.

Program History Log:

Date Programmer Comment
1997-02-24 M. Farley Modified w3fi72() - this routine allows for no gds (errors in w3fi71 for grib grids 21-26, 61-64 forced the need for this routine).
1998-06-24 Stephen Gilbert Added number of gridpoint values for grids 61-64, needed when igflag=2 ( no gds ).
1998-12-21 Stephen Gilbert Replaced function ichar with mova2i.
Parameters
[in]ITYPE0 = Floating point data supplied in array 'fld' 1 = Data supplied in array 'ifld'
[in]FLDArray of data (at proper gridpoints) to be converted to grib format if itype=0. see remarks #1 & 2.
[in]IFLDArray of data (at proper gridpoints) to be converted to grib format if itype=1. see remarks #1 & 2.
[in]IBITL0 = Computer computes length for packing data from power of 2 (number of bits) best fit of data using 'variable' bit packer w3fi58. 8, 12, etc. computer rescales data to fit into that 'fixed' number of bits using w3fi59. see remarks #3.
[in]IPFLAG0 = Make pds from user supplied array (id) 1 = user supplying pds note: if pds is greater than 30, use iplfag=1. the user could call w3fi68 before he calls w3nogds. this would make the first 30 bytes of the pds, user then would make bytes after 30.
[in]IDArray of values that w3fi68 will use to make an edition 1 pds if ipflag=0. (see the docblock for w3fi68 for layout of array)
[in]PDSArray of values (valid pds supplied by user) if ipflag=1. length may exceed 28 bytes (contents of bytes beyond 28 are passed through unchanged).
[in]IGFLAG0 = Make gds based on 'igrid' value. 1 = make gds from user supplied info in 'igds' and 'igrid' value. see remarks #4. 2 = no gds will be included...for international grids *** this is an exception to remarks #4!!!!
[in]IGRID# = Grid identification (table b) 255 = if user defined grid; igds must be supplied and igflag must =1.
[in]IGDSArray containing user gds info (same format as supplied by w3fi71 - see dockblock for layout) if igflag=1.
[in]ICOMPResolution and component flag for bit 5 of gds(17) 0 = earth oriented winds 1 = grid oriented winds
[in]IBFLAG0 = Make bit map from user supplied data
  • # = bit map predefined by center see remarks #5.
[in]IBMAPArray containing bit map
[in]IBLENLength of bit map will be used to verify length of field (error if it doesn't match).
[in]IBDSFLArray containing table 11 flag info bds octet 4: (1) 0 = grid point data 1 = spherical harmonic coefficients (2) 0 = simple packing 1 = second order packing (3) ... same value as 'itype' 0 = original data were floating point values 1 = original data were integer values (4) 0 = no additional flags at octet 14 1 = octet 14 contains flag bits 5-12 (5) 0 = reserved - always set to 0 byte 6 option 1 not available (as of 5-16-93) (6) 0 = single datum at each grid point 1 = matrix of values at each grid point byte 7 option 0 with second order packing n/a (as of 5-16-93) (7) 0 = no secondary bit maps 1 = secondary bit maps present (8) 0 = second order values have constant width 1 = second order values have different widths
[out]NPTSNumber of gridpoints in array fld or ifld
[out]KBUFEntire grib message ('grib' to '7777') equivalence to integer array to make sure it is on word bounary.
[out]ITOTTotal length of grib message in bytes
[out]JERR=:
  • 0, Completed making grib field without error
  • 1, Ipflag not 0 or 1
  • 2, Igflag not 0 or 1 or 2
  • 3, Error converting ieee f.p. number to ibm370 f.p.
  • 4, W3fi71 error/igrid not defined
  • 5, W3fk74 error/grid representation type not valid
  • 6, Grid too large for packer dimension arrays see automation division for revision!
  • 7, Length of bit map not equal to size of fld/ifld
  • 8, W3fi73 error, all values in ibmap are zero
Remarks
  • 1 If bit map to be included in message, null data should be included in fld or ifld. this routine will take care of 'discarding' any null data based on the bit map.
  • 2 Units must be those in grib documentation: nmc o.n. 388 or wmo publication 306.
  • 3 In either case, input numbers will be multiplied by '10 to the nth' power found in id(25) or pds(27-28), the d-scaling factor, prior to binary packing.
  • 4 All nmc produced grib fields will have a grid definition section included in the grib message. id(6) will be set to '1'.
  • gds will be built based on grid number (igrid), unless igflag=1 (user supplying igds). user must still supply igrid even if igds provided.
  • 5 If bit map used then id(7) or pds(8) must indicate the presence of a bit map.
  • 6 Array kbuf should be equivalenced to an integer value or array to make sure it is on a word boundary.
  • 7 Subprogram can be called from a multiprocessing environment.

Definition at line 120 of file w3nogds.f.