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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 159 - (hide annotations)
Tue Jul 21 15:29:52 2015 UTC (8 years, 10 months ago) by guez
File size: 12323 byte(s)
Write variables from phytrac to "histins.nc" instead of
"histrac.nc". The idea is to have different output files only if they
have different coordinates, and not according to content (following LMDZ).

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

  ViewVC Help
Powered by ViewVC 1.1.21