1 |
guez |
3 |
! |
2 |
|
|
! $Header: /home/cvsroot/LMDZ4/libf/phylmd/initphysto.F,v 1.2 2004/06/22 11:45:32 lmdzadmin Exp $ |
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 |
|
|
use dimens_m |
13 |
|
|
use paramet_m |
14 |
|
|
use comconst |
15 |
|
|
use indicesol |
16 |
|
|
use dimphy |
17 |
|
|
use logic |
18 |
|
|
use comgeom |
19 |
|
|
use serre |
20 |
|
|
use temps |
21 |
|
|
use ener |
22 |
|
|
implicit none |
23 |
|
|
|
24 |
|
|
C |
25 |
|
|
C Routine d'initialisation des ecritures des fichiers histoires LMDZ |
26 |
|
|
C au format IOIPSL |
27 |
|
|
C |
28 |
|
|
C Appels succesifs des routines: histbeg |
29 |
|
|
C histhori |
30 |
|
|
C histver |
31 |
|
|
C histdef |
32 |
|
|
C histend |
33 |
|
|
C |
34 |
|
|
C Entree: |
35 |
|
|
C |
36 |
|
|
C infile: nom du fichier histoire a creer |
37 |
|
|
C day0,anne0: date de reference |
38 |
|
|
C tstep: duree du pas de temps en seconde |
39 |
|
|
C t_ops: frequence de l'operation pour IOIPSL |
40 |
|
|
C t_wrt: frequence d'ecriture sur le fichier |
41 |
|
|
C nq: nombre de traceurs |
42 |
|
|
C |
43 |
|
|
C Sortie: |
44 |
|
|
C fileid: ID du fichier netcdf cree |
45 |
|
|
C filevid:ID du fichier netcdf pour la grille v |
46 |
|
|
C |
47 |
|
|
C L. Fairhead, LMD, 03/99 |
48 |
|
|
C |
49 |
|
|
C ===================================================================== |
50 |
|
|
C |
51 |
|
|
C Declarations |
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, intent(in):: 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 = annee_ref |
87 |
|
|
idayref = day_ref |
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_totreg(infile, iim, zx_lon(:,1), jjm+1, zx_lat(1,:), |
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 |
|
|
c abderrahmane le 16 09 02 |
193 |
|
|
call histdef(fileid, "fm_th", " ", " ", |
194 |
|
|
. iim, jjm+1, nhoriid, llm, 1, llm, zvertiid, |
195 |
|
|
. 32, "inst(X)", t_ops, t_wrt) |
196 |
|
|
|
197 |
|
|
call histdef(fileid, "en_th", " ", " ", |
198 |
|
|
. iim, jjm+1, nhoriid, llm, 1, llm, zvertiid, |
199 |
|
|
. 32, "inst(X)", t_ops, t_wrt) |
200 |
|
|
c fin aj |
201 |
|
|
|
202 |
|
|
write(*,*) 'apres coefh ds initphysto' |
203 |
|
|
|
204 |
|
|
call histdef(fileid, 'frac_impa', ' ', ' ', |
205 |
|
|
. iim, jjm+1, nhoriid, llm, 1, llm, zvertiid, |
206 |
|
|
. 32, 'inst(X)', t_ops, t_wrt) |
207 |
|
|
|
208 |
|
|
call histdef(fileid, 'frac_nucl', ' ', ' ', |
209 |
|
|
. iim, jjm+1, nhoriid, llm, 1, llm, zvertiid, |
210 |
|
|
. 32, 'inst(X)', t_ops, t_wrt) |
211 |
|
|
|
212 |
|
|
c |
213 |
|
|
c pyu1 |
214 |
|
|
c |
215 |
|
|
CALL histdef(fileid, "pyu1", " ", " ", |
216 |
|
|
. iim,jjm+1,nhoriid, 1,1,1, -99, 32, |
217 |
|
|
. "inst(X)", t_ops, t_wrt) |
218 |
|
|
|
219 |
|
|
c |
220 |
|
|
c pyv1 |
221 |
|
|
c |
222 |
|
|
CALL histdef(fileid, "pyv1", " ", " ", |
223 |
|
|
. iim,jjm+1,nhoriid, 1,1,1, -99, 32, |
224 |
|
|
. "inst(X)", t_ops, t_wrt) |
225 |
|
|
|
226 |
|
|
write(*,*) 'apres pyv1 ds initphysto' |
227 |
|
|
c |
228 |
|
|
c ftsol1 |
229 |
|
|
c |
230 |
|
|
call histdef(fileid, "ftsol1", " ", " ", |
231 |
|
|
. iim, jjm+1, nhoriid, 1, 1,1, -99,32, |
232 |
|
|
. "inst(X)", t_ops, t_wrt) |
233 |
|
|
|
234 |
|
|
c |
235 |
|
|
c ftsol2 |
236 |
|
|
c |
237 |
|
|
call histdef(fileid, "ftsol2", " ", " ", |
238 |
|
|
. iim, jjm+1, nhoriid, 1, 1,1, -99,32, |
239 |
|
|
. "inst(X)", t_ops, t_wrt) |
240 |
|
|
|
241 |
|
|
c |
242 |
|
|
c ftsol3 |
243 |
|
|
c |
244 |
|
|
call histdef(fileid, "ftsol3", " ", " ", |
245 |
|
|
. iim, jjm+1, nhoriid, 1, 1,1, -99, |
246 |
|
|
. 32, "inst(X)", t_ops, t_wrt) |
247 |
|
|
|
248 |
|
|
c |
249 |
|
|
c ftsol4 |
250 |
|
|
c |
251 |
|
|
call histdef(fileid, "ftsol4", " ", " ", |
252 |
|
|
. iim, jjm+1, nhoriid, 1, 1,1, -99, |
253 |
|
|
. 32, "inst(X)", t_ops, t_wrt) |
254 |
|
|
|
255 |
|
|
c |
256 |
|
|
c rain |
257 |
|
|
c |
258 |
|
|
call histdef(fileid, "rain", " ", " ", |
259 |
|
|
. iim, jjm+1, nhoriid, 1, 1,1, -99, |
260 |
|
|
. 32, "inst(X)", t_ops, t_wrt) |
261 |
|
|
|
262 |
|
|
c |
263 |
|
|
c psrf1 |
264 |
|
|
c |
265 |
|
|
call histdef(fileid, "psrf1", " ", " ", |
266 |
|
|
. iim, jjm+1, nhoriid, 1, 1, 1, -99, |
267 |
|
|
. 32, "inst(X)", t_ops, t_wrt) |
268 |
|
|
|
269 |
|
|
c |
270 |
|
|
c psrf2 |
271 |
|
|
c |
272 |
|
|
call histdef(fileid, "psrf2", " ", " ", |
273 |
|
|
. iim, jjm+1, nhoriid, 1, 1, 1, -99, |
274 |
|
|
. 32, "inst(X)", t_ops, t_wrt) |
275 |
|
|
|
276 |
|
|
c |
277 |
|
|
c psrf3 |
278 |
|
|
c |
279 |
|
|
call histdef(fileid, "psrf3", " ", " ", |
280 |
|
|
. iim, jjm+1, nhoriid, 1, 1, 1, -99, |
281 |
|
|
. 32, "inst(X)", t_ops, t_wrt) |
282 |
|
|
|
283 |
|
|
c |
284 |
|
|
c psrf4 |
285 |
|
|
c |
286 |
|
|
call histdef(fileid, "psrf4", " ", " ", |
287 |
|
|
. iim, jjm+1, nhoriid, 1, 1, 1, -99, |
288 |
|
|
. 32, "inst(X)", t_ops, t_wrt) |
289 |
|
|
|
290 |
|
|
write(*,*) 'avant histend ds initphysto' |
291 |
|
|
|
292 |
|
|
call histend(fileid) |
293 |
|
|
c if (ok_sync) call histsync(fileid) |
294 |
|
|
if (ok_sync) call histsync |
295 |
|
|
|
296 |
|
|
|
297 |
|
|
|
298 |
|
|
return |
299 |
|
|
end |