RMNLIB

(CONVIP)

FSTD



SUBROUTINE CONVIP( ip, p, kind, mode, string, flag)
integer ip, kind, mode real p character *(*) string logical flag
DESCRIPTION Coding/decoding P from/to IP for IP1,IP2,IP3 needed to read/write a record on a standard RPN file.
NOTE: code can come in 2 formats: oldstyle or newstyle
Authors: N. Ek et B. Dugas - March 1996
Modified: Several times by M. Valin, M. Lepine and B. Dugas since then

ARGUMENTS

Input
MODE mode of operation
= -1, converts IP --> P
= 0, will set the encoding of IP to be in 31 bits(NEWSTYLE) when converting from P-->IP for all subsequent calls to CONVIP for MODE = +1. The default encoding of IP is normally in 15 bits (OLDSTYLE)
= +1, converts P --> IP (using default "style")
= +2, convert from P --> IP using the NEWSTYLE encoding on the current call only
= +3, convert from P --> IP using the OLDSTYLE encoding on the current call only
STRING value of format to be used for writing out P if FLAG=TRUE
FLAG .TRUE. to write P in the format given in STRING
Input/Output
IP coded value: input if MODE = -1, output if MODE > 0
P real value: input if MODE > 0, output if MODE = -1
KIND kind of "P": input if MODE > 0, output if MODE = -1.
kind > 4 values are in only available for NEWSTYLE coding.  Attempting to code any of these with MODE=+3 will result in an error.
= 0: P is in height [m] (metres) with respect to sea level. Values: -20,000 -> 100,000
= 1: P is in sigma [sg]. Values: 0.0 -> 1.0
= 2: P is in pressure [mb] (millibars). Values: 0. -> 1100.
= 3: P is in an arbitrary code. Values -4.8e8 -> 1.0e10.
= 4: P is in height [M] (metres) with respect to ground level. Values: -20,000 -> 100,000
= 5: P is in hybrid coordinates [hy]. Values: 0.0 -> 1.0
= 6: P is in theta [th]. Values: 1 -> 200,000
= 10: P is in time in hours [H]. Values: 1.0 -> 1.0e10
= 15: P is in integers [_0]. Values: 1 -> 2,000,000
= 17: P is the x indicie of the conversion matrix [[]]. Values: 1.0 -> 1.0e10
= 21: P is in metres-pressure [mp]. Values: 0 -> 1,000,000<


EXAMPLE call convip( ip1 , 1., 3, 1, etiket_S, .false. ) call convip(na(i), rna(i), kind,-1, blk_S,.false.)

See utilities: r.ip1, ip1newstyle
Return to RPN Libraries home page