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

Last change on this file since 213 was 212, checked in by lfita, 11 years ago

First final version without checking if everithing is done fine

File size: 3.8 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#
69#     -----------------------------------------------------------------
70#
71#*       4.    define radiation constants.
72#              ---------------------------
73#
74# z.x.li      rsigma=2. * rpi**5 * rkbol**4 /(15.* rclum**2 * rhpla**3)
75sigma = 2.*pi**5 * (kbol/hpla)**3 * kbol/clum/clum/15.
76#
77#     -----------------------------------------------------------------
78#
79#*       5.    define thermodynamic constants, gas phase.
80#              ------------------------------------------
81#
82r = navo*kbol
83md = 28.9644
84mo3 = 47.9942
85mv = 18.0153
86rd = 1000.*r/md
87rv = 1000.*r/mv
88cpd = 3.5*rd
89cvd = cpd-rd
90cpv = 4.*rv
91cvv = cpv-rv
92kappa = rd/cpd
93etv = rv/rd-1.
94#
95#     ----------------------------------------------------------------
96#
97#*       6.    define thermodynamic constants, liquid phase.
98#              ---------------------------------------------
99#
100cw = cpv
101#     ----------------------------------------------------------------
102#
103#*       7.    define thermodynamic constants, solid phase.
104#              --------------------------------------------
105#
106cs = cpv
107#
108#     ----------------------------------------------------------------
109#
110#*       8.    define thermodynamic constants, transition of phase.
111#              ----------------------------------------------------
112#
113tt = 273.16
114lvtt = 2.5008e+6
115lstt = 2.8345e+6
116lmlt = lstt-lvtt
117atm = 100000.
118#
119#     ----------------------------------------------------------------
120#
121#*       9.    saturated vapour pressure.
122#              --------------------------
123#
124estt = 611.14
125gamw = (cw-cpv)/rv
126betw = lvtt/rv+gamw*tt
127alpw = np.log(estt)+betw/tt+gamw*np.log(tt)
128gams = (cs-cpv)/rv
129bets = lstt/rv+gams*tt
130alps = np.log(estt)+bets/tt+gams*np.log(tt)
131gamd = gams-gamw
132betd = bets-betw
133alpd = alps-alpw
134#
135#     ------------------------------------------------------------------
136#
137# calculer les constantes pour les fonctions thermodynamiques
138#
139vtmp2 = cpv/cpd-1.
140hoh2o = atm/100.
141r2es = estt*rd/rv
142r3les = 17.269
143r3ies = 21.875
144r4les = 35.86
145r4ies = 7.66
146r5les = r3les*(tt-r4les)
147r5ies = r3ies*(tt-r4ies)
148
149# For filtreg
150#
151type_sddu=1
152type_sddv=2
153type_unsddu=3
154type_unsddv=4
Note: See TracBrowser for help on using the repository browser.