CALL SEQUENCE... gsmslph GSTEMP GLNSP GPHIS GPMSL [GSLNPT] INPUT OUTPUT \ [ -n VAL1 -a VAL2 -b VAL3 -kind VAL5 -def [AABB] ] DESCRIPTION... gsmslph - COMPUTES MEAN-SEA-LEVEL PRESSURE FROM HYBRID T, LNSP, PHIS AUTHOR - M. Lazare, JAN 19/89 (FROM GSMSLP BUT FOR HYBRID MODEL) LAST REVISION: $Header: Implementer-les-comdecks-toc_gest_formats-et-set_a_b_formats @ 2019-01-12 16:31:28 -0500 (dugas) $ PURPOSE - FROM A SERIES OF HYBRID LEVEL TEMPERATURES (=GSTEMP) AND LN(PS) (=GLNSP), COMPUTE A SERIES OF MEAN-SEA-LEVEL PRESSURES (=GPMSL), USING THE MOUNTAIN FIELD PHIS (=GPHIS). INPUT FILES... GSTEMP = HYBRID LEVEL GRID SETS OF TEMPERATURE ('TEMP' in DEG Kor 'TT'/'VT' in Deg C). GSLNSP = CORRESPONDING GRIDS OF LN(SF.PRES.) ('LP' or 'LNSP', with units in hPa) GPHIS = GRID OF SURFACE GEOPOTENTIAL ('PHIS','MT' (in gm) or 'ME' (in m)) (EXCLUSIVELY FOR GAL-CHEN LEVELS SUCH AS IN THE RCM MODEL) GSLNPT = SET OF LN(PRESSURE) ON THERMODYNAMIC LEVELS. OUTPUT FILE... GPMSL = MEAN-SEA-LEVEL PRESSURE GRIDS (IN MB). INPUT PARAMETERS... GAM (a) = LOW LEVEL LAPSE RATE (DEFAULT .0065). NLVLUP (n) = NUMBER OF LEVELS BETWEEN REFERENCE AND LOWEST LEVEL TEMP (DEFAULT 1). COORD (kind) = VERTICAL COORDINATE FOR THE CGCM (ETA, SIG OR GAL-CHEN) AND SEVERAL GEM VERSIONS (GEM, GEM2, GEM3 AND GEM4) PLID (b) = MODEL "LID" IN PASCALS (DEFAULT pression_au_toit ) PREF (d) = REF PRESSURE USED WHEN COORD='GEM2' OR 'GEM3' (DEF 80000 PA). R (i) = EXPONENT USED ONLY WHEN COORD='GEMi', i=234 (DEF 1.0) R2 (i2) = Second reference exponent if COORD='GEM4' (DEF 1.0) Notes: 1) LAY and PLID are not used for gal-chen levels. 2) 'GEM' is the original gem coordinate, while GEM2 is the original 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. ************* READ(5,5010) GAM,NLVLUP,COORD,PLID,PREF,R,R2 5010 FORMAT(10X,F10.0,I5,6X,A4,4E10.0) EXAMPLE OF INPUT CARD... * GSMSLP .0065 1 ETA 500. 0123456789012345678901234567890123456789012345678901234567890 1 2 3 4 5 6 7 EXIT CONDITIONS... 0 NO PROBLEMS 1 NOT ENOUGH OR TOO MANY VERTICAL LEVELS 2 UNABLE TO READ GPHIS 3 GPHIS NOT THE SAME SIZE AS GSTEMP 4 UNABLE TO READ GSTEMP 5 MORE THAN ONE SIZE FOUND IN GSTEMP 6 UNABLE TO READ GLNSP 7 GLNSP NOT THE SAME SIZE AS GSTEMP 8 HAVING PROBLEMS READING DIRECTIVES 9 UNABLE TO READ GLNPT 10 GLNPT NOT THE SAME SIZE AS GSTEMP 11 UNABLE TO ALLOCATE WORKING MEMORY 12 GSLNSP DOES NOT CONTAIN LN( SURFP ) FOR EARTH 13 PLID GREATER THAN TOP MODEL LEVEL (=ETA(TOP)*PREF) 14 MODEL VERT COORDINATE NOT MONOTONIC 16 UNSUPPORTED VERTICAL COORDINATE IN GSTEMP 17 COORD PARAMETRE AND GSTEMP DATA MISMATCH 18 UNABLE TO FIND A GEM4 '!!' RECORD 20 UNABLE TO READ AABB NAMELIST 21 MORE THAN ONE VERTICAL COORDINATE IN GSTEMP 22 WRONG NUMBER OF A,B IN AABB