| 1 | !SFX_LIC Copyright 1994-2014 CNRS, Meteo-France and Universite Paul Sabatier |
|---|
| 2 | !SFX_LIC This is part of the SURFEX software governed by the CeCILL-C licence |
|---|
| 3 | !SFX_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt |
|---|
| 4 | !SFX_LIC for details. version 1. |
|---|
| 5 | ! ############### |
|---|
| 6 | MODULE modd_csts |
|---|
| 7 | ! ############### |
|---|
| 8 | ! |
|---|
| 9 | !!**** *MODD_CSTS* - declaration of Physic constants |
|---|
| 10 | !! |
|---|
| 11 | !! PURPOSE |
|---|
| 12 | !! ------- |
|---|
| 13 | ! The purpose of this declarative module is to declare the |
|---|
| 14 | ! Physics constants. |
|---|
| 15 | ! |
|---|
| 16 | !! |
|---|
| 17 | !!** IMPLICIT ARGUMENTS |
|---|
| 18 | !! ------------------ |
|---|
| 19 | !! None |
|---|
| 20 | !! |
|---|
| 21 | !! REFERENCE |
|---|
| 22 | !! --------- |
|---|
| 23 | !! |
|---|
| 24 | !! AUTHOR |
|---|
| 25 | !! ------ |
|---|
| 26 | !! V. Ducrocq *Meteo France* |
|---|
| 27 | !! |
|---|
| 28 | !! MODIFICATIONS |
|---|
| 29 | !! ------------- |
|---|
| 30 | !! Original 16/05/94 |
|---|
| 31 | !! J. Stein 02/01/95 add xrholw |
|---|
| 32 | !! J.-P. Pinty 13/12/95 add XALPI,XBETAI,XGAMI |
|---|
| 33 | !! J. Stein 25/07/97 add XTH00 |
|---|
| 34 | !! V. Masson 05/10/98 add XRHOLI |
|---|
| 35 | !! C. Mari 31/10/00 add NDAYSEC |
|---|
| 36 | !! J. Escobar 06/13 add XSURF_TIMY XSURF_TIMY_12 XSURF_EPSILON for REAL*4 |
|---|
| 37 | !------------------------------------------------------------------------------- |
|---|
| 38 | ! |
|---|
| 39 | !* 0. DECLARATIONS |
|---|
| 40 | ! ------------ |
|---|
| 41 | ! |
|---|
| 42 | IMPLICIT NONE |
|---|
| 43 | REAL,SAVE :: XPI ! Pi |
|---|
| 44 | ! |
|---|
| 45 | REAL,SAVE :: XDAY,XSIYEA,XSIDAY ! day duration, sideral year duration, |
|---|
| 46 | ! sideral day duration |
|---|
| 47 | ! |
|---|
| 48 | REAL,SAVE :: XKARMAN ! von karman constant |
|---|
| 49 | REAL,SAVE :: XLIGHTSPEED ! light speed |
|---|
| 50 | REAL,SAVE :: XPLANCK ! Planck constant |
|---|
| 51 | REAL,SAVE :: XBOLTZ ! Boltzman constant |
|---|
| 52 | REAL,SAVE :: XAVOGADRO ! Avogadro number |
|---|
| 53 | ! |
|---|
| 54 | REAL,SAVE :: XRADIUS,XOMEGA ! Earth radius, earth rotation |
|---|
| 55 | REAL,SAVE :: XG ! Gravity constant |
|---|
| 56 | ! |
|---|
| 57 | REAL,SAVE :: XP00 ! Reference pressure |
|---|
| 58 | ! |
|---|
| 59 | REAL,SAVE :: XSTEFAN,XI0 ! Stefan-Boltzman constant, solar constant |
|---|
| 60 | ! |
|---|
| 61 | REAL,SAVE :: XMD,XMV ! Molar mass of dry air and molar mass of vapor |
|---|
| 62 | REAL,SAVE :: XRD,XRV ! Gaz constant for dry air, gaz constant for vapor |
|---|
| 63 | REAL,SAVE :: XCPD,XCPV ! Cpd (dry air), Cpv (vapor) |
|---|
| 64 | REAL,SAVE :: XRHOLW ! Volumic mass of liquid water |
|---|
| 65 | REAL,SAVE :: XCL,XCI ! Cl (liquid), Ci (ice) |
|---|
| 66 | REAL,SAVE :: XTT ! Triple point temperature |
|---|
| 67 | REAL,SAVE :: XTTSI ! Temperature of ice fusion over salty sea |
|---|
| 68 | REAL,SAVE :: XTTS ! Equivalent temperature of ice fusion over a mixed of sea and sea-ice |
|---|
| 69 | REAL,SAVE :: XICEC ! Threshold fraction over which the tile is considered as only covered with ice |
|---|
| 70 | REAL,SAVE :: XLVTT ! Vaporization heat constant |
|---|
| 71 | REAL,SAVE :: XLSTT ! Sublimation heat constant |
|---|
| 72 | REAL,SAVE :: XLMTT ! Melting heat constant |
|---|
| 73 | REAL,SAVE :: XESTT ! Saturation vapor pressure at triple point |
|---|
| 74 | ! temperature |
|---|
| 75 | REAL,SAVE :: XALPW,XBETAW,XGAMW ! Constants for saturation vapor |
|---|
| 76 | ! pressure function |
|---|
| 77 | REAL,SAVE :: XALPI,XBETAI,XGAMI ! Constants for saturation vapor |
|---|
| 78 | ! pressure function over solid ice |
|---|
| 79 | REAL, SAVE :: XTH00 ! reference value for the potential |
|---|
| 80 | ! temperature |
|---|
| 81 | REAL,SAVE :: XRHOLI ! Volumic mass of ice |
|---|
| 82 | REAL,SAVE :: XCONDI ! thermal conductivity of ice (W m-1 K-1) |
|---|
| 83 | ! |
|---|
| 84 | INTEGER, SAVE :: NDAYSEC ! Number of seconds in a day |
|---|
| 85 | ! |
|---|
| 86 | REAL,SAVE :: XSURF_TINY ! minimum real on this machine |
|---|
| 87 | REAL,SAVE :: XSURF_TINY_12 ! sqrt(minimum real on this machine) |
|---|
| 88 | REAL,SAVE :: XSURF_EPSILON ! minimum space with 1.0 |
|---|
| 89 | ! |
|---|
| 90 | !$OMP THREADPRIVATE(XPI,XDAY,XSIYEA,XSIDAY,XKARMAN,XLIGHTSPEED,XPLANCK,XBOLTZ,XAVOGADRO) |
|---|
| 91 | !$OMP THREADPRIVATE(XRADIUS,XOMEGA,XG,XP00,XSTEFAN,XI0,XMD,XMV,XRD,XRV) |
|---|
| 92 | !$OMP THREADPRIVATE(XCPD,XCPV,XRHOLW,XCL,XCI,XTT,XTTSI,XTTS,XICEC,XLVTT,XLSTT,XLMTT,XESTT) |
|---|
| 93 | !$OMP THREADPRIVATE(XALPW,XBETAW,XGAMW,XALPI,XBETAI,XGAMI,XTH00) |
|---|
| 94 | !$OMP THREADPRIVATE(XRHOLI,XCONDI,NDAYSEC) |
|---|
| 95 | !$OMP THREADPRIVATE(XSURF_TINY,XSURF_TINY_12,XSURF_EPSILON) |
|---|
| 96 | |
|---|
| 97 | CONTAINS |
|---|
| 98 | |
|---|
| 99 | |
|---|
| 100 | !SFX_LIC Copyright 1994-2014 CNRS, Meteo-France and Universite Paul Sabatier |
|---|
| 101 | !SFX_LIC This is part of the SURFEX software governed by the CeCILL-C licence |
|---|
| 102 | !SFX_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt |
|---|
| 103 | !SFX_LIC for details. version 1. |
|---|
| 104 | ! ######### |
|---|
| 105 | SUBROUTINE ini_csts |
|---|
| 106 | ! ################## |
|---|
| 107 | ! |
|---|
| 108 | !!**** *INI_CSTS * - routine to initialize the module MODD_CST |
|---|
| 109 | !! |
|---|
| 110 | !! PURPOSE |
|---|
| 111 | !! ------- |
|---|
| 112 | ! The purpose of this routine is to initialize the physical constants |
|---|
| 113 | ! stored in module MODD_CST. |
|---|
| 114 | ! |
|---|
| 115 | ! |
|---|
| 116 | !!** METHOD |
|---|
| 117 | !! ------ |
|---|
| 118 | !! The physical constants are set to their numerical values |
|---|
| 119 | !! |
|---|
| 120 | !! |
|---|
| 121 | !! EXTERNAL |
|---|
| 122 | !! -------- |
|---|
| 123 | !! FMLOOK : to retrieve logical unit number associated to a file |
|---|
| 124 | !! |
|---|
| 125 | !! IMPLICIT ARGUMENTS |
|---|
| 126 | !! ------------------ |
|---|
| 127 | !! Module MODD_CST : contains physical constants |
|---|
| 128 | !! |
|---|
| 129 | !! REFERENCE |
|---|
| 130 | !! --------- |
|---|
| 131 | !! Book2 of the documentation (module MODD_CST, routine INI_CSTS) |
|---|
| 132 | !! |
|---|
| 133 | !! |
|---|
| 134 | !! AUTHOR |
|---|
| 135 | !! ------ |
|---|
| 136 | !! V. Ducrocq * Meteo France * |
|---|
| 137 | !! |
|---|
| 138 | !! MODIFICATIONS |
|---|
| 139 | !! ------------- |
|---|
| 140 | !! Original 18/05/94 |
|---|
| 141 | !! J. Stein 02/01/95 add the volumic mass of liquid water |
|---|
| 142 | !! J.-P. Pinty 13/12/95 add the water vapor pressure over solid ice |
|---|
| 143 | !! J. Stein 29/06/97 add XTH00 |
|---|
| 144 | !! V. Masson 05/10/98 add XRHOLI |
|---|
| 145 | !! C. Mari 31/10/00 add NDAYSEC |
|---|
| 146 | !! V. Masson 01/03/03 add XCONDI |
|---|
| 147 | !! A. Voldoire 01/12/09 add XTTSI, XICEC, XTTS for ESM |
|---|
| 148 | !! J. Escobar 28/03/2014 for pb with emissivity/aerosol reset XSURF_TINY=1.0e-80 in real8 case |
|---|
| 149 | !! |
|---|
| 150 | !------------------------------------------------------------------------------- |
|---|
| 151 | ! |
|---|
| 152 | !* 0. DECLARATIONS |
|---|
| 153 | ! ------------ |
|---|
| 154 | ! |
|---|
| 155 | !USE MODD_CSTS |
|---|
| 156 | ! |
|---|
| 157 | ! |
|---|
| 158 | !USE YOMHOOK ,ONLY : LHOOK, DR_HOOK |
|---|
| 159 | !USE PARKIND1 ,ONLY : JPRB |
|---|
| 160 | ! |
|---|
| 161 | !USE MODI_INI_CTURBS |
|---|
| 162 | ! |
|---|
| 163 | !USE MODI_INI_OCEAN_CSTS |
|---|
| 164 | ! |
|---|
| 165 | !USE MODI_INI_SURF_CSTS |
|---|
| 166 | ! |
|---|
| 167 | IMPLICIT NONE |
|---|
| 168 | ! |
|---|
| 169 | !------------------------------------------------------------------------------- |
|---|
| 170 | ! |
|---|
| 171 | !* 1. FUNDAMENTAL CONSTANTS |
|---|
| 172 | ! --------------------- |
|---|
| 173 | ! |
|---|
| 174 | |
|---|
| 175 | !REAL(KIND=JPRB) :: ZHOOK_HANDLE |
|---|
| 176 | |
|---|
| 177 | !IF (LHOOK) CALL DR_HOOK('INI_CSTS',0,ZHOOK_HANDLE) |
|---|
| 178 | |
|---|
| 179 | !#ifdef SFX_MNH |
|---|
| 180 | !#ifdef MNH_MPI_DOUBLE_PRECISION |
|---|
| 181 | XSURF_TINY = 1.0e-80 |
|---|
| 182 | !#else |
|---|
| 183 | !XSURF_TINY = TINY (XSURF_TINY ) |
|---|
| 184 | !#endif |
|---|
| 185 | !#else |
|---|
| 186 | XSURF_TINY = 1.0e-80 |
|---|
| 187 | !#endif |
|---|
| 188 | XSURF_TINY_12 = SQRT (XSURF_TINY ) |
|---|
| 189 | XSURF_EPSILON = EPSILON (XSURF_EPSILON ) * 10.0 |
|---|
| 190 | |
|---|
| 191 | XPI = 2.*ASIN(1.) |
|---|
| 192 | XKARMAN = 0.4 |
|---|
| 193 | XBOLTZ = 1.380658E-23 |
|---|
| 194 | XLIGHTSPEED = 299792458. |
|---|
| 195 | XPLANCK = 6.6260755E-34 |
|---|
| 196 | XAVOGADRO = 6.0221367E+23 |
|---|
| 197 | ! |
|---|
| 198 | !------------------------------------------------------------------------------- |
|---|
| 199 | ! |
|---|
| 200 | !* 2. ASTRONOMICAL CONSTANTS |
|---|
| 201 | ! ---------------------- |
|---|
| 202 | ! |
|---|
| 203 | XDAY = 86400. |
|---|
| 204 | XSIYEA = 365.25*XDAY*2.*XPI/ 6.283076 |
|---|
| 205 | XSIDAY = XDAY/(1.+XDAY/XSIYEA) |
|---|
| 206 | XOMEGA = 2.*XPI/XSIDAY |
|---|
| 207 | NDAYSEC = 24*3600 ! Number of seconds in a day |
|---|
| 208 | ! |
|---|
| 209 | !-------------------------------------------------------------------------------! |
|---|
| 210 | ! |
|---|
| 211 | ! |
|---|
| 212 | !* 3. TERRESTRIAL GEOIDE CONSTANTS |
|---|
| 213 | ! ---------------------------- |
|---|
| 214 | ! |
|---|
| 215 | XRADIUS = 6371229. |
|---|
| 216 | XG = 9.80665 |
|---|
| 217 | ! |
|---|
| 218 | !------------------------------------------------------------------------------- |
|---|
| 219 | ! |
|---|
| 220 | !* 4. REFERENCE PRESSURE |
|---|
| 221 | ! ------------------- |
|---|
| 222 | ! |
|---|
| 223 | XP00 = 1.E5 |
|---|
| 224 | XTH00 = 300. |
|---|
| 225 | !------------------------------------------------------------------------------- |
|---|
| 226 | ! |
|---|
| 227 | !* 5. RADIATION CONSTANTS |
|---|
| 228 | ! ------------------- |
|---|
| 229 | ! |
|---|
| 230 | !JUAN OVERFLOW XSTEFAN = 2.* XPI**5 * XBOLTZ**4 / (15.* XLIGHTSPEED**2 * XPLANCK**3) |
|---|
| 231 | XSTEFAN = ( 2.* XPI**5 / 15. ) * ( (XBOLTZ / XPLANCK)* XBOLTZ ) * (XBOLTZ/(XLIGHTSPEED*XPLANCK))**2 |
|---|
| 232 | XI0 = 1370. |
|---|
| 233 | ! |
|---|
| 234 | !------------------------------------------------------------------------------- |
|---|
| 235 | ! |
|---|
| 236 | !* 6. THERMODYNAMIC CONSTANTS |
|---|
| 237 | ! ----------------------- |
|---|
| 238 | ! |
|---|
| 239 | XMD = 28.9644E-3 |
|---|
| 240 | XMV = 18.0153E-3 |
|---|
| 241 | XRD = XAVOGADRO * XBOLTZ / XMD |
|---|
| 242 | XRV = XAVOGADRO * XBOLTZ / XMV |
|---|
| 243 | XCPD = 7.* XRD /2. |
|---|
| 244 | XCPV = 4.* XRV |
|---|
| 245 | XRHOLW = 1000. |
|---|
| 246 | XRHOLI = 917. |
|---|
| 247 | XCONDI = 2.22 |
|---|
| 248 | XCL = 4.218E+3 |
|---|
| 249 | XCI = 2.106E+3 |
|---|
| 250 | XTT = 273.16 |
|---|
| 251 | XTTSI = XTT - 1.8 |
|---|
| 252 | XICEC = 0.5 |
|---|
| 253 | XTTS = XTT*(1-XICEC) + XTTSI*XICEC |
|---|
| 254 | XLVTT = 2.5008E+6 |
|---|
| 255 | XLSTT = 2.8345E+6 |
|---|
| 256 | XLMTT = XLSTT - XLVTT |
|---|
| 257 | XESTT = 611.14 |
|---|
| 258 | XGAMW = (XCL - XCPV) / XRV |
|---|
| 259 | XBETAW = (XLVTT/XRV) + (XGAMW * XTT) |
|---|
| 260 | XALPW = LOG(XESTT) + (XBETAW /XTT) + (XGAMW *LOG(XTT)) |
|---|
| 261 | XGAMI = (XCI - XCPV) / XRV |
|---|
| 262 | XBETAI = (XLSTT/XRV) + (XGAMI * XTT) |
|---|
| 263 | XALPI = LOG(XESTT) + (XBETAI /XTT) + (XGAMI *LOG(XTT)) |
|---|
| 264 | ! |
|---|
| 265 | !------------------------------------------------------------------------------- |
|---|
| 266 | ! |
|---|
| 267 | !* 7. TURBULENCE CONSTANTS |
|---|
| 268 | ! -------------------- |
|---|
| 269 | ! |
|---|
| 270 | ! CALL INI_CTURBS |
|---|
| 271 | !------------------------------------------------------------------------------- |
|---|
| 272 | ! |
|---|
| 273 | !* 8. OCEAN CONSTANTS |
|---|
| 274 | ! --------------- |
|---|
| 275 | ! |
|---|
| 276 | ! CALL INI_OCEAN_CSTS |
|---|
| 277 | ! |
|---|
| 278 | !* 9. SURFACE CONSTANTS |
|---|
| 279 | ! ----------------- |
|---|
| 280 | ! |
|---|
| 281 | ! CALL INI_SURF_CSTS |
|---|
| 282 | !IF (LHOOK) CALL DR_HOOK('INI_CSTS',1,ZHOOK_HANDLE) |
|---|
| 283 | ! |
|---|
| 284 | !------------------------------------------------------------------------------- |
|---|
| 285 | ! |
|---|
| 286 | |
|---|
| 287 | END SUBROUTINE ini_csts |
|---|
| 288 | |
|---|
| 289 | |
|---|
| 290 | |
|---|
| 291 | END MODULE modd_csts |
|---|
| 292 | |
|---|