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