source: lmdz_wrf/trunk/tools/lmdz_const.py @ 222

Last change on this file since 222 was 214, checked in by lfita, 10 years ago

Trying to avoid hyperbolic-tangent for the zoom...

File size: 4.0 KB
Line 
1#
2# $Id: comconst.h 1795 2013-07-18 08:20:28Z emillour $
3#
4#----------------------------------------------------------------------
5import numpy as np
6
7# dtvr: dynamical time step (in s)
8# daysec: length (in s) of a standard day
9# pi: something like 3.14159....
10# dtphys: (s) time step for the physics
11# dtdiss: (s) time step for the dissipation
12# rad: (m) radius of the planet
13# r: Reduced Gas constant r=R/mu
14#   with R=8.31.. J.K-1.mol-1, mu: mol mass of atmosphere (kg/mol)
15# cpp: Specific heat Cp (J.kg-1.K-1)
16# kappa: kappa=R/Cp
17# cotot
18# unsim: 1./iim
19# g: (m/s2) gravity
20# omeg: (rad/s) rotation rate of the planet
21# dissip_factz,dissip_deltaz,dissip_zref
22## top_bound sponge:
23# iflag_top_bound: sponge type
24# mode_top_bound: sponge mode
25# tau_top_bound: inverse of sponge characteristic time scale (Hz)
26# daylen: length of solar day, in 'standard' day length
27# year_day: Number of standard days in a year
28# molmass: (g/mol) molar mass of the atmosphere
29# ihf: (W/m2) Intrinsic heat flux (for giant planets)
30
31planet_type = 'terre'
32iflag_phys = 2
33daysec = 86400.
34preff = 1013250.
35pa = 500.
36
37#-----------------------------------------------------------------------
38# From suphel
39
40pi = 2.*np.arcsin(1.)
41clum = 299792458.
42hpla = 6.6260755e-34
43kbol = 1.380658e-23
44navo = 6.0221367e+23
45#
46#     ----------------------------------------------------------------
47#
48#*       2.    define astronomical constants.
49#              ------------------------------
50#
51day = 86400.
52ea = 149597870000.
53epsm = 0.409093
54#
55siyea = 365.25*day*2.*pi/6.283076
56siday = day/(1.+day/siyea)
57omega = 2.*pi/siday
58#
59#
60#     ------------------------------------------------------------------
61#
62#*       3.    define geoide.
63#              --------------
64#
65g = 9.80665
66a = 6371229.
67r1sa = np.float(np.float64(1.)/np.float64(a))
68#rad = 6371220
69rad = a*1.
70omeg = 7.272205e-05
71
72#
73#     -----------------------------------------------------------------
74#
75#*       4.    define radiation constants.
76#              ---------------------------
77#
78# z.x.li      rsigma=2. * rpi**5 * rkbol**4 /(15.* rclum**2 * rhpla**3)
79sigma = 2.*pi**5 * (kbol/hpla)**3 * kbol/clum/clum/15.
80#
81#     -----------------------------------------------------------------
82#
83#*       5.    define thermodynamic constants, gas phase.
84#              ------------------------------------------
85#
86r = navo*kbol
87md = 28.9644
88mo3 = 47.9942
89mv = 18.0153
90rd = 1000.*r/md
91rv = 1000.*r/mv
92cpd = 3.5*rd
93cvd = cpd-rd
94cpv = 4.*rv
95cvv = cpv-rv
96kappa = rd/cpd
97etv = rv/rd-1.
98cpp = cpd*1.
99#
100#     ----------------------------------------------------------------
101#
102#*       6.    define thermodynamic constants, liquid phase.
103#              ---------------------------------------------
104#
105cw = cpv
106#     ----------------------------------------------------------------
107#
108#*       7.    define thermodynamic constants, solid phase.
109#              --------------------------------------------
110#
111cs = cpv
112#
113#     ----------------------------------------------------------------
114#
115#*       8.    define thermodynamic constants, transition of phase.
116#              ----------------------------------------------------
117#
118tt = 273.16
119lvtt = 2.5008e+6
120lstt = 2.8345e+6
121lmlt = lstt-lvtt
122atm = 100000.
123#
124#     ----------------------------------------------------------------
125#
126#*       9.    saturated vapour pressure.
127#              --------------------------
128#
129estt = 611.14
130gamw = (cw-cpv)/rv
131betw = lvtt/rv+gamw*tt
132alpw = np.log(estt)+betw/tt+gamw*np.log(tt)
133gams = (cs-cpv)/rv
134bets = lstt/rv+gams*tt
135alps = np.log(estt)+bets/tt+gams*np.log(tt)
136gamd = gams-gamw
137betd = bets-betw
138alpd = alps-alpw
139#
140#     ------------------------------------------------------------------
141#
142# calculer les constantes pour les fonctions thermodynamiques
143#
144vtmp2 = cpv/cpd-1.
145hoh2o = atm/100.
146r2es = estt*rd/rv
147r3les = 17.269
148r3ies = 21.875
149r4les = 35.86
150r4ies = 7.66
151r5les = r3les*(tt-r4les)
152r5ies = r3ies*(tt-r4ies)
153
154# For filtreg
155#
156type_sddu=1
157type_sddv=2
158type_unsddu=3
159type_unsddv=4
160
161# Zoom related
162#
163fxyhypb = False
164nitergdiv = 1
165nitergrot = 2
166niterh = 2
167coefdis = 0.
168ysinus = True
Note: See TracBrowser for help on using the repository browser.