PHYEX 0.9.5
PHYsique EXternalisée
Loading...
Searching...
No Matches
mode_ini_cst.F90
Go to the documentation of this file.
1!MNH_LIC Copyright 1994-2024 CNRS, Meteo-France and Universite Paul Sabatier
2!MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence
3!MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt
4!MNH_LIC for details. version 1.
5! ##################
7IMPLICIT NONE
8CONTAINS
9 SUBROUTINE ini_cst
10! ##################
11!
12!!**** *INI_CST * - routine to initialize the module MODD_CST
13!!
14!! PURPOSE
15!! -------
16! The purpose of this routine is to initialize the physical constants
17! stored in module MODD_CST.
18!
19!
20!!** METHOD
21!! ------
22!! The physical constants are set to their numerical values
23!!
24!!
25!! EXTERNAL
26!! --------
27!!
28!! IMPLICIT ARGUMENTS
29!! ------------------
30!! Module MODD_CST : contains physical constants
31!!
32!! REFERENCE
33!! ---------
34!! Book2 of the documentation (module MODD_CST, routine INI_CST)
35!!
36!!
37!! AUTHOR
38!! ------
39!! V. Ducrocq * Meteo France *
40!!
41!! MODIFICATIONS
42!! -------------
43!! Original 18/05/94
44!! J. Stein 02/01/95 add the volumic mass of liquid water
45!! J.-P. Pinty 13/12/95 add the water vapor pressure over solid ice
46!! J. Stein 29/06/97 add XTH00
47!! V. Masson 05/10/98 add XRHOLI
48!! C. Mari 31/10/00 add NDAYSEC
49!! V. Masson 01/03/03 add XCONDI
50!! J. Escobar 28/03/2014 for pb with emissivity/aerosol reset XMNH_TINY=1.0e-80 in real8 case
51!! R. El Khatib 04/08/14 add pre-computed quantities
52!! P. Marguinaud 04/10/16 Port to single precision
53!! J.Escobar : 10/2017 : for real*4 , add XMNH_HUGE_12_LOG
54!! Philippe Wautelet: 05/2016-04/2018: new data structures and calls for I/O
55!! J.Escobar : 5/10/2018 : for real*4 ,higher value for XEPS_DT = 1.5e-4
56!!
57!-------------------------------------------------------------------------------
58!
59!* 0. DECLARATIONS
60! ------------
61!
70USE mode_msg, ONLY: print_msg
71USE yomhook , ONLY : lhook, dr_hook, jphook
72USE modd_io, ONLY:nverb_fatal
73!
74IMPLICIT NONE
75!
76REAL(KIND=jphook) :: zhook_handle
77!-------------------------------------------------------------------------------
78IF (lhook) CALL dr_hook('INI_CST',0,zhook_handle)
79CALL cst_associate()
80!
81!* 1. FUNDAMENTAL CONSTANTS
82! ---------------------
83!
84xpi = 2.*asin(1.)
85xkarman = 0.4
86xlightspeed = 299792458.
87xplanck = 6.6260755e-34
88xboltz = 1.380658e-23
89xavogadro = 6.0221367e+23
90!
91!-------------------------------------------------------------------------------
92!
93!* 2. ASTRONOMICAL CONSTANTS
94! ----------------------
95!
96xday = 86400.
97xsiyea = 365.25*xday*2.*xpi/ 6.283076
99xomega = 2.*xpi/xsiday
100ndaysec = 24*3600 ! Number of seconds in a day
101!
102!-------------------------------------------------------------------------------!
103!
104!
105!* 3. TERRESTRIAL GEOIDE CONSTANTS
106! ----------------------------
107!
108xradius = 6371229.
109xg = 9.80665
110!
111!-------------------------------------------------------------------------------
112!
113!* 4. REFERENCE PRESSURE
114! -------------------
115!
116! Ocean model cst same as in 1D/CMO SURFEX
117! values used in ini_cst to overwrite XP00 and XTH00
118xrh00ocean =1024.
119xth00ocean = 286.65
120xsa00ocean= 32.6
121xp00ocean = 201.e5
122!Atmospheric model
123xp00 = 1.e5
124xth00 = 300.
125!-------------------------------------------------------------------------------
126!
127!* 5. RADIATION CONSTANTS
128! -------------------
129!
130! Original: XSTEFAN = 2.* XPI**5 * XBOLTZ**4 / (15.* XLIGHTSPEED**2 * XPLANCK**3)
131! Juan: XSTEFAN = ( 2.* XPI**5 / 15. ) * ( (XBOLTZ / XPLANCK) * XBOLTZ ) * (XBOLTZ/(XLIGHTSPEED*XPLANCK))**2
132! Philippe Marguinaud: XSTEFAN=REAL(2._8*REAL(XPI, 8)**5*REAL(XBOLTZ, 8)**4/(15._8* REAL(XLIGHTSPEED, 8)**2 * REAL(XPLANCK, 8)**3))
133xstefan = real(2._mnhreal64* real(xpi, mnhreal64)**5 * real(xboltz, mnhreal64)**4 / &
134 & (15._mnhreal64* real(xlightspeed, mnhreal64)**2 * real(xplanck, mnhreal64)**3))
135xi0 = 1370.
136!
137!-------------------------------------------------------------------------------
138!
139!* 6. THERMODYNAMIC CONSTANTS
140! -----------------------
141!
142xmd = 28.9644e-3
143xmv = 18.0153e-3
147xcpd = 7.* xrd /2.
148xcpv = 4.* xrv
149xrholw = 1000.
150xrholi = 900.
151xcondi = 2.22
152xcl = 4.218e+3
153xci = 2.106e+3
154xtt = 273.16
155xlvtt = 2.5008e+6
156xlstt = 2.8345e+6
157xlmtt = xlstt - xlvtt
158xestt = 611.14
159xgamw = (xcl - xcpv) / xrv
160xbetaw = (xlvtt/xrv) + (xgamw * xtt)
161xalpw = log(xestt) + (xbetaw /xtt) + (xgamw *log(xtt))
162xgami = (xci - xcpv) / xrv
163xbetai = (xlstt/xrv) + (xgami * xtt)
164xalpi = log(xestt) + (xbetai /xtt) + (xgami *log(xtt))
165! Values identical to ones used in CMO1D in SURFEX /could be modified
166! Coefficient of thermal expansion of water (K-1)
167xalphaoc = 1.9e-4
168! Coeff of Haline contraction coeff (S-1)
169xbetaoc= 7.7475e-4
170!
171!* 7. PRECOMPUTED CONSTANTS
172! ---------------------
173!
174rdsrv = xrd/xrv
176rinvxp00 = 1./xp00
177!
178!* 8. MACHINE PRECISION VALUE DEPENDING of REAL4/8 USE
179! ---------------------
180!
181xmnh_epsilon = epsilon(xmnh_epsilon )
182xmnh_huge = huge(xmnh_huge )
183xmnh_huge_12_log = log( sqrt(xmnh_huge) )
184
185IF (mnhreal == mnhreal64) THEN
186xmnh_tiny = 1.0e-80_mnhreal
187xeps_dt = 1.0e-5_mnhreal
188xres_flat_cart = 1.0e-12_mnhreal
189xres_other = 1.0e-9_mnhreal
190xres_prep = 1.0e-8_mnhreal
191ELSEIF (mnhreal == mnhreal32) THEN
192xmnh_tiny = tiny(xmnh_tiny )
193xeps_dt = 1.5e-4_mnhreal
194xres_flat_cart = 1.0e-12_mnhreal
195xres_other = 1.0e-7_mnhreal
196xres_prep = 1.0e-4_mnhreal
197ELSE
198CALL print_msg(nverb_fatal, 'GEN', 'INI_CST', 'Invalid MNH_REAL')
199ENDIF
200xmnh_tiny_12 = sqrt(xmnh_tiny )
201!
202!-------------------------------------------------------------------------------
203!
204IF (lhook) CALL dr_hook('INI_CST',1,zhook_handle)
205END SUBROUTINE ini_cst
206
207END MODULE mode_ini_cst
real, pointer xmnh_tiny
Definition modd_cst.F90:179
real, pointer xday
Definition modd_cst.F90:140
real, pointer xi0
Definition modd_cst.F90:151
real, pointer xeps_dt
Definition modd_cst.F90:184
real, pointer xmnh_huge_12_log
Definition modd_cst.F90:183
real, pointer xth00ocean
Definition modd_cst.F90:169
real, pointer xg
Definition modd_cst.F90:147
real, pointer xgamw
Definition modd_cst.F90:163
real, pointer xci
Definition modd_cst.F90:157
real, pointer xrh00ocean
Definition modd_cst.F90:150
real, pointer rdscpd
Definition modd_cst.F90:177
real, pointer rinvxp00
Definition modd_cst.F90:178
real, pointer xsiyea
Definition modd_cst.F90:140
real, pointer xalphaoc
Definition modd_cst.F90:166
real, pointer xres_other
Definition modd_cst.F90:186
real, pointer xlightspeed
Definition modd_cst.F90:142
real, pointer xres_flat_cart
Definition modd_cst.F90:185
real, pointer xalpi
Definition modd_cst.F90:164
real, pointer xrv
Definition modd_cst.F90:153
real, pointer xbetaw
Definition modd_cst.F90:163
real, pointer xlstt
Definition modd_cst.F90:160
real, pointer xtt
Definition modd_cst.F90:158
real, pointer xcpd
Definition modd_cst.F90:155
real, pointer xalpw
Definition modd_cst.F90:163
real, pointer xcpv
Definition modd_cst.F90:155
real, pointer xbetai
Definition modd_cst.F90:164
real, pointer xcondi
Definition modd_cst.F90:165
real, pointer xlmtt
Definition modd_cst.F90:161
real, pointer xth00
Definition modd_cst.F90:168
real, pointer xplanck
Definition modd_cst.F90:143
real, pointer xres_prep
Definition modd_cst.F90:187
integer, pointer ndaysec
Definition modd_cst.F90:175
real, pointer xp00
Definition modd_cst.F90:148
real, pointer xmv
Definition modd_cst.F90:152
real, pointer xgami
Definition modd_cst.F90:164
real, pointer xrd
Definition modd_cst.F90:153
real, pointer xomega
Definition modd_cst.F90:146
real, pointer xmnh_huge
Definition modd_cst.F90:182
real, pointer xsa00ocean
Definition modd_cst.F90:170
real, pointer xpi
Definition modd_cst.F90:139
real, pointer xavogadro
Definition modd_cst.F90:145
real, pointer xkarman
Definition modd_cst.F90:141
real, pointer xradius
Definition modd_cst.F90:146
real, pointer xepsilo
Definition modd_cst.F90:154
real, pointer xboltz
Definition modd_cst.F90:144
real, pointer xstefan
Definition modd_cst.F90:151
real, pointer rdsrv
Definition modd_cst.F90:176
real, pointer xbetaoc
Definition modd_cst.F90:167
real, pointer xestt
Definition modd_cst.F90:162
subroutine cst_associate()
Definition modd_cst.F90:192
real, pointer xrholw
Definition modd_cst.F90:156
real, pointer xlvtt
Definition modd_cst.F90:159
real, pointer xp00ocean
Definition modd_cst.F90:149
real, pointer xmnh_epsilon
Definition modd_cst.F90:181
real, pointer xrholi
Definition modd_cst.F90:174
real, pointer xmnh_tiny_12
Definition modd_cst.F90:180
real, pointer xsiday
Definition modd_cst.F90:140
real, pointer xmd
Definition modd_cst.F90:152
real, pointer xcl
Definition modd_cst.F90:157
integer, parameter nverb_fatal
Definition modd_io.F90:6
integer, parameter mnhreal
integer, parameter mnhreal64
integer, parameter mnhreal32
subroutine ini_cst