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

GRIB pack data and form bds octets(1-11) More...

Go to the source code of this file.

Functions/Subroutines

subroutine fi7501 (iwork, ipfld, npts, ibdsfl, bds11, len, lenbds, pds, refnce, iscal2, kwide)
 BDS second order packing.
 
subroutine fi7502 (iwork, istart, npts, isame)
 Second order same value collection.
 
subroutine fi7503 (iwork, ipfld, npts, ibdsfl, bds11, len, lenbds, pds, refnce, iscal2, kwide, igds)
 Row by row, col by col packing.
 
subroutine fi7505 (n, nbits)
 Determine number of bits to contain value.
 
subroutine fi7513 (iwork, istart, npts, max, min, inrnge)
 Select block of data for packing.
 
subroutine fi7516 (iwork, npts, inrng, istart, max, min, mxval, lwidth)
 Scan number of points.
 
subroutine fi7517 (iret, iwork, npts, istrtb, inrnga, maxb, minb, mxvalb, lwideb)
 Scan backward.
 
subroutine fi7518 (iret, iwork, npts, istrta, inrnga, inrngb, maxa, mina, lwidea, mxvala)
 Scan forward.
 
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).
 

Detailed Description

GRIB pack data and form bds octets(1-11)

Author
M. Farley
Date
1992-07-10

Definition in file w3fi75.f.

Function/Subroutine Documentation

◆ fi7501()

subroutine fi7501 ( integer, dimension(*)  iwork,
character(len=1), dimension(*)  ipfld,
  npts,
integer, dimension(*)  ibdsfl,
character*1, dimension(*)  bds11,
integer  len,
integer  lenbds,
character*1, dimension(*)  pds,
real  refnce,
integer  iscal2,
integer  kwide 
)

BDS second order packing.

Author
Bill Cavanaugh
Date
1993-08-06 Perform secondary packing on grid point data, generating all BDS information.

Program history log:

  • Bill Cavanaugh 1993-08-06
  • Bill Cavanaugh 1993-12-15 Corrected location of start of first order values and start of second order values to reflect a byte location in the BDS instead of an offset.
  • Mark Iredell 1995-10-31 Removed saves and prints
Parameters
[in]IWORKInteger source array
[in]NPTSNumber of points in iwork
[in]IBDSFLFlags
[out]IPFLDContains bds from byte 12 on
[out]BDS11Contains first 11 bytes for bds
[out]LENNumber of bytes from 12 on
[out]LENBDSTotal length of bds
PDS
REFNCE
ISCAL2
KWIDE
Note
Subprogram can be called from a multiprocessing environment.
Author
Bill Cavanaugh
Date
1993-08-06

Definition at line 535 of file w3fi75.f.

◆ fi7502()

subroutine fi7502 ( integer, dimension(*)  iwork,
integer  istart,
integer  npts,
integer  isame 
)

Second order same value collection.

Author
Bill Cavanaugh
Date
1993-06-23 Collect sequential same values for processing as second order value for grib messages.

Program history log:

  • Bill Cavanaugh 1993-06-23
  • Mark Iredell 1995-10-31 Removed saves and prints
Parameters
[in]IWORKArray containing source data
[in]ISTARTStarting location for this test
[in]NPTSNumber of points in iwork
[out]ISAMENumber of sequential points having the same value
Note
Subprogram can be called from a multiprocessing environment.
Author
Bill Cavanaugh
Date
1993-06-23

Definition at line 856 of file w3fi75.f.

◆ fi7503()

subroutine fi7503 ( integer, dimension(*)  iwork,
character*1, dimension(*)  ipfld,
  npts,
integer, dimension(*)  ibdsfl,
character*1, dimension(*)  bds11,
integer  len,
integer  lenbds,
character*1, dimension(*)  pds,
real  refnce,
integer  iscal2,
integer  kwide,
integer, dimension(*)  igds 
)

Row by row, col by col packing.

Author
Bill Cavanaugh
Date
1993-08-06 Perform row by row or column by column packing generating all bds information.

Program history log:

  • Bill Cavanaugh 1993-08-06
  • Mark Iredell 1995-10-31 Removed saves and prints
Parameters
[in]IWORKInteger source array
[in]NPTSNumber of points in iwork
[in]IBDSFLFlags
[out]IPFLDContains bds from byte 12 on
[out]BDS11Contains first 11 bytes for bds
[out]LENNumber of bytes from 12 on
[out]LENBDSTotal length of bds
PDS
REFNCE
ISCAL2
KWIDE
IGDS
Note
Subprogram can be called from a multiprocessing environment.
Author
Bill Cavanaugh
Date
1993-08-06

Definition at line 900 of file w3fi75.f.

◆ fi7505()

subroutine fi7505 ( integer  n,
integer  nbits 
)

Determine number of bits to contain value.

Author
Bill Cavanaugh
Date
1993-06-23 Calculate number of bits to contain value n, with a maximum of 32 bits.

Program history log:

  • Bill Cavanaugh 1993-06-23
  • Mark Iredell 1995-10-31 Removed saves and prints
Parameters
[in]NInteger value
[out]NBITSNumber of bits to contain n
Note
Subprogram can be called from a multiprocessing environment.
Author
Bill Cavanaugh
Date
1993-06-23

Definition at line 1207 of file w3fi75.f.

◆ fi7513()

subroutine fi7513 ( integer, dimension(*)  iwork,
integer  istart,
integer  npts,
integer  max,
integer  min,
integer  inrnge 
)

Select block of data for packing.

Author
Bill Cavanaugh
Date
1994-01-21 Select a block of data for packing

Program history log:

  • Bill Cavanaugh 1994-01-21
  • Mark Iredell 1995-10-31 Removed saves and prints
  • Return address if encounter set of same values
    Parameters
    [in]IWORK
    [in]ISTART
    [in]NPTS
    [out]MAX
    [out]MIN
    [out]INRNGE
    Note
    Subprogram can be called from a multiprocessing environment.
    Author
    Bill Cavanaugh
    Date
    1994-01-21

Definition at line 1247 of file w3fi75.f.

◆ fi7516()

subroutine fi7516 ( integer, dimension(*)  iwork,
integer  npts,
integer  inrng,
integer  istart,
integer  max,
integer  min,
integer  mxval,
integer  lwidth 
)

Scan number of points.

Author
Bill Cavanaugh
Date
1994-01-21 Scan forward from current position. collect points and determine maximum and minimum values and the number of points that are included. Forward search is terminated by encountering a set of identical values, by reaching the number of points selected or by reaching the end of data.

Program history log:

  • Bill Cavavnaugh 1994-01-21
  • Mark Iredell 1995-10-31 Removed saves and prints
  • Return address if encounter set of same values
    Parameters
    [in]IWORKData array
    [in]NPTSNumber of points in data array
    [in]ISTARTStarting location in data
    [out]INRNGNumber of points selected
    [out]MAXMaximum value of points
    [out]MINMinimum value of points
    [out]MXVALMaximum value that can be contained in lwidth bits
    [out]LWIDTHNumber of bits to contain max diff
    Note
    Subprogram can be called from a multiprocessing environment.
    Author
    Bill Cavanaugh
    Date
    1994-01-21

Definition at line 1370 of file w3fi75.f.

◆ fi7517()

subroutine fi7517 (   iret,
integer, dimension(*)  iwork,
integer  npts,
integer  istrtb,
integer  inrnga,
integer  maxb,
integer  minb,
integer  mxvalb,
integer  lwideb 
)

Scan backward.

Author
Bill Cavanaugh
Date
1994-01-21 Scan backwards until a value exceeds range of group b this may shorten group a

Program history log:

  • Bill Cavanaugh 1994-01-21
  • Mark Iredell 1995-10-31 Removed saves and prints
  • Mark Iredell 1998-06-17 Removed alternate return
Parameters
[in]IWORK
[in]ISTRTB
[in]NPTS
[in]INRNGA
[out]IRET
[out]MAXB
[out]MINB
MXVALB
LWIDEB
Note
Subprogram can be called from a multiprocessing environment.
Author
Bill Cavanaugh
Date
1994-01-21

Definition at line 1433 of file w3fi75.f.

◆ fi7518()

subroutine fi7518 (   iret,
integer, dimension(*)  iwork,
integer  npts,
integer  istrta,
integer  inrnga,
  inrngb,
integer  maxa,
integer  mina,
integer  lwidea,
integer  mxvala 
)

Scan forward.

Author
Bill Cavanaugh
Date
1994-01-21 Scan forward from start of block b towards end of block b if next point under test forces a larger maxvala then terminate indicating last point tested for inclusion into block a.

Program history log:

  • Bill Cavanaugh 1994-01-21
  • Mark Iredell 1995-10-31 Removed saves and prints
  • Mark Iredell 1998-06-17 Removed alternate return
Parameters
IWORK
ISTRTA
INRNGA
INRNGB
MAXA
MINA
LWIDEA
MXVALA
[in]NPTS
[out]IRET
Note
Subprogram can be called from a multiprocessing environment.
Author
Bill Cavanaugh
Date
1994-01-21

Definition at line 1510 of file w3fi75.f.

◆ w3fi75()

subroutine w3fi75 (   ibitl,
  itype,
  itoss,
real, dimension(*)  fld,
integer, dimension(*)  ifld,
integer, dimension(*)  ibmap,
integer, dimension(*)  ibdsfl,
  npts,
character * 1, dimension(11)  bds11,
character(len=1), dimension(*)  ipfld,
character * 1, dimension(*)  pfld,
  len,
  lenbds,
  iberr,
character * 1, dimension(*)  pds,
integer, dimension(*)  igds 
)

This routine packs a grib field and forms octets(1-11) of the binary data section (bds).

Program history log:

  • M. Farley 1992-07-10 Original author
  • Ralph Jones 1992-10-01 Correction for field of constant data
  • Ralph Jones 1992-10-16 Get rid of arrays fp and int
  • Bill Cavanaugh 1993-08-06 Added routines fi7501, fi7502, fi7503 To allow second order packing in pds.
  • John Stackpole 1993-07-21 Assorted repairs to get 2nd diff pack in
  • Bill Cavanaugh 1993-10-28 Commented out nonoperational prints and Write statements
  • Bill Cavanaugh 1993-12-15 Corrected location of start of first order Values and start of second order values to Reflect a byte location in the bds instead Of an offset in subroutine fi7501().
  • Bill Cavanaugh 1994-01-27 Added igds as input argument to this routine And added pds and igds arrays to the call to W3fi82 to provide information needed for Boustrophedonic processing.
  • Bill Cavanaugh 1994-05-25 Subroutine fi7503 has been added to provide For row by row or column by column second Order packing. this feature can be activated By setting ibdsfl(7) to zero.
  • Bill Cavanaugh 1994-07-08 Commented out print statements used for debug
  • M. Farley 1994-11-22 Enlarged work arrays to handle .5degree grids
  • Ralph Jones 1995-06-01 Correction for number of unused bits at end Of section 4, in bds byte 4, bits 5-8.
  • Mark Iredell 1995-10-31 Removed saves and prints
  • Stephen Gilbert 2001-06-06 Changed gbyte/sbyte calls to refer to Wesley ebisuzaki's endian independent versions gbytec/sbytec. Use f90 standard routine bit_size to get number of bits in an integer instead of w3fi01.
Parameters
[in]IBITL
  • 0, computer computes packing length from power of 2 that best fits the data.
  • 8, 12, etc. computer rescales data to fit into set number of bits.
[in]ITYPE
  • 0 = if input data is floating point (fld)
  • 1 = If input data is integer (ifld)
[in]ITOSS
  • 0 = no bit map is included (don't toss data)
  • 1 = Toss null data according to ibmap
[in]FLDReal array of data to be packed if itype=0
[in]IFLDInteger array to be packed if itype=1
[in]IBMAPBit map supplied from user
[in]IBDSFLInteger array 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)
    • 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
  • (6)
    • 0 = single datum at each grid point
    • 1 = matrix of values at each grid point
  • (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
[in]NPTSNumber of gridpoints in array to be packed
[in]IGDSArray of gds information
[out]BDS11First 11 octets of bds
[out]PFLDPacked grib field
[out]LENLength of pfld
[out]LENBDSLength of bds
[out]IBERR1, error converting ieee f.p. number to ibm370 f.p.
IPFLD
PDS
Note
Subprogram can be called from a multiprocessing environment.

Definition at line 88 of file w3fi75.f.