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

Last change on this file since 211 was 180, checked in by lfita, 10 years ago

Adding python script to generate same initial conditions as 'iniaqua'

File size: 3.7 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
31daysec = 86400.
32preff = 1013250.
33pa = 500.
34
35#-----------------------------------------------------------------------
36# From suphel
37
38pi = 2.*np.arcsin(1.)
39clum = 299792458.
40hpla = 6.6260755e-34
41kbol = 1.380658e-23
42navo = 6.0221367e+23
43#
44#     ----------------------------------------------------------------
45#
46#*       2.    define astronomical constants.
47#              ------------------------------
48#
49day = 86400.
50ea = 149597870000.
51epsm = 0.409093
52#
53siyea = 365.25*day*2.*pi/6.283076
54siday = day/(1.+day/siyea)
55omega = 2.*pi/siday
56#
57#
58#     ------------------------------------------------------------------
59#
60#*       3.    define geoide.
61#              --------------
62#
63g = 9.80665
64a = 6371229.
65r1sa = np.float(np.float64(1.)/np.float64(a))
66#
67#     -----------------------------------------------------------------
68#
69#*       4.    define radiation constants.
70#              ---------------------------
71#
72# z.x.li      rsigma=2. * rpi**5 * rkbol**4 /(15.* rclum**2 * rhpla**3)
73sigma = 2.*pi**5 * (kbol/hpla)**3 * kbol/clum/clum/15.
74#
75#     -----------------------------------------------------------------
76#
77#*       5.    define thermodynamic constants, gas phase.
78#              ------------------------------------------
79#
80r = navo*kbol
81md = 28.9644
82mo3 = 47.9942
83mv = 18.0153
84rd = 1000.*r/md
85rv = 1000.*r/mv
86cpd = 3.5*rd
87cvd = cpd-rd
88cpv = 4.*rv
89cvv = cpv-rv
90kappa = rd/cpd
91etv = rv/rd-1.
92#
93#     ----------------------------------------------------------------
94#
95#*       6.    define thermodynamic constants, liquid phase.
96#              ---------------------------------------------
97#
98cw = cpv
99#     ----------------------------------------------------------------
100#
101#*       7.    define thermodynamic constants, solid phase.
102#              --------------------------------------------
103#
104cs = cpv
105#
106#     ----------------------------------------------------------------
107#
108#*       8.    define thermodynamic constants, transition of phase.
109#              ----------------------------------------------------
110#
111tt = 273.16
112lvtt = 2.5008e+6
113lstt = 2.8345e+6
114lmlt = lstt-lvtt
115atm = 100000.
116#
117#     ----------------------------------------------------------------
118#
119#*       9.    saturated vapour pressure.
120#              --------------------------
121#
122estt = 611.14
123gamw = (cw-cpv)/rv
124betw = lvtt/rv+gamw*tt
125alpw = np.log(estt)+betw/tt+gamw*np.log(tt)
126gams = (cs-cpv)/rv
127bets = lstt/rv+gams*tt
128alps = np.log(estt)+bets/tt+gams*np.log(tt)
129gamd = gams-gamw
130betd = bets-betw
131alpd = alps-alpw
132#
133#     ------------------------------------------------------------------
134#
135# calculer les constantes pour les fonctions thermodynamiques
136#
137vtmp2 = cpv/cpd-1.
138hoh2o = atm/100.
139r2es = estt*rd/rv
140r3les = 17.269
141r3ies = 21.875
142r4les = 35.86
143r4ies = 7.66
144r5les = r3les*(tt-r4les)
145r5ies = r3ies*(tt-r4ies)
Note: See TracBrowser for help on using the repository browser.