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

Pack positive differences in least bits. More...

Go to the source code of this file.

Functions/Subroutines

subroutine w3fi58 (ifield, npts, nwork, npfld, nbits, len, kmin)
 Converts an array of integer numbers into an array of positive differences (number(s) - minimum value) and packs the magnitude of each difference right-adjusted into the least number of bits that holds the largest difference.
 

Detailed Description

Pack positive differences in least bits.

Author
Robert Allard
Date
1987-09-02

Definition in file w3fi58.f.

Function/Subroutine Documentation

◆ w3fi58()

subroutine w3fi58 ( integer, dimension(*)  ifield,
  npts,
integer, dimension(*)  nwork,
character*1, dimension(*)  npfld,
  nbits,
  len,
  kmin 
)

Converts an array of integer numbers into an array of positive differences (number(s) - minimum value) and packs the magnitude of each difference right-adjusted into the least number of bits that holds the largest difference.

Program history log:

  • Robert Allard 1987-09-02
  • Ralph Jones 1988-10-02 Converted to cdc cyber 205 ftn200 fortran.
  • Ralph Jones 1990-05-17 Converted to cray cft77 fortran.
  • Ralph Jones 1990-05-18 Change name vbimpk to w3lib name w3fi58()
  • Mark Iredell 1996-05-14 Generalized computation of nbits.
  • Ebisuzaki 1998-06-30 Linux port.
Parameters
[in]IFIELDArray of integer data for processing.
[in]NPTSNumber of data values to process in IFIELD (and nwork) where, npts > 0.
[out]NWORKWork array with integer difference
[out]NPFLDArray for packed data (character*1) (user is responsible for an adequate dimension.)
[out]NBITSNumber of bits used to pack data where, 0 < nbits < 32 (the maximum difference without overflow is 2**31 -1)
[out]LENNumber of packed bytes in npfld (set to 0 if no packing) where, len = (nbits * npts + 7) / 8 without remainder
[out]KMINMinimum value (subtracted from each datum). If this packed data is being used for grib data, the programer will have to convert the KMIN value to an IBM370 32 bit floating point number.
Note
LEN = 0, NBITS = 0, and no packing performed if
  • (1) KMAX = KMIN (a constant field)
  • (2) NPTS < 1 (see input argument)
Author
Robert Allard
Date
1987-09-02

Definition at line 38 of file w3fi58.f.