/[lmdze]/trunk/Sources/phylmd/ini_histins.f
ViewVC logotype

Contents of /trunk/Sources/phylmd/ini_histins.f

Parent Directory Parent Directory | Revision Log Revision Log


Revision 190 - (show annotations)
Thu Apr 14 15:15:56 2016 UTC (8 years, 1 month ago) by guez
File size: 12406 byte(s)
Created module cv_thermo_m around procedure cv_thermo. Moved variables
from module cvthermo to module cv_thermo_m, where they are defined.

In ini_histins and initphysto, using part of rlon and rlat from
phyetat0_m is pretending that we do not know about the dynamical grid,
while the way we extract zx_lon(:, 1) and zx_lat(1, :) depends on
ordering inside rlon and rlat. So we might as well simplify and
clarify by using directly rlonv and rlatu.

Removed intermediary variables in write_histins and phystokenc.

1 module ini_histins_m
2
3 implicit none
4
5 contains
6
7 subroutine ini_histins(dtime, ok_instan, nid_ins, itau_phy)
8
9 ! From phylmd/ini_histins.h, v 1.2 2005/05/25 13:10:09
10
11 use clesphys, only: ecrit_ins
12 use clesphys2, only: conv_emanuel
13 use dimens_m, only: iim, jjm, llm, nqmx
14 use dimphy, only: klon
15 use disvert_m, only: presnivs
16 use dynetat0_m, only: day_ref, annee_ref, rlatu, rlonv
17 USE histbeg_totreg_m, ONLY : histbeg_totreg
18 USE histdef_m, ONLY : histdef
19 USE histend_m, ONLY : histend
20 USE histvert_m, ONLY : histvert
21 use indicesol, only: nbsrf, clnsurf
22 use iniadvtrac_m, only: tname, ttext
23 use nr_util, only: pi
24 USE ymds2ju_m, only: ymds2ju
25
26 REAL, intent(in):: dtime ! pas temporel de la physique (s)
27 logical, intent(in):: ok_instan
28 integer, intent(out):: nid_ins
29 integer, intent(in):: itau_phy
30
31 ! Local:
32 real zjulian, zsto, zout
33 integer nhori, nvert, nsrf, iq, it
34
35 !-------------------------------------------------------------------
36
37 IF (ok_instan) THEN
38 zsto = dtime * ecrit_ins
39 zout = dtime * ecrit_ins
40 CALL ymds2ju(annee_ref, 1, day_ref, 0.0, zjulian)
41 CALL histbeg_totreg("histins", rlonv(:iim) / pi * 180., &
42 rlatu / pi * 180., 1, iim, &
43 1, jjm + 1, itau_phy, zjulian, dtime, nhori, nid_ins)
44 write(*, *)'Inst ', itau_phy, zjulian
45 CALL histvert(nid_ins, "presnivs", "Vertical levels", "mb", &
46 presnivs/100., nvert)
47 CALL histdef(nid_ins, "phis", "Surface geop. height", "-", &
48 iim, (jjm + 1), nhori, 1, 1, 1, -99, &
49 "once", zsto, zout)
50 CALL histdef(nid_ins, "aire", "Grid area", "-", &
51 iim, (jjm + 1), nhori, 1, 1, 1, -99, &
52 "once", zsto, zout)
53
54 ! Champs 2D:
55
56 CALL histdef(nid_ins, "tsol", "Surface Temperature", "K", &
57 iim, (jjm + 1), nhori, 1, 1, 1, -99, &
58 "inst(X)", zsto, zout)
59
60 CALL histdef(nid_ins, "t2m", "Temperature 2m", "K", &
61 iim, (jjm + 1), nhori, 1, 1, 1, -99, &
62 "inst(X)", zsto, zout)
63
64 CALL histdef(nid_ins, "q2m", "Specific humidity 2m", "Kg/Kg", &
65 iim, (jjm + 1), nhori, 1, 1, 1, -99, &
66 "inst(X)", zsto, zout)
67
68 CALL histdef(nid_ins, "u10m", "Vent zonal 10m", "m/s", &
69 iim, (jjm + 1), nhori, 1, 1, 1, -99, &
70 "inst(X)", zsto, zout)
71
72 CALL histdef(nid_ins, "v10m", "Vent meridien 10m", "m/s", &
73 iim, (jjm + 1), nhori, 1, 1, 1, -99, &
74 "inst(X)", zsto, zout)
75
76 CALL histdef(nid_ins, "psol", "Surface Pressure", "Pa", &
77 iim, (jjm + 1), nhori, 1, 1, 1, -99, &
78 "inst(X)", zsto, zout)
79
80 CALL histdef(nid_ins, "plul", "Large-scale Precip.", "mm/day", &
81 iim, (jjm + 1), nhori, 1, 1, 1, -99, &
82 "inst(X)", zsto, zout)
83
84 CALL histdef(nid_ins, "pluc", "Convective Precip.", "mm/day", &
85 iim, (jjm + 1), nhori, 1, 1, 1, -99, &
86 "inst(X)", zsto, zout)
87
88 CALL histdef(nid_ins, "cdrm", "Momentum drag coef.", "-", &
89 iim, (jjm + 1), nhori, 1, 1, 1, -99, &
90 "inst(X)", zsto, zout)
91
92 CALL histdef(nid_ins, "cdrh", "Heat drag coef.", "-", &
93 iim, (jjm + 1), nhori, 1, 1, 1, -99, &
94 "inst(X)", zsto, zout)
95
96 CALL histdef(nid_ins, "precip", "Precipitation Totale liq+sol", &
97 "kg/(s*m2)", &
98 iim, (jjm + 1), nhori, 1, 1, 1, -99, &
99 "inst(X)", zsto, zout)
100
101 CALL histdef(nid_ins, "snow", "Snow fall", "kg/(s*m2)", &
102 iim, (jjm + 1), nhori, 1, 1, 1, -99, &
103 "inst(X)", zsto, zout)
104
105 ! CALL histdef(nid_ins, "snow_mass", "Snow Mass", "kg/m2",
106 ! . iim, (jjm + 1), nhori, 1, 1, 1, -99,
107 ! . "inst(X)", zsto, zout)
108
109 CALL histdef(nid_ins, "topl", "OLR", "W/m2", &
110 iim, (jjm + 1), nhori, 1, 1, 1, -99, &
111 "inst(X)", zsto, zout)
112
113 CALL histdef(nid_ins, "evap", "Evaporation", "kg/(s*m2)", &
114 iim, (jjm + 1), nhori, 1, 1, 1, -99, &
115 "inst(X)", zsto, zout)
116
117 CALL histdef(nid_ins, "sols", "Solar rad. at surf.", "W/m2", &
118 iim, (jjm + 1), nhori, 1, 1, 1, -99, &
119 "inst(X)", zsto, zout)
120
121 CALL histdef(nid_ins, "soll", "IR rad. at surface", "W/m2", &
122 iim, (jjm + 1), nhori, 1, 1, 1, -99, &
123 "inst(X)", zsto, zout)
124
125 CALL histdef(nid_ins, "solldown", "Down. IR rad. at surface", &
126 "W/m2", iim, (jjm + 1), nhori, 1, 1, 1, -99, &
127 "inst(X)", zsto, zout)
128
129 CALL histdef(nid_ins, "bils", "Surf. total heat flux", "W/m2", &
130 iim, (jjm + 1), nhori, 1, 1, 1, -99, &
131 "inst(X)", zsto, zout)
132
133 CALL histdef(nid_ins, "sens", "Sensible heat flux", "W/m2", &
134 iim, (jjm + 1), nhori, 1, 1, 1, -99, &
135 "inst(X)", zsto, zout)
136
137 CALL histdef(nid_ins, "fder", "Heat flux derivation", "W/m2", &
138 iim, (jjm + 1), nhori, 1, 1, 1, -99, &
139 "inst(X)", zsto, zout)
140
141 CALL histdef(nid_ins, "dtsvdfo", "Boundary-layer dTs(o)", "K/s", &
142 iim, (jjm + 1), nhori, 1, 1, 1, -99, &
143 "inst(X)", zsto, zout)
144
145 CALL histdef(nid_ins, "dtsvdft", "Boundary-layer dTs(t)", "K/s", &
146 iim, (jjm + 1), nhori, 1, 1, 1, -99, &
147 "inst(X)", zsto, zout)
148
149 CALL histdef(nid_ins, "dtsvdfg", "Boundary-layer dTs(g)", "K/s", &
150 iim, (jjm + 1), nhori, 1, 1, 1, -99, &
151 "inst(X)", zsto, zout)
152
153 CALL histdef(nid_ins, "dtsvdfi", "Boundary-layer dTs(g)", "K/s", &
154 iim, (jjm + 1), nhori, 1, 1, 1, -99, &
155 "inst(X)", zsto, zout)
156
157 DO nsrf = 1, nbsrf
158
159 call histdef(nid_ins, "pourc_"//clnsurf(nsrf), &
160 "% "//clnsurf(nsrf), "%", &
161 iim, (jjm + 1), nhori, 1, 1, 1, -99, &
162 "inst(X)", zsto, zout)
163
164 call histdef(nid_ins, "fract_"//clnsurf(nsrf), &
165 "Fraction "//clnsurf(nsrf), "1", &
166 iim, (jjm + 1), nhori, 1, 1, 1, -99, &
167 "inst(X)", zsto, zout)
168
169 call histdef(nid_ins, "sens_"//clnsurf(nsrf), &
170 "Sensible heat flux "//clnsurf(nsrf), "W/m2", &
171 iim, (jjm + 1), nhori, 1, 1, 1, -99, &
172 "inst(X)", zsto, zout)
173
174 call histdef(nid_ins, "tsol_"//clnsurf(nsrf), &
175 "Surface Temperature"//clnsurf(nsrf), "W/m2", &
176 iim, (jjm + 1), nhori, 1, 1, 1, -99, &
177 "inst(X)", zsto, zout)
178
179 call histdef(nid_ins, "lat_"//clnsurf(nsrf), &
180 "Latent heat flux "//clnsurf(nsrf), "W/m2", &
181 iim, (jjm + 1), nhori, 1, 1, 1, -99, &
182 "inst(X)", zsto, zout)
183
184 call histdef(nid_ins, "taux_"//clnsurf(nsrf), &
185 "Zonal wind stress"//clnsurf(nsrf), "Pa", &
186 iim, (jjm + 1), nhori, 1, 1, 1, -99, &
187 "inst(X)", zsto, zout)
188
189 call histdef(nid_ins, "tauy_"//clnsurf(nsrf), &
190 "Meridional xind stress "//clnsurf(nsrf), "Pa", &
191 iim, (jjm + 1), nhori, 1, 1, 1, -99, &
192 "inst(X)", zsto, zout)
193
194 call histdef(nid_ins, "albe_"//clnsurf(nsrf), &
195 "Albedo "//clnsurf(nsrf), "-", &
196 iim, (jjm + 1), nhori, 1, 1, 1, -99, &
197 "inst(X)", zsto, zout)
198
199 call histdef(nid_ins, "rugs_"//clnsurf(nsrf), &
200 "rugosite "//clnsurf(nsrf), "-", &
201 iim, (jjm + 1), nhori, 1, 1, 1, -99, &
202 "inst(X)", zsto, zout)
203 !XXX
204 END DO
205 CALL histdef(nid_ins, "rugs", "rugosity", "-", &
206 iim, (jjm + 1), nhori, 1, 1, 1, -99, &
207 "inst(X)", zsto, zout)
208
209 CALL histdef(nid_ins, "albs", "Surface albedo", "-", &
210 iim, (jjm + 1), nhori, 1, 1, 1, -99, &
211 "inst(X)", zsto, zout)
212
213 CALL histdef(nid_ins, "s_pblh", "Boundary Layer Height", "m", &
214 iim, (jjm + 1), nhori, 1, 1, 1, -99, &
215 "inst(X)", zsto, zout)
216
217 CALL histdef(nid_ins, "s_pblt", "T at Boundary Layer Height", &
218 "K", &
219 iim, (jjm + 1), nhori, 1, 1, 1, -99, &
220 "inst(X)", zsto, zout)
221
222 CALL histdef(nid_ins, "s_lcl", "Condensation level", "m", &
223 iim, (jjm + 1), nhori, 1, 1, 1, -99, &
224 "inst(X)", zsto, zout)
225
226 CALL histdef(nid_ins, "s_capCL", "Conv avlbl pot ener for ABL", "J/m2", &
227 iim, (jjm + 1), nhori, 1, 1, 1, -99, &
228 "inst(X)", zsto, zout)
229
230 CALL histdef(nid_ins, "s_oliqCL", "Liq Water in BL", "kg/m2", &
231 iim, (jjm + 1), nhori, 1, 1, 1, -99, &
232 "inst(X)", zsto, zout)
233
234 CALL histdef(nid_ins, "s_cteiCL", "Instability criteria (ABL)", "K", &
235 iim, (jjm + 1), nhori, 1, 1, 1, -99, &
236 "inst(X)", zsto, zout)
237
238 CALL histdef(nid_ins, "s_therm", "Exces du thermique", "K", &
239 iim, (jjm + 1), nhori, 1, 1, 1, -99, &
240 "inst(X)", zsto, zout)
241
242 CALL histdef(nid_ins, "s_trmb1", "deep_cape(HBTM2)", "J/m2", &
243 iim, (jjm + 1), nhori, 1, 1, 1, -99, &
244 "inst(X)", zsto, zout)
245
246 CALL histdef(nid_ins, "s_trmb2", "inhibition (HBTM2)", "J/m2", &
247 iim, (jjm + 1), nhori, 1, 1, 1, -99, &
248 "inst(X)", zsto, zout)
249
250 CALL histdef(nid_ins, "s_trmb3", "Point Omega (HBTM2)", "m", &
251 iim, (jjm + 1), nhori, 1, 1, 1, -99, &
252 "inst(X)", zsto, zout)
253
254 if (conv_emanuel) CALL histdef(nid_ins, "ptop", "cloud top pressure", &
255 "Pa", iim, jjm + 1, nhori, 1, 1, 1, -99, "inst(X)", zsto, zout)
256
257 ! Champs 3D:
258
259 CALL histdef(nid_ins, "temp", "Temperature", "K", &
260 iim, (jjm + 1), nhori, llm, 1, llm, nvert, &
261 "inst(X)", zsto, zout)
262
263 CALL histdef(nid_ins, "vitu", "Zonal wind", "m/s", &
264 iim, (jjm + 1), nhori, llm, 1, llm, nvert, &
265 "inst(X)", zsto, zout)
266
267 CALL histdef(nid_ins, "vitv", "Merid wind", "m/s", &
268 iim, (jjm + 1), nhori, llm, 1, llm, nvert, &
269 "inst(X)", zsto, zout)
270
271 CALL histdef(nid_ins, "geop", "Geopotential height", "m", &
272 iim, (jjm + 1), nhori, llm, 1, llm, nvert, &
273 "inst(X)", zsto, zout)
274
275 CALL histdef(nid_ins, "pres", "Air pressure", "Pa", &
276 iim, (jjm + 1), nhori, llm, 1, llm, nvert, &
277 "inst(X)", zsto, zout)
278
279 CALL histdef(nid_ins, "dtvdf", "Boundary-layer dT", "K/s", &
280 iim, (jjm + 1), nhori, llm, 1, llm, nvert, &
281 "inst(X)", zsto, zout)
282
283 CALL histdef(nid_ins, "dqvdf", "Boundary-layer dQ", "Kg/Kg/s", &
284 iim, (jjm + 1), nhori, llm, 1, llm, nvert, &
285 "inst(X)", zsto, zout)
286
287 CALL histdef(nid_ins, "zmasse", "column density of air in cell", &
288 "kg m-2", iim, jjm + 1, nhori, llm, 1, llm, nvert, "inst(X)", &
289 zsto, zout)
290
291 CALL histdef(nid_ins, "rhum", "Relative humidity", &
292 "", iim, jjm + 1, nhori, llm, 1, llm, nvert, "inst(X)", &
293 zsto, zout)
294
295 DO it = 1, nqmx - 2
296 ! champ 2D
297 iq=it+2
298 CALL histdef(nid_ins, tname(iq), ttext(iq), "U/kga", iim, jjm+1, &
299 nhori, llm, 1, llm, nvert, "inst(X)", zsto, zout)
300 CALL histdef(nid_ins, "fl"//tname(iq), "Flux "//ttext(iq), &
301 "U/m2/s", iim, jjm+1, nhori, llm, 1, llm, nvert, &
302 "inst(X)", zsto, zout)
303
304 !---Ajout Olivia
305 CALL histdef(nid_ins, "d_tr_th_"//tname(iq), &
306 "tendance thermique"// ttext(iq), "?", &
307 iim, jjm+1, nhori, llm, 1, llm, nvert, &
308 "inst(X)", zsto, zout)
309 CALL histdef(nid_ins, "d_tr_cv_"//tname(iq), &
310 "tendance convection"// ttext(iq), "?", &
311 iim, jjm+1, nhori, llm, 1, llm, nvert, &
312 "inst(X)", zsto, zout)
313 CALL histdef(nid_ins, "d_tr_cl_"//tname(iq), &
314 "tendance couche limite"// ttext(iq), "?", &
315 iim, jjm+1, nhori, llm, 1, llm, nvert, &
316 "inst(X)", zsto, zout)
317 !---fin Olivia
318
319 ENDDO
320
321 CALL histend(nid_ins)
322 ENDIF
323
324 end subroutine ini_histins
325
326 end module ini_histins_m

  ViewVC Help
Powered by ViewVC 1.1.21