1 | ! |
---|
2 | ! $Id: initphysto.F 1299 2010-01-20 14:27:21Z lguez $ |
---|
3 | ! |
---|
4 | C |
---|
5 | C |
---|
6 | subroutine initphysto |
---|
7 | . (infile, |
---|
8 | . rlon, rlat, tstep,t_ops,t_wrt,nq,fileid) |
---|
9 | |
---|
10 | USE dimphy |
---|
11 | USE mod_phys_lmdz_para |
---|
12 | USE IOIPSL |
---|
13 | USE iophy |
---|
14 | USE control_mod |
---|
15 | |
---|
16 | implicit none |
---|
17 | |
---|
18 | C |
---|
19 | C Routine d'initialisation des ecritures des fichiers histoires LMDZ |
---|
20 | C au format IOIPSL |
---|
21 | C |
---|
22 | C Appels succesifs des routines: histbeg |
---|
23 | C histhori |
---|
24 | C histver |
---|
25 | C histdef |
---|
26 | C histend |
---|
27 | C |
---|
28 | C Entree: |
---|
29 | C |
---|
30 | C infile: nom du fichier histoire a creer |
---|
31 | C day0,anne0: date de reference |
---|
32 | C tstep: duree du pas de temps en seconde |
---|
33 | C t_ops: frequence de l'operation pour IOIPSL |
---|
34 | C t_wrt: frequence d'ecriture sur le fichier |
---|
35 | C nq: nombre de traceurs |
---|
36 | C |
---|
37 | C Sortie: |
---|
38 | C fileid: ID du fichier netcdf cree |
---|
39 | C filevid:ID du fichier netcdf pour la grille v |
---|
40 | C |
---|
41 | C L. Fairhead, LMD, 03/99 |
---|
42 | C |
---|
43 | C ===================================================================== |
---|
44 | C |
---|
45 | C Declarations |
---|
46 | #include "dimensions.h" |
---|
47 | #include "paramet.h" |
---|
48 | #include "comconst.h" |
---|
49 | #include "comgeom.h" |
---|
50 | #include "temps.h" |
---|
51 | #include "ener.h" |
---|
52 | #include "logic.h" |
---|
53 | #include "description.h" |
---|
54 | #include "serre.h" |
---|
55 | #include "indicesol.h" |
---|
56 | cym#include "dimphy.h" |
---|
57 | |
---|
58 | C Arguments |
---|
59 | character*(*) infile |
---|
60 | integer nhoriid, i |
---|
61 | real tstep, t_ops, t_wrt |
---|
62 | integer fileid, filevid |
---|
63 | integer nq,l |
---|
64 | real nivsigs(llm) |
---|
65 | |
---|
66 | C Variables locales |
---|
67 | C |
---|
68 | integer tau0 |
---|
69 | real zjulian |
---|
70 | character*3 str |
---|
71 | character*10 ctrac |
---|
72 | integer iq |
---|
73 | integer uhoriid, vhoriid, thoriid, zvertiid |
---|
74 | integer ii,jj |
---|
75 | integer zan, idayref |
---|
76 | logical ok_sync |
---|
77 | REAL zx_lon(iim,jjm+1), zx_lat(iim,jjm+1) |
---|
78 | C |
---|
79 | REAL rlon(klon), rlat(klon) |
---|
80 | |
---|
81 | C Initialisations |
---|
82 | C |
---|
83 | pi = 4. * atan (1.) |
---|
84 | str='q ' |
---|
85 | ctrac = 'traceur ' |
---|
86 | ok_sync= .true. |
---|
87 | C |
---|
88 | C Appel a histbeg: creation du fichier netcdf et initialisations diverses |
---|
89 | C |
---|
90 | |
---|
91 | zan = annee_ref |
---|
92 | idayref = day_ref |
---|
93 | CALL ymds2ju(zan, 1, idayref, 0.0, zjulian) |
---|
94 | tau0 = 0 |
---|
95 | |
---|
96 | cym CALL gr_fi_ecrit(1,klon,iim,jjm+1,rlon,zx_lon) |
---|
97 | cym DO i = 1, iim |
---|
98 | cym zx_lon(i,1) = rlon(i+1) |
---|
99 | cym zx_lon(i,jjm+1) = rlon(i+1) |
---|
100 | cym ENDDO |
---|
101 | cym CALL gr_fi_ecrit(1,klon,iim,jjm+1,rlat,zx_lat) |
---|
102 | |
---|
103 | |
---|
104 | call histbeg_phy(infile,tau0, zjulian, tstep, |
---|
105 | . nhoriid, fileid) |
---|
106 | |
---|
107 | c$OMP MASTER |
---|
108 | C Appel a histvert pour la grille verticale |
---|
109 | C |
---|
110 | DO l=1,llm |
---|
111 | nivsigs(l)=REAL(l) |
---|
112 | ENDDO |
---|
113 | |
---|
114 | write(*,*) 'avant histvert ds initphysto' |
---|
115 | |
---|
116 | call histvert(fileid, 'sig_s', 'Niveaux sigma', |
---|
117 | . 'sigma_level', |
---|
118 | . llm, nivsigs, zvertiid) |
---|
119 | C |
---|
120 | C Appels a histdef pour la definition des variables a sauvegarder |
---|
121 | C |
---|
122 | write(*,*) 'apres histvert ds initphysto' |
---|
123 | |
---|
124 | CALL histdef(fileid, "phis", "Surface geop. height", "-", |
---|
125 | . iim,jj_nb,nhoriid, 1,1,1, -99, 32, |
---|
126 | . "once", t_ops, t_wrt) |
---|
127 | c |
---|
128 | write(*,*) 'apres phis ds initphysto' |
---|
129 | |
---|
130 | CALL histdef(fileid, "aire", "Grid area", "-", |
---|
131 | . iim,jj_nb,nhoriid, 1,1,1, -99, 32, |
---|
132 | . "once", t_ops, t_wrt) |
---|
133 | write(*,*) 'apres aire ds initphysto' |
---|
134 | |
---|
135 | cym Attention dtime et istphy ne sont pas �rit ---> a �iminer ? |
---|
136 | CALL histdef(fileid, "dtime", "tps phys ", "s", |
---|
137 | . 1,1,nhoriid, 1,1,1, -99, 32, |
---|
138 | . "once", t_ops, t_wrt) |
---|
139 | |
---|
140 | CALL histdef(fileid, "istphy", "tps stock", "s", |
---|
141 | . 1,1,nhoriid, 1,1,1, -99, 32, |
---|
142 | . "once", t_ops, t_wrt) |
---|
143 | |
---|
144 | C T |
---|
145 | C |
---|
146 | call histdef(fileid, 't', 'Temperature', 'K', |
---|
147 | . iim, jj_nb, nhoriid, llm, 1, llm, zvertiid, |
---|
148 | . 32, 'inst(X)', t_ops, t_wrt) |
---|
149 | write(*,*) 'apres t ds initphysto' |
---|
150 | C mfu |
---|
151 | C |
---|
152 | call histdef(fileid, 'mfu', 'flx m. pan. mt', 'kg m/s', |
---|
153 | . iim, jj_nb, nhoriid, llm, 1, llm, zvertiid, |
---|
154 | . 32, 'inst(X)', t_ops, t_wrt) |
---|
155 | write(*,*) 'apres mfu ds initphysto' |
---|
156 | C |
---|
157 | C mfd |
---|
158 | C |
---|
159 | call histdef(fileid, 'mfd', 'flx m. pan. des', 'kg m/s', |
---|
160 | . iim, jj_nb, nhoriid, llm, 1, llm, zvertiid, |
---|
161 | . 32, 'inst(X)', t_ops, t_wrt) |
---|
162 | |
---|
163 | C |
---|
164 | C en_u |
---|
165 | C |
---|
166 | call histdef(fileid, 'en_u', 'flx ent pan mt', 'kg m/s', |
---|
167 | . iim, jj_nb, nhoriid, llm, 1, llm, zvertiid, |
---|
168 | . 32, 'inst(X)', t_ops, t_wrt) |
---|
169 | write(*,*) 'apres en_u ds initphysto' |
---|
170 | C |
---|
171 | C de_u |
---|
172 | C |
---|
173 | call histdef(fileid, 'de_u', 'flx det pan mt', 'kg m/s', |
---|
174 | . iim, jj_nb, nhoriid, llm, 1, llm, zvertiid, |
---|
175 | . 32, 'inst(X)', t_ops, t_wrt) |
---|
176 | |
---|
177 | C |
---|
178 | C en_d |
---|
179 | C |
---|
180 | call histdef(fileid, 'en_d', 'flx ent pan dt', 'kg m/s', |
---|
181 | . iim, jj_nb, nhoriid, llm, 1, llm, zvertiid, |
---|
182 | . 32, 'inst(X)', t_ops, t_wrt) |
---|
183 | C |
---|
184 | |
---|
185 | C |
---|
186 | C de_d |
---|
187 | C |
---|
188 | call histdef(fileid, 'de_d', 'flx det pan dt', 'kg m/s', |
---|
189 | . iim, jj_nb, nhoriid, llm, 1, llm, zvertiid, |
---|
190 | . 32, 'inst(X)', t_ops, t_wrt) |
---|
191 | |
---|
192 | c coefh frac_impa,frac_nucl |
---|
193 | |
---|
194 | call histdef(fileid, "coefh", " ", " ", |
---|
195 | . iim, jj_nb, nhoriid, llm, 1, llm, zvertiid, |
---|
196 | . 32, "inst(X)", t_ops, t_wrt) |
---|
197 | |
---|
198 | c abderrahmane le 16 09 02 |
---|
199 | call histdef(fileid, "fm_th", " ", " ", |
---|
200 | . iim, jj_nb, nhoriid, llm, 1, llm, zvertiid, |
---|
201 | . 32, "inst(X)", t_ops, t_wrt) |
---|
202 | |
---|
203 | call histdef(fileid, "en_th", " ", " ", |
---|
204 | . iim, jj_nb, nhoriid, llm, 1, llm, zvertiid, |
---|
205 | . 32, "inst(X)", t_ops, t_wrt) |
---|
206 | c fin aj |
---|
207 | |
---|
208 | write(*,*) 'apres coefh ds initphysto' |
---|
209 | |
---|
210 | call histdef(fileid, 'frac_impa', ' ', ' ', |
---|
211 | . iim, jj_nb, nhoriid, llm, 1, llm, zvertiid, |
---|
212 | . 32, 'inst(X)', t_ops, t_wrt) |
---|
213 | |
---|
214 | call histdef(fileid, 'frac_nucl', ' ', ' ', |
---|
215 | . iim, jj_nb, nhoriid, llm, 1, llm, zvertiid, |
---|
216 | . 32, 'inst(X)', t_ops, t_wrt) |
---|
217 | |
---|
218 | c |
---|
219 | c pyu1 |
---|
220 | c |
---|
221 | CALL histdef(fileid, "pyu1", " ", " ", |
---|
222 | . iim,jj_nb,nhoriid, 1,1,1, -99, 32, |
---|
223 | . "inst(X)", t_ops, t_wrt) |
---|
224 | |
---|
225 | c |
---|
226 | c pyv1 |
---|
227 | c |
---|
228 | CALL histdef(fileid, "pyv1", " ", " ", |
---|
229 | . iim,jj_nb,nhoriid, 1,1,1, -99, 32, |
---|
230 | . "inst(X)", t_ops, t_wrt) |
---|
231 | |
---|
232 | write(*,*) 'apres pyv1 ds initphysto' |
---|
233 | c |
---|
234 | c ftsol1 |
---|
235 | c |
---|
236 | call histdef(fileid, "ftsol1", " ", " ", |
---|
237 | . iim, jj_nb, nhoriid, 1, 1,1, -99,32, |
---|
238 | . "inst(X)", t_ops, t_wrt) |
---|
239 | |
---|
240 | c |
---|
241 | c ftsol2 |
---|
242 | c |
---|
243 | call histdef(fileid, "ftsol2", " ", " ", |
---|
244 | . iim, jj_nb, nhoriid, 1, 1,1, -99,32, |
---|
245 | . "inst(X)", t_ops, t_wrt) |
---|
246 | |
---|
247 | c |
---|
248 | c ftsol3 |
---|
249 | c |
---|
250 | call histdef(fileid, "ftsol3", " ", " ", |
---|
251 | . iim, jj_nb, nhoriid, 1, 1,1, -99, |
---|
252 | . 32, "inst(X)", t_ops, t_wrt) |
---|
253 | |
---|
254 | c |
---|
255 | c ftsol4 |
---|
256 | c |
---|
257 | call histdef(fileid, "ftsol4", " ", " ", |
---|
258 | . iim, jj_nb, nhoriid, 1, 1,1, -99, |
---|
259 | . 32, "inst(X)", t_ops, t_wrt) |
---|
260 | |
---|
261 | c |
---|
262 | c rain |
---|
263 | c |
---|
264 | call histdef(fileid, "rain", " ", " ", |
---|
265 | . iim, jj_nb, nhoriid, 1, 1,1, -99, |
---|
266 | . 32, "inst(X)", t_ops, t_wrt) |
---|
267 | |
---|
268 | c |
---|
269 | c psrf1 |
---|
270 | c |
---|
271 | call histdef(fileid, "psrf1", " ", " ", |
---|
272 | . iim, jj_nb, nhoriid, 1, 1, 1, -99, |
---|
273 | . 32, "inst(X)", t_ops, t_wrt) |
---|
274 | |
---|
275 | c |
---|
276 | c psrf2 |
---|
277 | c |
---|
278 | call histdef(fileid, "psrf2", " ", " ", |
---|
279 | . iim, jj_nb, nhoriid, 1, 1, 1, -99, |
---|
280 | . 32, "inst(X)", t_ops, t_wrt) |
---|
281 | |
---|
282 | c |
---|
283 | c psrf3 |
---|
284 | c |
---|
285 | call histdef(fileid, "psrf3", " ", " ", |
---|
286 | . iim, jj_nb, nhoriid, 1, 1, 1, -99, |
---|
287 | . 32, "inst(X)", t_ops, t_wrt) |
---|
288 | |
---|
289 | c |
---|
290 | c psrf4 |
---|
291 | c |
---|
292 | call histdef(fileid, "psrf4", " ", " ", |
---|
293 | . iim, jj_nb, nhoriid, 1, 1, 1, -99, |
---|
294 | . 32, "inst(X)", t_ops, t_wrt) |
---|
295 | |
---|
296 | write(*,*) 'avant histend ds initphysto' |
---|
297 | |
---|
298 | call histend(fileid) |
---|
299 | c if (ok_sync) call histsync(fileid) |
---|
300 | if (ok_sync) call histsync |
---|
301 | c$OMP END MASTER |
---|
302 | |
---|
303 | |
---|
304 | return |
---|
305 | end |
---|