PHYEX 0.9.5
PHYsique EXternalisée
Loading...
Searching...
No Matches
modd_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!-----------------------------------------------------------------
6! ###############
7 MODULE modd_cst
8
9!$ACDC methods
10
11! ###############
12!
13!!**** *MODD_CST* - declaration of Physic constants
14!!
15!! PURPOSE
16!! -------
17! The purpose of this declarative module is to declare the
18! Physics constants.
19!
20!!
21!!** IMPLICIT ARGUMENTS
22!! ------------------
23!! None
24!!
25!! REFERENCE
26!! ---------
27!! Book2 of documentation of Meso-NH (MODD_CST)
28!!
29!! AUTHOR
30!! ------
31!! V. Ducrocq *Meteo France*
32!!
33!! MODIFICATIONS
34!! -------------
35!! Original 16/05/94
36!! J. Stein 02/01/95 add xrholw
37!! J.-P. Pinty 13/12/95 add XALPI,XBETAI,XGAMI
38!! J. Stein 25/07/97 add XTH00
39!! V. Masson 05/10/98 add XRHOLI
40!! C. Mari 31/10/00 add NDAYSEC
41!! V. Masson 01/03/03 add conductivity of ice
42!! R. El Khatib 04/08/14 add pre-computed quantities
43!! J.Escobar : 10/2017 : for real*4 , add XMNH_HUGE_12_LOG
44! J.L. Redelsperger 03/2021: add constants for ocean penetrating solar
45! S. Riette 01/2022: introduction of a structure
46! P. Wautelet 20/05/2022: add RASTA cloud radar wavelength
47!-------------------------------------------------------------------------------
48!
49!* 0. DECLARATIONS
50! ------------
51!
52IMPLICIT NONE
53
54REAL, PARAMETER :: xlam_crad = 3.154e-3 ! RASTA cloud radar wavelength (m) <=> 95.04 GHz
55
57 !
58 !* 1. FUNDAMENTAL CONSTANTS
59 ! ---------------------
60 REAL :: xpi !< Pi
61 REAL :: xkarman !< von karman constant
62 REAL :: xlightspeed !< light speed
63 REAL :: xplanck !< Planck constant
64 REAL :: xboltz !< Boltzman constant
65 REAL :: xavogadro !< Avogadro number
66 !
67 !* 2. ASTRONOMICAL CONSTANTS
68 ! ----------------------
69 REAL :: xday,xsiyea,xsiday !< day duration, sideral year duration, sideral day duration
70 INTEGER :: ndaysec !< Number of seconds in a day
71 REAL :: xomega !< Earth rotation
72 !
73 !* 3. TERRESTRIAL GEOIDE CONSTANTS
74 ! ----------------------------
75 REAL :: xradius !< Earth radius
76 REAL :: xg !< Gravity constant
77 !
78 !* 4. REFERENCE PRESSURE
79 ! -------------------
80 REAL :: xp00 !< Reference pressure
81 REAL :: xp00ocean !< Reference pressure for ocean model
82 REAL :: xrh00ocean !< Reference density for ocean model
83 REAL :: xth00 !< reference value for the potential temperature
84 REAL :: xth00ocean !< Ref value for pot temp in ocean model
85 REAL :: xsa00ocean !< Ref value for SAlinity in ocean model
86 !
87 !* 5. RADIATION CONSTANTS
88 ! -------------------
89 REAL :: xstefan,xi0 !< Stefan-Boltzman constant, solar constant
90 !
91 !* 6. THERMODYNAMIC CONSTANTS
92 ! -----------------------
93 REAL :: xmd,xmv !< Molar mass of dry air and molar mass of vapor
94 REAL :: xrd,xrv !< Gaz constant for dry air, gaz constant for vapor
95 REAL :: xepsilo !< XMV/XMD
96 REAL :: xcpd,xcpv !< Cpd (dry air), Cpv (vapor)
97 REAL :: xrholw !< Volumic mass of liquid water
98 REAL :: xcl,xci !< Cl (liquid), Ci (ice)
99 REAL :: xtt !< Triple point temperature
100 REAL :: xlvtt !< Vaporization heat constant
101 REAL :: xlstt !< Sublimation heat constant
102 REAL :: xlmtt !< Melting heat constant
103 REAL :: xestt !< Saturation vapor pressure at triple point temperature
104 REAL :: xalpw,xbetaw,xgamw !< Constants for saturation vapor pressure function
105 REAL :: xalpi,xbetai,xgami !< Constants for saturation vapor pressure function over solid ice
106 REAL :: xcondi !< thermal conductivity of ice (W m-1 K-1)
107 REAL :: xalphaoc !< thermal expansion coefficient for ocean (K-1)
108 REAL :: xbetaoc !< Haline contraction coeff for ocean (S-1)
109 REAL :: xroc=0.69 !< coeff for SW penetration in Ocean (Hoecker et al)
110 REAL :: xd1=1.1 !< coeff for SW penetration in Ocean (Hoecker et al)
111 REAL :: xd2=23. !< coeff for SW penetration in Ocean (Hoecker et al)
112 ! Values used in SURFEX CMO
113 !REAL :: XROC=0.58
114 !REAL :: XD1=0.35
115 !REAL :: XD2=23.
116 REAL :: xrholi !< Volumic mass of ice
117 !
118 !* 7. PRECOMPUTED CONSTANTS
119 ! ---------------------
120 REAL :: rdsrv !< XRD/XRV
121 REAL :: rdscpd !< XRD/XCPD
122 REAL :: rinvxp00 !< 1./XP00
123 !
124 !* 8. MACHINE PRECISION VALUE DEPENDING of REAL4/8 USE
125 ! ---------------------
126 REAL :: xmnh_tiny !< minimum real on this machine
127 REAL :: xmnh_tiny_12 !< sqrt(minimum real on this machine)
128 REAL :: xmnh_epsilon !< minimum space with 1.0
129 REAL :: xmnh_huge !< maximum real on this machine
130 REAL :: xmnh_huge_12_log !< maximum log(sqrt(real)) on this machine
131 REAL :: xeps_dt !< default value for DT test
132 REAL :: xres_flat_cart !< default flat&cart residual tolerance
133 REAL :: xres_other !< default not flat&cart residual tolerance
134 REAL :: xres_prep !< default prep residual tolerance
135END TYPE cst_t
136
137TYPE(cst_t), TARGET, SAVE :: cst
138
139REAL, POINTER :: xpi=>null()
140REAL, POINTER :: xday=>null(), xsiyea=>null(), xsiday=>null()
141REAL, POINTER :: xkarman=>null()
142REAL, POINTER :: xlightspeed=>null()
143REAL, POINTER :: xplanck=>null()
144REAL, POINTER :: xboltz=>null()
145REAL, POINTER :: xavogadro=>null()
146REAL, POINTER :: xradius=>null(), xomega=>null()
147REAL, POINTER :: xg=>null()
148REAL, POINTER :: xp00=>null()
149REAL, POINTER :: xp00ocean=>null()
150REAL, POINTER :: xrh00ocean=>null()
151REAL, POINTER :: xstefan=>null(), xi0=>null()
152REAL, POINTER :: xmd=>null(), xmv=>null()
153REAL, POINTER :: xrd=>null(), xrv=>null()
154REAL, POINTER :: xepsilo=>null()
155REAL, POINTER :: xcpd=>null(), xcpv=>null()
156REAL, POINTER :: xrholw=>null()
157REAL, POINTER :: xcl=>null(), xci=>null()
158REAL, POINTER :: xtt=>null()
159REAL, POINTER :: xlvtt=>null()
160REAL, POINTER :: xlstt=>null()
161REAL, POINTER :: xlmtt=>null()
162REAL, POINTER :: xestt=>null()
163REAL, POINTER :: xalpw=>null(), xbetaw=>null(), xgamw=>null()
164REAL, POINTER :: xalpi=>null(), xbetai=>null(), xgami=>null()
165REAL, POINTER :: xcondi=>null()
166REAL, POINTER :: xalphaoc=>null()
167REAL, POINTER :: xbetaoc=>null()
168REAL, POINTER :: xth00=>null()
169REAL, POINTER :: xth00ocean=>null()
170REAL, POINTER :: xsa00ocean=>null()
171REAL, POINTER :: xroc=>null()
172REAL, POINTER :: xd1=>null()
173REAL, POINTER :: xd2=>null()
174REAL, POINTER :: xrholi=>null()
175INTEGER, POINTER :: ndaysec=>null()
176REAL, POINTER :: rdsrv=>null()
177REAL, POINTER :: rdscpd=>null()
178REAL, POINTER :: rinvxp00=>null()
179REAL, POINTER :: xmnh_tiny=>null()
180REAL, POINTER :: xmnh_tiny_12=>null()
181REAL, POINTER :: xmnh_epsilon=>null()
182REAL, POINTER :: xmnh_huge=>null()
183REAL, POINTER :: xmnh_huge_12_log=>null()
184REAL, POINTER :: xeps_dt=>null()
185REAL, POINTER :: xres_flat_cart=>null()
186REAL, POINTER :: xres_other=>null()
187REAL, POINTER :: xres_prep=>null()
188!
189CONTAINS
190
191SUBROUTINE cst_associate()
192 IMPLICIT NONE
193 xpi=>cst%XPI
194 xday=>cst%XDAY
195 xsiyea=>cst%XSIYEA
196 xsiday=>cst%XSIDAY
197 xkarman=>cst%XKARMAN
198 xlightspeed=>cst%XLIGHTSPEED
199 xplanck=>cst%XPLANCK
200 xboltz=>cst%XBOLTZ
201 xavogadro=>cst%XAVOGADRO
202 xradius=>cst%XRADIUS
203 xomega=>cst%XOMEGA
204 xg=>cst%XG
205 xp00=>cst%XP00
206 xp00ocean=>cst%XP00OCEAN
207 xrh00ocean=>cst%XRH00OCEAN
208 xstefan=>cst%XSTEFAN
209 xi0=>cst%XI0
210 xmd=>cst%XMD
211 xmv=>cst%XMV
212 xrd=>cst%XRD
213 xrv=>cst%XRV
214 xepsilo=>cst%XEPSILO
215 xcpd=>cst%XCPD
216 xcpv=>cst%XCPV
217 xrholw=>cst%XRHOLW
218 xcl=>cst%XCL
219 xci=>cst%XCI
220 xtt=>cst%XTT
221 xlvtt=>cst%XLVTT
222 xlstt=>cst%XLSTT
223 xlmtt=>cst%XLMTT
224 xestt=>cst%XESTT
225 xalpw=>cst%XALPW
226 xbetaw=>cst%XBETAW
227 xgamw=>cst%XGAMW
228 xalpi=>cst%XALPI
229 xbetai=>cst%XBETAI
230 xgami=>cst%XGAMI
231 xcondi=>cst%XCONDI
232 xalphaoc=>cst%XALPHAOC
233 xbetaoc=>cst%XBETAOC
234 xth00=>cst%XTH00
235 xth00ocean=>cst%XTH00OCEAN
236 xsa00ocean=>cst%XSA00OCEAN
237 xroc=>cst%XROC
238 xd1=>cst%XD1
239 xd2=>cst%XD2
240 xrholi=>cst%XRHOLI
241 ndaysec=>cst%NDAYSEC
242 rdsrv=>cst%RDSRV
243 rdscpd=>cst%RDSCPD
244 rinvxp00=>cst%RINVXP00
245 xmnh_tiny=>cst%XMNH_TINY
246 xmnh_tiny_12=>cst%XMNH_TINY_12
247 xmnh_epsilon=>cst%XMNH_EPSILON
248 xmnh_huge=>cst%XMNH_HUGE
249 xmnh_huge_12_log=>cst%XMNH_HUGE_12_LOG
250 xeps_dt=>cst%XEPS_DT
251 xres_flat_cart=>cst%XRES_FLAT_CART
252 xres_other=>cst%XRES_OTHER
253 xres_prep=>cst%XRES_PREP
254END SUBROUTINE cst_associate
255!
256SUBROUTINE print_cst(KULOUT)
257INTEGER, INTENT(IN) :: KULOUT
258
259WRITE(unit=kulout,fmt='('' MODD_CST: FUNDAMENTAL CONSTANTS '')')
260WRITE(unit=kulout,fmt='('' XPI = '',E10.4,'' XKARMAN = '',E10.4,'' XLIGHTSPEED = '',E10.4,/, &
261 &'' XPLANCK = '',E10.4,'' XBOLTZ = '',E10.4,'' XAVOGADRO = '',E10.4)')&
264
265WRITE(unit=kulout,fmt='('' MODD_CST: ASTRONOMICAL CONSTANTS '')')
266WRITE(unit=kulout,fmt='('' XDAY = '',E10.4,'' XSIYEA = '',E10.4,'' XSIDAY = '',E10.4,/,&
267 &'' XOMEGA = '',E10.4,'' NDAYSEC = '', I6)')&
270
271WRITE(unit=kulout,fmt='('' MODD_CST: TERRESTRIAL GEOIDE CONSTANTS '')')
272WRITE(unit=kulout,fmt='('' XRADIUS = '',E10.4,'' XG = '',E10.4)')&
273 &xradius,xg
274
275WRITE(unit=kulout,fmt='('' MODD_CST: REFERENCE '')')
276WRITE(unit=kulout,fmt='('' XRH00OCEAN = '',E10.4,'' XTH00OCEAN = '',E10.4,'' XSA00OCEAN = '',E10.4,/,&
277 &'' XP00OCEAN = '',E10.4,'' XP00 = '',E10.4,'' XTH00 = '',E10.4)')&
280
281WRITE(unit=kulout,fmt='('' MODD_CST: RADIATION CONSTANTS '')')
282WRITE(unit=kulout,fmt='('' XSTEFAN = '',E10.4,'' XIO = '',E10.4)')&
283 &xstefan,xi0
284
285WRITE(unit=kulout,fmt='('' MODD_CST: THERMODYNAMIC CONSTANTS '')')
286WRITE(unit=kulout,fmt='('' XMD = '',E10.4,'' XMV = '',E10.4,'' XRD = '',E10.4,/,&
287 &'' XRV = '',E10.4,'' XEPSILO = '',E10.4,'' XCPD = '',E10.4,/,&
288 &'' XCPV = '',E10.4,'' XRHOLW = '',E10.4,'' XRHOLI = '',E10.4,/,&
289 &'' XCONDI = '',E10.4,'' XCL = '',E10.4,'' XCI = '',E10.4,/,&
290 &'' XTT = '',E10.4,'' XLVTT = '',E10.4,'' XLSTT = '',E10.4,/,&
291 &'' XLMTT = '',E10.4,'' XESTT = '',E10.4,'' XGAMW = '',E10.4,/,&
292 &'' XBETAW = '',E10.4,'' XALPW = '',E10.4,'' XGAMI = '',E10.4,/,&
293 &'' XBETAI = '',E10.4,'' XALPI = '',E10.4,'' XALPHAOC = '',E10.4,/,&
294 &'' XBETAOC = '',E10.4)')&
295 &xmd,xmv,xrd,&
296 &xrv,xepsilo,xcpd,&
298 &xcondi,xcl,xci,&
299 &xtt,xlvtt,xlstt,&
300 &xlmtt,xestt,xgamw,&
303 &xbetaoc
304
305WRITE(unit=kulout,fmt='('' MODD_CST: PRECOMPUTED CONSTANTS '')')
306WRITE(unit=kulout,fmt='('' RDSRV = '',E10.4,'' RDSCPD = '',E10.4,'' RINVXP00 = '',E10.4)')&
308
309WRITE(unit=kulout,fmt='('' MODD_CST: MACHINE PRECISION VALUE DEPENDING of REAL4/8 USE '')')
310WRITE(unit=kulout,fmt='('' XMNH_EPSILON = '',E10.4,'' XMNH_HUGE = '',E10.4,'' XMNH_HUGE_12_LOG = '',E10.4,/,&
311 &'' XMNH_TINY = '',E10.4,'' XEPS_DT '',E10.4,'' XRES_FLAT_CART = '',E10.4,/,&
312 &'' XRES_OTHER = '',E10.4,'' XRES_PREP = '',E10.4,'' XMNH_TINY_12 = '',E10.4)')&
316!
317END SUBROUTINE print_cst
318!
319END MODULE modd_cst
320
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
subroutine print_cst(kulout)
Definition modd_cst.F90:257
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 xroc
Definition modd_cst.F90:171
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, parameter xlam_crad
Definition modd_cst.F90:54
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
type(cst_t), target, save cst
Definition modd_cst.F90:137
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 xd2
Definition modd_cst.F90:173
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 xd1
Definition modd_cst.F90:172
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