CALL SEQUENCE... gpdpd HUM TEMP ES [SP] OUTPUT \ [ -kind VAL1 -c VAL2 -d VAL3 -i VAL4 [VAL5] -def [SPWH][AABB] ] DESCRIPTION... gpdpd - COMPUTES DEW POINT DEPRESSION FROM T,SHUM OR RHUM AUTHOR - J.D.Henderson, DEC 04/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 PRESSURE LEVEL GRID FILES OF TEMPERATURE AND SPECIFIC OR RELATIVE HUMIDITY TO DEW POINT DEPRESSION. 1) CALCULATIONS ARE DONE WITH THE RPN PHYSIC'S SET OF THERMODYNAMIC CONVERSION FUNCTIONS (I.E. FINTERN) RATHER THAN THE FORMULAS USED IN CCCma MODEL. 2) IF TEMP CONTAINS VIRTUAL TEMPERATURES (I.E. 'VT'), HUM MUST CONTAIN SPECIFIC HUMIDITIES. INPUT FILES... HUM = SPECIFIC OR RELATIVE HUMIDITY ARRAY. TEMP = TEMPERATURE OR VIRTUAL TEMPERATURE ARRAY. Note that the assumed units for 'VT' are either centigrades (for RPN/CMC files) or kelvins (for CCCma files). [SP = SURFACE PRESSURE (MB), ONLY USED WHEN COORD .NE. 'PRES'. NOTE THAT ITS ACCEPTED VARIABLE NAMES ARE 'P0' OR 'PS'] OUTPUT FILE... ES = DEW POINT DEPRESSION ARRAYS. (COMMAND-LINE) INPUT PARAMETERS... COORD (kind) = 'SIG'/'GEM'/'GEM2'/'GEM3'/'GEM4'/'PRES'. 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 HUMIDITY FILE 2 FOUND DATA OTHER THAN TYPE 'GRID' OR 'SUBA' 3 HUMIDITY FILE IS NOT SHUM OR RHUM 4 PREMATURE EOF ON HUMIDITY FILE 5 PREMATURE EOF ON TEMPERATURE FILE 6 HUMIDITY AND TEMPERATURE ARRAYS NOT THE SAME SIZE 7 VIRTUAL TEMPERATURE NOT SUPPORTED WITH RELATIVE HUMIDITY 8 EITHER SP IS SPECIFIED WHEN IT SHOULD NOT, OR IT IS NOT SPECIFIED WHEN IT SHOULD 9 PREMATURE EOF ON SURFACE PRESSURE FILE 10 SURFACE PRESSURE AND TEMPERATURE ARRAYS NOT THE SAME SIZE 11 UNSUPPORTED TYPE OF VERTICAL COORDINATE IN COORD ARGUMENT 12 PROBLEM READING COMMAND-LINE PARAMETRE 14 UNABLE TO ALLOCATE WORKING MEMORY 15 SP DOES NOT CONTAIN SURFACE PRESSURES FOR EARTH 16 UNSUPPORTED VERTICAL COORDINATE FOUND IN HUM 17 INPUT FILE AND "COORD" MISMATCH 18 UNABLE TO FIND A GEM4 '!!' RECORD 20 UNABLE TO READ AABB NAMELIST 21 MORE THAN ONE VERTICAL COORDINATE IN GPHUM 22 WRONG NUMBER OF A,B IN AABB 23 UNRECOGNIZED -DEF ARGUMENT VALUE