Make a complete GRIB message.
More...
Go to the source code of this file.
|
subroutine | w3fi72 (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.
|
|
Make a complete GRIB message.
- Author
- Ralph Jones
- Date
- 1991-05-08
Definition in file w3fi72.f.
◆ w3fi72()
subroutine w3fi72 |
( |
|
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 information.
- Parameters
-
[in] | ITYPE |
- 0 = Floating point data supplied in array 'fld'
- 1 = Integer data supplied in array 'ifld'
|
[in] | FLD | Real array of data (at proper gridpoints) to be converted to grib format if itype=0. see remarks #1 & 2. |
[in] | IFLD | Integer array of data (at proper gridpoints) to be converted to grib format if itype=1. See remarks #1 & 2. |
[in] | IBITL |
- 0 = 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] | IPFLAG |
- 0 = 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 w3fi72(). This would make the first 30 bytes of the pds, user then would make bytes after 30.
- Parameters
-
[in] | ID | Integer array 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] | PDS | Character array 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] | IGFLAG |
- 0 = Make gds based on 'igrid' value.
- 1 = Make gds from user supplied info in 'igds' and 'igrid' value. See remarks #4.
|
[in] | IGRID |
- # = Grid identification (table b)
- 255 = If user defined grid; igds must be supplied and igflag must =1.
|
[in] | IGDS | Integer array containing user gds info (same format as supplied by w3fi71() - see dockblock for layout) if igflag=1. |
[in] | ICOMP | Resolution and component flag for bit 5 of gds(17)
- 0 = Earth oriented winds
- 1 = Grid oriented winds
|
[in] | IBFLAG |
- 0 = Make bit map from user supplied data
- # = Bit map predefined by center. See remarks #5.
|
[in] | IBMAP | Integer array containing bit map |
[in] | IBLEN | Length of bit map will be used to verify length of field (error if it doesn't match). |
[in] | IBDSFL | Integer array containing table 11 flag info
- BDS octet 4:
- (1)
- 0 = Grid point data
- 1 = Spherical harmonic coefficients
- (2) 0 = Simple 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] | NPTS | Number of gridpoints in array fld or ifld |
[out] | KBUF | Entire grib message ('grib' to '7777') equivalence to integer array to make sure it is on word boundary. |
[out] | ITOT | Total 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
- = 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
|
- Note
- 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.
- Author
- Ralph Jones
- Date
- 1991-05-08
Definition at line 116 of file w3fi72.f.