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