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

Contents of /trunk/phylmd/phyetat0.f

Parent Directory Parent Directory | Revision Log Revision Log


Revision 99 - (show annotations)
Wed Jul 2 18:39:15 2014 UTC (9 years, 10 months ago) by guez
File size: 23236 byte(s)
Created procedure test_disvert (following LMDZ). Added procedures
hybrid and funcd in module disvert_m. Upgraded compute_ab from
internal procedure of disvert to module procedure. Added variables y,
ya in module disvert_m. Upgraded s from local variable of procedure
disvert to module variable.

Renamed allowed value of variable vert_sampling in procedure disvert
from "read" to "read_hybrid". Added possibility to read pressure
values, value "read_pressure". Replaced vertical distribution for
value "param" by the distribution "strato_correct" from LMDZ (but kept
the value "param"). In case "tropo", replaced 1 by dsigmin (following
LMDZ). In case "strato", replaced 0.3 by dsigmin (following LMDZ).

Changed computation of bp in procedure compute_ab.

Removed debugindex case in clmain. Removed useless argument rlon of
procedure clmain. Removed useless variables ytaux, ytauy of procedure
clmain.

Removed intermediary variables tsol, qsol, tsolsrf, tslab in procedure
etat0.

Removed variable ok_veget:. coupling with the model Orchid is not
possible. Removed variable ocean: modeling an ocean slab is not
possible.

Removed useless variables tmp_rriv and tmp_rcoa from module
interface_surf.

Moved initialization of variables da, mp, phi in procedure physiq to
to inside the test iflag_con >= 3.

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

  ViewVC Help
Powered by ViewVC 1.1.21