SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
ini_csts.F90
Go to the documentation of this file.
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  SUBROUTINE ini_csts
7 ! ##################
8 !
9 !!**** *INI_CSTS * - routine to initialize the module MODD_CST
10 !!
11 !! PURPOSE
12 !! -------
13 ! The purpose of this routine is to initialize the physical constants
14 ! stored in module MODD_CST.
15 !
16 !
17 !!** METHOD
18 !! ------
19 !! The physical constants are set to their numerical values
20 !!
21 !!
22 !! EXTERNAL
23 !! --------
24 !! FMLOOK : to retrieve logical unit number associated to a file
25 !!
26 !! IMPLICIT ARGUMENTS
27 !! ------------------
28 !! Module MODD_CST : contains physical constants
29 !!
30 !! REFERENCE
31 !! ---------
32 !! Book2 of the documentation (module MODD_CST, routine INI_CSTS)
33 !!
34 !!
35 !! AUTHOR
36 !! ------
37 !! V. Ducrocq * Meteo France *
38 !!
39 !! MODIFICATIONS
40 !! -------------
41 !! Original 18/05/94
42 !! J. Stein 02/01/95 add the volumic mass of liquid water
43 !! J.-P. Pinty 13/12/95 add the water vapor pressure over solid ice
44 !! J. Stein 29/06/97 add XTH00
45 !! V. Masson 05/10/98 add XRHOLI
46 !! C. Mari 31/10/00 add NDAYSEC
47 !! V. Masson 01/03/03 add XCONDI
48 !! A. Voldoire 01/12/09 add XTTSI, XICEC, XTTS for ESM
49 !! J. Escobar 28/03/2014 for pb with emissivity/aerosol reset XSURF_TINY=1.0e-80 in real8 case
50 !!
51 !-------------------------------------------------------------------------------
52 !
53 !* 0. DECLARATIONS
54 ! ------------
55 !
56 USE modd_csts
57 !
58 !
59 USE yomhook ,ONLY : lhook, dr_hook
60 USE parkind1 ,ONLY : jprb
61 !
62 USE modi_ini_cturbs
63 !
64 USE modi_ini_ocean_csts
65 !
66 USE modi_ini_surf_csts
67 !
68 IMPLICIT NONE
69 !
70 !-------------------------------------------------------------------------------
71 !
72 !* 1. FUNDAMENTAL CONSTANTS
73 ! ---------------------
74 !
75 
76 REAL(KIND=JPRB) :: zhook_handle
77 
78 IF (lhook) CALL dr_hook('INI_CSTS',0,zhook_handle)
79 
80 #ifdef SFX_MNH
81 #ifdef MNH_MPI_DOUBLE_PRECISION
82 xsurf_tiny = 1.0e-80
83 #else
84 xsurf_tiny = tiny(xsurf_tiny )
85 #endif
86 #else
87 xsurf_tiny = 1.0e-80
88 #endif
89 xsurf_tiny_12 = sqrt(xsurf_tiny )
90 xsurf_epsilon = epsilon(xsurf_epsilon ) * 10.0
91 
92 xpi = 2.*asin(1.)
93 xkarman = 0.4
94 xboltz = 1.380658e-23
95 xlightspeed = 299792458.
96 xplanck = 6.6260755e-34
97 xavogadro = 6.0221367e+23
98 !
99 !-------------------------------------------------------------------------------
100 !
101 !* 2. ASTRONOMICAL CONSTANTS
102 ! ----------------------
103 !
104 xday = 86400.
105 xsiyea = 365.25*xday*2.*xpi/ 6.283076
106 xsiday = xday/(1.+xday/xsiyea)
107 xomega = 2.*xpi/xsiday
108 ndaysec = 24*3600 ! Number of seconds in a day
109 !
110 !-------------------------------------------------------------------------------!
111 !
112 !
113 !* 3. TERRESTRIAL GEOIDE CONSTANTS
114 ! ----------------------------
115 !
116 xradius = 6371229.
117 xg = 9.80665
118 !
119 !-------------------------------------------------------------------------------
120 !
121 !* 4. REFERENCE PRESSURE
122 ! -------------------
123 !
124 xp00 = 1.e5
125 xth00 = 300.
126 !-------------------------------------------------------------------------------
127 !
128 !* 5. RADIATION CONSTANTS
129 ! -------------------
130 !
131 !JUAN OVERFLOW XSTEFAN = 2.* XPI**5 * XBOLTZ**4 / (15.* XLIGHTSPEED**2 * XPLANCK**3)
132 xstefan = ( 2.* xpi**5 / 15. ) * ( (xboltz / xplanck)* xboltz ) * (xboltz/(xlightspeed*xplanck))**2
133 xi0 = 1370.
134 !
135 !-------------------------------------------------------------------------------
136 !
137 !* 6. THERMODYNAMIC CONSTANTS
138 ! -----------------------
139 !
140 xmd = 28.9644e-3
141 xmv = 18.0153e-3
142 xrd = xavogadro * xboltz / xmd
143 xrv = xavogadro * xboltz / xmv
144 xcpd = 7.* xrd /2.
145 xcpv = 4.* xrv
146 xrholw = 1000.
147 xrholi = 917.
148 xcondi = 2.22
149 xcl = 4.218e+3
150 xci = 2.106e+3
151 xtt = 273.16
152 xttsi = xtt - 1.8
153 xicec = 0.5
154 xtts = xtt*(1-xicec) + xttsi*xicec
155 xlvtt = 2.5008e+6
156 xlstt = 2.8345e+6
157 xlmtt = xlstt - xlvtt
158 xestt = 611.14
159 xgamw = (xcl - xcpv) / xrv
160 xbetaw = (xlvtt/xrv) + (xgamw * xtt)
161 xalpw = log(xestt) + (xbetaw /xtt) + (xgamw *log(xtt))
162 xgami = (xci - xcpv) / xrv
163 xbetai = (xlstt/xrv) + (xgami * xtt)
164 xalpi = log(xestt) + (xbetai /xtt) + (xgami *log(xtt))
165 !
166 !-------------------------------------------------------------------------------
167 !
168 !* 7. TURBULENCE CONSTANTS
169 ! --------------------
170 !
171  CALL ini_cturbs
172 !-------------------------------------------------------------------------------
173 !
174 !* 8. OCEAN CONSTANTS
175 ! ---------------
176 !
177  CALL ini_ocean_csts
178 !
179 !* 9. SURFACE CONSTANTS
180 ! -----------------
181 !
182  CALL ini_surf_csts
183 IF (lhook) CALL dr_hook('INI_CSTS',1,zhook_handle)
184 !
185 !-------------------------------------------------------------------------------
186 !
187 END SUBROUTINE ini_csts
subroutine ini_surf_csts
subroutine ini_cturbs
Definition: ini_cturbs.F90:5
subroutine ini_csts
Definition: ini_csts.F90:6
subroutine ini_ocean_csts