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 | use dimphy |
---|
15 | IMPLICIT none |
---|
16 | c====================================================================== |
---|
17 | c Auteur(s) Z.X. Li (LMD/CNRS) date: 19930818 |
---|
18 | c Objet: Ecriture de l'etat de redemarrage pour la physique |
---|
19 | c====================================================================== |
---|
20 | #include "dimensions.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( ok_orodr ) tab_cntrl(10 ) = 1. |
---|
81 | IF( ok_orolf ) tab_cntrl(11 ) = 1. |
---|
82 | IF( ok_gw_nonoro ) tab_cntrl(12 ) = 1. |
---|
83 | |
---|
84 | tab_cntrl(13) = day_end |
---|
85 | tab_cntrl(14) = annee_ref |
---|
86 | tab_cntrl(15) = itau_phy |
---|
87 | c |
---|
88 | ierr = NF_REDEF (nid) |
---|
89 | #ifdef NC_DOUBLE |
---|
90 | ierr = NF_DEF_VAR (nid, "controle", NF_DOUBLE, 1, idim1,nvarid) |
---|
91 | #else |
---|
92 | ierr = NF_DEF_VAR (nid, "controle", NF_FLOAT, 1, idim1,nvarid) |
---|
93 | #endif |
---|
94 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 22, |
---|
95 | . "Parametres de controle") |
---|
96 | ierr = NF_ENDDEF(nid) |
---|
97 | #ifdef NC_DOUBLE |
---|
98 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,tab_cntrl) |
---|
99 | #else |
---|
100 | ierr = NF_PUT_VAR_REAL (nid,nvarid,tab_cntrl) |
---|
101 | #endif |
---|
102 | c |
---|
103 | ierr = NF_REDEF (nid) |
---|
104 | #ifdef NC_DOUBLE |
---|
105 | ierr = NF_DEF_VAR (nid, "longitude", NF_DOUBLE, 1, idim2,nvarid) |
---|
106 | #else |
---|
107 | ierr = NF_DEF_VAR (nid, "longitude", NF_FLOAT, 1, idim2,nvarid) |
---|
108 | #endif |
---|
109 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 32, |
---|
110 | . "Longitudes de la grille physique") |
---|
111 | ierr = NF_ENDDEF(nid) |
---|
112 | #ifdef NC_DOUBLE |
---|
113 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,rlon) |
---|
114 | #else |
---|
115 | ierr = NF_PUT_VAR_REAL (nid,nvarid,rlon) |
---|
116 | #endif |
---|
117 | c |
---|
118 | ierr = NF_REDEF (nid) |
---|
119 | #ifdef NC_DOUBLE |
---|
120 | ierr = NF_DEF_VAR (nid, "latitude", NF_DOUBLE, 1, idim2,nvarid) |
---|
121 | #else |
---|
122 | ierr = NF_DEF_VAR (nid, "latitude", NF_FLOAT, 1, idim2,nvarid) |
---|
123 | #endif |
---|
124 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 31, |
---|
125 | . "Latitudes de la grille physique") |
---|
126 | ierr = NF_ENDDEF(nid) |
---|
127 | #ifdef NC_DOUBLE |
---|
128 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,rlat) |
---|
129 | #else |
---|
130 | ierr = NF_PUT_VAR_REAL (nid,nvarid,rlat) |
---|
131 | #endif |
---|
132 | c |
---|
133 | ierr = NF_REDEF (nid) |
---|
134 | #ifdef NC_DOUBLE |
---|
135 | ierr = NF_DEF_VAR (nid, "TS", NF_DOUBLE, 1, idim2,nvarid) |
---|
136 | #else |
---|
137 | ierr = NF_DEF_VAR (nid, "TS", NF_FLOAT, 1, idim2,nvarid) |
---|
138 | #endif |
---|
139 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 22, |
---|
140 | . "Temperature de surface") |
---|
141 | ierr = NF_ENDDEF(nid) |
---|
142 | #ifdef NC_DOUBLE |
---|
143 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,tsol(1)) |
---|
144 | #else |
---|
145 | ierr = NF_PUT_VAR_REAL (nid,nvarid,tsol(1)) |
---|
146 | #endif |
---|
147 | c |
---|
148 | DO isoil=1, nsoilmx |
---|
149 | IF (isoil.LE.99) THEN |
---|
150 | WRITE(str2,'(i2.2)') isoil |
---|
151 | ierr = NF_REDEF (nid) |
---|
152 | #ifdef NC_DOUBLE |
---|
153 | ierr = NF_DEF_VAR (nid, "Tsoil"//str2,NF_DOUBLE,1,idim2,nvarid) |
---|
154 | #else |
---|
155 | ierr = NF_DEF_VAR (nid, "Tsoil"//str2,NF_FLOAT,1,idim2,nvarid) |
---|
156 | #endif |
---|
157 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 24, |
---|
158 | . "Temperature du sol No."//str2) |
---|
159 | ierr = NF_ENDDEF(nid) |
---|
160 | ELSE |
---|
161 | PRINT*, "Trop de couches" |
---|
162 | CALL abort |
---|
163 | ENDIF |
---|
164 | #ifdef NC_DOUBLE |
---|
165 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,tsoil(1,isoil)) |
---|
166 | #else |
---|
167 | ierr = NF_PUT_VAR_REAL (nid,nvarid,tsoil(1,isoil)) |
---|
168 | #endif |
---|
169 | ENDDO |
---|
170 | c |
---|
171 | ierr = NF_REDEF (nid) |
---|
172 | #ifdef NC_DOUBLE |
---|
173 | ierr = NF_DEF_VAR (nid,"ALBE",NF_DOUBLE,1,idim2,nvarid) |
---|
174 | #else |
---|
175 | ierr = NF_DEF_VAR (nid,"ALBE",NF_FLOAT,1,idim2,nvarid) |
---|
176 | #endif |
---|
177 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 18, |
---|
178 | . "albedo de surface") |
---|
179 | ierr = NF_ENDDEF(nid) |
---|
180 | #ifdef NC_DOUBLE |
---|
181 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,albedo(1)) |
---|
182 | #else |
---|
183 | ierr = NF_PUT_VAR_REAL (nid,nvarid,albedo(1)) |
---|
184 | #endif |
---|
185 | c |
---|
186 | ierr = NF_REDEF (nid) |
---|
187 | #ifdef NC_DOUBLE |
---|
188 | ierr = NF_DEF_VAR (nid, "solsw", NF_DOUBLE, 1, idim2,nvarid) |
---|
189 | #else |
---|
190 | ierr = NF_DEF_VAR (nid, "solsw", NF_FLOAT, 1, idim2,nvarid) |
---|
191 | #endif |
---|
192 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 32, |
---|
193 | . "Rayonnement solaire a la surface") |
---|
194 | ierr = NF_ENDDEF(nid) |
---|
195 | #ifdef NC_DOUBLE |
---|
196 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,solsw) |
---|
197 | #else |
---|
198 | ierr = NF_PUT_VAR_REAL (nid,nvarid,solsw) |
---|
199 | #endif |
---|
200 | c |
---|
201 | ierr = NF_REDEF (nid) |
---|
202 | #ifdef NC_DOUBLE |
---|
203 | ierr = NF_DEF_VAR (nid, "sollw", NF_DOUBLE, 1, idim2,nvarid) |
---|
204 | #else |
---|
205 | ierr = NF_DEF_VAR (nid, "sollw", NF_FLOAT, 1, idim2,nvarid) |
---|
206 | #endif |
---|
207 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 27, |
---|
208 | . "Rayonnement IF a la surface") |
---|
209 | ierr = NF_ENDDEF(nid) |
---|
210 | #ifdef NC_DOUBLE |
---|
211 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,sollw) |
---|
212 | #else |
---|
213 | ierr = NF_PUT_VAR_REAL (nid,nvarid,sollw) |
---|
214 | #endif |
---|
215 | c |
---|
216 | ierr = NF_REDEF (nid) |
---|
217 | #ifdef NC_DOUBLE |
---|
218 | ierr = NF_DEF_VAR (nid, "fder", NF_DOUBLE, 1, idim2,nvarid) |
---|
219 | #else |
---|
220 | ierr = NF_DEF_VAR (nid, "fder", NF_FLOAT, 1, idim2,nvarid) |
---|
221 | #endif |
---|
222 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 14, |
---|
223 | . "Derive de flux") |
---|
224 | ierr = NF_ENDDEF(nid) |
---|
225 | #ifdef NC_DOUBLE |
---|
226 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,fder) |
---|
227 | #else |
---|
228 | ierr = NF_PUT_VAR_REAL (nid,nvarid,fder) |
---|
229 | #endif |
---|
230 | c |
---|
231 | ierr = NF_REDEF (nid) |
---|
232 | #ifdef NC_DOUBLE |
---|
233 | ierr = NF_DEF_VAR (nid, "RADS", NF_DOUBLE, 1, idim2,nvarid) |
---|
234 | #else |
---|
235 | ierr = NF_DEF_VAR (nid, "RADS", NF_FLOAT, 1, idim2,nvarid) |
---|
236 | #endif |
---|
237 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 28, |
---|
238 | . "Rayonnement net a la surface") |
---|
239 | ierr = NF_ENDDEF(nid) |
---|
240 | #ifdef NC_DOUBLE |
---|
241 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,radsol) |
---|
242 | #else |
---|
243 | ierr = NF_PUT_VAR_REAL (nid,nvarid,radsol) |
---|
244 | #endif |
---|
245 | c |
---|
246 | ierr = NF_REDEF (nid) |
---|
247 | #ifdef NC_DOUBLE |
---|
248 | ierr = NF_DEF_VAR (nid, "ZMEA", NF_DOUBLE, 1, idim2,nvarid) |
---|
249 | #else |
---|
250 | ierr = NF_DEF_VAR (nid, "ZMEA", NF_FLOAT, 1, idim2,nvarid) |
---|
251 | #endif |
---|
252 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 27, |
---|
253 | . "zmea Orographie sous-maille") |
---|
254 | ierr = NF_ENDDEF(nid) |
---|
255 | #ifdef NC_DOUBLE |
---|
256 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,zmea) |
---|
257 | #else |
---|
258 | ierr = NF_PUT_VAR_REAL (nid,nvarid,zmea) |
---|
259 | #endif |
---|
260 | c |
---|
261 | ierr = NF_REDEF (nid) |
---|
262 | #ifdef NC_DOUBLE |
---|
263 | ierr = NF_DEF_VAR (nid, "ZSTD", NF_DOUBLE, 1, idim2,nvarid) |
---|
264 | #else |
---|
265 | ierr = NF_DEF_VAR (nid, "ZSTD", NF_FLOAT, 1, idim2,nvarid) |
---|
266 | #endif |
---|
267 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 27, |
---|
268 | . "zstd Orographie sous-maille") |
---|
269 | ierr = NF_ENDDEF(nid) |
---|
270 | #ifdef NC_DOUBLE |
---|
271 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,zstd) |
---|
272 | #else |
---|
273 | ierr = NF_PUT_VAR_REAL (nid,nvarid,zstd) |
---|
274 | #endif |
---|
275 | ierr = NF_REDEF (nid) |
---|
276 | #ifdef NC_DOUBLE |
---|
277 | ierr = NF_DEF_VAR (nid, "ZSIG", NF_DOUBLE, 1, idim2,nvarid) |
---|
278 | #else |
---|
279 | ierr = NF_DEF_VAR (nid, "ZSIG", NF_FLOAT, 1, idim2,nvarid) |
---|
280 | #endif |
---|
281 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 27, |
---|
282 | . "zsig Orographie sous-maille") |
---|
283 | ierr = NF_ENDDEF(nid) |
---|
284 | #ifdef NC_DOUBLE |
---|
285 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,zsig) |
---|
286 | #else |
---|
287 | ierr = NF_PUT_VAR_REAL (nid,nvarid,zsig) |
---|
288 | #endif |
---|
289 | ierr = NF_REDEF (nid) |
---|
290 | #ifdef NC_DOUBLE |
---|
291 | ierr = NF_DEF_VAR (nid, "ZGAM", NF_DOUBLE, 1, idim2,nvarid) |
---|
292 | #else |
---|
293 | ierr = NF_DEF_VAR (nid, "ZGAM", NF_FLOAT, 1, idim2,nvarid) |
---|
294 | #endif |
---|
295 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 27, |
---|
296 | . "zgam Orographie sous-maille") |
---|
297 | ierr = NF_ENDDEF(nid) |
---|
298 | #ifdef NC_DOUBLE |
---|
299 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,zgam) |
---|
300 | #else |
---|
301 | ierr = NF_PUT_VAR_REAL (nid,nvarid,zgam) |
---|
302 | #endif |
---|
303 | ierr = NF_REDEF (nid) |
---|
304 | #ifdef NC_DOUBLE |
---|
305 | ierr = NF_DEF_VAR (nid, "ZTHE", NF_DOUBLE, 1, idim2,nvarid) |
---|
306 | #else |
---|
307 | ierr = NF_DEF_VAR (nid, "ZTHE", NF_FLOAT, 1, idim2,nvarid) |
---|
308 | #endif |
---|
309 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 27, |
---|
310 | . "zthe Orographie sous-maille") |
---|
311 | ierr = NF_ENDDEF(nid) |
---|
312 | #ifdef NC_DOUBLE |
---|
313 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,zthe) |
---|
314 | #else |
---|
315 | ierr = NF_PUT_VAR_REAL (nid,nvarid,zthe) |
---|
316 | #endif |
---|
317 | ierr = NF_REDEF (nid) |
---|
318 | #ifdef NC_DOUBLE |
---|
319 | ierr = NF_DEF_VAR (nid, "ZPIC", NF_DOUBLE, 1, idim2,nvarid) |
---|
320 | #else |
---|
321 | ierr = NF_DEF_VAR (nid, "ZPIC", NF_FLOAT, 1, idim2,nvarid) |
---|
322 | #endif |
---|
323 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 27, |
---|
324 | . "zpic Orographie sous-maille") |
---|
325 | ierr = NF_ENDDEF(nid) |
---|
326 | #ifdef NC_DOUBLE |
---|
327 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,zpic) |
---|
328 | #else |
---|
329 | ierr = NF_PUT_VAR_REAL (nid,nvarid,zpic) |
---|
330 | #endif |
---|
331 | ierr = NF_REDEF (nid) |
---|
332 | #ifdef NC_DOUBLE |
---|
333 | ierr = NF_DEF_VAR (nid, "ZVAL", NF_DOUBLE, 1, idim2,nvarid) |
---|
334 | #else |
---|
335 | ierr = NF_DEF_VAR (nid, "ZVAL", NF_FLOAT, 1, idim2,nvarid) |
---|
336 | #endif |
---|
337 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 27, |
---|
338 | . "zval Orographie sous-maille") |
---|
339 | ierr = NF_ENDDEF(nid) |
---|
340 | #ifdef NC_DOUBLE |
---|
341 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,zval) |
---|
342 | #else |
---|
343 | ierr = NF_PUT_VAR_REAL (nid,nvarid,zval) |
---|
344 | #endif |
---|
345 | c |
---|
346 | ierr = NF_REDEF (nid) |
---|
347 | #ifdef NC_DOUBLE |
---|
348 | ierr = NF_DEF_VAR (nid, "TANCIEN", NF_DOUBLE, 1, idim3,nvarid) |
---|
349 | #else |
---|
350 | ierr = NF_DEF_VAR (nid, "TANCIEN", NF_FLOAT, 1, idim3,nvarid) |
---|
351 | #endif |
---|
352 | ierr = NF_ENDDEF(nid) |
---|
353 | #ifdef NC_DOUBLE |
---|
354 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,t_ancien) |
---|
355 | #else |
---|
356 | ierr = NF_PUT_VAR_REAL (nid,nvarid,t_ancien) |
---|
357 | #endif |
---|
358 | c |
---|
359 | ierr = NF_CLOSE(nid) |
---|
360 | c |
---|
361 | RETURN |
---|
362 | END |
---|