Arthur Taylor
10/10/2007
Version: 1.86
This patch attempts to address the following problem:
The NCEP g2clib-1.0.2 library stored the lower limits and upper limits
of probabilities using unsigned ints, whereas version 1.0.4 used signed
ints. The reason for the change is because some thresholds were negative.
To encode a negative value using an unsigned int, 1.0.2 used "2's
complement + 1". To encode a negative value using a signed int, 1.0.4
used a "sign bit". Example -2 => FFFFFFFE (1.0.2) => 80000002 (1.0.4).
The problem (for backward compatibility sake) is to be able to read both
encodings and get -2. This is needed because if one only read the new
encoding method, then archived data would not be handled.
The algorithm which is used is: If the number is positive or missing,
leave it alone. If the number is negative, look at the 2's complement
method, and the sign bit method, and use the method which results in a
smaller absolute value.