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