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

Contents of /trunk/phylmd/phyetat0.f

Parent Directory Parent Directory | Revision Log Revision Log


Revision 101 - (show annotations)
Mon Jul 7 17:45:21 2014 UTC (9 years, 10 months ago) by guez
File size: 21950 byte(s)
Removed unused files "interfoce_slab.f" and "gath2cpl.f". Removed
unused variables coastalflow and riverflow of module
interface_surf. Removed unused arguments cal, radsol, dif_grnd,
fluxlat, fluxsens, dflux_s, dflux_l of procedure fonte_neige. Removed
unused arguments tslab, seaice of procedure interfsurf_hq and
clqh. Removed unused arguments seaice of procedure clmain.

In interfsurf_hq, used variable soil_model of module clesphys2 instead
of cascading it as an argument from physiq.

In phyetat0, stop if masque not found.

Variable TS instead of "TS[0-9][0-9]" in "(re)startphy.nc", with
additional dimension nbsrf.

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

  ViewVC Help
Powered by ViewVC 1.1.21