1 | ! |
---|
2 | ! $Header$ |
---|
3 | ! |
---|
4 | c |
---|
5 | cIM SUBROUTINE phyredem (fichnom,dtime,radpas,co2_ppm,solaire, |
---|
6 | SUBROUTINE phyredem (fichnom,dtime,radpas, |
---|
7 | . rlat,rlon, pctsrf,tsol,tsoil,deltat,qsurf,qsol,snow, |
---|
8 | . albedo, alblw, evap, rain_fall, snow_fall, |
---|
9 | . solsw, sollw,fder, |
---|
10 | . radsol,frugs,agesno, |
---|
11 | . zmea,zstd,zsig,zgam,zthe,zpic,zval,rugsrel, |
---|
12 | . t_ancien, q_ancien, rnebcon, ratqs, clwcon, |
---|
13 | . run_off_lic_0) |
---|
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 "indicesol.h" |
---|
23 | #include "dimsoil.h" |
---|
24 | #include "clesphys.h" |
---|
25 | #include "control.h" |
---|
26 | #include "temps.h" |
---|
27 | c====================================================================== |
---|
28 | CHARACTER*(*) fichnom |
---|
29 | REAL dtime |
---|
30 | INTEGER radpas |
---|
31 | REAL rlat(klon), rlon(klon) |
---|
32 | cIM REAL co2_ppm |
---|
33 | cIM REAL solaire |
---|
34 | REAL tsol(klon,nbsrf) |
---|
35 | REAL tsoil(klon,nsoilmx,nbsrf) |
---|
36 | REAL deltat(klon) |
---|
37 | REAL qsurf(klon,nbsrf) |
---|
38 | REAL qsol(klon) |
---|
39 | REAL snow(klon,nbsrf) |
---|
40 | REAL albedo(klon,nbsrf) |
---|
41 | cIM BEG |
---|
42 | REAL alblw(klon,nbsrf) |
---|
43 | cIM END |
---|
44 | REAL evap(klon,nbsrf) |
---|
45 | REAL rain_fall(klon) |
---|
46 | REAL snow_fall(klon) |
---|
47 | real solsw(klon) |
---|
48 | real sollw(klon) |
---|
49 | real fder(klon) |
---|
50 | REAL radsol(klon) |
---|
51 | REAL frugs(klon,nbsrf) |
---|
52 | REAL agesno(klon,nbsrf) |
---|
53 | REAL zmea(klon) |
---|
54 | REAL zstd(klon) |
---|
55 | REAL zsig(klon) |
---|
56 | REAL zgam(klon) |
---|
57 | REAL zthe(klon) |
---|
58 | REAL zpic(klon) |
---|
59 | REAL zval(klon) |
---|
60 | REAL rugsrel(klon) |
---|
61 | REAL pctsrf(klon, nbsrf) |
---|
62 | REAL t_ancien(klon,klev), q_ancien(klon,klev) |
---|
63 | real clwcon(klon,klev),rnebcon(klon,klev),ratqs(klon,klev) |
---|
64 | REAL run_off_lic_0(klon) |
---|
65 | c |
---|
66 | INTEGER nid, nvarid, idim1, idim2, idim3 |
---|
67 | INTEGER ierr |
---|
68 | INTEGER length |
---|
69 | PARAMETER (length=100) |
---|
70 | REAL tab_cntrl(length) |
---|
71 | c |
---|
72 | INTEGER isoil, nsrf |
---|
73 | CHARACTER*7 str7 |
---|
74 | CHARACTER*2 str2 |
---|
75 | c |
---|
76 | ierr = NF_CREATE(fichnom, NF_CLOBBER, nid) |
---|
77 | IF (ierr.NE.NF_NOERR) THEN |
---|
78 | write(6,*)' Pb d''ouverture du fichier '//fichnom |
---|
79 | write(6,*)' ierr = ', ierr |
---|
80 | CALL ABORT |
---|
81 | ENDIF |
---|
82 | c |
---|
83 | ierr = NF_PUT_ATT_TEXT (nid, NF_GLOBAL, "title", 28, |
---|
84 | . "Fichier redemmarage physique") |
---|
85 | c |
---|
86 | ierr = NF_DEF_DIM (nid, "index", length, idim1) |
---|
87 | ierr = NF_DEF_DIM (nid, "points_physiques", klon, idim2) |
---|
88 | ierr = NF_DEF_DIM (nid, "horizon_vertical", klon*klev, idim3) |
---|
89 | c |
---|
90 | ierr = NF_ENDDEF(nid) |
---|
91 | c |
---|
92 | DO ierr = 1, length |
---|
93 | tab_cntrl(ierr) = 0.0 |
---|
94 | ENDDO |
---|
95 | tab_cntrl(1) = dtime |
---|
96 | tab_cntrl(2) = radpas |
---|
97 | tab_cntrl(3) = co2_ppm |
---|
98 | tab_cntrl(4) = solaire |
---|
99 | tab_cntrl(5) = iflag_con |
---|
100 | tab_cntrl(6) = nbapp_rad |
---|
101 | |
---|
102 | IF( cycle_diurne ) tab_cntrl( 7 ) = 1. |
---|
103 | IF( soil_model ) tab_cntrl( 8 ) = 1. |
---|
104 | IF( new_oliq ) tab_cntrl( 9 ) = 1. |
---|
105 | IF( ok_orodr ) tab_cntrl(10 ) = 1. |
---|
106 | IF( ok_orolf ) tab_cntrl(11 ) = 1. |
---|
107 | |
---|
108 | tab_cntrl(13) = day_end |
---|
109 | tab_cntrl(14) = annee_ref |
---|
110 | tab_cntrl(15) = itau_phy |
---|
111 | c |
---|
112 | ierr = NF_REDEF (nid) |
---|
113 | #ifdef NC_DOUBLE |
---|
114 | ierr = NF_DEF_VAR (nid, "controle", NF_DOUBLE, 1, idim1,nvarid) |
---|
115 | #else |
---|
116 | ierr = NF_DEF_VAR (nid, "controle", NF_FLOAT, 1, idim1,nvarid) |
---|
117 | #endif |
---|
118 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 22, |
---|
119 | . "Parametres de controle") |
---|
120 | ierr = NF_ENDDEF(nid) |
---|
121 | #ifdef NC_DOUBLE |
---|
122 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,tab_cntrl) |
---|
123 | #else |
---|
124 | ierr = NF_PUT_VAR_REAL (nid,nvarid,tab_cntrl) |
---|
125 | #endif |
---|
126 | c |
---|
127 | ierr = NF_REDEF (nid) |
---|
128 | #ifdef NC_DOUBLE |
---|
129 | ierr = NF_DEF_VAR (nid, "longitude", NF_DOUBLE, 1, idim2,nvarid) |
---|
130 | #else |
---|
131 | ierr = NF_DEF_VAR (nid, "longitude", NF_FLOAT, 1, idim2,nvarid) |
---|
132 | #endif |
---|
133 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 32, |
---|
134 | . "Longitudes de la grille physique") |
---|
135 | ierr = NF_ENDDEF(nid) |
---|
136 | #ifdef NC_DOUBLE |
---|
137 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,rlon) |
---|
138 | #else |
---|
139 | ierr = NF_PUT_VAR_REAL (nid,nvarid,rlon) |
---|
140 | #endif |
---|
141 | c |
---|
142 | ierr = NF_REDEF (nid) |
---|
143 | #ifdef NC_DOUBLE |
---|
144 | ierr = NF_DEF_VAR (nid, "latitude", NF_DOUBLE, 1, idim2,nvarid) |
---|
145 | #else |
---|
146 | ierr = NF_DEF_VAR (nid, "latitude", NF_FLOAT, 1, idim2,nvarid) |
---|
147 | #endif |
---|
148 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 31, |
---|
149 | . "Latitudes de la grille physique") |
---|
150 | ierr = NF_ENDDEF(nid) |
---|
151 | #ifdef NC_DOUBLE |
---|
152 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,rlat) |
---|
153 | #else |
---|
154 | ierr = NF_PUT_VAR_REAL (nid,nvarid,rlat) |
---|
155 | #endif |
---|
156 | c |
---|
157 | C PB ajout du masque terre/mer |
---|
158 | C |
---|
159 | ierr = NF_REDEF (nid) |
---|
160 | #ifdef NC_DOUBLE |
---|
161 | ierr = NF_DEF_VAR (nid, "masque", NF_DOUBLE, 1, idim2,nvarid) |
---|
162 | #else |
---|
163 | ierr = NF_DEF_VAR (nid, "masque", NF_FLOAT, 1, idim2,nvarid) |
---|
164 | #endif |
---|
165 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 16, |
---|
166 | . "masque terre mer") |
---|
167 | ierr = NF_ENDDEF(nid) |
---|
168 | #ifdef NC_DOUBLE |
---|
169 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,zmasq) |
---|
170 | #else |
---|
171 | ierr = NF_PUT_VAR_REAL (nid,nvarid,zmasq) |
---|
172 | #endif |
---|
173 | c BP ajout des fraction de chaque sous-surface |
---|
174 | C |
---|
175 | C 1. fraction de terre |
---|
176 | C |
---|
177 | ierr = NF_REDEF (nid) |
---|
178 | #ifdef NC_DOUBLE |
---|
179 | ierr = NF_DEF_VAR (nid, "FTER", NF_DOUBLE, 1, idim2,nvarid) |
---|
180 | #else |
---|
181 | ierr = NF_DEF_VAR (nid, "FTER", NF_FLOAT, 1, idim2,nvarid) |
---|
182 | #endif |
---|
183 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 21, |
---|
184 | . "fraction de continent") |
---|
185 | ierr = NF_ENDDEF(nid) |
---|
186 | #ifdef NC_DOUBLE |
---|
187 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,pctsrf(1 : klon, is_ter)) |
---|
188 | #else |
---|
189 | ierr = NF_PUT_VAR_REAL (nid,nvarid,pctsrf(1 : klon, is_ter)) |
---|
190 | #endif |
---|
191 | C |
---|
192 | C 2. Fraction de glace de terre |
---|
193 | C |
---|
194 | ierr = NF_REDEF (nid) |
---|
195 | #ifdef NC_DOUBLE |
---|
196 | ierr = NF_DEF_VAR (nid, "FLIC", NF_DOUBLE, 1, idim2,nvarid) |
---|
197 | #else |
---|
198 | ierr = NF_DEF_VAR (nid, "FLIC", NF_FLOAT, 1, idim2,nvarid) |
---|
199 | #endif |
---|
200 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 24, |
---|
201 | . "fraction glace de terre") |
---|
202 | ierr = NF_ENDDEF(nid) |
---|
203 | #ifdef NC_DOUBLE |
---|
204 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,pctsrf(1 : klon,is_lic)) |
---|
205 | #else |
---|
206 | ierr = NF_PUT_VAR_REAL (nid,nvarid,pctsrf(1 : klon, is_lic)) |
---|
207 | #endif |
---|
208 | C |
---|
209 | C 3. fraction ocean |
---|
210 | C |
---|
211 | ierr = NF_REDEF (nid) |
---|
212 | #ifdef NC_DOUBLE |
---|
213 | ierr = NF_DEF_VAR (nid, "FOCE", NF_DOUBLE, 1, idim2,nvarid) |
---|
214 | #else |
---|
215 | ierr = NF_DEF_VAR (nid, "FOCE", NF_FLOAT, 1, idim2,nvarid) |
---|
216 | #endif |
---|
217 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 14, |
---|
218 | . "fraction ocean") |
---|
219 | ierr = NF_ENDDEF(nid) |
---|
220 | #ifdef NC_DOUBLE |
---|
221 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,pctsrf(1 : klon, is_oce)) |
---|
222 | #else |
---|
223 | ierr = NF_PUT_VAR_REAL (nid,nvarid,pctsrf(1 : klon, is_oce)) |
---|
224 | #endif |
---|
225 | C |
---|
226 | C 4. Fraction glace de mer |
---|
227 | C |
---|
228 | ierr = NF_REDEF (nid) |
---|
229 | #ifdef NC_DOUBLE |
---|
230 | ierr = NF_DEF_VAR (nid, "FSIC", NF_DOUBLE, 1, idim2,nvarid) |
---|
231 | #else |
---|
232 | ierr = NF_DEF_VAR (nid, "FSIC", NF_FLOAT, 1, idim2,nvarid) |
---|
233 | #endif |
---|
234 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 18, |
---|
235 | . "fraction glace mer") |
---|
236 | ierr = NF_ENDDEF(nid) |
---|
237 | #ifdef NC_DOUBLE |
---|
238 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,pctsrf(1 : klon, is_sic)) |
---|
239 | #else |
---|
240 | ierr = NF_PUT_VAR_REAL (nid,nvarid,pctsrf(1 : klon, is_sic)) |
---|
241 | #endif |
---|
242 | C |
---|
243 | C |
---|
244 | c |
---|
245 | DO nsrf = 1, nbsrf |
---|
246 | IF (nsrf.LE.99) THEN |
---|
247 | WRITE(str2,'(i2.2)') nsrf |
---|
248 | ierr = NF_REDEF (nid) |
---|
249 | #ifdef NC_DOUBLE |
---|
250 | ierr = NF_DEF_VAR (nid, "TS"//str2, NF_DOUBLE, 1, idim2,nvarid) |
---|
251 | #else |
---|
252 | ierr = NF_DEF_VAR (nid, "TS"//str2, NF_FLOAT, 1, idim2,nvarid) |
---|
253 | #endif |
---|
254 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 28, |
---|
255 | . "Temperature de surface No."//str2) |
---|
256 | ierr = NF_ENDDEF(nid) |
---|
257 | ELSE |
---|
258 | PRINT*, "Trop de sous-mailles" |
---|
259 | CALL abort |
---|
260 | ENDIF |
---|
261 | #ifdef NC_DOUBLE |
---|
262 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,tsol(1,nsrf)) |
---|
263 | #else |
---|
264 | ierr = NF_PUT_VAR_REAL (nid,nvarid,tsol(1,nsrf)) |
---|
265 | #endif |
---|
266 | ENDDO |
---|
267 | c |
---|
268 | DO nsrf = 1, nbsrf |
---|
269 | DO isoil=1, nsoilmx |
---|
270 | IF (isoil.LE.99 .AND. nsrf.LE.99) THEN |
---|
271 | WRITE(str7,'(i2.2,"srf",i2.2)') isoil,nsrf |
---|
272 | ierr = NF_REDEF (nid) |
---|
273 | #ifdef NC_DOUBLE |
---|
274 | ierr = NF_DEF_VAR (nid, "Tsoil"//str7,NF_DOUBLE,1,idim2,nvarid) |
---|
275 | #else |
---|
276 | ierr = NF_DEF_VAR (nid, "Tsoil"//str7,NF_FLOAT,1,idim2,nvarid) |
---|
277 | #endif |
---|
278 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 29, |
---|
279 | . "Temperature du sol No."//str7) |
---|
280 | ierr = NF_ENDDEF(nid) |
---|
281 | ELSE |
---|
282 | PRINT*, "Trop de couches" |
---|
283 | CALL abort |
---|
284 | ENDIF |
---|
285 | #ifdef NC_DOUBLE |
---|
286 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,tsoil(1,isoil,nsrf)) |
---|
287 | #else |
---|
288 | ierr = NF_PUT_VAR_REAL (nid,nvarid,tsoil(1,isoil,nsrf)) |
---|
289 | #endif |
---|
290 | ENDDO |
---|
291 | ENDDO |
---|
292 | c |
---|
293 | c |
---|
294 | ierr = NF_REDEF (nid) |
---|
295 | #ifdef NC_DOUBLE |
---|
296 | ierr = NF_DEF_VAR (nid, "DELTAT", NF_DOUBLE, 1, idim2,nvarid) |
---|
297 | #else |
---|
298 | ierr = NF_DEF_VAR (nid, "DELTAT", NF_FLOAT, 1, idim2,nvarid) |
---|
299 | #endif |
---|
300 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 33, |
---|
301 | . "Ecart de la SST (pour slab-ocean)") |
---|
302 | ierr = NF_ENDDEF(nid) |
---|
303 | #ifdef NC_DOUBLE |
---|
304 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,deltat) |
---|
305 | #else |
---|
306 | ierr = NF_PUT_VAR_REAL (nid,nvarid,deltat) |
---|
307 | #endif |
---|
308 | c |
---|
309 | DO nsrf = 1, nbsrf |
---|
310 | IF (nsrf.LE.99) THEN |
---|
311 | WRITE(str2,'(i2.2)') nsrf |
---|
312 | ierr = NF_REDEF (nid) |
---|
313 | #ifdef NC_DOUBLE |
---|
314 | ierr = NF_DEF_VAR (nid,"QS"//str2,NF_DOUBLE,1,idim2,nvarid) |
---|
315 | #else |
---|
316 | ierr = NF_DEF_VAR (nid,"QS"//str2,NF_FLOAT,1,idim2,nvarid) |
---|
317 | #endif |
---|
318 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 25, |
---|
319 | . "Humidite de surface No."//str2) |
---|
320 | ierr = NF_ENDDEF(nid) |
---|
321 | ELSE |
---|
322 | PRINT*, "Trop de sous-mailles" |
---|
323 | CALL abort |
---|
324 | ENDIF |
---|
325 | #ifdef NC_DOUBLE |
---|
326 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,qsurf(1,nsrf)) |
---|
327 | #else |
---|
328 | ierr = NF_PUT_VAR_REAL (nid,nvarid,qsurf(1,nsrf)) |
---|
329 | #endif |
---|
330 | END DO |
---|
331 | C |
---|
332 | ierr = NF_REDEF (nid) |
---|
333 | #ifdef NC_DOUBLE |
---|
334 | ierr = NF_DEF_VAR (nid,"QSOL",NF_DOUBLE,1,idim2,nvarid) |
---|
335 | #else |
---|
336 | ierr = NF_DEF_VAR (nid,"QSOL",NF_FLOAT,1,idim2,nvarid) |
---|
337 | #endif |
---|
338 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 20, |
---|
339 | . "Eau dans le sol (mm)") |
---|
340 | ierr = NF_ENDDEF(nid) |
---|
341 | #ifdef NC_DOUBLE |
---|
342 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,qsol) |
---|
343 | #else |
---|
344 | ierr = NF_PUT_VAR_REAL (nid,nvarid,qsol) |
---|
345 | #endif |
---|
346 | c |
---|
347 | DO nsrf = 1, nbsrf |
---|
348 | IF (nsrf.LE.99) THEN |
---|
349 | WRITE(str2,'(i2.2)') nsrf |
---|
350 | ierr = NF_REDEF (nid) |
---|
351 | #ifdef NC_DOUBLE |
---|
352 | ierr = NF_DEF_VAR (nid,"ALBE"//str2,NF_DOUBLE,1,idim2,nvarid) |
---|
353 | #else |
---|
354 | ierr = NF_DEF_VAR (nid,"ALBE"//str2,NF_FLOAT,1,idim2,nvarid) |
---|
355 | #endif |
---|
356 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 23, |
---|
357 | . "albedo de surface No."//str2) |
---|
358 | ierr = NF_ENDDEF(nid) |
---|
359 | ELSE |
---|
360 | PRINT*, "Trop de sous-mailles" |
---|
361 | CALL abort |
---|
362 | ENDIF |
---|
363 | #ifdef NC_DOUBLE |
---|
364 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,albedo(1,nsrf)) |
---|
365 | #else |
---|
366 | ierr = NF_PUT_VAR_REAL (nid,nvarid,albedo(1,nsrf)) |
---|
367 | #endif |
---|
368 | ENDDO |
---|
369 | |
---|
370 | cIM BEG albedo LW |
---|
371 | DO nsrf = 1, nbsrf |
---|
372 | IF (nsrf.LE.99) THEN |
---|
373 | WRITE(str2,'(i2.2)') nsrf |
---|
374 | ierr = NF_REDEF (nid) |
---|
375 | #ifdef NC_DOUBLE |
---|
376 | ierr = NF_DEF_VAR (nid,"ALBLW"//str2,NF_DOUBLE,1,idim2,nvarid) |
---|
377 | #else |
---|
378 | ierr = NF_DEF_VAR (nid,"ALBLW"//str2,NF_FLOAT,1,idim2,nvarid) |
---|
379 | #endif |
---|
380 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 23, |
---|
381 | . "albedo LW de surface No."//str2) |
---|
382 | ierr = NF_ENDDEF(nid) |
---|
383 | ELSE |
---|
384 | PRINT*, "Trop de sous-mailles" |
---|
385 | CALL abort |
---|
386 | ENDIF |
---|
387 | #ifdef NC_DOUBLE |
---|
388 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,alblw(1,nsrf)) |
---|
389 | #else |
---|
390 | ierr = NF_PUT_VAR_REAL (nid,nvarid,alblw(1,nsrf)) |
---|
391 | #endif |
---|
392 | ENDDO |
---|
393 | cIM END albedo LW |
---|
394 | c |
---|
395 | DO nsrf = 1, nbsrf |
---|
396 | IF (nsrf.LE.99) THEN |
---|
397 | WRITE(str2,'(i2.2)') nsrf |
---|
398 | ierr = NF_REDEF (nid) |
---|
399 | #ifdef NC_DOUBLE |
---|
400 | ierr = NF_DEF_VAR (nid,"EVAP"//str2,NF_DOUBLE,1,idim2,nvarid) |
---|
401 | #else |
---|
402 | ierr = NF_DEF_VAR (nid,"EVAP"//str2,NF_FLOAT,1,idim2,nvarid) |
---|
403 | #endif |
---|
404 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 28, |
---|
405 | . "Evaporation de surface No."//str2) |
---|
406 | ierr = NF_ENDDEF(nid) |
---|
407 | ELSE |
---|
408 | PRINT*, "Trop de sous-mailles" |
---|
409 | CALL abort |
---|
410 | ENDIF |
---|
411 | #ifdef NC_DOUBLE |
---|
412 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,evap(1,nsrf)) |
---|
413 | #else |
---|
414 | ierr = NF_PUT_VAR_REAL (nid,nvarid,evap(1,nsrf)) |
---|
415 | #endif |
---|
416 | ENDDO |
---|
417 | |
---|
418 | c |
---|
419 | DO nsrf = 1, nbsrf |
---|
420 | IF (nsrf.LE.99) THEN |
---|
421 | WRITE(str2,'(i2.2)') nsrf |
---|
422 | ierr = NF_REDEF (nid) |
---|
423 | #ifdef NC_DOUBLE |
---|
424 | ierr = NF_DEF_VAR (nid,"SNOW"//str2,NF_DOUBLE,1,idim2,nvarid) |
---|
425 | #else |
---|
426 | ierr = NF_DEF_VAR (nid,"SNOW"//str2,NF_FLOAT,1,idim2,nvarid) |
---|
427 | #endif |
---|
428 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 22, |
---|
429 | . "Neige de surface No."//str2) |
---|
430 | ierr = NF_ENDDEF(nid) |
---|
431 | ELSE |
---|
432 | PRINT*, "Trop de sous-mailles" |
---|
433 | CALL abort |
---|
434 | ENDIF |
---|
435 | #ifdef NC_DOUBLE |
---|
436 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,snow(1,nsrf)) |
---|
437 | #else |
---|
438 | ierr = NF_PUT_VAR_REAL (nid,nvarid,snow(1,nsrf)) |
---|
439 | #endif |
---|
440 | ENDDO |
---|
441 | |
---|
442 | c |
---|
443 | ierr = NF_REDEF (nid) |
---|
444 | #ifdef NC_DOUBLE |
---|
445 | ierr = NF_DEF_VAR (nid, "RADS", NF_DOUBLE, 1, idim2,nvarid) |
---|
446 | #else |
---|
447 | ierr = NF_DEF_VAR (nid, "RADS", NF_FLOAT, 1, idim2,nvarid) |
---|
448 | #endif |
---|
449 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 28, |
---|
450 | . "Rayonnement net a la surface") |
---|
451 | ierr = NF_ENDDEF(nid) |
---|
452 | #ifdef NC_DOUBLE |
---|
453 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,radsol) |
---|
454 | #else |
---|
455 | ierr = NF_PUT_VAR_REAL (nid,nvarid,radsol) |
---|
456 | #endif |
---|
457 | c |
---|
458 | ierr = NF_REDEF (nid) |
---|
459 | #ifdef NC_DOUBLE |
---|
460 | ierr = NF_DEF_VAR (nid, "solsw", NF_DOUBLE, 1, idim2,nvarid) |
---|
461 | #else |
---|
462 | ierr = NF_DEF_VAR (nid, "solsw", NF_FLOAT, 1, idim2,nvarid) |
---|
463 | #endif |
---|
464 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 32, |
---|
465 | . "Rayonnement solaire a la surface") |
---|
466 | ierr = NF_ENDDEF(nid) |
---|
467 | #ifdef NC_DOUBLE |
---|
468 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,solsw) |
---|
469 | #else |
---|
470 | ierr = NF_PUT_VAR_REAL (nid,nvarid,solsw) |
---|
471 | #endif |
---|
472 | c |
---|
473 | ierr = NF_REDEF (nid) |
---|
474 | #ifdef NC_DOUBLE |
---|
475 | ierr = NF_DEF_VAR (nid, "sollw", NF_DOUBLE, 1, idim2,nvarid) |
---|
476 | #else |
---|
477 | ierr = NF_DEF_VAR (nid, "sollw", NF_FLOAT, 1, idim2,nvarid) |
---|
478 | #endif |
---|
479 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 27, |
---|
480 | . "Rayonnement IF a la surface") |
---|
481 | ierr = NF_ENDDEF(nid) |
---|
482 | #ifdef NC_DOUBLE |
---|
483 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,sollw) |
---|
484 | #else |
---|
485 | ierr = NF_PUT_VAR_REAL (nid,nvarid,sollw) |
---|
486 | #endif |
---|
487 | c |
---|
488 | ierr = NF_REDEF (nid) |
---|
489 | #ifdef NC_DOUBLE |
---|
490 | ierr = NF_DEF_VAR (nid, "fder", NF_DOUBLE, 1, idim2,nvarid) |
---|
491 | #else |
---|
492 | ierr = NF_DEF_VAR (nid, "fder", NF_FLOAT, 1, idim2,nvarid) |
---|
493 | #endif |
---|
494 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 14, |
---|
495 | . "Derive de flux") |
---|
496 | ierr = NF_ENDDEF(nid) |
---|
497 | #ifdef NC_DOUBLE |
---|
498 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,fder) |
---|
499 | #else |
---|
500 | ierr = NF_PUT_VAR_REAL (nid,nvarid,fder) |
---|
501 | #endif |
---|
502 | c |
---|
503 | ierr = NF_REDEF (nid) |
---|
504 | #ifdef NC_DOUBLE |
---|
505 | ierr = NF_DEF_VAR (nid, "rain_f", NF_DOUBLE, 1, idim2,nvarid) |
---|
506 | #else |
---|
507 | ierr = NF_DEF_VAR (nid, "rain_f", NF_FLOAT, 1, idim2,nvarid) |
---|
508 | #endif |
---|
509 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 21, |
---|
510 | . "precipitation liquide") |
---|
511 | ierr = NF_ENDDEF(nid) |
---|
512 | #ifdef NC_DOUBLE |
---|
513 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,rain_fall) |
---|
514 | #else |
---|
515 | ierr = NF_PUT_VAR_REAL (nid,nvarid,rain_fall) |
---|
516 | #endif |
---|
517 | c |
---|
518 | ierr = NF_REDEF (nid) |
---|
519 | #ifdef NC_DOUBLE |
---|
520 | ierr = NF_DEF_VAR (nid, "snow_f", NF_DOUBLE, 1, idim2,nvarid) |
---|
521 | #else |
---|
522 | ierr = NF_DEF_VAR (nid, "snow_f", NF_FLOAT, 1, idim2,nvarid) |
---|
523 | #endif |
---|
524 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 20, |
---|
525 | . "precipitation solide") |
---|
526 | ierr = NF_ENDDEF(nid) |
---|
527 | #ifdef NC_DOUBLE |
---|
528 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,snow_fall) |
---|
529 | #else |
---|
530 | ierr = NF_PUT_VAR_REAL (nid,nvarid,snow_fall) |
---|
531 | #endif |
---|
532 | c |
---|
533 | DO nsrf = 1, nbsrf |
---|
534 | IF (nsrf.LE.99) THEN |
---|
535 | WRITE(str2,'(i2.2)') nsrf |
---|
536 | ierr = NF_REDEF (nid) |
---|
537 | #ifdef NC_DOUBLE |
---|
538 | ierr = NF_DEF_VAR (nid,"RUG"//str2,NF_DOUBLE,1,idim2,nvarid) |
---|
539 | #else |
---|
540 | ierr = NF_DEF_VAR (nid,"RUG"//str2,NF_FLOAT,1,idim2,nvarid) |
---|
541 | #endif |
---|
542 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 23, |
---|
543 | . "rugosite de surface No."//str2) |
---|
544 | ierr = NF_ENDDEF(nid) |
---|
545 | ELSE |
---|
546 | PRINT*, "Trop de sous-mailles" |
---|
547 | CALL abort |
---|
548 | ENDIF |
---|
549 | #ifdef NC_DOUBLE |
---|
550 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,frugs(1,nsrf)) |
---|
551 | #else |
---|
552 | ierr = NF_PUT_VAR_REAL (nid,nvarid,frugs(1,nsrf)) |
---|
553 | #endif |
---|
554 | ENDDO |
---|
555 | c |
---|
556 | DO nsrf = 1, nbsrf |
---|
557 | IF (nsrf.LE.99) THEN |
---|
558 | WRITE(str2,'(i2.2)') nsrf |
---|
559 | ierr = NF_REDEF (nid) |
---|
560 | #ifdef NC_DOUBLE |
---|
561 | ierr = NF_DEF_VAR (nid,"AGESNO"//str2,NF_DOUBLE,1,idim2 |
---|
562 | $ ,nvarid) |
---|
563 | #else |
---|
564 | ierr = NF_DEF_VAR (nid,"AGESNO"//str2,NF_FLOAT,1,idim2 |
---|
565 | $ ,nvarid) |
---|
566 | #endif |
---|
567 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 15, |
---|
568 | . "Age de la neige surface No."//str2) |
---|
569 | ierr = NF_ENDDEF(nid) |
---|
570 | ELSE |
---|
571 | PRINT*, "Trop de sous-mailles" |
---|
572 | CALL abort |
---|
573 | ENDIF |
---|
574 | #ifdef NC_DOUBLE |
---|
575 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,agesno(1,nsrf)) |
---|
576 | #else |
---|
577 | ierr = NF_PUT_VAR_REAL (nid,nvarid,agesno(1,nsrf)) |
---|
578 | #endif |
---|
579 | ENDDO |
---|
580 | c |
---|
581 | ierr = NF_REDEF (nid) |
---|
582 | #ifdef NC_DOUBLE |
---|
583 | ierr = NF_DEF_VAR (nid, "ZMEA", NF_DOUBLE, 1, idim2,nvarid) |
---|
584 | #else |
---|
585 | ierr = NF_DEF_VAR (nid, "ZMEA", NF_FLOAT, 1, idim2,nvarid) |
---|
586 | #endif |
---|
587 | ierr = NF_ENDDEF(nid) |
---|
588 | #ifdef NC_DOUBLE |
---|
589 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,zmea) |
---|
590 | #else |
---|
591 | ierr = NF_PUT_VAR_REAL (nid,nvarid,zmea) |
---|
592 | #endif |
---|
593 | c |
---|
594 | ierr = NF_REDEF (nid) |
---|
595 | #ifdef NC_DOUBLE |
---|
596 | ierr = NF_DEF_VAR (nid, "ZSTD", NF_DOUBLE, 1, idim2,nvarid) |
---|
597 | #else |
---|
598 | ierr = NF_DEF_VAR (nid, "ZSTD", NF_FLOAT, 1, idim2,nvarid) |
---|
599 | #endif |
---|
600 | ierr = NF_ENDDEF(nid) |
---|
601 | #ifdef NC_DOUBLE |
---|
602 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,zstd) |
---|
603 | #else |
---|
604 | ierr = NF_PUT_VAR_REAL (nid,nvarid,zstd) |
---|
605 | #endif |
---|
606 | ierr = NF_REDEF (nid) |
---|
607 | #ifdef NC_DOUBLE |
---|
608 | ierr = NF_DEF_VAR (nid, "ZSIG", NF_DOUBLE, 1, idim2,nvarid) |
---|
609 | #else |
---|
610 | ierr = NF_DEF_VAR (nid, "ZSIG", NF_FLOAT, 1, idim2,nvarid) |
---|
611 | #endif |
---|
612 | ierr = NF_ENDDEF(nid) |
---|
613 | #ifdef NC_DOUBLE |
---|
614 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,zsig) |
---|
615 | #else |
---|
616 | ierr = NF_PUT_VAR_REAL (nid,nvarid,zsig) |
---|
617 | #endif |
---|
618 | ierr = NF_REDEF (nid) |
---|
619 | #ifdef NC_DOUBLE |
---|
620 | ierr = NF_DEF_VAR (nid, "ZGAM", NF_DOUBLE, 1, idim2,nvarid) |
---|
621 | #else |
---|
622 | ierr = NF_DEF_VAR (nid, "ZGAM", NF_FLOAT, 1, idim2,nvarid) |
---|
623 | #endif |
---|
624 | ierr = NF_ENDDEF(nid) |
---|
625 | #ifdef NC_DOUBLE |
---|
626 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,zgam) |
---|
627 | #else |
---|
628 | ierr = NF_PUT_VAR_REAL (nid,nvarid,zgam) |
---|
629 | #endif |
---|
630 | ierr = NF_REDEF (nid) |
---|
631 | #ifdef NC_DOUBLE |
---|
632 | ierr = NF_DEF_VAR (nid, "ZTHE", NF_DOUBLE, 1, idim2,nvarid) |
---|
633 | #else |
---|
634 | ierr = NF_DEF_VAR (nid, "ZTHE", NF_FLOAT, 1, idim2,nvarid) |
---|
635 | #endif |
---|
636 | ierr = NF_ENDDEF(nid) |
---|
637 | #ifdef NC_DOUBLE |
---|
638 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,zthe) |
---|
639 | #else |
---|
640 | ierr = NF_PUT_VAR_REAL (nid,nvarid,zthe) |
---|
641 | #endif |
---|
642 | ierr = NF_REDEF (nid) |
---|
643 | #ifdef NC_DOUBLE |
---|
644 | ierr = NF_DEF_VAR (nid, "ZPIC", NF_DOUBLE, 1, idim2,nvarid) |
---|
645 | #else |
---|
646 | ierr = NF_DEF_VAR (nid, "ZPIC", NF_FLOAT, 1, idim2,nvarid) |
---|
647 | #endif |
---|
648 | ierr = NF_ENDDEF(nid) |
---|
649 | #ifdef NC_DOUBLE |
---|
650 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,zpic) |
---|
651 | #else |
---|
652 | ierr = NF_PUT_VAR_REAL (nid,nvarid,zpic) |
---|
653 | #endif |
---|
654 | ierr = NF_REDEF (nid) |
---|
655 | #ifdef NC_DOUBLE |
---|
656 | ierr = NF_DEF_VAR (nid, "ZVAL", NF_DOUBLE, 1, idim2,nvarid) |
---|
657 | #else |
---|
658 | ierr = NF_DEF_VAR (nid, "ZVAL", NF_FLOAT, 1, idim2,nvarid) |
---|
659 | #endif |
---|
660 | ierr = NF_ENDDEF(nid) |
---|
661 | #ifdef NC_DOUBLE |
---|
662 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,zval) |
---|
663 | #else |
---|
664 | ierr = NF_PUT_VAR_REAL (nid,nvarid,zval) |
---|
665 | #endif |
---|
666 | ierr = NF_REDEF (nid) |
---|
667 | #ifdef NC_DOUBLE |
---|
668 | ierr = NF_DEF_VAR (nid, "RUGSREL", NF_DOUBLE, 1, idim2,nvarid) |
---|
669 | #else |
---|
670 | ierr = NF_DEF_VAR (nid, "RUGSREL", NF_FLOAT, 1, idim2,nvarid) |
---|
671 | #endif |
---|
672 | ierr = NF_ENDDEF(nid) |
---|
673 | #ifdef NC_DOUBLE |
---|
674 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,rugsrel) |
---|
675 | #else |
---|
676 | ierr = NF_PUT_VAR_REAL (nid,nvarid,rugsrel) |
---|
677 | #endif |
---|
678 | c |
---|
679 | ierr = NF_REDEF (nid) |
---|
680 | #ifdef NC_DOUBLE |
---|
681 | ierr = NF_DEF_VAR (nid, "TANCIEN", NF_DOUBLE, 1, idim3,nvarid) |
---|
682 | #else |
---|
683 | ierr = NF_DEF_VAR (nid, "TANCIEN", NF_FLOAT, 1, idim3,nvarid) |
---|
684 | #endif |
---|
685 | ierr = NF_ENDDEF(nid) |
---|
686 | #ifdef NC_DOUBLE |
---|
687 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,t_ancien) |
---|
688 | #else |
---|
689 | ierr = NF_PUT_VAR_REAL (nid,nvarid,t_ancien) |
---|
690 | #endif |
---|
691 | c |
---|
692 | ierr = NF_REDEF (nid) |
---|
693 | #ifdef NC_DOUBLE |
---|
694 | ierr = NF_DEF_VAR (nid, "QANCIEN", NF_DOUBLE, 1, idim3,nvarid) |
---|
695 | #else |
---|
696 | ierr = NF_DEF_VAR (nid, "QANCIEN", NF_FLOAT, 1, idim3,nvarid) |
---|
697 | #endif |
---|
698 | ierr = NF_ENDDEF(nid) |
---|
699 | #ifdef NC_DOUBLE |
---|
700 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,q_ancien) |
---|
701 | #else |
---|
702 | ierr = NF_PUT_VAR_REAL (nid,nvarid,q_ancien) |
---|
703 | #endif |
---|
704 | c |
---|
705 | ierr = NF_REDEF (nid) |
---|
706 | #ifdef NC_DOUBLE |
---|
707 | ierr = NF_DEF_VAR (nid, "RUGMER", NF_DOUBLE, 1, idim2,nvarid) |
---|
708 | #else |
---|
709 | ierr = NF_DEF_VAR (nid, "RUGMER", NF_FLOAT, 1, idim2,nvarid) |
---|
710 | #endif |
---|
711 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 28, |
---|
712 | . "Longueur de rugosite sur mer") |
---|
713 | ierr = NF_ENDDEF(nid) |
---|
714 | #ifdef NC_DOUBLE |
---|
715 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,frugs(1,is_oce)) |
---|
716 | #else |
---|
717 | ierr = NF_PUT_VAR_REAL (nid,nvarid,frugs(1,is_oce)) |
---|
718 | #endif |
---|
719 | c |
---|
720 | ierr = NF_REDEF (nid) |
---|
721 | #ifdef NC_DOUBLE |
---|
722 | ierr = NF_DEF_VAR (nid, "CLWCON", NF_DOUBLE, 1, idim2,nvarid) |
---|
723 | #else |
---|
724 | ierr = NF_DEF_VAR (nid, "CLWCON", NF_FLOAT, 1, idim2,nvarid) |
---|
725 | #endif |
---|
726 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 28, |
---|
727 | . "Eau liquide convective") |
---|
728 | ierr = NF_ENDDEF(nid) |
---|
729 | #ifdef NC_DOUBLE |
---|
730 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,clwcon) |
---|
731 | #else |
---|
732 | ierr = NF_PUT_VAR_REAL (nid,nvarid,clwcon) |
---|
733 | #endif |
---|
734 | c |
---|
735 | ierr = NF_REDEF (nid) |
---|
736 | #ifdef NC_DOUBLE |
---|
737 | ierr = NF_DEF_VAR (nid, "RNEBCON", NF_DOUBLE, 1, idim2,nvarid) |
---|
738 | #else |
---|
739 | ierr = NF_DEF_VAR (nid, "RNEBCON", NF_FLOAT, 1, idim2,nvarid) |
---|
740 | #endif |
---|
741 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 28, |
---|
742 | . "Nebulosite convective") |
---|
743 | ierr = NF_ENDDEF(nid) |
---|
744 | #ifdef NC_DOUBLE |
---|
745 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,rnebcon) |
---|
746 | #else |
---|
747 | ierr = NF_PUT_VAR_REAL (nid,nvarid,rnebcon) |
---|
748 | #endif |
---|
749 | c |
---|
750 | ierr = NF_REDEF (nid) |
---|
751 | #ifdef NC_DOUBLE |
---|
752 | ierr = NF_DEF_VAR (nid, "RATQS", NF_DOUBLE, 1, idim2,nvarid) |
---|
753 | #else |
---|
754 | ierr = NF_DEF_VAR (nid, "RATQS", NF_FLOAT, 1, idim2,nvarid) |
---|
755 | #endif |
---|
756 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 28, |
---|
757 | . "Ratqs") |
---|
758 | ierr = NF_ENDDEF(nid) |
---|
759 | #ifdef NC_DOUBLE |
---|
760 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,ratqs) |
---|
761 | #else |
---|
762 | ierr = NF_PUT_VAR_REAL (nid,nvarid,ratqs) |
---|
763 | #endif |
---|
764 | c |
---|
765 | c run_off_lic_0 |
---|
766 | c |
---|
767 | ierr = NF_REDEF (nid) |
---|
768 | #ifdef NC_DOUBLE |
---|
769 | ierr=NF_DEF_VAR(nid,"RUNOFFLIC0",NF_DOUBLE,1,idim2,nvarid) |
---|
770 | #else |
---|
771 | ierr=NF_DEF_VAR(nid,"RUNOFFLIC0",NF_FLOAT, 1,idim2,nvarid) |
---|
772 | #endif |
---|
773 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"title", 28, |
---|
774 | . "Runofflic0") |
---|
775 | ierr = NF_ENDDEF(nid) |
---|
776 | #ifdef NC_DOUBLE |
---|
777 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,run_off_lic_0) |
---|
778 | #else |
---|
779 | ierr = NF_PUT_VAR_REAL (nid,nvarid,run_off_lic_0) |
---|
780 | #endif |
---|
781 | c |
---|
782 | c |
---|
783 | ierr = NF_CLOSE(nid) |
---|
784 | c |
---|
785 | RETURN |
---|
786 | END |
---|