1 | ! |
---|
2 | ! $Header: /home/cvsroot/LMDZ4/libf/phylmd/phyredem.F,v 1.2 2004/06/22 11:45:34 lmdzadmin Exp $ |
---|
3 | ! |
---|
4 | c |
---|
5 | SUBROUTINE phyredem (fichnom,dtime,radpas, |
---|
6 | . rlat,rlon, tsol,tsoil, |
---|
7 | . albedo, |
---|
8 | . solsw, sollw,fder, |
---|
9 | . radsol, |
---|
10 | . zmea, zstd, zsig, zgam, zthe, zpic, zval, |
---|
11 | . t_ancien) |
---|
12 | |
---|
13 | USE control_mod |
---|
14 | IMPLICIT none |
---|
15 | c====================================================================== |
---|
16 | c Auteur(s) Z.X. Li (LMD/CNRS) date: 19930818 |
---|
17 | c Objet: Ecriture de l'etat de redemarrage pour la physique |
---|
18 | c====================================================================== |
---|
19 | #include "dimensions.h" |
---|
20 | #include "dimphy.h" |
---|
21 | #include "netcdf.inc" |
---|
22 | #include "dimsoil.h" |
---|
23 | #include "clesphys.h" |
---|
24 | #include "temps.h" |
---|
25 | c====================================================================== |
---|
26 | CHARACTER*13 fichnom |
---|
27 | REAL dtime |
---|
28 | INTEGER radpas |
---|
29 | REAL rlat(klon), rlon(klon) |
---|
30 | REAL tsol(klon) |
---|
31 | REAL tsoil(klon,nsoilmx) |
---|
32 | REAL albedo(klon) |
---|
33 | real solsw(klon) |
---|
34 | real sollw(klon) |
---|
35 | real fder(klon) |
---|
36 | REAL radsol(klon) |
---|
37 | REAL zmea(klon), zstd(klon) |
---|
38 | REAL zsig(klon), zgam(klon), zthe(klon) |
---|
39 | REAL zpic(klon), zval(klon) |
---|
40 | REAL t_ancien(klon,klev) |
---|
41 | c |
---|
42 | INTEGER nid, nvarid, idim1, idim2, idim3 |
---|
43 | INTEGER ierr |
---|
44 | INTEGER length |
---|
45 | PARAMETER (length=100) |
---|
46 | REAL tab_cntrl(length) |
---|
47 | c |
---|
48 | INTEGER isoil |
---|
49 | CHARACTER*2 str2 |
---|
50 | c |
---|
51 | c print*,'fichnom',fichnom |
---|
52 | ierr = NF_CREATE(fichnom, NF_CLOBBER, nid) |
---|
53 | IF (ierr.NE.NF_NOERR) THEN |
---|
54 | write(6,*)' Pb d''ouverture du fichier '//fichnom |
---|
55 | write(6,*)' ierr = ', ierr |
---|
56 | CALL ABORT |
---|
57 | ENDIF |
---|
58 | c |
---|
59 | ierr = NF_PUT_ATT_TEXT (nid, NF_GLOBAL, "title", 28, |
---|
60 | . "Fichier redemarrage physique") |
---|
61 | c |
---|
62 | ierr = NF_DEF_DIM (nid, "index", length, idim1) |
---|
63 | ierr = NF_DEF_DIM (nid, "points_physiques", klon, idim2) |
---|
64 | ierr = NF_DEF_DIM (nid, "horizon_vertical", klon*klev, idim3) |
---|
65 | c |
---|
66 | ierr = NF_ENDDEF(nid) |
---|
67 | c |
---|
68 | DO ierr = 1, length |
---|
69 | tab_cntrl(ierr) = 0.0 |
---|
70 | ENDDO |
---|
71 | tab_cntrl(1) = dtime |
---|
72 | tab_cntrl(2) = radpas |
---|
73 | tab_cntrl(3) = 0.0 |
---|
74 | tab_cntrl(4) = solaire |
---|
75 | tab_cntrl(5) = 0 |
---|
76 | tab_cntrl(6) = nbapp_rad |
---|
77 | |
---|
78 | IF( cycle_diurne ) tab_cntrl( 7 ) = 1. |
---|
79 | IF( soil_model ) tab_cntrl( 8 ) = 1. |
---|
80 | IF( new_oliq ) tab_cntrl( 9 ) = 1. |
---|
81 | IF( ok_orodr ) tab_cntrl(10 ) = 1. |
---|
82 | IF( ok_orolf ) tab_cntrl(11 ) = 1. |
---|
83 | IF( ok_gw_nonoro ) tab_cntrl(12 ) = 1. |
---|
84 | |
---|
85 | tab_cntrl(13) = day_end |
---|
86 | tab_cntrl(14) = annee_ref |
---|
87 | tab_cntrl(15) = itau_phy |
---|
88 | c |
---|
89 | ierr = NF_REDEF (nid) |
---|
90 | #ifdef NC_DOUBLE |
---|
91 | ierr = NF_DEF_VAR (nid, "controle", NF_DOUBLE, 1, idim1,nvarid) |
---|
92 | #else |
---|
93 | ierr = NF_DEF_VAR (nid, "controle", NF_FLOAT, 1, idim1,nvarid) |
---|
94 | #endif |
---|
95 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 22, |
---|
96 | . "Parametres de controle") |
---|
97 | ierr = NF_ENDDEF(nid) |
---|
98 | #ifdef NC_DOUBLE |
---|
99 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,tab_cntrl) |
---|
100 | #else |
---|
101 | ierr = NF_PUT_VAR_REAL (nid,nvarid,tab_cntrl) |
---|
102 | #endif |
---|
103 | c |
---|
104 | ierr = NF_REDEF (nid) |
---|
105 | #ifdef NC_DOUBLE |
---|
106 | ierr = NF_DEF_VAR (nid, "longitude", NF_DOUBLE, 1, idim2,nvarid) |
---|
107 | #else |
---|
108 | ierr = NF_DEF_VAR (nid, "longitude", NF_FLOAT, 1, idim2,nvarid) |
---|
109 | #endif |
---|
110 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 32, |
---|
111 | . "Longitudes de la grille physique") |
---|
112 | ierr = NF_ENDDEF(nid) |
---|
113 | #ifdef NC_DOUBLE |
---|
114 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,rlon) |
---|
115 | #else |
---|
116 | ierr = NF_PUT_VAR_REAL (nid,nvarid,rlon) |
---|
117 | #endif |
---|
118 | c |
---|
119 | ierr = NF_REDEF (nid) |
---|
120 | #ifdef NC_DOUBLE |
---|
121 | ierr = NF_DEF_VAR (nid, "latitude", NF_DOUBLE, 1, idim2,nvarid) |
---|
122 | #else |
---|
123 | ierr = NF_DEF_VAR (nid, "latitude", NF_FLOAT, 1, idim2,nvarid) |
---|
124 | #endif |
---|
125 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 31, |
---|
126 | . "Latitudes de la grille physique") |
---|
127 | ierr = NF_ENDDEF(nid) |
---|
128 | #ifdef NC_DOUBLE |
---|
129 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,rlat) |
---|
130 | #else |
---|
131 | ierr = NF_PUT_VAR_REAL (nid,nvarid,rlat) |
---|
132 | #endif |
---|
133 | c |
---|
134 | ierr = NF_REDEF (nid) |
---|
135 | #ifdef NC_DOUBLE |
---|
136 | ierr = NF_DEF_VAR (nid, "TS", NF_DOUBLE, 1, idim2,nvarid) |
---|
137 | #else |
---|
138 | ierr = NF_DEF_VAR (nid, "TS", NF_FLOAT, 1, idim2,nvarid) |
---|
139 | #endif |
---|
140 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 22, |
---|
141 | . "Temperature de surface") |
---|
142 | ierr = NF_ENDDEF(nid) |
---|
143 | #ifdef NC_DOUBLE |
---|
144 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,tsol(1)) |
---|
145 | #else |
---|
146 | ierr = NF_PUT_VAR_REAL (nid,nvarid,tsol(1)) |
---|
147 | #endif |
---|
148 | c |
---|
149 | DO isoil=1, nsoilmx |
---|
150 | IF (isoil.LE.99) THEN |
---|
151 | WRITE(str2,'(i2.2)') isoil |
---|
152 | ierr = NF_REDEF (nid) |
---|
153 | #ifdef NC_DOUBLE |
---|
154 | ierr = NF_DEF_VAR (nid, "Tsoil"//str2,NF_DOUBLE,1,idim2,nvarid) |
---|
155 | #else |
---|
156 | ierr = NF_DEF_VAR (nid, "Tsoil"//str2,NF_FLOAT,1,idim2,nvarid) |
---|
157 | #endif |
---|
158 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 24, |
---|
159 | . "Temperature du sol No."//str2) |
---|
160 | ierr = NF_ENDDEF(nid) |
---|
161 | ELSE |
---|
162 | PRINT*, "Trop de couches" |
---|
163 | CALL abort |
---|
164 | ENDIF |
---|
165 | #ifdef NC_DOUBLE |
---|
166 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,tsoil(1,isoil)) |
---|
167 | #else |
---|
168 | ierr = NF_PUT_VAR_REAL (nid,nvarid,tsoil(1,isoil)) |
---|
169 | #endif |
---|
170 | ENDDO |
---|
171 | c |
---|
172 | ierr = NF_REDEF (nid) |
---|
173 | #ifdef NC_DOUBLE |
---|
174 | ierr = NF_DEF_VAR (nid,"ALBE",NF_DOUBLE,1,idim2,nvarid) |
---|
175 | #else |
---|
176 | ierr = NF_DEF_VAR (nid,"ALBE",NF_FLOAT,1,idim2,nvarid) |
---|
177 | #endif |
---|
178 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 18, |
---|
179 | . "albedo de surface") |
---|
180 | ierr = NF_ENDDEF(nid) |
---|
181 | #ifdef NC_DOUBLE |
---|
182 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,albedo(1)) |
---|
183 | #else |
---|
184 | ierr = NF_PUT_VAR_REAL (nid,nvarid,albedo(1)) |
---|
185 | #endif |
---|
186 | c |
---|
187 | ierr = NF_REDEF (nid) |
---|
188 | #ifdef NC_DOUBLE |
---|
189 | ierr = NF_DEF_VAR (nid, "solsw", NF_DOUBLE, 1, idim2,nvarid) |
---|
190 | #else |
---|
191 | ierr = NF_DEF_VAR (nid, "solsw", NF_FLOAT, 1, idim2,nvarid) |
---|
192 | #endif |
---|
193 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 32, |
---|
194 | . "Rayonnement solaire a la surface") |
---|
195 | ierr = NF_ENDDEF(nid) |
---|
196 | #ifdef NC_DOUBLE |
---|
197 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,solsw) |
---|
198 | #else |
---|
199 | ierr = NF_PUT_VAR_REAL (nid,nvarid,solsw) |
---|
200 | #endif |
---|
201 | c |
---|
202 | ierr = NF_REDEF (nid) |
---|
203 | #ifdef NC_DOUBLE |
---|
204 | ierr = NF_DEF_VAR (nid, "sollw", NF_DOUBLE, 1, idim2,nvarid) |
---|
205 | #else |
---|
206 | ierr = NF_DEF_VAR (nid, "sollw", NF_FLOAT, 1, idim2,nvarid) |
---|
207 | #endif |
---|
208 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 27, |
---|
209 | . "Rayonnement IF a la surface") |
---|
210 | ierr = NF_ENDDEF(nid) |
---|
211 | #ifdef NC_DOUBLE |
---|
212 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,sollw) |
---|
213 | #else |
---|
214 | ierr = NF_PUT_VAR_REAL (nid,nvarid,sollw) |
---|
215 | #endif |
---|
216 | c |
---|
217 | ierr = NF_REDEF (nid) |
---|
218 | #ifdef NC_DOUBLE |
---|
219 | ierr = NF_DEF_VAR (nid, "fder", NF_DOUBLE, 1, idim2,nvarid) |
---|
220 | #else |
---|
221 | ierr = NF_DEF_VAR (nid, "fder", NF_FLOAT, 1, idim2,nvarid) |
---|
222 | #endif |
---|
223 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 14, |
---|
224 | . "Derive de flux") |
---|
225 | ierr = NF_ENDDEF(nid) |
---|
226 | #ifdef NC_DOUBLE |
---|
227 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,fder) |
---|
228 | #else |
---|
229 | ierr = NF_PUT_VAR_REAL (nid,nvarid,fder) |
---|
230 | #endif |
---|
231 | c |
---|
232 | ierr = NF_REDEF (nid) |
---|
233 | #ifdef NC_DOUBLE |
---|
234 | ierr = NF_DEF_VAR (nid, "RADS", NF_DOUBLE, 1, idim2,nvarid) |
---|
235 | #else |
---|
236 | ierr = NF_DEF_VAR (nid, "RADS", NF_FLOAT, 1, idim2,nvarid) |
---|
237 | #endif |
---|
238 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 28, |
---|
239 | . "Rayonnement net a la surface") |
---|
240 | ierr = NF_ENDDEF(nid) |
---|
241 | #ifdef NC_DOUBLE |
---|
242 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,radsol) |
---|
243 | #else |
---|
244 | ierr = NF_PUT_VAR_REAL (nid,nvarid,radsol) |
---|
245 | #endif |
---|
246 | c |
---|
247 | ierr = NF_REDEF (nid) |
---|
248 | #ifdef NC_DOUBLE |
---|
249 | ierr = NF_DEF_VAR (nid, "ZMEA", NF_DOUBLE, 1, idim2,nvarid) |
---|
250 | #else |
---|
251 | ierr = NF_DEF_VAR (nid, "ZMEA", NF_FLOAT, 1, idim2,nvarid) |
---|
252 | #endif |
---|
253 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 27, |
---|
254 | . "zmea Orographie sous-maille") |
---|
255 | ierr = NF_ENDDEF(nid) |
---|
256 | #ifdef NC_DOUBLE |
---|
257 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,zmea) |
---|
258 | #else |
---|
259 | ierr = NF_PUT_VAR_REAL (nid,nvarid,zmea) |
---|
260 | #endif |
---|
261 | c |
---|
262 | ierr = NF_REDEF (nid) |
---|
263 | #ifdef NC_DOUBLE |
---|
264 | ierr = NF_DEF_VAR (nid, "ZSTD", NF_DOUBLE, 1, idim2,nvarid) |
---|
265 | #else |
---|
266 | ierr = NF_DEF_VAR (nid, "ZSTD", NF_FLOAT, 1, idim2,nvarid) |
---|
267 | #endif |
---|
268 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 27, |
---|
269 | . "zstd Orographie sous-maille") |
---|
270 | ierr = NF_ENDDEF(nid) |
---|
271 | #ifdef NC_DOUBLE |
---|
272 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,zstd) |
---|
273 | #else |
---|
274 | ierr = NF_PUT_VAR_REAL (nid,nvarid,zstd) |
---|
275 | #endif |
---|
276 | ierr = NF_REDEF (nid) |
---|
277 | #ifdef NC_DOUBLE |
---|
278 | ierr = NF_DEF_VAR (nid, "ZSIG", NF_DOUBLE, 1, idim2,nvarid) |
---|
279 | #else |
---|
280 | ierr = NF_DEF_VAR (nid, "ZSIG", NF_FLOAT, 1, idim2,nvarid) |
---|
281 | #endif |
---|
282 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 27, |
---|
283 | . "zsig Orographie sous-maille") |
---|
284 | ierr = NF_ENDDEF(nid) |
---|
285 | #ifdef NC_DOUBLE |
---|
286 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,zsig) |
---|
287 | #else |
---|
288 | ierr = NF_PUT_VAR_REAL (nid,nvarid,zsig) |
---|
289 | #endif |
---|
290 | ierr = NF_REDEF (nid) |
---|
291 | #ifdef NC_DOUBLE |
---|
292 | ierr = NF_DEF_VAR (nid, "ZGAM", NF_DOUBLE, 1, idim2,nvarid) |
---|
293 | #else |
---|
294 | ierr = NF_DEF_VAR (nid, "ZGAM", NF_FLOAT, 1, idim2,nvarid) |
---|
295 | #endif |
---|
296 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 27, |
---|
297 | . "zgam Orographie sous-maille") |
---|
298 | ierr = NF_ENDDEF(nid) |
---|
299 | #ifdef NC_DOUBLE |
---|
300 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,zgam) |
---|
301 | #else |
---|
302 | ierr = NF_PUT_VAR_REAL (nid,nvarid,zgam) |
---|
303 | #endif |
---|
304 | ierr = NF_REDEF (nid) |
---|
305 | #ifdef NC_DOUBLE |
---|
306 | ierr = NF_DEF_VAR (nid, "ZTHE", NF_DOUBLE, 1, idim2,nvarid) |
---|
307 | #else |
---|
308 | ierr = NF_DEF_VAR (nid, "ZTHE", NF_FLOAT, 1, idim2,nvarid) |
---|
309 | #endif |
---|
310 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 27, |
---|
311 | . "zthe Orographie sous-maille") |
---|
312 | ierr = NF_ENDDEF(nid) |
---|
313 | #ifdef NC_DOUBLE |
---|
314 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,zthe) |
---|
315 | #else |
---|
316 | ierr = NF_PUT_VAR_REAL (nid,nvarid,zthe) |
---|
317 | #endif |
---|
318 | ierr = NF_REDEF (nid) |
---|
319 | #ifdef NC_DOUBLE |
---|
320 | ierr = NF_DEF_VAR (nid, "ZPIC", NF_DOUBLE, 1, idim2,nvarid) |
---|
321 | #else |
---|
322 | ierr = NF_DEF_VAR (nid, "ZPIC", NF_FLOAT, 1, idim2,nvarid) |
---|
323 | #endif |
---|
324 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 27, |
---|
325 | . "zpic Orographie sous-maille") |
---|
326 | ierr = NF_ENDDEF(nid) |
---|
327 | #ifdef NC_DOUBLE |
---|
328 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,zpic) |
---|
329 | #else |
---|
330 | ierr = NF_PUT_VAR_REAL (nid,nvarid,zpic) |
---|
331 | #endif |
---|
332 | ierr = NF_REDEF (nid) |
---|
333 | #ifdef NC_DOUBLE |
---|
334 | ierr = NF_DEF_VAR (nid, "ZVAL", NF_DOUBLE, 1, idim2,nvarid) |
---|
335 | #else |
---|
336 | ierr = NF_DEF_VAR (nid, "ZVAL", NF_FLOAT, 1, idim2,nvarid) |
---|
337 | #endif |
---|
338 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 27, |
---|
339 | . "zval Orographie sous-maille") |
---|
340 | ierr = NF_ENDDEF(nid) |
---|
341 | #ifdef NC_DOUBLE |
---|
342 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,zval) |
---|
343 | #else |
---|
344 | ierr = NF_PUT_VAR_REAL (nid,nvarid,zval) |
---|
345 | #endif |
---|
346 | c |
---|
347 | ierr = NF_REDEF (nid) |
---|
348 | #ifdef NC_DOUBLE |
---|
349 | ierr = NF_DEF_VAR (nid, "TANCIEN", NF_DOUBLE, 1, idim3,nvarid) |
---|
350 | #else |
---|
351 | ierr = NF_DEF_VAR (nid, "TANCIEN", NF_FLOAT, 1, idim3,nvarid) |
---|
352 | #endif |
---|
353 | ierr = NF_ENDDEF(nid) |
---|
354 | #ifdef NC_DOUBLE |
---|
355 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,t_ancien) |
---|
356 | #else |
---|
357 | ierr = NF_PUT_VAR_REAL (nid,nvarid,t_ancien) |
---|
358 | #endif |
---|
359 | c |
---|
360 | ierr = NF_CLOSE(nid) |
---|
361 | c |
---|
362 | RETURN |
---|
363 | END |
---|