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