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

Form and pack positive, scaled differences. More...

Go to the source code of this file.

Functions/Subroutines

subroutine w3fi59 (field, npts, nbits, nwork, npfld, iscale, len, rmin)
 Converts an array of single precision real numbers into an array of positive scaled differences (number(s) - minimum value), in integer format and packs the argument-specified number of significant bits from each difference.
 

Detailed Description

Form and pack positive, scaled differences.

Author
Robert Allard
Date
1984-08-01

Definition in file w3fi59.f.

Function/Subroutine Documentation

◆ w3fi59()

subroutine w3fi59 ( real, dimension(*)  field,
  npts,
  nbits,
integer, dimension(*)  nwork,
character*1, dimension(*)  npfld,
  iscale,
  len,
  rmin 
)

Converts an array of single precision real numbers into an array of positive scaled differences (number(s) - minimum value), in integer format and packs the argument-specified number of significant bits from each difference.

Program history log:

  • Robert Allard 1984-08-01 ALLARD
  • Ralph Jones 1990-05-17 Convert to cray cft77 fortran.
  • Ralph Jones 1990-05-18 Change name pakmag to w3lib name w3fi59().
  • Ralph Jones 1993-07-06 Add nint to do loop 2000 so numbers are rounded to nearest integer, not truncated.
  • Mark Iredell 1994-01-05 Computation of iscale fixed with respect to the 93-07-06 change.
  • Ebisuzaki 1998-06-30 Linux port.
Parameters
[in]FIELDArray of floating point data for processing (real)
[in]NPTSNumber of data values to process in field (and nwork) where, npts > 0
[in]NBITSNumber of significant bits of processed data to be packed where, 0 < nbits < 32+1
[out]NWORKArray for integer conversion (integer) if packing performed (see note below), the array will contain the pre-packed, right adjusted, scaled, integer differences upon return to the user. (the user may equivalence field and nwork. Same size.)
[out]NPFLDArray for packed data (character*1) (dimension must be at least (nbits * npts) / 64 + 1)
[out]ISCALEPower of 2 for restoring data, such that datum = (difference * 2**iscale) + rmin
[out]LENNumber of packed bytes in npfld (set to 0 if no packing) where, len = (nbits * npts + 7) / 8 without remainder
[out]RMINMinimum value (reference value subtracted from input data) this is a cray floating point number, it will have to be converted to an ibm370 32 bit floating point number at some point in your program if you are packing grib data.
Note
: Len = 0 and no packing performed if
  • (1) RMAX = RMIN (a constant field)
  • (2) NBITS value out of range (see input argument)
  • (3) NPTS value less than 1 (see input argument)
Author
Robert Allard
Date
1984-08-01

Definition at line 47 of file w3fi59.f.