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