/[lmdze]/trunk/Sources/phylmd/phyetat0.f
ViewVC logotype

Contents of /trunk/Sources/phylmd/phyetat0.f

Parent Directory Parent Directory | Revision Log Revision Log


Revision 138 - (show annotations)
Fri May 22 23:13:19 2015 UTC (8 years, 11 months ago) by guez
File size: 22015 byte(s)
Moved variable nb_files from module histcom_var to module
histbeg_totreg_m.

Removed unused argument q of writehist.

No history file is created in program ce0l so there is no need to call
histclo in etat0.

In phyredem, access variables rlat and rlon directly from module
phyetat0_m instead of having them as arguments. This is clearer for
the program gcm. There are bad side effects for the program ce0l: we
have to modify the module variables rlat and rlon in procedure etat0,
and we need the additional file phyetat0.f to compile ce0l.

1 module phyetat0_m
2
3 use dimphy, only: klon
4
5 IMPLICIT none
6
7 REAL, save:: rlat(klon), rlon(klon)
8 ! latitude and longitude of a point of the scalar grid identified
9 ! by a simple index, in degrees
10
11 private klon
12
13 contains
14
15 SUBROUTINE phyetat0(pctsrf, tsol, tsoil, tslab, seaice, qsurf, qsol, &
16 snow, albe, alblw, evap, rain_fall, snow_fall, solsw, sollw, fder, &
17 radsol, frugs, agesno, zmea, zstd, zsig, zgam, zthe, zpic, zval, &
18 t_ancien, q_ancien, ancien_ok, rnebcon, ratqs, clwcon, run_off_lic_0, &
19 sig1, w01)
20
21 ! From phylmd/phyetat0.F, version 1.4 2005/06/03 10:03:07
22 ! Author: Z.X. Li (LMD/CNRS)
23 ! Date: 1993/08/18
24 ! Objet : lecture de l'état initial pour la physique
25
26 use dimphy, only: zmasq, klev
27 USE dimsoil, ONLY : nsoilmx
28 USE indicesol, ONLY : epsfra, is_lic, is_oce, is_sic, is_ter, nbsrf
29 use netcdf, only: nf90_global, nf90_inq_varid, NF90_NOERR, &
30 NF90_NOWRITE
31 use netcdf95, only: nf95_close, nf95_get_att, nf95_get_var, &
32 nf95_inq_varid, nf95_inquire_variable, NF95_OPEN
33 USE temps, ONLY : itau_phy
34
35 REAL pctsrf(klon, nbsrf)
36 REAL tsol(klon, nbsrf)
37 REAL tsoil(klon, nsoilmx, nbsrf)
38 REAL tslab(klon), seaice(klon)
39 REAL qsurf(klon, nbsrf)
40 REAL, intent(out):: qsol(:) ! (klon)
41 REAL snow(klon, nbsrf)
42 REAL albe(klon, nbsrf)
43 REAL alblw(klon, nbsrf)
44 REAL evap(klon, nbsrf)
45 REAL, intent(out):: rain_fall(klon)
46 REAL snow_fall(klon)
47 real solsw(klon)
48 REAL, intent(out):: 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, intent(out):: zstd(klon)
55 REAL, intent(out):: zsig(klon)
56 REAL zgam(klon)
57 REAL zthe(klon)
58 REAL zpic(klon)
59 REAL zval(klon)
60 REAL t_ancien(klon, klev), q_ancien(klon, klev)
61 LOGICAL, intent(out):: ancien_ok
62 real rnebcon(klon, klev), ratqs(klon, klev), clwcon(klon, klev)
63 REAL run_off_lic_0(klon)
64 real, intent(out):: sig1(klon, klev) ! section adiabatic updraft
65
66 real, intent(out):: w01(klon, klev)
67 ! vertical velocity within adiabatic updraft
68
69 ! Local:
70 REAL fractint(klon)
71 REAL xmin, xmax
72 INTEGER ncid, varid, ndims
73 INTEGER ierr, i, nsrf, isoil
74 CHARACTER(len=7) str7
75 CHARACTER(len=2) str2
76
77 !---------------------------------------------------------------
78
79 print *, "Call sequence information: phyetat0"
80
81 ! Fichier contenant l'état initial :
82 call NF95_OPEN("startphy.nc", NF90_NOWRITE, ncid)
83
84 call nf95_get_att(ncid, nf90_global, "itau_phy", itau_phy)
85
86 ! Lecture des latitudes (coordonnees):
87
88 call NF95_INQ_VARID(ncid, "latitude", varid)
89 call NF95_GET_VAR(ncid, varid, rlat)
90
91 ! Lecture des longitudes (coordonnees):
92
93 call NF95_INQ_VARID(ncid, "longitude", varid)
94 call NF95_GET_VAR(ncid, varid, rlon)
95
96 ! Lecture du masque terre mer
97
98 call NF95_INQ_VARID(ncid, "masque", varid)
99 call nf95_get_var(ncid, varid, zmasq)
100
101 ! Lecture des fractions pour chaque sous-surface
102
103 ! initialisation des sous-surfaces
104
105 pctsrf = 0.
106
107 ! fraction de terre
108
109 ierr = NF90_INQ_VARID(ncid, "FTER", varid)
110 IF (ierr == NF90_NOERR) THEN
111 call nf95_get_var(ncid, varid, pctsrf(:, is_ter))
112 else
113 PRINT *, 'phyetat0: Le champ <FTER> est absent'
114 ENDIF
115
116 ! fraction de glace de terre
117
118 ierr = NF90_INQ_VARID(ncid, "FLIC", varid)
119 IF (ierr == NF90_NOERR) THEN
120 call nf95_get_var(ncid, varid, pctsrf(:, is_lic))
121 else
122 PRINT *, 'phyetat0: Le champ <FLIC> est absent'
123 ENDIF
124
125 ! fraction d'ocean
126
127 ierr = NF90_INQ_VARID(ncid, "FOCE", varid)
128 IF (ierr == NF90_NOERR) THEN
129 call nf95_get_var(ncid, varid, pctsrf(:, is_oce))
130 else
131 PRINT *, 'phyetat0: Le champ <FOCE> est absent'
132 ENDIF
133
134 ! fraction glace de mer
135
136 ierr = NF90_INQ_VARID(ncid, "FSIC", varid)
137 IF (ierr == NF90_NOERR) THEN
138 call nf95_get_var(ncid, varid, pctsrf(:, is_sic))
139 else
140 PRINT *, 'phyetat0: Le champ <FSIC> est absent'
141 ENDIF
142
143 ! Verification de l'adequation entre le masque et les sous-surfaces
144
145 fractint = pctsrf(:, is_ter) + pctsrf(:, is_lic)
146 DO i = 1 , klon
147 IF ( abs(fractint(i) - zmasq(i) ) > EPSFRA ) THEN
148 WRITE(*, *) 'phyetat0: attention fraction terre pas ', &
149 'coherente ', i, zmasq(i), pctsrf(i, is_ter) &
150 , pctsrf(i, is_lic)
151 ENDIF
152 END DO
153 fractint = pctsrf(:, is_oce) + pctsrf(:, is_sic)
154 DO i = 1 , klon
155 IF ( abs( fractint(i) - (1. - zmasq(i))) > EPSFRA ) THEN
156 WRITE(*, *) 'phyetat0 attention fraction ocean pas ', &
157 'coherente ', i, zmasq(i) , pctsrf(i, is_oce) &
158 , pctsrf(i, is_sic)
159 ENDIF
160 END DO
161
162 ! Lecture des temperatures du sol:
163 call NF95_INQ_VARID(ncid, "TS", varid)
164 call nf95_inquire_variable(ncid, varid, ndims = ndims)
165 if (ndims == 2) then
166 call NF95_GET_VAR(ncid, varid, tsol)
167 else
168 print *, "Found only one surface type for soil temperature."
169 call nf95_get_var(ncid, varid, tsol(:, 1))
170 tsol(:, 2:nbsrf) = spread(tsol(:, 1), dim = 2, ncopies = nbsrf - 1)
171 end if
172
173 ! Lecture des temperatures du sol profond:
174
175 DO nsrf = 1, nbsrf
176 DO isoil=1, nsoilmx
177 IF (isoil > 99 .AND. nsrf > 99) THEN
178 PRINT *, "Trop de couches ou sous-mailles"
179 stop 1
180 ENDIF
181 WRITE(str7, '(i2.2, "srf", i2.2)') isoil, nsrf
182 ierr = NF90_INQ_VARID(ncid, 'Tsoil'//str7, varid)
183 IF (ierr /= NF90_NOERR) THEN
184 PRINT *, "phyetat0: Le champ <Tsoil"//str7//"> est absent"
185 PRINT *, " Il prend donc la valeur de surface"
186 DO i=1, klon
187 tsoil(i, isoil, nsrf)=tsol(i, nsrf)
188 ENDDO
189 ELSE
190 call NF95_GET_VAR(ncid, varid, tsoil(:, isoil, nsrf))
191 ENDIF
192 ENDDO
193 ENDDO
194
195 !IM "slab" ocean
196 ! Lecture de tslab (pour slab ocean seulement):
197 tslab = 0.
198 seaice = 0.
199
200 ! Lecture de l'humidite de l'air juste au dessus du sol:
201
202 ierr = NF90_INQ_VARID(ncid, "QS", varid)
203 IF (ierr /= NF90_NOERR) THEN
204 PRINT *, 'phyetat0: Le champ <QS> est absent'
205 PRINT *, ' Mais je vais essayer de lire QS**'
206 DO nsrf = 1, nbsrf
207 IF (nsrf > 99) THEN
208 PRINT *, "Trop de sous-mailles"
209 stop 1
210 ENDIF
211 WRITE(str2, '(i2.2)') nsrf
212 call NF95_INQ_VARID(ncid, "QS"//str2, varid)
213 call NF95_GET_VAR(ncid, varid, qsurf(:, nsrf))
214 xmin = 1.0E+20
215 xmax = -1.0E+20
216 DO i = 1, klon
217 xmin = MIN(qsurf(i, nsrf), xmin)
218 xmax = MAX(qsurf(i, nsrf), xmax)
219 ENDDO
220 PRINT *, 'Humidite pres du sol QS**:', nsrf, xmin, xmax
221 ENDDO
222 ELSE
223 PRINT *, 'phyetat0: Le champ <QS> est present'
224 PRINT *, ' J ignore donc les autres humidites QS**'
225 call nf95_get_var(ncid, varid, qsurf(:, 1))
226 xmin = 1.0E+20
227 xmax = -1.0E+20
228 DO i = 1, klon
229 xmin = MIN(qsurf(i, 1), xmin)
230 xmax = MAX(qsurf(i, 1), xmax)
231 ENDDO
232 PRINT *, 'Humidite pres du sol <QS>', xmin, xmax
233 DO nsrf = 2, nbsrf
234 DO i = 1, klon
235 qsurf(i, nsrf) = qsurf(i, 1)
236 ENDDO
237 ENDDO
238 ENDIF
239
240 ! Eau dans le sol (pour le modele de sol "bucket")
241
242 ierr = NF90_INQ_VARID(ncid, "QSOL", varid)
243 IF (ierr == NF90_NOERR) THEN
244 call nf95_get_var(ncid, varid, qsol)
245 else
246 PRINT *, 'phyetat0: Le champ <QSOL> est absent'
247 PRINT *, ' Valeur par defaut nulle'
248 qsol = 0.
249 ENDIF
250
251 ! Lecture de neige au sol:
252
253 ierr = NF90_INQ_VARID(ncid, "SNOW", varid)
254 IF (ierr /= NF90_NOERR) THEN
255 PRINT *, 'phyetat0: Le champ <SNOW> est absent'
256 PRINT *, ' Mais je vais essayer de lire SNOW**'
257 DO nsrf = 1, nbsrf
258 IF (nsrf > 99) THEN
259 PRINT *, "Trop de sous-mailles"
260 stop 1
261 ENDIF
262 WRITE(str2, '(i2.2)') nsrf
263 call NF95_INQ_VARID(ncid, "SNOW"//str2, varid)
264 call NF95_GET_VAR(ncid, varid, snow(:, nsrf))
265 xmin = 1.0E+20
266 xmax = -1.0E+20
267 DO i = 1, klon
268 xmin = MIN(snow(i, nsrf), xmin)
269 xmax = MAX(snow(i, nsrf), xmax)
270 ENDDO
271 PRINT *, 'Neige du sol SNOW**:', nsrf, xmin, xmax
272 ENDDO
273 ELSE
274 PRINT *, 'phyetat0: Le champ <SNOW> est present'
275 PRINT *, ' J ignore donc les autres neiges SNOW**'
276 call nf95_get_var(ncid, varid, snow(:, 1))
277 xmin = 1.0E+20
278 xmax = -1.0E+20
279 DO i = 1, klon
280 xmin = MIN(snow(i, 1), xmin)
281 xmax = MAX(snow(i, 1), xmax)
282 ENDDO
283 PRINT *, 'Neige du sol <SNOW>', xmin, xmax
284 DO nsrf = 2, nbsrf
285 DO i = 1, klon
286 snow(i, nsrf) = snow(i, 1)
287 ENDDO
288 ENDDO
289 ENDIF
290
291 ! Lecture de albedo au sol:
292
293 ierr = NF90_INQ_VARID(ncid, "ALBE", varid)
294 IF (ierr /= NF90_NOERR) THEN
295 PRINT *, 'phyetat0: Le champ <ALBE> est absent'
296 PRINT *, ' Mais je vais essayer de lire ALBE**'
297 DO nsrf = 1, nbsrf
298 IF (nsrf > 99) THEN
299 PRINT *, "Trop de sous-mailles"
300 stop 1
301 ENDIF
302 WRITE(str2, '(i2.2)') nsrf
303 call NF95_INQ_VARID(ncid, "ALBE"//str2, varid)
304 call NF95_GET_VAR(ncid, varid, albe(:, nsrf))
305 xmin = 1.0E+20
306 xmax = -1.0E+20
307 DO i = 1, klon
308 xmin = MIN(albe(i, nsrf), xmin)
309 xmax = MAX(albe(i, nsrf), xmax)
310 ENDDO
311 PRINT *, 'Albedo du sol ALBE**:', nsrf, xmin, xmax
312 ENDDO
313 ELSE
314 PRINT *, 'phyetat0: Le champ <ALBE> est present'
315 PRINT *, ' J ignore donc les autres ALBE**'
316 call nf95_get_var(ncid, varid, albe(:, 1))
317 xmin = 1.0E+20
318 xmax = -1.0E+20
319 DO i = 1, klon
320 xmin = MIN(albe(i, 1), xmin)
321 xmax = MAX(albe(i, 1), xmax)
322 ENDDO
323 PRINT *, 'Neige du sol <ALBE>', xmin, xmax
324 DO nsrf = 2, nbsrf
325 DO i = 1, klon
326 albe(i, nsrf) = albe(i, 1)
327 ENDDO
328 ENDDO
329 ENDIF
330
331 ! Lecture de albedo au sol LW:
332
333 ierr = NF90_INQ_VARID(ncid, "ALBLW", varid)
334 IF (ierr /= NF90_NOERR) THEN
335 PRINT *, 'phyetat0: Le champ <ALBLW> est absent'
336 ! PRINT *, ' Mais je vais essayer de lire ALBLW**'
337 PRINT *, ' Mais je vais prendre ALBE**'
338 DO nsrf = 1, nbsrf
339 DO i = 1, klon
340 alblw(i, nsrf) = albe(i, nsrf)
341 ENDDO
342 ENDDO
343 ELSE
344 PRINT *, 'phyetat0: Le champ <ALBLW> est present'
345 PRINT *, ' J ignore donc les autres ALBLW**'
346 call nf95_get_var(ncid, varid, alblw(:, 1))
347 xmin = 1.0E+20
348 xmax = -1.0E+20
349 DO i = 1, klon
350 xmin = MIN(alblw(i, 1), xmin)
351 xmax = MAX(alblw(i, 1), xmax)
352 ENDDO
353 PRINT *, 'Neige du sol <ALBLW>', xmin, xmax
354 DO nsrf = 2, nbsrf
355 DO i = 1, klon
356 alblw(i, nsrf) = alblw(i, 1)
357 ENDDO
358 ENDDO
359 ENDIF
360
361 ! Lecture de evaporation:
362
363 ierr = NF90_INQ_VARID(ncid, "EVAP", varid)
364 IF (ierr /= NF90_NOERR) THEN
365 PRINT *, 'phyetat0: Le champ <EVAP> est absent'
366 PRINT *, ' Mais je vais essayer de lire EVAP**'
367 DO nsrf = 1, nbsrf
368 IF (nsrf > 99) THEN
369 PRINT *, "Trop de sous-mailles"
370 stop 1
371 ENDIF
372 WRITE(str2, '(i2.2)') nsrf
373 call NF95_INQ_VARID(ncid, "EVAP"//str2, varid)
374 call NF95_GET_VAR(ncid, varid, evap(:, nsrf))
375 xmin = 1.0E+20
376 xmax = -1.0E+20
377 DO i = 1, klon
378 xmin = MIN(evap(i, nsrf), xmin)
379 xmax = MAX(evap(i, nsrf), xmax)
380 ENDDO
381 PRINT *, 'evap du sol EVAP**:', nsrf, xmin, xmax
382 ENDDO
383 ELSE
384 PRINT *, 'phyetat0: Le champ <EVAP> est present'
385 PRINT *, ' J ignore donc les autres EVAP**'
386 call nf95_get_var(ncid, varid, evap(:, 1))
387 xmin = 1.0E+20
388 xmax = -1.0E+20
389 DO i = 1, klon
390 xmin = MIN(evap(i, 1), xmin)
391 xmax = MAX(evap(i, 1), xmax)
392 ENDDO
393 PRINT *, 'Evap du sol <EVAP>', xmin, xmax
394 DO nsrf = 2, nbsrf
395 DO i = 1, klon
396 evap(i, nsrf) = evap(i, 1)
397 ENDDO
398 ENDDO
399 ENDIF
400
401 ! Lecture precipitation liquide:
402
403 call NF95_INQ_VARID(ncid, "rain_f", varid)
404 call NF95_GET_VAR(ncid, varid, rain_fall)
405
406 ! Lecture precipitation solide:
407
408 call NF95_INQ_VARID(ncid, "snow_f", varid)
409 call NF95_GET_VAR(ncid, varid, snow_fall)
410 xmin = 1.0E+20
411 xmax = -1.0E+20
412 DO i = 1, klon
413 xmin = MIN(snow_fall(i), xmin)
414 xmax = MAX(snow_fall(i), xmax)
415 ENDDO
416 PRINT *, 'Precipitation solide snow_f:', xmin, xmax
417
418 ! Lecture rayonnement solaire au sol:
419
420 ierr = NF90_INQ_VARID(ncid, "solsw", varid)
421 IF (ierr /= NF90_NOERR) THEN
422 PRINT *, 'phyetat0: Le champ <solsw> est absent'
423 PRINT *, 'mis a zero'
424 solsw = 0.
425 ELSE
426 call nf95_get_var(ncid, varid, solsw)
427 ENDIF
428 xmin = 1.0E+20
429 xmax = -1.0E+20
430 DO i = 1, klon
431 xmin = MIN(solsw(i), xmin)
432 xmax = MAX(solsw(i), xmax)
433 ENDDO
434 PRINT *, 'Rayonnement solaire au sol solsw:', xmin, xmax
435
436 ! Lecture rayonnement IF au sol:
437
438 ierr = NF90_INQ_VARID(ncid, "sollw", varid)
439 IF (ierr /= NF90_NOERR) THEN
440 PRINT *, 'phyetat0: Le champ <sollw> est absent'
441 PRINT *, 'mis a zero'
442 sollw = 0.
443 ELSE
444 call nf95_get_var(ncid, varid, sollw)
445 ENDIF
446 PRINT *, 'Rayonnement IF au sol sollw:', minval(sollw), maxval(sollw)
447
448 ! Lecture derive des flux:
449
450 ierr = NF90_INQ_VARID(ncid, "fder", varid)
451 IF (ierr /= NF90_NOERR) THEN
452 PRINT *, 'phyetat0: Le champ <fder> est absent'
453 PRINT *, 'mis a zero'
454 fder = 0.
455 ELSE
456 call nf95_get_var(ncid, varid, fder)
457 ENDIF
458 xmin = 1.0E+20
459 xmax = -1.0E+20
460 DO i = 1, klon
461 xmin = MIN(fder(i), xmin)
462 xmax = MAX(fder(i), xmax)
463 ENDDO
464 PRINT *, 'Derive des flux fder:', xmin, xmax
465
466 ! Lecture du rayonnement net au sol:
467
468 call NF95_INQ_VARID(ncid, "RADS", varid)
469 call NF95_GET_VAR(ncid, varid, radsol)
470 xmin = 1.0E+20
471 xmax = -1.0E+20
472 DO i = 1, klon
473 xmin = MIN(radsol(i), xmin)
474 xmax = MAX(radsol(i), xmax)
475 ENDDO
476 PRINT *, 'Rayonnement net au sol radsol:', xmin, xmax
477
478 ! Lecture de la longueur de rugosite
479
480 ierr = NF90_INQ_VARID(ncid, "RUG", varid)
481 IF (ierr /= NF90_NOERR) THEN
482 PRINT *, 'phyetat0: Le champ <RUG> est absent'
483 PRINT *, ' Mais je vais essayer de lire RUG**'
484 DO nsrf = 1, nbsrf
485 IF (nsrf > 99) THEN
486 PRINT *, "Trop de sous-mailles"
487 stop 1
488 ENDIF
489 WRITE(str2, '(i2.2)') nsrf
490 call NF95_INQ_VARID(ncid, "RUG"//str2, varid)
491 call NF95_GET_VAR(ncid, varid, frugs(:, nsrf))
492 xmin = 1.0E+20
493 xmax = -1.0E+20
494 DO i = 1, klon
495 xmin = MIN(frugs(i, nsrf), xmin)
496 xmax = MAX(frugs(i, nsrf), xmax)
497 ENDDO
498 PRINT *, 'rugosite du sol RUG**:', nsrf, xmin, xmax
499 ENDDO
500 ELSE
501 PRINT *, 'phyetat0: Le champ <RUG> est present'
502 PRINT *, ' J ignore donc les autres RUG**'
503 call nf95_get_var(ncid, varid, frugs(:, 1))
504 xmin = 1.0E+20
505 xmax = -1.0E+20
506 DO i = 1, klon
507 xmin = MIN(frugs(i, 1), xmin)
508 xmax = MAX(frugs(i, 1), xmax)
509 ENDDO
510 PRINT *, 'rugosite <RUG>', xmin, xmax
511 DO nsrf = 2, nbsrf
512 DO i = 1, klon
513 frugs(i, nsrf) = frugs(i, 1)
514 ENDDO
515 ENDDO
516 ENDIF
517
518 ! Lecture de l'age de la neige:
519
520 ierr = NF90_INQ_VARID(ncid, "AGESNO", varid)
521 IF (ierr /= NF90_NOERR) THEN
522 PRINT *, 'phyetat0: Le champ <AGESNO> est absent'
523 PRINT *, ' Mais je vais essayer de lire AGESNO**'
524 DO nsrf = 1, nbsrf
525 IF (nsrf > 99) THEN
526 PRINT *, "Trop de sous-mailles"
527 stop 1
528 ENDIF
529 WRITE(str2, '(i2.2)') nsrf
530 ierr = NF90_INQ_VARID(ncid, "AGESNO"//str2, varid)
531 IF (ierr /= NF90_NOERR) THEN
532 PRINT *, "phyetat0: Le champ <AGESNO"//str2//"> est absent"
533 agesno = 50.0
534 ENDIF
535 call NF95_GET_VAR(ncid, varid, agesno(:, nsrf))
536 xmin = 1.0E+20
537 xmax = -1.0E+20
538 DO i = 1, klon
539 xmin = MIN(agesno(i, nsrf), xmin)
540 xmax = MAX(agesno(i, nsrf), xmax)
541 ENDDO
542 PRINT *, 'Age de la neige AGESNO**:', nsrf, xmin, xmax
543 ENDDO
544 ELSE
545 PRINT *, 'phyetat0: Le champ <AGESNO> est present'
546 PRINT *, ' J ignore donc les autres AGESNO**'
547 call nf95_get_var(ncid, varid, agesno(:, 1))
548 xmin = 1.0E+20
549 xmax = -1.0E+20
550 DO i = 1, klon
551 xmin = MIN(agesno(i, 1), xmin)
552 xmax = MAX(agesno(i, 1), xmax)
553 ENDDO
554 PRINT *, 'Age de la neige <AGESNO>', xmin, xmax
555 DO nsrf = 2, nbsrf
556 DO i = 1, klon
557 agesno(i, nsrf) = agesno(i, 1)
558 ENDDO
559 ENDDO
560 ENDIF
561
562 call NF95_INQ_VARID(ncid, "ZMEA", varid)
563 call NF95_GET_VAR(ncid, varid, zmea)
564 xmin = 1.0E+20
565 xmax = -1.0E+20
566 DO i = 1, klon
567 xmin = MIN(zmea(i), xmin)
568 xmax = MAX(zmea(i), xmax)
569 ENDDO
570 PRINT *, 'OROGRAPHIE SOUS-MAILLE zmea:', xmin, xmax
571
572 call NF95_INQ_VARID(ncid, "ZSTD", varid)
573 call NF95_GET_VAR(ncid, varid, zstd)
574 xmin = 1.0E+20
575 xmax = -1.0E+20
576 DO i = 1, klon
577 xmin = MIN(zstd(i), xmin)
578 xmax = MAX(zstd(i), xmax)
579 ENDDO
580 PRINT *, 'OROGRAPHIE SOUS-MAILLE zstd:', xmin, xmax
581
582 call NF95_INQ_VARID(ncid, "ZSIG", varid)
583 call NF95_GET_VAR(ncid, varid, zsig)
584 xmin = 1.0E+20
585 xmax = -1.0E+20
586 DO i = 1, klon
587 xmin = MIN(zsig(i), xmin)
588 xmax = MAX(zsig(i), xmax)
589 ENDDO
590 PRINT *, 'OROGRAPHIE SOUS-MAILLE zsig:', xmin, xmax
591
592 call NF95_INQ_VARID(ncid, "ZGAM", varid)
593 call NF95_GET_VAR(ncid, varid, zgam)
594 xmin = 1.0E+20
595 xmax = -1.0E+20
596 DO i = 1, klon
597 xmin = MIN(zgam(i), xmin)
598 xmax = MAX(zgam(i), xmax)
599 ENDDO
600 PRINT *, 'OROGRAPHIE SOUS-MAILLE zgam:', xmin, xmax
601
602 call NF95_INQ_VARID(ncid, "ZTHE", varid)
603 call NF95_GET_VAR(ncid, varid, zthe)
604 xmin = 1.0E+20
605 xmax = -1.0E+20
606 DO i = 1, klon
607 xmin = MIN(zthe(i), xmin)
608 xmax = MAX(zthe(i), xmax)
609 ENDDO
610 PRINT *, 'OROGRAPHIE SOUS-MAILLE zthe:', xmin, xmax
611
612 call NF95_INQ_VARID(ncid, "ZPIC", varid)
613 call NF95_GET_VAR(ncid, varid, zpic)
614 xmin = 1.0E+20
615 xmax = -1.0E+20
616 DO i = 1, klon
617 xmin = MIN(zpic(i), xmin)
618 xmax = MAX(zpic(i), xmax)
619 ENDDO
620 PRINT *, 'OROGRAPHIE SOUS-MAILLE zpic:', xmin, xmax
621
622 call NF95_INQ_VARID(ncid, "ZVAL", varid)
623 call NF95_GET_VAR(ncid, varid, zval)
624 xmin = 1.0E+20
625 xmax = -1.0E+20
626 DO i = 1, klon
627 xmin = MIN(zval(i), xmin)
628 xmax = MAX(zval(i), xmax)
629 ENDDO
630 PRINT *, 'OROGRAPHIE SOUS-MAILLE zval:', xmin, xmax
631
632 ancien_ok = .TRUE.
633
634 ierr = NF90_INQ_VARID(ncid, "TANCIEN", varid)
635 IF (ierr /= NF90_NOERR) THEN
636 PRINT *, "phyetat0: Le champ <TANCIEN> est absent"
637 PRINT *, "Depart legerement fausse. Mais je continue"
638 ancien_ok = .FALSE.
639 ELSE
640 call nf95_get_var(ncid, varid, t_ancien)
641 ENDIF
642
643 ierr = NF90_INQ_VARID(ncid, "QANCIEN", varid)
644 IF (ierr /= NF90_NOERR) THEN
645 PRINT *, "phyetat0: Le champ <QANCIEN> est absent"
646 PRINT *, "Depart legerement fausse. Mais je continue"
647 ancien_ok = .FALSE.
648 ELSE
649 call nf95_get_var(ncid, varid, q_ancien)
650 ENDIF
651
652 ierr = NF90_INQ_VARID(ncid, "CLWCON", varid)
653 IF (ierr /= NF90_NOERR) THEN
654 PRINT *, "phyetat0: Le champ CLWCON est absent"
655 PRINT *, "Depart legerement fausse. Mais je continue"
656 clwcon = 0.
657 ELSE
658 call nf95_get_var(ncid, varid, clwcon(:, 1))
659 clwcon(:, 2:) = 0.
660 ENDIF
661 xmin = 1.0E+20
662 xmax = -1.0E+20
663 xmin = MINval(clwcon)
664 xmax = MAXval(clwcon)
665 PRINT *, 'Eau liquide convective (ecart-type) clwcon:', xmin, xmax
666
667 ierr = NF90_INQ_VARID(ncid, "RNEBCON", varid)
668 IF (ierr /= NF90_NOERR) THEN
669 PRINT *, "phyetat0: Le champ RNEBCON est absent"
670 PRINT *, "Depart legerement fausse. Mais je continue"
671 rnebcon = 0.
672 ELSE
673 call nf95_get_var(ncid, varid, rnebcon(:, 1))
674 rnebcon(:, 2:) = 0.
675 ENDIF
676 xmin = 1.0E+20
677 xmax = -1.0E+20
678 xmin = MINval(rnebcon)
679 xmax = MAXval(rnebcon)
680 PRINT *, 'Nebulosite convective (ecart-type) rnebcon:', xmin, xmax
681
682 ! Lecture ratqs
683
684 ierr = NF90_INQ_VARID(ncid, "RATQS", varid)
685 IF (ierr /= NF90_NOERR) THEN
686 PRINT *, "phyetat0: Le champ <RATQS> est absent"
687 PRINT *, "Depart legerement fausse. Mais je continue"
688 ratqs = 0.
689 ELSE
690 call nf95_get_var(ncid, varid, ratqs(:, 1))
691 ratqs(:, 2:) = 0.
692 ENDIF
693 xmin = 1.0E+20
694 xmax = -1.0E+20
695 xmin = MINval(ratqs)
696 xmax = MAXval(ratqs)
697 PRINT *, '(ecart-type) ratqs:', xmin, xmax
698
699 ! Lecture run_off_lic_0
700
701 ierr = NF90_INQ_VARID(ncid, "RUNOFFLIC0", varid)
702 IF (ierr /= NF90_NOERR) THEN
703 PRINT *, "phyetat0: Le champ <RUNOFFLIC0> est absent"
704 PRINT *, "Depart legerement fausse. Mais je continue"
705 run_off_lic_0 = 0.
706 ELSE
707 call nf95_get_var(ncid, varid, run_off_lic_0)
708 ENDIF
709 xmin = 1.0E+20
710 xmax = -1.0E+20
711 xmin = MINval(run_off_lic_0)
712 xmax = MAXval(run_off_lic_0)
713 PRINT *, '(ecart-type) run_off_lic_0:', xmin, xmax
714
715 call nf95_inq_varid(ncid, "sig1", varid)
716 call nf95_get_var(ncid, varid, sig1)
717
718 call nf95_inq_varid(ncid, "w01", varid)
719 call nf95_get_var(ncid, varid, w01)
720
721 call NF95_CLOSE(ncid)
722
723 END SUBROUTINE phyetat0
724
725 end module phyetat0_m

  ViewVC Help
Powered by ViewVC 1.1.21