1 | !WRF:MODEL_LAYER:CONSTANTS |
---|
2 | ! |
---|
3 | |
---|
4 | MODULE module_model_constants |
---|
5 | ! 2. Following are constants for use in defining real number bounds. |
---|
6 | |
---|
7 | ! A really small number. |
---|
8 | |
---|
9 | REAL , PARAMETER :: epsilon = 1.E-15 |
---|
10 | |
---|
11 | ! 4. Following is information related to the physical constants. |
---|
12 | |
---|
13 | ! These are the physical parameters used within the model. |
---|
14 | character(len=15) :: planet ! In generic model, to know which physics is used |
---|
15 | !JL22 Because we deal with different planets, many variables below have the PARAMETER attribute |
---|
16 | ! in WRF, but are now simple variables that will be initialized at runtime in init_module_model_constants. |
---|
17 | ! These are the ones with a commented value or definition on the right. |
---|
18 | ! for the moment we leave the water constants untouched, but we may |
---|
19 | ! change that for other condensible substances. |
---|
20 | |
---|
21 | |
---|
22 | ! JM NOTE -- can we name this grav instead? |
---|
23 | REAL :: g != 9.81 ! acceleration due to gravity (m {s}^-2) |
---|
24 | |
---|
25 | REAL :: r_d ! = 287. ! gas constant of dry air (J deg^-1 kg^-1) |
---|
26 | REAL :: cp ! = 7.*r_d/2. ! |
---|
27 | |
---|
28 | REAL , PARAMETER :: r_v = 461.6 ! gas constant for water vapor (J deg^-1 kg^-1) |
---|
29 | REAL :: cv ! = cp-r_d ! Specific heat of air at contant volume (J deg^-1 kg^-1) |
---|
30 | REAL :: cpv ! = 4.*r_v |
---|
31 | REAL :: cvv ! = cpv-r_v ! |
---|
32 | REAL :: cvpm ! = -cv/cp |
---|
33 | REAL , PARAMETER :: cliq = 4190. ! specific heat of liquid water at 0^oC |
---|
34 | REAL , PARAMETER :: cice = 2106. ! specific heat of ice at 0^oC |
---|
35 | REAL , PARAMETER :: psat = 610.78 |
---|
36 | REAL :: rcv ! = r_d/cv ! |
---|
37 | REAL :: rcp ! = r_d/cp |
---|
38 | REAL :: rovg ! = r_d/g |
---|
39 | REAL :: c2 ! = cp * rcv |
---|
40 | REAL :: mwdry ! = 28.966 ! molecular weight of dry air (g/mole) |
---|
41 | |
---|
42 | REAL :: p1000mb ! = 100000. ! pressure at 1000 hPa (pa) |
---|
43 | REAL :: t0 ! = 300. ! base state tempertaure (K) |
---|
44 | REAL :: p0 ! = p1000mb ! base state surface pressure (pa) |
---|
45 | REAL :: cpovcv ! = cp/(cp-r_d) |
---|
46 | REAL :: cvovcp ! = 1./cpovcv |
---|
47 | REAL :: rvovrd ! = r_v/r_d |
---|
48 | |
---|
49 | REAL :: reradius ! = 1./6370.0e03 ! reciprocal of earth radius (m^-1) |
---|
50 | |
---|
51 | REAL , PARAMETER :: asselin = .025 |
---|
52 | ! REAL , PARAMETER :: asselin = .0 |
---|
53 | REAL , PARAMETER :: cb = 25. |
---|
54 | |
---|
55 | REAL , PARAMETER :: XLV0 = 3.15E6 ! constant defined for calculation of latent heating |
---|
56 | REAL , PARAMETER :: XLV1 = 2370. ! constant defined for calculation of latent heating |
---|
57 | REAL , PARAMETER :: XLS0 = 2.905E6 ! constant defined for calculation of latent heating |
---|
58 | REAL , PARAMETER :: XLS1 = 259.532 ! constant defined for calculation of latent heating |
---|
59 | |
---|
60 | REAL , PARAMETER :: XLS = 2.85E6 ! latent heat of sublimation of water at 0^oC (J kg^-1) |
---|
61 | REAL , PARAMETER :: XLV = 2.5E6 ! latent heat of vaporization of water at 0^oC (J kg^-1) |
---|
62 | REAL , PARAMETER :: XLF = 3.50E5 ! latent heat of fusion of water at 0^oC (J kg^-1) |
---|
63 | |
---|
64 | REAL , PARAMETER :: rhowater = 1000. ! density of liquid water at 0^oC (kg m^-3) |
---|
65 | REAL , PARAMETER :: rhosnow = 100. ! density of snow (kg m^-3) |
---|
66 | REAL , PARAMETER :: rhoair0 = 1.28 ! density of dry air at 0^oC and 1000mb pressure (kg m^-3) |
---|
67 | !JL22 should be 0.02kg/m3 for mars, but is it used ? |
---|
68 | |
---|
69 | REAL , PARAMETER :: RE_QC_BG = 2.49E-6 ! effective radius of cloud for background (m) |
---|
70 | REAL , PARAMETER :: RE_QI_BG = 4.99E-6 ! effective radius of ice for background (m) |
---|
71 | REAL , PARAMETER :: RE_QS_BG = 9.99E-6 ! effective radius of snow for background (m) |
---|
72 | ! |
---|
73 | ! Now namelist-specified parameter: ccn_conc - RAS |
---|
74 | ! REAL , PARAMETER :: n_ccn0 = 1.0E8 |
---|
75 | ! |
---|
76 | REAL , PARAMETER :: piconst = 3.1415926535897932384626433 ! constant of PI |
---|
77 | REAL , PARAMETER :: DEGRAD = piconst/180. ! radians per degree |
---|
78 | REAL , PARAMETER :: DPD = 360./365. ! longitude solaire d'un jour? |
---|
79 | !JL22 should be 360./669. on Mars, but is it used ? |
---|
80 | |
---|
81 | REAL , PARAMETER :: SVP1=0.6112 ! constant for saturation vapor pressure calculation (dimensionless) |
---|
82 | REAL , PARAMETER :: SVP2=17.67 ! constant for saturation vapor pressure calculation (dimensionless) |
---|
83 | REAL , PARAMETER :: SVP3=29.65 ! constant for saturation vapor pressure calculation (K) |
---|
84 | REAL , PARAMETER :: SVPT0=273.15 ! constant for saturation vapor pressure calculation (K) |
---|
85 | REAL :: EP_1 !=R_v/R_d-1. ! constant for virtual temperature (r_v/r_d - 1) (dimensionless) |
---|
86 | REAL :: EP_2 !=R_d/R_v ! constant for specific humidity calculation (dimensionless) |
---|
87 | REAL , PARAMETER :: KARMAN=0.4 ! von Karman constant |
---|
88 | REAL :: EOMEG !=7.2921E-5 ! angular velocity of rotation (rad^-1) |
---|
89 | REAL , PARAMETER :: STBOLT=5.67051E-8 ! Stefan-Boltzmann constant (W m^-2 deg^-4) |
---|
90 | |
---|
91 | REAL , PARAMETER :: prandtl = 1./3.0 ! prandtl's mixing length (m) |
---|
92 | ! constants for w-damping option |
---|
93 | REAL , PARAMETER :: w_alpha = 0.3 ! strength m/s/s |
---|
94 | !JL22 w_alpha was 2.0 in AS implementation with WRFV3 |
---|
95 | REAL , PARAMETER :: w_beta = 1.0 ! activation cfl number |
---|
96 | !JL22 w_beta was 0.8 in AS implementation with WRFV3 |
---|
97 | |
---|
98 | REAL , PARAMETER :: pq0=379.90516 ! |
---|
99 | REAL , PARAMETER :: epsq2=0.2 ! initial TKE for camuw PBL scheme (m2 s^-2) |
---|
100 | REAL , PARAMETER :: a2=17.2693882 |
---|
101 | REAL , PARAMETER :: a3=273.16 |
---|
102 | REAL , PARAMETER :: a4=35.86 |
---|
103 | REAL , PARAMETER :: epsq=1.e-12 ! threshold specified for SPECIFIC HUMIDITY calculation in BMJ cumulus scheme (kg kg^-1) |
---|
104 | REAL :: p608 !=rvovrd-1. |
---|
105 | REAL , PARAMETER :: climit=1.e-20 |
---|
106 | REAL , PARAMETER :: cm1=2937.4 |
---|
107 | REAL , PARAMETER :: cm2=4.9283 |
---|
108 | REAL , PARAMETER :: cm3=23.5518 |
---|
109 | ! REAL , PARAMETER :: defc=8.0 |
---|
110 | ! REAL , PARAMETER :: defm=32.0 |
---|
111 | REAL , PARAMETER :: defc=0.0 |
---|
112 | REAL , PARAMETER :: defm=99999.0 |
---|
113 | REAL , PARAMETER :: epsfc=1./1.05 |
---|
114 | REAL , PARAMETER :: epswet=0.0 |
---|
115 | REAL , PARAMETER :: fcdif=1./3. |
---|
116 | REAL , PARAMETER :: fcm=0.00003 |
---|
117 | REAL :: gma !=-r_d*(1.-rcp)*0.5 |
---|
118 | REAL , PARAMETER :: p400=40000.0 |
---|
119 | REAL , PARAMETER :: phitp=15000.0 |
---|
120 | REAL , PARAMETER :: pi2=2.*3.1415926, pi1=3.1415926 |
---|
121 | REAL , PARAMETER :: plbtm=105000.0 |
---|
122 | REAL , PARAMETER :: plomd=64200.0 |
---|
123 | REAL , PARAMETER :: pmdhi=35000.0 |
---|
124 | REAL , PARAMETER :: q2ini=0.50 |
---|
125 | REAL :: rfcp !=0.25/cp |
---|
126 | REAL , PARAMETER :: rhcrit_land=0.75 |
---|
127 | REAL , PARAMETER :: rhcrit_sea=0.80 |
---|
128 | REAL , PARAMETER :: rlag=14.8125 |
---|
129 | REAL , PARAMETER :: rlx=0.90 |
---|
130 | REAL , PARAMETER :: scq2=50.0 |
---|
131 | REAL , PARAMETER :: slopht=0.001 |
---|
132 | REAL , PARAMETER :: tlc=2.*0.703972477 |
---|
133 | REAL , PARAMETER :: wa=0.15 |
---|
134 | REAL , PARAMETER :: wght=0.35 |
---|
135 | REAL , PARAMETER :: wpc=0.075 |
---|
136 | REAL , PARAMETER :: z0land=0.10 ! surface roughness length over land (m) |
---|
137 | REAL , PARAMETER :: z0max=0.008 ! maximum roughness length (m) |
---|
138 | REAL , PARAMETER :: z0sea=0.001 ! roughness length over ocean (m) |
---|
139 | |
---|
140 | !JL12 some new variables used in earth parametrizations |
---|
141 | REAL :: CAPA !=rcp |
---|
142 | REAL :: ELOCP |
---|
143 | ! Earth |
---|
144 | |
---|
145 | ! The value for P2SI *must* be set to 1.0 for Earth |
---|
146 | ! Although, now we may not need this declaration here (see above) |
---|
147 | !REAL , PARAMETER :: P2SI = 1.0 |
---|
148 | |
---|
149 | ! Orbital constants: |
---|
150 | |
---|
151 | INTEGER , PARAMETER :: PLANET_YEAR = 365 ! number of days in a calendar year |
---|
152 | !JL22 this integer is only for calendar timekeeping in WRF, wo we keep it unchanged |
---|
153 | REAL :: PLANET_YEAR_REAL ! number of days in a year in the physics |
---|
154 | REAL :: OBLIQUITY != 23.5 ! solar obliquity (degree) |
---|
155 | REAL , PARAMETER :: ECCENTRICITY = 0.014 ! Orbital eccentricity |
---|
156 | REAL , PARAMETER :: SEMIMAJORAXIS = 1.0 ! Ratio of semi-major axis of planet / semi-major axis of earth |
---|
157 | REAL , PARAMETER :: zero_date = 0.0 ! Time of perihelion passage |
---|
158 | REAL , PARAMETER :: EQUINOX_FRACTION= 0.0 ! Fraction into the year (from perhelion) of the occurrence of the Northern Spring Equinox |
---|
159 | |
---|
160 | ! 2012103 |
---|
161 | #if (EM_CORE == 1) |
---|
162 | ! for calls to set_tiles |
---|
163 | INTEGER, PARAMETER :: ZONE_SOLVE_EM = 1 |
---|
164 | INTEGER, PARAMETER :: ZONE_SFS = 2 |
---|
165 | #endif |
---|
166 | |
---|
167 | ! These are the physical constants added in the LMDZ physcis |
---|
168 | |
---|
169 | REAL :: wdaysec ! duree du sol (s) ~88775 s |
---|
170 | REAL :: wperiheli ! Dist.min. soleil-mars (Mkm) ~206.66 |
---|
171 | REAL :: waphelie ! Dist.max. soleil-mars (Mkm) ~249.22 |
---|
172 | REAL :: wperi_day ! Date du perihelie (sols depuis printemps) |
---|
173 | REAL :: wobliquit ! Obliquite de la planete (deg) ~25.2 |
---|
174 | REAL :: wz0 ! surface roughness (m) ~0.01 |
---|
175 | REAL :: wlmixmin ! longueur de melange ~100 |
---|
176 | REAL :: wemin_turb ! energie minimale ~1.e-8 |
---|
177 | REAL :: wemissiv ! Emissivite du sol martien ~.95 |
---|
178 | REAL :: wemissiceN ! Emissivite calotte nord |
---|
179 | REAL :: wemissiceS ! Emissivite calotte sud |
---|
180 | REAL :: walbediceN ! Albedo calotte nord !0.5 |
---|
181 | REAL :: walbediceS ! Albedo calotte sud !0.5 |
---|
182 | REAL :: wiceradiusN ! mean scat radius of CO2 snow (north) |
---|
183 | REAL :: wiceradiusS ! mean scat radius of CO2 snow (south) |
---|
184 | REAL :: wdtemisiceN ! time scale for snow metamorphism (north) !2 |
---|
185 | REAL :: wdtemisiceS ! time scale for snow metamorphism (south) !2 |
---|
186 | REAL :: wvolcapa ! volumetric capacity of soil (new soil model) |
---|
187 | REAL :: z_scale ! scale height |
---|
188 | |
---|
189 | REAL :: TT00 |
---|
190 | REAL :: nu |
---|
191 | CONTAINS |
---|
192 | |
---|
193 | SUBROUTINE init_module_model_constants |
---|
194 | USE module_configure |
---|
195 | IMPLICIT NONE |
---|
196 | REAL :: rad ! radius of the planet (tmp to compute reradius) |
---|
197 | |
---|
198 | Call initial_config ! to read the namelist |
---|
199 | |
---|
200 | CALL nl_get_planet(1, planet ) |
---|
201 | !JL22 Here are some constants that are probably not used for many planets |
---|
202 | ! so we initialize them to default values to avoid compiling issues |
---|
203 | PLANET_YEAR_REAL = PLANET_YEAR * 1.d0 |
---|
204 | OBLIQUITY = 0. |
---|
205 | |
---|
206 | ! These are the physical constants used within the model |
---|
207 | |
---|
208 | IF ( planet == "mars" ) then |
---|
209 | ! JM NOTE -- can we name this grav instead? |
---|
210 | g = 3.72 ! acceleration due to gravity (m {s}^-2) |
---|
211 | |
---|
212 | !#if ( NMM_CORE == 1 ) |
---|
213 | ! REAL :: r_d = 192. ! gas constant m2 s-2 K-1 |
---|
214 | ! REAL :: cp = 844.6 ! r= 8.314511E+0 *1000.E+0/mugaz |
---|
215 | !#else |
---|
216 | ! REAL :: r_d = 192. |
---|
217 | ! REAL :: cp = 844.6 |
---|
218 | !#endif |
---|
219 | |
---|
220 | r_d = 191. |
---|
221 | cp = 744.5 |
---|
222 | t0 = 220. ! earth : 300 ... � remplacer par 220 ? |
---|
223 | p0 = 610. |
---|
224 | p1000mb = 610. |
---|
225 | reradius = 1./3397200. ! Rayon de mars (m) ~3397200 m |
---|
226 | EOMEG =7.0721E-5 ! angular rotation rate (rad.s-1) |
---|
227 | wdaysec = 88800. ! duree du sol (s) ~88775 s |
---|
228 | mwdry = 43.49 ! Masse molaire de l'atm (g.mol-1) ~43.49 |
---|
229 | EOMEG = 7.0721E-5 ! omega (rad.s-1) |
---|
230 | PLANET_YEAR_REAL = 669. ! Duree de l'annee (sols) ~668.6 |
---|
231 | wperiheli = 206.66 ! Dist.min. soleil-mars (Mkm) ~206.66 |
---|
232 | waphelie = 249.22 ! Dist.max. soleil-mars (Mkm) ~249.22 |
---|
233 | wperi_day = 485. ! Date du perihelie (sols depuis printemps) |
---|
234 | OBLIQUITY = 25.2 ! Obliquite de la planete (deg) ~25.2 |
---|
235 | wz0 = 1.e-2 ! surface roughness (m) ~0.01 |
---|
236 | wlmixmin = 30. ! longueur de melange ~100 |
---|
237 | wemin_turb = 1.e-6 ! energie minimale ~1.e-8 |
---|
238 | wemissiv = 0.95 ! Emissivite du sol martien ~.95 |
---|
239 | wemissiceN = 0.95 ! Emissivite calotte nord |
---|
240 | wemissiceS = 0.95 ! Emissivite calotte sud |
---|
241 | walbediceN = 0.65 ! Albedo calotte nord !0.5 |
---|
242 | walbediceS = 0.65 ! Albedo calotte sud !0.5 |
---|
243 | wiceradiusN = 100.e-6 ! mean scat radius of CO2 snow (north) |
---|
244 | wiceradiusS = 100.e-6 ! mean scat radius of CO2 snow (south) |
---|
245 | wdtemisiceN = 0.4 ! time scale for snow metamorphism (north) !2 |
---|
246 | wdtemisiceS = 0.4 ! time scale for snow metamorphism (south) !2 |
---|
247 | wvolcapa = 1.e6 ! volumetric capacity of soil (new soil model) |
---|
248 | TT00=0. |
---|
249 | nu=0. |
---|
250 | !#endif |
---|
251 | ELSE if ( planet == "venus") then |
---|
252 | g = 8.87 |
---|
253 | r_d = 191.84383904727036 |
---|
254 | !cpp = 1000. |
---|
255 | cp = 1000. |
---|
256 | t0 = 735. ! earth : 300 |
---|
257 | p0 = 92.e5 |
---|
258 | p1000mb = 92.e5 |
---|
259 | reradius = 1./6051800. ! Rayon de venus (m) ~6051800 m |
---|
260 | mwdry = 43.49 |
---|
261 | EOMEG = 0.2992549E-06 |
---|
262 | wdaysec = 0.1008707E08 |
---|
263 | TT00=460. |
---|
264 | nu=0.35 |
---|
265 | ELSE if ( planet == "titan") then |
---|
266 | g = 1.35 |
---|
267 | r_d = 298.734319568 |
---|
268 | cp = 1038.72627727 |
---|
269 | t0 = 94. ! earth : 300 |
---|
270 | p0 = 146144.796875 |
---|
271 | p1000mb = 146144.796875 |
---|
272 | reradius = 1./2575500.0 ! Rayon de titan (m) ~2575500.0 m |
---|
273 | mwdry = 28.6 |
---|
274 | EOMEG = 0.2992549E-06 !!!!!!!!!!!!!!!!!!! |
---|
275 | wdaysec = 1377665.28 |
---|
276 | TT00=0. |
---|
277 | nu=0. |
---|
278 | ELSE if (( planet == "prescribed").or.(planet == "generic").or.(planet == "earth")) then |
---|
279 | open(17,file='planet_constant',form='formatted',status='old') |
---|
280 | rewind(17) |
---|
281 | read(17,*) g |
---|
282 | read(17,*) cp |
---|
283 | read(17,*) mwdry |
---|
284 | read(17,*) t0 |
---|
285 | read(17,*) p0 |
---|
286 | read(17,*) rad |
---|
287 | close(17) |
---|
288 | EOMEG = 0.d0 |
---|
289 | r_d=8.314/(mwdry*1e-3) |
---|
290 | p1000mb=p0 |
---|
291 | reradius=1./rad |
---|
292 | TT00=0. |
---|
293 | nu=0. |
---|
294 | ELSE |
---|
295 | write(*,*) "unknown planet type:", planet |
---|
296 | stop |
---|
297 | endif |
---|
298 | cv = cp-r_d |
---|
299 | cpv = 3.9*r_v |
---|
300 | cvv = cpv-r_v |
---|
301 | cvpm = -cv/cp |
---|
302 | rcv = r_d/cv |
---|
303 | rcp = r_d/cp |
---|
304 | rovg = r_d/g |
---|
305 | c2 = cp * rcv |
---|
306 | cpovcv = cp/(cp-r_d) |
---|
307 | cvovcp = 1./cpovcv |
---|
308 | rvovrd = r_v/r_d |
---|
309 | gma = -r_d*(1.-rcp)*0.5 |
---|
310 | EP_1 = r_v/r_d-1. |
---|
311 | EP_2 = r_d/r_v |
---|
312 | rfcp =0.25/cp |
---|
313 | p608 =rvovrd-1. |
---|
314 | z_scale =(r_d*t0/g) |
---|
315 | write(*,*) "planet : ", planet |
---|
316 | write(*,*) "g = ", g |
---|
317 | write(*,*) "cp = ", cp |
---|
318 | write(*,*) "r_d = ", r_d |
---|
319 | write(*,*) "t0 = ", t0 |
---|
320 | write(*,*) "p0 = ", p0 |
---|
321 | write(*,*) "T0 = ", TT00 |
---|
322 | write(*,*) "nu = ", nu |
---|
323 | |
---|
324 | !JL12 some new variables used in earth parametrizations |
---|
325 | CAPA = rcp |
---|
326 | ELOCP = 2.72E6/CP |
---|
327 | |
---|
328 | |
---|
329 | END SUBROUTINE init_module_model_constants |
---|
330 | END MODULE module_model_constants |
---|