CALL SEQUENCE... zxrhum ES TEMP ZXRHUM OUTPUT [ -def ] gphum ES TEMP SHUM RHUM [SP] OUTPUT \ [ -kind VAL1 -c VAL2 -d VAL3 -i VAL4 [VAL5] -def [SPWH][AABB] ] PURPOSE... gphum - CONVERTS GRIDS OF ES,T TO SPECIFIC AND RELATIVE HUMIDITY zxrhum - CALCULATES ZONAL RELATIVE HUMIDITY FROM ES AND TEMPERATURE AUTHOR - J.D.Henderson, FEB 05/80. LAST REVISION: $Header: Implementer-les-comdecks-toc_gest_formats-et-set_a_b_formats @ 2019-01-12 16:31:28 -0500 (dugas) $ PURPOSE - CONVERTS GRID FILES OF TEMPERATURE AND DEW POINT DEPRESSION TO SPECIFIC AND RELATIVE HUMIDITY. 1) CALCULATIONS ARE DONE WITH THE RPN PHYSIC'S SET OF THERMODYNAMIC CONVERSION FUNCTIONS (I.E. FINTERN) RATHER THAN THE FORMULAS USED IN CCCmaMA MODEL. 2) ZXRHUM WILL ONLY USE THE ZONAL AVERAGE COMPONENTS OF THE INPUT ES AND TEMPERATURE. INPUT FILES... (FOR gphum) ES = DEW POINT DEPRESSION GRIDS. TEMP = TEMPERATURE GRIDS ON THE SAME LEVELS AS ES. [SP = SURFACE PRESSURE (MB), ONLY USED WHEN COORD .NE. 'PRES'. NOTE THAT ITS ACCEPTED VARIABLE NAMES ARE 'P0' OR 'PS'] (FOR zxrhum) ES = PRESSURE LEVEL ARRAYS OF DEW POINT DEPRESSION. TEMP = PRESSURE LEVEL ARRAYS OF TEMPERATURE ON THE SAME LEVELS AS ES. OUTPUT FILES... (FOR gphum) SHUM = SPECIFIC HUMIDITY GRIDS. RHUM = RELATIVE HUMIDITY GRIDS. (FOR zxrhum) ZXRHUM = PRESSURE LEVEL CROSS-SECTION OF RELATIVE HUMIDITY. (COMMAND-LINE) INPUT PARAMETERS... COORD (kind) = 'SIG'/'GEM'/'GEM2'/'GEM3'/'GEM4'/'PRES', AND THE CGCM 'ETA'/'ET10'/'ET15'/'ET16' COORDINATES. PTOIT (c) = CONSTANT PRESSURE (PA) AT THE LID OF MODEL WHEN (COORD.NE.'PRES') (DEF = pression_au_toit). The next parametres are only used when COORD='GEMx', x=2,3 or 4. PREF (d) = Ref pressure (DEF 80000 PA, except for 'GEM4', where the only acceptable value is 100000 Pa). R (i) = Reference exponent (DEF 1.0) R2 (i2) = Second reference exponent if COORD='GEM4' (DEF 1.0) Notes: 1) Water and ice phases are considered in the conversion when the command line parameter "-def" is specified without a value. However, if a 'AABB' value is defined (see item 4 for more details), a 'SPWH' character sequence must also be added to activate this option, as in "-def AABB-SPWH". Otherwise, only water phase is considered. 2) 'GEM' is the original gem eta coordinate, while 'GEM2' is the first gem hybrid coordinate as implemented by Edouard & Gravel in GEM/DM v2.2.0. 'GEM3' is the normalized version that was implemented in the v2.3.1 GEM/DM. 'GEM4' is the staggered hybrid coordinate version of GEM/DM from v4.0.6. 3) The default value of COORD is determined by the file type and the program will also try to determine it by the (internal) coding used for the coordinate itself. 4) Specifying "-def AABB" will force the attempt to read a text file called aabb.nml, containing a FORTRAN namelist AABB_NML, which in turns will hold two arrays, A and B such that the local pressure at level K, PL(K), can be calculated as "A(K)+B(K)*PS" for most coordinates. For 'GEM4', the corresponding formula to calculate the K-level natural logaritm of the local pressure is rather "A(K)+B(K)*LN(PS/PREF)". The A and B terms should be such as to produce local pressures in Pa units, even though PS is usually read in units of hPa (before being converted to Pa units internally). In all cases, this approach then by-passes the normal COORD-related calculations for PL(K). ************* Given the above, correctly using the AABB option with a GEM4 file requires specifying the "-kind GEM4" argument. ************* EXIT CONDITIONS... 0 NO PROBLEMS 1 UNABLE TO READ FIRST LABEL IN ES 2 FOUND SPECTRAL/FOURIER DATA TYPE 3 UNABLE TO READ FIRST LABEL IN TEMP 4 ARRAYS IN GPES AND GPTEMP NOT THE SAME SIZE 5 UNABLE TO READ ES 6 NOT AS MANY TEMP AS ES 7 ILLEGAL "COORD" VALUE 8 EITHER SP IS SPECIFIED WHEN IT SHOULD NOT, OR IT IS NOT SPECIFIED WHEN IT SHOULD 9 UNABLE TO READ FIRST LABEL IN SP 10 SP FILE MISSING OR EMPTY 11 SP AND ES RECORDS NOT THE SAME SIZE 12 PROBLEM READING COMMAND-LINE PARAMETRE 13 FOUND UNSUPPORTED DATA TYPE 14 UNABLE TO READ AABB NAMELIST 15 SP DOES NOT CONTAIN SURFACE PRESSURES FOR EARTH 16 UNSUPPORTED VERTICAL COORDINATE FOUND IN ES 17 INPUT FILE AND "COORD" MISMATCH 18 UNABLE TO FIND A GEM4 '!!' RECORD 19 UNABLE TO ALLOCATE WORKING MEMORY 21 MORE THAN ONE VERTICAL COORDINATE IN XIN 22 WRONG NUMBER OF A,B IN AABB 23 ZXRHUM DID NOT FIND PRESSURE LEVELS 24 UNRECOGNIZED -DEF ARGUMENT VALUE