source: LMDZ5/trunk/libf/phylmd/phyetat0.F90 @ 2188

Last change on this file since 2188 was 2188, checked in by fhourdin, 10 years ago

Modification of the numerical scheme for coupling of surface temperature
with Orchidee.

Modification du schéma numérique pour le couplage de la température
de surface avec Orchidee.
Cette modification concerne la gestion des pas de temps différents pour
l'appel au rayonnement et au modèle de surface.

Orchidee prend en entrée le flux LW descendant.
Dans la version actuelle, on recalculait ce flux descendant à partir
du flux net issu du rayonnement, comme si il ne variait pas dans
le temps.
pbl_surface recalculait ensuite un flux descendant en ajoutant
au flux net descendant l'emission du sol, simga Ts4.
Mais du coup, si la température du sol partait en dérive froide entre
deux appels au rayonnement, on ne tenait pas compte du rappel
exercé par le rayonnement : le flux descendant ne bouge
pas et réhauffe la surface tandis que celle ci se refroidit de
moins en moins par émission LW.

Dans la nouvelle version, on passe le LWdown directement depuis
le rayonnement.
Il s'agit de deux hypothèses extrêmes :
Avant on supposait que le LWnet ne bougeait pas d'un appel au rayonnement
sur l'autre. Maintenant on suppose que c'est le LWdown.
La réalité est entre les deux car le WLdown a tendance à
suivre la température de surface, quand la température de l'air
et de la surface sont fortement couplées.

La nouvelle façon de faire devrait limiter la dérive vers le froid
dans les conditions de découplage nocturne. Un découplage extrême
avait amené à limiter la fonction de Richardson dans le calcul du coefficient
de trraînée Cd f(Ri) à F(ri) > 0.6 plutôt que 0.1 sur le cas 1D Dice.
Les corrections pourraient également résoudre des plantages
aléatoires sur l'Himalaya.

Jean-Louis Dufresne, Fuxing Wang, Frédéric Hourdin

PS : les changements concernent l'interface entre physiq et
pbl_surface, ainsi que phyredem et phyetat0 pour garantir 1+1=2.
On en a profité pour faire un brin de toilette.

  • Property copyright set to
    Name of program: LMDZ
    Creation date: 1984
    Version: LMDZ5
    License: CeCILL version 2
    Holder: Laboratoire de m\'et\'eorologie dynamique, CNRS, UMR 8539
    See the license file in the root directory
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 33.2 KB
Line 
1! $Id: phyetat0.F90 2188 2015-01-30 16:25:12Z fhourdin $
2
3SUBROUTINE phyetat0 (fichnom, clesphy0, tabcntr0)
4
5  USE dimphy, only: klon, zmasq, klev, nslay
6  USE iophy, ONLY : init_iophy_new
7  USE ocean_cpl_mod,    ONLY : ocean_cpl_init
8  USE fonte_neige_mod,  ONLY : fonte_neige_init
9  USE pbl_surface_mod,  ONLY : pbl_surface_init
10  USE surface_data,     ONLY : type_ocean
11  USE phys_state_var_mod, ONLY : ancien_ok, clwcon, detr_therm, dtime, &
12       du_gwd_rando, dv_gwd_rando, entr_therm, f0, falb1, falb2, fm_therm, &
13       ftsol, pbl_tke, pctsrf, q_ancien, radpas, radsol, rain_fall, ratqs, &
14       rlat, rlon, rnebcon, rugoro, sig1, snow_fall, solaire_etat0, sollw, sollwdown, &
15       solsw, t_ancien, u_ancien, v_ancien, w01, wake_cstar, wake_deltaq, &
16       wake_deltat, wake_delta_pbl_TKE, delta_tsurf, wake_fip, wake_pe, &
17       wake_s, zgam, &
18       zmax0, zmea, zpic, zsig, &
19       zstd, zthe, zval, ale_bl, ale_bl_trig, alp_bl
20  USE iostart, ONLY : close_startphy, get_field, get_var, open_startphy
21  USE infotrac, only: nbtr, type_trac, tname, niadv
22  USE traclmdz_mod,    ONLY : traclmdz_from_restart
23  USE carbon_cycle_mod, ONLY : carbon_cycle_tr, carbon_cycle_cpl, co2_send
24  USE indice_sol_mod, only: nbsrf, is_ter, epsfra, is_lic, is_oce, is_sic
25  USE ocean_slab_mod, ONLY: tslab, ocean_slab_init
26
27
28  IMPLICIT none
29  !======================================================================
30  ! Auteur(s) Z.X. Li (LMD/CNRS) date: 19930818
31  ! Objet: Lecture de l'etat initial pour la physique
32  !======================================================================
33  include "dimensions.h"
34  include "netcdf.inc"
35  include "dimsoil.h"
36  include "clesphys.h"
37  include "temps.h"
38  include "thermcell.h"
39  include "compbl.h"
40  include "YOMCST.h"
41  !======================================================================
42  CHARACTER*(*) fichnom
43
44  ! les variables globales lues dans le fichier restart
45
46  REAL tsoil(klon, nsoilmx, nbsrf)
47  REAL qsurf(klon, nbsrf)
48  REAL qsol(klon)
49  REAL snow(klon, nbsrf)
50  REAL evap(klon, nbsrf)
51  real fder(klon)
52  REAL frugs(klon, nbsrf)
53  REAL agesno(klon, nbsrf)
54  REAL run_off_lic_0(klon)
55  REAL fractint(klon)
56  REAL trs(klon, nbtr)
57  REAL zts(klon)
58
59  CHARACTER*6 ocean_in
60  LOGICAL ok_veget_in
61
62  INTEGER        longcles
63  PARAMETER    ( longcles = 20 )
64  REAL clesphy0( longcles )
65
66  REAL xmin, xmax
67
68  INTEGER nid, nvarid
69  INTEGER ierr, i, nsrf, isoil , k
70  INTEGER length
71  PARAMETER (length=100)
72  INTEGER it, iiq
73  REAL tab_cntrl(length), tabcntr0(length)
74  CHARACTER*7 str7
75  CHARACTER*2 str2
76  LOGICAL :: found
77
78  ! FH1D
79  !     real iolat(jjm+1)
80  real iolat(jjm+1-1/(iim*jjm))
81
82  ! Ouvrir le fichier contenant l'etat initial:
83
84  CALL open_startphy(fichnom)
85
86  ! Lecture des parametres de controle:
87
88  CALL get_var("controle", tab_cntrl)
89
90!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
91  ! FH 2008/05/09 On elimine toutes les clefs physiques dans la dynamique
92  ! Les constantes de la physiques sont lues dans la physique seulement.
93  ! Les egalites du type
94  !             tab_cntrl( 5 )=clesphy0(1)
95  ! sont remplacees par
96  !             clesphy0(1)=tab_cntrl( 5 )
97  ! On inverse aussi la logique.
98  ! On remplit les tab_cntrl avec les parametres lus dans les .def
99!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
100
101  DO i = 1, length
102     tabcntr0( i ) = tab_cntrl( i )
103  ENDDO
104
105  tab_cntrl(1)=dtime
106  tab_cntrl(2)=radpas
107
108  ! co2_ppm : value from the previous time step
109  IF (carbon_cycle_tr .OR. carbon_cycle_cpl) THEN
110     co2_ppm = tab_cntrl(3)
111     RCO2    = co2_ppm * 1.0e-06  * 44.011/28.97
112     ! ELSE : keep value from .def
113  END IF
114
115  ! co2_ppm0 : initial value of atmospheric CO2 (from create_etat0_limit.e .def)
116  co2_ppm0   = tab_cntrl(16)
117
118  solaire_etat0      = tab_cntrl(4)
119  tab_cntrl(5)=iflag_con
120  tab_cntrl(6)=nbapp_rad
121
122  if (cycle_diurne) tab_cntrl( 7) =1.
123  if (soil_model) tab_cntrl( 8) =1.
124  if (new_oliq) tab_cntrl( 9) =1.
125  if (ok_orodr) tab_cntrl(10) =1.
126  if (ok_orolf) tab_cntrl(11) =1.
127  if (ok_limitvrai) tab_cntrl(12) =1.
128
129  itau_phy = tab_cntrl(15)
130
131  clesphy0(1)=tab_cntrl( 5 )
132  clesphy0(2)=tab_cntrl( 6 )
133  clesphy0(3)=tab_cntrl( 7 )
134  clesphy0(4)=tab_cntrl( 8 )
135  clesphy0(5)=tab_cntrl( 9 )
136  clesphy0(6)=tab_cntrl( 10 )
137  clesphy0(7)=tab_cntrl( 11 )
138  clesphy0(8)=tab_cntrl( 12 )
139
140  ! Lecture des latitudes (coordonnees):
141
142  CALL get_field("latitude", rlat)
143
144  ! Lecture des longitudes (coordonnees):
145
146  CALL get_field("longitude", rlon)
147
148  ! Lecture du masque terre mer
149
150  CALL get_field("masque", zmasq, found)
151  IF (.NOT. found) THEN
152     PRINT*, 'phyetat0: Le champ <masque> est absent'
153     PRINT *, 'fichier startphy non compatible avec phyetat0'
154  ENDIF
155
156  ! Lecture des fractions pour chaque sous-surface
157
158  ! initialisation des sous-surfaces
159
160  pctsrf = 0.
161
162  ! fraction de terre
163
164  CALL get_field("FTER", pctsrf(:, is_ter), found)
165  IF (.NOT. found) PRINT*, 'phyetat0: Le champ <FTER> est absent'
166
167  ! fraction de glace de terre
168
169  CALL get_field("FLIC", pctsrf(:, is_lic), found)
170  IF (.NOT. found) PRINT*, 'phyetat0: Le champ <FLIC> est absent'
171
172  ! fraction d'ocean
173
174  CALL get_field("FOCE", pctsrf(:, is_oce), found)
175  IF (.NOT. found) PRINT*, 'phyetat0: Le champ <FOCE> est absent'
176
177  ! fraction glace de mer
178
179  CALL get_field("FSIC", pctsrf(:, is_sic), found)
180  IF (.NOT. found) PRINT*, 'phyetat0: Le champ <FSIC> est absent'
181
182  !  Verification de l'adequation entre le masque et les sous-surfaces
183
184  fractint( 1 : klon) = pctsrf(1 : klon, is_ter)  &
185       + pctsrf(1 : klon, is_lic)
186  DO i = 1 , klon
187     IF ( abs(fractint(i) - zmasq(i) ) .GT. EPSFRA ) THEN
188        WRITE(*, *) 'phyetat0: attention fraction terre pas ',  &
189             'coherente ', i, zmasq(i), pctsrf(i, is_ter) &
190             , pctsrf(i, is_lic)
191        WRITE(*, *) 'Je force la coherence zmasq=fractint'
192        zmasq(i) = fractint(i)
193     ENDIF
194  END DO
195  fractint (1 : klon) =  pctsrf(1 : klon, is_oce)  &
196       + pctsrf(1 : klon, is_sic)
197  DO i = 1 , klon
198     IF ( abs( fractint(i) - (1. - zmasq(i))) .GT. EPSFRA ) THEN
199        WRITE(*, *) 'phyetat0 attention fraction ocean pas ',  &
200             'coherente ', i, zmasq(i) , pctsrf(i, is_oce) &
201             , pctsrf(i, is_sic)
202        WRITE(*, *) 'Je force la coherence zmasq=1.-fractint'
203        zmasq(i) = 1. - fractint(i)
204     ENDIF
205  END DO
206
207  ! Lecture des temperatures du sol:
208
209  CALL get_field("TS", ftsol(:, 1), found)
210  IF (.NOT. found) THEN
211     PRINT*, 'phyetat0: Le champ <TS> est absent'
212     PRINT*, '          Mais je vais essayer de lire TS**'
213     DO nsrf = 1, nbsrf
214        IF (nsrf.GT.99) THEN
215           PRINT*, "Trop de sous-mailles"
216           call abort_gcm("phyetat0", "", 1)
217        ENDIF
218        WRITE(str2, '(i2.2)') nsrf
219        CALL get_field("TS"//str2, ftsol(:, nsrf))
220
221        xmin = 1.0E+20
222        xmax = -1.0E+20
223        DO i = 1, klon
224           xmin = MIN(ftsol(i, nsrf), xmin)
225           xmax = MAX(ftsol(i, nsrf), xmax)
226        ENDDO
227        PRINT*, 'Temperature du sol TS**:', nsrf, xmin, xmax
228     ENDDO
229  ELSE
230     PRINT*, 'phyetat0: Le champ <TS> est present'
231     PRINT*, '          J ignore donc les autres temperatures TS**'
232     xmin = 1.0E+20
233     xmax = -1.0E+20
234     DO i = 1, klon
235        xmin = MIN(ftsol(i, 1), xmin)
236        xmax = MAX(ftsol(i, 1), xmax)
237     ENDDO
238     PRINT*, 'Temperature du sol <TS>', xmin, xmax
239     DO nsrf = 2, nbsrf
240        DO i = 1, klon
241           ftsol(i, nsrf) = ftsol(i, 1)
242        ENDDO
243     ENDDO
244  ENDIF
245
246  ! Lecture des temperatures du sol profond:
247
248  DO nsrf = 1, nbsrf
249     DO isoil=1, nsoilmx
250        IF (isoil.GT.99 .AND. nsrf.GT.99) THEN
251           PRINT*, "Trop de couches ou sous-mailles"
252           call abort_gcm("phyetat0", "", 1)
253        ENDIF
254        WRITE(str7, '(i2.2, "srf", i2.2)') isoil, nsrf
255
256        CALL get_field('Tsoil'//str7, tsoil(:, isoil, nsrf), found)
257        IF (.NOT. found) THEN
258           PRINT*, "phyetat0: Le champ <Tsoil"//str7//"> est absent"
259           PRINT*, "          Il prend donc la valeur de surface"
260           DO i=1, klon
261              tsoil(i, isoil, nsrf)=ftsol(i, nsrf)
262           ENDDO
263        ENDIF
264     ENDDO
265  ENDDO
266
267  ! Lecture de l'humidite de l'air juste au dessus du sol:
268
269  CALL get_field("QS", qsurf(:, 1), found)
270  IF (.NOT. found) THEN
271     PRINT*, 'phyetat0: Le champ <QS> est absent'
272     PRINT*, '          Mais je vais essayer de lire QS**'
273     DO nsrf = 1, nbsrf
274        IF (nsrf.GT.99) THEN
275           PRINT*, "Trop de sous-mailles"
276           call abort_gcm("phyetat0", "", 1)
277        ENDIF
278        WRITE(str2, '(i2.2)') nsrf
279        CALL get_field("QS"//str2, qsurf(:, nsrf))
280        xmin = 1.0E+20
281        xmax = -1.0E+20
282        DO i = 1, klon
283           xmin = MIN(qsurf(i, nsrf), xmin)
284           xmax = MAX(qsurf(i, nsrf), xmax)
285        ENDDO
286        PRINT*, 'Humidite pres du sol QS**:', nsrf, xmin, xmax
287     ENDDO
288  ELSE
289     PRINT*, 'phyetat0: Le champ <QS> est present'
290     PRINT*, '          J ignore donc les autres humidites QS**'
291     xmin = 1.0E+20
292     xmax = -1.0E+20
293     DO i = 1, klon
294        xmin = MIN(qsurf(i, 1), xmin)
295        xmax = MAX(qsurf(i, 1), xmax)
296     ENDDO
297     PRINT*, 'Humidite pres du sol <QS>', xmin, xmax
298     DO nsrf = 2, nbsrf
299        DO i = 1, klon
300           qsurf(i, nsrf) = qsurf(i, 1)
301        ENDDO
302     ENDDO
303  ENDIF
304
305  ! Eau dans le sol (pour le modele de sol "bucket")
306
307  CALL get_field("QSOL", qsol, found)
308  IF (.NOT. found) THEN
309     PRINT*, 'phyetat0: Le champ <QSOL> est absent'
310     PRINT*, '          Valeur par defaut nulle'
311     qsol(:)=0.
312  ENDIF
313
314  xmin = 1.0E+20
315  xmax = -1.0E+20
316  DO i = 1, klon
317     xmin = MIN(qsol(i), xmin)
318     xmax = MAX(qsol(i), xmax)
319  ENDDO
320  PRINT*, 'Eau dans le sol (mm) <QSOL>', xmin, xmax
321
322  ! Lecture de neige au sol:
323
324  CALL get_field("SNOW", snow(:, 1), found)
325  IF (.NOT. found) THEN
326     PRINT*, 'phyetat0: Le champ <SNOW> est absent'
327     PRINT*, '          Mais je vais essayer de lire SNOW**'
328     DO nsrf = 1, nbsrf
329        IF (nsrf.GT.99) THEN
330           PRINT*, "Trop de sous-mailles"
331           call abort_gcm("phyetat0", "", 1)
332        ENDIF
333        WRITE(str2, '(i2.2)') nsrf
334        CALL get_field( "SNOW"//str2, snow(:, nsrf))
335        xmin = 1.0E+20
336        xmax = -1.0E+20
337        DO i = 1, klon
338           xmin = MIN(snow(i, nsrf), xmin)
339           xmax = MAX(snow(i, nsrf), xmax)
340        ENDDO
341        PRINT*, 'Neige du sol SNOW**:', nsrf, xmin, xmax
342     ENDDO
343  ELSE
344     PRINT*, 'phyetat0: Le champ <SNOW> est present'
345     PRINT*, '          J ignore donc les autres neiges SNOW**'
346     xmin = 1.0E+20
347     xmax = -1.0E+20
348     DO i = 1, klon
349        xmin = MIN(snow(i, 1), xmin)
350        xmax = MAX(snow(i, 1), xmax)
351     ENDDO
352     PRINT*, 'Neige du sol <SNOW>', xmin, xmax
353     DO nsrf = 2, nbsrf
354        DO i = 1, klon
355           snow(i, nsrf) = snow(i, 1)
356        ENDDO
357     ENDDO
358  ENDIF
359
360  ! Lecture de albedo de l'interval visible au sol:
361
362  CALL get_field("ALBE", falb1(:, 1), found)
363  IF (.NOT. found) THEN
364     PRINT*, 'phyetat0: Le champ <ALBE> est absent'
365     PRINT*, '          Mais je vais essayer de lire ALBE**'
366     DO nsrf = 1, nbsrf
367        IF (nsrf.GT.99) THEN
368           PRINT*, "Trop de sous-mailles"
369           call abort_gcm("phyetat0", "", 1)
370        ENDIF
371        WRITE(str2, '(i2.2)') nsrf
372        CALL get_field("ALBE"//str2, falb1(:, nsrf))
373        xmin = 1.0E+20
374        xmax = -1.0E+20
375        DO i = 1, klon
376           xmin = MIN(falb1(i, nsrf), xmin)
377           xmax = MAX(falb1(i, nsrf), xmax)
378        ENDDO
379        PRINT*, 'Albedo du sol ALBE**:', nsrf, xmin, xmax
380     ENDDO
381  ELSE
382     PRINT*, 'phyetat0: Le champ <ALBE> est present'
383     PRINT*, '          J ignore donc les autres ALBE**'
384     xmin = 1.0E+20
385     xmax = -1.0E+20
386     DO i = 1, klon
387        xmin = MIN(falb1(i, 1), xmin)
388        xmax = MAX(falb1(i, 1), xmax)
389     ENDDO
390     PRINT*, 'Neige du sol <ALBE>', xmin, xmax
391     DO nsrf = 2, nbsrf
392        DO i = 1, klon
393           falb1(i, nsrf) = falb1(i, 1)
394        ENDDO
395     ENDDO
396  ENDIF
397
398  ! Lecture de albedo au sol dans l'interval proche infra-rouge:
399
400  CALL get_field("ALBLW", falb2(:, 1), found)
401  IF (.NOT. found) THEN
402     PRINT*, 'phyetat0: Le champ <ALBLW> est absent'
403     PRINT*, '          Mais je vais prendre ALBE**'
404     DO nsrf = 1, nbsrf
405        DO i = 1, klon
406           falb2(i, nsrf) = falb1(i, nsrf)
407        ENDDO
408     ENDDO
409  ELSE
410     PRINT*, 'phyetat0: Le champ <ALBLW> est present'
411     PRINT*, '          J ignore donc les autres ALBLW**'
412     xmin = 1.0E+20
413     xmax = -1.0E+20
414     DO i = 1, klon
415        xmin = MIN(falb2(i, 1), xmin)
416        xmax = MAX(falb2(i, 1), xmax)
417     ENDDO
418     PRINT*, 'Neige du sol <ALBLW>', xmin, xmax
419     DO nsrf = 2, nbsrf
420        DO i = 1, klon
421           falb2(i, nsrf) = falb2(i, 1)
422        ENDDO
423     ENDDO
424  ENDIF
425
426  ! Lecture de evaporation: 
427
428  CALL get_field("EVAP", evap(:, 1), found)
429  IF (.NOT. found) THEN
430     PRINT*, 'phyetat0: Le champ <EVAP> est absent'
431     PRINT*, '          Mais je vais essayer de lire EVAP**'
432     DO nsrf = 1, nbsrf
433        IF (nsrf.GT.99) THEN
434           PRINT*, "Trop de sous-mailles"
435           call abort_gcm("phyetat0", "", 1)
436        ENDIF
437        WRITE(str2, '(i2.2)') nsrf
438        CALL get_field("EVAP"//str2, evap(:, nsrf))
439        xmin = 1.0E+20
440        xmax = -1.0E+20
441        DO i = 1, klon
442           xmin = MIN(evap(i, nsrf), xmin)
443           xmax = MAX(evap(i, nsrf), xmax)
444        ENDDO
445        PRINT*, 'evap du sol EVAP**:', nsrf, xmin, xmax
446     ENDDO
447  ELSE
448     PRINT*, 'phyetat0: Le champ <EVAP> est present'
449     PRINT*, '          J ignore donc les autres EVAP**'
450     xmin = 1.0E+20
451     xmax = -1.0E+20
452     DO i = 1, klon
453        xmin = MIN(evap(i, 1), xmin)
454        xmax = MAX(evap(i, 1), xmax)
455     ENDDO
456     PRINT*, 'Evap du sol <EVAP>', xmin, xmax
457     DO nsrf = 2, nbsrf
458        DO i = 1, klon
459           evap(i, nsrf) = evap(i, 1)
460        ENDDO
461     ENDDO
462  ENDIF
463
464  ! Lecture precipitation liquide:
465
466  CALL get_field("rain_f", rain_fall)
467  xmin = 1.0E+20
468  xmax = -1.0E+20
469  DO i = 1, klon
470     xmin = MIN(rain_fall(i), xmin)
471     xmax = MAX(rain_fall(i), xmax)
472  ENDDO
473  PRINT*, 'Precipitation liquide rain_f:', xmin, xmax
474
475  ! Lecture precipitation solide:
476
477  CALL get_field("snow_f", snow_fall)
478  xmin = 1.0E+20
479  xmax = -1.0E+20
480  DO i = 1, klon
481     xmin = MIN(snow_fall(i), xmin)
482     xmax = MAX(snow_fall(i), xmax)
483  ENDDO
484  PRINT*, 'Precipitation solide snow_f:', xmin, xmax
485
486  ! Lecture rayonnement solaire au sol:
487
488  CALL get_field("solsw", solsw, found)
489  IF (.NOT. found) THEN
490     PRINT*, 'phyetat0: Le champ <solsw> est absent'
491     PRINT*, 'mis a zero'
492     solsw(:) = 0.
493  ENDIF
494  xmin = 1.0E+20
495  xmax = -1.0E+20
496  DO i = 1, klon
497     xmin = MIN(solsw(i), xmin)
498     xmax = MAX(solsw(i), xmax)
499  ENDDO
500  PRINT*, 'Rayonnement solaire au sol solsw:', xmin, xmax
501
502  ! Lecture rayonnement IF au sol:
503
504  CALL get_field("sollw", sollw, found)
505  IF (.NOT. found) THEN
506     PRINT*, 'phyetat0: Le champ <sollw> est absent'
507     PRINT*, 'mis a zero'
508     sollw = 0.
509  ENDIF
510  xmin = 1.0E+20
511  xmax = -1.0E+20
512  DO i = 1, klon
513     xmin = MIN(sollw(i), xmin)
514     xmax = MAX(sollw(i), xmax)
515  ENDDO
516  PRINT*, 'Rayonnement IF au sol sollw:', xmin, xmax
517
518  CALL get_field("sollwdown", sollwdown, found)
519  IF (.NOT. found) THEN
520     PRINT*, 'phyetat0: Le champ <sollwdown> est absent'
521     PRINT*, 'mis a zero'
522     sollwdown = 0.
523     do nsrf=1,nbsrf
524        zts(:)=zts(:)+ftsol(:,nsrf)*pctsrf(:,nsrf)
525     enddo
526     sollwdown(:)=sollw(:)+RSIGMA*zts(:)**4
527  ENDIF
528  print*,'TS SOLL',zts(klon/2),sollw(klon/2),sollwdown(klon/2)
529  xmin = 1.0E+20
530  xmax = -1.0E+20
531  DO i = 1, klon
532     xmin = MIN(sollwdown(i), xmin)
533     xmax = MAX(sollwdown(i), xmax)
534  ENDDO
535  PRINT*, 'Rayonnement IF au sol sollwdown:', xmin, xmax
536
537
538  ! Lecture derive des flux:
539
540  CALL get_field("fder", fder, found)
541  IF (.NOT. found) THEN
542     PRINT*, 'phyetat0: Le champ <fder> est absent'
543     PRINT*, 'mis a zero'
544     fder = 0.
545  ENDIF
546  xmin = 1.0E+20
547  xmax = -1.0E+20
548  DO i = 1, klon
549     xmin = MIN(fder(i), xmin)
550     xmax = MAX(fder(i), xmax)
551  ENDDO
552  PRINT*, 'Derive des flux fder:', xmin, xmax
553
554  ! Lecture du rayonnement net au sol:
555
556  CALL get_field("RADS", radsol)
557  xmin = 1.0E+20
558  xmax = -1.0E+20
559  DO i = 1, klon
560     xmin = MIN(radsol(i), xmin)
561     xmax = MAX(radsol(i), xmax)
562  ENDDO
563  PRINT*, 'Rayonnement net au sol radsol:', xmin, xmax
564
565  ! Lecture de la longueur de rugosite
566
567  CALL get_field("RUG", frugs(:, 1), found)
568  IF (.NOT. found) THEN
569     PRINT*, 'phyetat0: Le champ <RUG> est absent'
570     PRINT*, '          Mais je vais essayer de lire RUG**'
571     DO nsrf = 1, nbsrf
572        IF (nsrf.GT.99) THEN
573           PRINT*, "Trop de sous-mailles"
574           call abort_gcm("phyetat0", "", 1)
575        ENDIF
576        WRITE(str2, '(i2.2)') nsrf
577        CALL get_field("RUG"//str2, frugs(:, nsrf))
578        xmin = 1.0E+20
579        xmax = -1.0E+20
580        DO i = 1, klon
581           xmin = MIN(frugs(i, nsrf), xmin)
582           xmax = MAX(frugs(i, nsrf), xmax)
583        ENDDO
584        PRINT*, 'rugosite du sol RUG**:', nsrf, xmin, xmax
585     ENDDO
586  ELSE
587     PRINT*, 'phyetat0: Le champ <RUG> est present'
588     PRINT*, '          J ignore donc les autres RUG**'
589     xmin = 1.0E+20
590     xmax = -1.0E+20
591     DO i = 1, klon
592        xmin = MIN(frugs(i, 1), xmin)
593        xmax = MAX(frugs(i, 1), xmax)
594     ENDDO
595     PRINT*, 'rugosite <RUG>', xmin, xmax
596     DO nsrf = 2, nbsrf
597        DO i = 1, klon
598           frugs(i, nsrf) = frugs(i, 1)
599        ENDDO
600     ENDDO
601  ENDIF
602
603  ! Lecture de l'age de la neige:
604
605  CALL get_field("AGESNO", agesno(:, 1), found)
606  IF (.NOT. found) THEN
607     PRINT*, 'phyetat0: Le champ <AGESNO> est absent'
608     PRINT*, '          Mais je vais essayer de lire AGESNO**'
609     DO nsrf = 1, nbsrf
610        IF (nsrf.GT.99) THEN
611           PRINT*, "Trop de sous-mailles"
612           call abort_gcm("phyetat0", "", 1)
613        ENDIF
614        WRITE(str2, '(i2.2)') nsrf
615        CALL get_field("AGESNO"//str2, agesno(:, nsrf), found)
616        IF (.NOT. found) THEN
617           PRINT*, "phyetat0: Le champ <AGESNO"//str2//"> est absent"
618           agesno = 50.0
619        ENDIF
620        xmin = 1.0E+20
621        xmax = -1.0E+20
622        DO i = 1, klon
623           xmin = MIN(agesno(i, nsrf), xmin)
624           xmax = MAX(agesno(i, nsrf), xmax)
625        ENDDO
626        PRINT*, 'Age de la neige AGESNO**:', nsrf, xmin, xmax
627     ENDDO
628  ELSE
629     PRINT*, 'phyetat0: Le champ <AGESNO> est present'
630     PRINT*, '          J ignore donc les autres AGESNO**'
631     xmin = 1.0E+20
632     xmax = -1.0E+20
633     DO i = 1, klon
634        xmin = MIN(agesno(i, 1), xmin)
635        xmax = MAX(agesno(i, 1), xmax)
636     ENDDO
637     PRINT*, 'Age de la neige <AGESNO>', xmin, xmax
638     DO nsrf = 2, nbsrf
639        DO i = 1, klon
640           agesno(i, nsrf) = agesno(i, 1)
641        ENDDO
642     ENDDO
643  ENDIF
644
645  CALL get_field("ZMEA", zmea)
646  xmin = 1.0E+20
647  xmax = -1.0E+20
648  DO i = 1, klon
649     xmin = MIN(zmea(i), xmin)
650     xmax = MAX(zmea(i), xmax)
651  ENDDO
652  PRINT*, 'OROGRAPHIE SOUS-MAILLE zmea:', xmin, xmax
653
654  CALL get_field("ZSTD", zstd)
655  xmin = 1.0E+20
656  xmax = -1.0E+20
657  DO i = 1, klon
658     xmin = MIN(zstd(i), xmin)
659     xmax = MAX(zstd(i), xmax)
660  ENDDO
661  PRINT*, 'OROGRAPHIE SOUS-MAILLE zstd:', xmin, xmax
662
663  CALL get_field("ZSIG", zsig)
664  xmin = 1.0E+20
665  xmax = -1.0E+20
666  DO i = 1, klon
667     xmin = MIN(zsig(i), xmin)
668     xmax = MAX(zsig(i), xmax)
669  ENDDO
670  PRINT*, 'OROGRAPHIE SOUS-MAILLE zsig:', xmin, xmax
671
672  CALL get_field("ZGAM", zgam)
673  xmin = 1.0E+20
674  xmax = -1.0E+20
675  DO i = 1, klon
676     xmin = MIN(zgam(i), xmin)
677     xmax = MAX(zgam(i), xmax)
678  ENDDO
679  PRINT*, 'OROGRAPHIE SOUS-MAILLE zgam:', xmin, xmax
680
681  CALL get_field("ZTHE", zthe)
682  xmin = 1.0E+20
683  xmax = -1.0E+20
684  DO i = 1, klon
685     xmin = MIN(zthe(i), xmin)
686     xmax = MAX(zthe(i), xmax)
687  ENDDO
688  PRINT*, 'OROGRAPHIE SOUS-MAILLE zthe:', xmin, xmax
689
690  CALL get_field("ZPIC", zpic)
691  xmin = 1.0E+20
692  xmax = -1.0E+20
693  DO i = 1, klon
694     xmin = MIN(zpic(i), xmin)
695     xmax = MAX(zpic(i), xmax)
696  ENDDO
697  PRINT*, 'OROGRAPHIE SOUS-MAILLE zpic:', xmin, xmax
698
699  CALL get_field("ZVAL", zval)
700  xmin = 1.0E+20
701  xmax = -1.0E+20
702  DO i = 1, klon
703     xmin = MIN(zval(i), xmin)
704     xmax = MAX(zval(i), xmax)
705  ENDDO
706  PRINT*, 'OROGRAPHIE SOUS-MAILLE zval:', xmin, xmax
707
708  CALL get_field("RUGSREL", rugoro)
709  xmin = 1.0E+20
710  xmax = -1.0E+20
711  DO i = 1, klon
712     xmin = MIN(rugoro(i), xmin)
713     xmax = MAX(rugoro(i), xmax)
714  ENDDO
715  PRINT*, 'Rugosite relief (ecart-type) rugsrel:', xmin, xmax
716
717  ancien_ok = .TRUE.
718
719  CALL get_field("TANCIEN", t_ancien, found)
720  IF (.NOT. found) THEN
721     PRINT*, "phyetat0: Le champ <TANCIEN> est absent"
722     PRINT*, "Depart legerement fausse. Mais je continue"
723     ancien_ok = .FALSE.
724  ENDIF
725
726  CALL get_field("QANCIEN", q_ancien, found)
727  IF (.NOT. found) THEN
728     PRINT*, "phyetat0: Le champ <QANCIEN> est absent"
729     PRINT*, "Depart legerement fausse. Mais je continue"
730     ancien_ok = .FALSE.
731  ENDIF
732
733  CALL get_field("UANCIEN", u_ancien, found)
734  IF (.NOT. found) THEN
735     PRINT*, "phyetat0: Le champ <UANCIEN> est absent"
736     PRINT*, "Depart legerement fausse. Mais je continue"
737     ancien_ok = .FALSE.
738  ENDIF
739
740  CALL get_field("VANCIEN", v_ancien, found)
741  IF (.NOT. found) THEN
742     PRINT*, "phyetat0: Le champ <VANCIEN> est absent"
743     PRINT*, "Depart legerement fausse. Mais je continue"
744     ancien_ok = .FALSE.
745  ENDIF
746
747  clwcon=0.
748  CALL get_field("CLWCON", clwcon, found)
749  IF (.NOT. found) THEN
750     PRINT*, "phyetat0: Le champ CLWCON est absent"
751     PRINT*, "Depart legerement fausse. Mais je continue"
752  ENDIF
753  xmin = 1.0E+20
754  xmax = -1.0E+20
755  xmin = MINval(clwcon)
756  xmax = MAXval(clwcon)
757  PRINT*, 'Eau liquide convective (ecart-type) clwcon:', xmin, xmax
758
759  rnebcon = 0.
760  CALL get_field("RNEBCON", rnebcon, found)
761  IF (.NOT. found) THEN
762     PRINT*, "phyetat0: Le champ RNEBCON est absent"
763     PRINT*, "Depart legerement fausse. Mais je continue"
764  ENDIF
765  xmin = 1.0E+20
766  xmax = -1.0E+20
767  xmin = MINval(rnebcon)
768  xmax = MAXval(rnebcon)
769  PRINT*, 'Nebulosite convective (ecart-type) rnebcon:', xmin, xmax
770
771  ! Lecture ratqs
772
773  ratqs=0.
774  CALL get_field("RATQS", ratqs, found)
775  IF (.NOT. found) THEN
776     PRINT*, "phyetat0: Le champ <RATQS> est absent"
777     PRINT*, "Depart legerement fausse. Mais je continue"
778  ENDIF
779  xmin = 1.0E+20
780  xmax = -1.0E+20
781  xmin = MINval(ratqs)
782  xmax = MAXval(ratqs)
783  PRINT*, '(ecart-type) ratqs:', xmin, xmax
784
785  ! Lecture run_off_lic_0
786
787  CALL get_field("RUNOFFLIC0", run_off_lic_0, found)
788  IF (.NOT. found) THEN
789     PRINT*, "phyetat0: Le champ <RUNOFFLIC0> est absent"
790     PRINT*, "Depart legerement fausse. Mais je continue"
791     run_off_lic_0 = 0.
792  ENDIF
793  xmin = 1.0E+20
794  xmax = -1.0E+20
795  xmin = MINval(run_off_lic_0)
796  xmax = MAXval(run_off_lic_0)
797  PRINT*, '(ecart-type) run_off_lic_0:', xmin, xmax
798
799  ! Lecture de l'energie cinetique turbulente
800
801  IF (iflag_pbl>1) then
802     DO nsrf = 1, nbsrf
803        IF (nsrf.GT.99) THEN
804           PRINT*, "Trop de sous-mailles"
805           call abort_gcm("phyetat0", "", 1)
806        ENDIF
807        WRITE(str2, '(i2.2)') nsrf
808        CALL get_field("TKE"//str2, pbl_tke(:, 1:klev+1, nsrf), found)
809        IF (.NOT. found) THEN
810           PRINT*, "phyetat0: <TKE"//str2//"> est absent"
811           pbl_tke(:, :, nsrf)=1.e-8
812        ENDIF
813        xmin = 1.0E+20
814        xmax = -1.0E+20
815        DO k = 1, klev+1
816           DO i = 1, klon
817              xmin = MIN(pbl_tke(i, k, nsrf), xmin)
818              xmax = MAX(pbl_tke(i, k, nsrf), xmax)
819           ENDDO
820        ENDDO
821        PRINT*, 'Turbulent kinetic energyl TKE**:', nsrf, xmin, xmax
822     ENDDO
823  ENDIF
824
825! Lecture de l'ecart de TKE (w) - (x)
826!
827  IF (iflag_pbl>1 .AND. iflag_wake>=1  &
828           .AND. iflag_pbl_split >=1 ) then
829    DO nsrf = 1, nbsrf
830      IF (nsrf.GT.99) THEN
831        PRINT*, "Trop de sous-mailles"
832        call abort_gcm("phyetat0", "", 1)
833      ENDIF
834      WRITE(str2,'(i2.2)') nsrf
835      CALL get_field("DELTATKE"//str2, &
836                    wake_delta_pbl_tke(:,1:klev+1,nsrf),found)
837      IF (.NOT. found) THEN
838        PRINT*, "phyetat0: <DELTATKE"//str2//"> est absent"
839        wake_delta_pbl_tke(:,:,nsrf)=0.
840      ENDIF
841      xmin = 1.0E+20
842      xmax = -1.0E+20
843      DO k = 1, klev+1
844        DO i = 1, klon
845          xmin = MIN(wake_delta_pbl_tke(i,k,nsrf),xmin)
846          xmax = MAX(wake_delta_pbl_tke(i,k,nsrf),xmax)
847        ENDDO
848      ENDDO
849      PRINT*,'TKE difference (w)-(x) DELTATKE**:', nsrf, xmin, xmax
850    ENDDO
851
852  ! delta_tsurf
853
854    DO nsrf = 1, nbsrf
855       IF (nsrf.GT.99) THEN
856         PRINT*, "Trop de sous-mailles"
857         call abort_gcm("phyetat0", "", 1)
858       ENDIF
859       WRITE(str2,'(i2.2)') nsrf
860     CALL get_field("DELTA_TSURF"//str2, delta_tsurf(:,nsrf), found)
861     IF (.NOT. found) THEN
862        PRINT*, "phyetat0: Le champ <DELTA_TSURF"//str2//"> est absent"
863        PRINT*, "Depart legerement fausse. Mais je continue"
864        delta_tsurf(:,nsrf)=0.
865     ELSE
866        xmin = 1.0E+20
867        xmax = -1.0E+20
868         DO i = 1, klon
869            xmin = MIN(delta_tsurf(i, nsrf), xmin)
870            xmax = MAX(delta_tsurf(i, nsrf), xmax)
871         ENDDO
872        PRINT*, 'delta_tsurf:', xmin, xmax
873     ENDIF
874    ENDDO  ! nsrf = 1, nbsrf
875  ENDIF   !(iflag_pbl>1 .AND. iflag_wake>=1 .AND. iflag_pbl_split >=1 )
876
877  ! zmax0
878  CALL get_field("ZMAX0", zmax0, found)
879  IF (.NOT. found) THEN
880     PRINT*, "phyetat0: Le champ <ZMAX0> est absent"
881     PRINT*, "Depart legerement fausse. Mais je continue"
882     zmax0=40.
883  ENDIF
884  xmin = 1.0E+20
885  xmax = -1.0E+20
886  xmin = MINval(zmax0)
887  xmax = MAXval(zmax0)
888  PRINT*, '(ecart-type) zmax0:', xmin, xmax
889
890  !           f0(ig)=1.e-5
891  ! f0
892  CALL get_field("F0", f0, found)
893  IF (.NOT. found) THEN
894     PRINT*, "phyetat0: Le champ <f0> est absent"
895     PRINT*, "Depart legerement fausse. Mais je continue"
896     f0=1.e-5
897  ENDIF
898  xmin = 1.0E+20
899  xmax = -1.0E+20
900  xmin = MINval(f0)
901  xmax = MAXval(f0)
902  PRINT*, '(ecart-type) f0:', xmin, xmax
903
904  ! sig1 or ema_work1
905
906  CALL get_field("sig1", sig1, found)
907  IF (.NOT. found) CALL get_field("EMA_WORK1", sig1, found)
908  IF (.NOT. found) THEN
909     PRINT*, "phyetat0: Le champ sig1 est absent"
910     PRINT*, "Depart legerement fausse. Mais je continue"
911     sig1=0.
912  ELSE
913     xmin = 1.0E+20
914     xmax = -1.0E+20
915     DO k = 1, klev
916        DO i = 1, klon
917           xmin = MIN(sig1(i, k), xmin)
918           xmax = MAX(sig1(i, k), xmax)
919        ENDDO
920     ENDDO
921     PRINT*, 'sig1:', xmin, xmax
922  ENDIF
923
924  ! w01 or ema_work2
925
926  CALL get_field("w01", w01, found)
927  IF (.NOT. found) CALL get_field("EMA_WORK2", w01, found)
928  IF (.NOT. found) THEN
929     PRINT*, "phyetat0: Le champ w01 est absent"
930     PRINT*, "Depart legerement fausse. Mais je continue"
931     w01=0.
932  ELSE
933     xmin = 1.0E+20
934     xmax = -1.0E+20
935     DO k = 1, klev
936        DO i = 1, klon
937           xmin = MIN(w01(i, k), xmin)
938           xmax = MAX(w01(i, k), xmax)
939        ENDDO
940     ENDDO
941     PRINT*, 'w01:', xmin, xmax
942  ENDIF
943
944  ! wake_deltat
945
946  CALL get_field("WAKE_DELTAT", wake_deltat, found)
947  IF (.NOT. found) THEN
948     PRINT*, "phyetat0: Le champ <WAKE_DELTAT> est absent"
949     PRINT*, "Depart legerement fausse. Mais je continue"
950     wake_deltat=0.
951  ELSE
952     xmin = 1.0E+20
953     xmax = -1.0E+20
954     DO k = 1, klev
955        DO i = 1, klon
956           xmin = MIN(wake_deltat(i, k), xmin)
957           xmax = MAX(wake_deltat(i, k), xmax)
958        ENDDO
959     ENDDO
960     PRINT*, 'wake_deltat:', xmin, xmax
961  ENDIF
962
963  ! wake_deltaq
964
965  CALL get_field("WAKE_DELTAQ", wake_deltaq, found)
966  IF (.NOT. found) THEN
967     PRINT*, "phyetat0: Le champ <WAKE_DELTAQ> est absent"
968     PRINT*, "Depart legerement fausse. Mais je continue"
969     wake_deltaq=0.
970  ELSE
971     xmin = 1.0E+20
972     xmax = -1.0E+20
973     DO k = 1, klev
974        DO i = 1, klon
975           xmin = MIN(wake_deltaq(i, k), xmin)
976           xmax = MAX(wake_deltaq(i, k), xmax)
977        ENDDO
978     ENDDO
979     PRINT*, 'wake_deltaq:', xmin, xmax
980  ENDIF
981
982  ! wake_s
983
984  CALL get_field("WAKE_S", wake_s, found)
985  IF (.NOT. found) THEN
986     PRINT*, "phyetat0: Le champ <WAKE_S> est absent"
987     PRINT*, "Depart legerement fausse. Mais je continue"
988     wake_s=0.
989  ENDIF
990  xmin = 1.0E+20
991  xmax = -1.0E+20
992  xmin = MINval(wake_s)
993  xmax = MAXval(wake_s)
994  PRINT*, '(ecart-type) wake_s:', xmin, xmax
995
996  ! wake_cstar
997
998  CALL get_field("WAKE_CSTAR", wake_cstar, found)
999  IF (.NOT. found) THEN
1000     PRINT*, "phyetat0: Le champ <WAKE_CSTAR> est absent"
1001     PRINT*, "Depart legerement fausse. Mais je continue"
1002     wake_cstar=0.
1003  ENDIF
1004  xmin = 1.0E+20
1005  xmax = -1.0E+20
1006  xmin = MINval(wake_cstar)
1007  xmax = MAXval(wake_cstar)
1008  PRINT*, '(ecart-type) wake_cstar:', xmin, xmax
1009
1010  ! wake_pe
1011
1012  CALL get_field("WAKE_PE", wake_pe, found)
1013  IF (.NOT. found) THEN
1014     PRINT*, "phyetat0: Le champ <WAKE_PE> est absent"
1015     PRINT*, "Depart legerement fausse. Mais je continue"
1016     wake_pe=0.
1017  ENDIF
1018  xmin = 1.0E+20
1019  xmax = -1.0E+20
1020  xmin = MINval(wake_pe)
1021  xmax = MAXval(wake_pe)
1022  PRINT*, '(ecart-type) wake_pe:', xmin, xmax
1023
1024  ! wake_fip
1025
1026  CALL get_field("WAKE_FIP", wake_fip, found)
1027  IF (.NOT. found) THEN
1028     PRINT*, "phyetat0: Le champ <WAKE_FIP> est absent"
1029     PRINT*, "Depart legerement fausse. Mais je continue"
1030     wake_fip=0.
1031  ENDIF
1032  xmin = 1.0E+20
1033  xmax = -1.0E+20
1034  xmin = MINval(wake_fip)
1035  xmax = MAXval(wake_fip)
1036  PRINT*, '(ecart-type) wake_fip:', xmin, xmax
1037
1038  !  thermiques
1039
1040  CALL get_field("FM_THERM", fm_therm, found)
1041  IF (.NOT. found) THEN
1042     PRINT*, "phyetat0: Le champ <fm_therm> est absent"
1043     PRINT*, "Depart legerement fausse. Mais je continue"
1044     fm_therm=0.
1045  ENDIF
1046  xmin = 1.0E+20
1047  xmax = -1.0E+20
1048  xmin = MINval(fm_therm)
1049  xmax = MAXval(fm_therm)
1050  PRINT*, '(ecart-type) fm_therm:', xmin, xmax
1051
1052  CALL get_field("ENTR_THERM", entr_therm, found)
1053  IF (.NOT. found) THEN
1054     PRINT*, "phyetat0: Le champ <entr_therm> est absent"
1055     PRINT*, "Depart legerement fausse. Mais je continue"
1056     entr_therm=0.
1057  ENDIF
1058  xmin = 1.0E+20
1059  xmax = -1.0E+20
1060  xmin = MINval(entr_therm)
1061  xmax = MAXval(entr_therm)
1062  PRINT*, '(ecart-type) entr_therm:', xmin, xmax
1063
1064  CALL get_field("DETR_THERM", detr_therm, found)
1065  IF (.NOT. found) THEN
1066     PRINT*, "phyetat0: Le champ <detr_therm> est absent"
1067     PRINT*, "Depart legerement fausse. Mais je continue"
1068     detr_therm=0.
1069  ENDIF
1070  xmin = 1.0E+20
1071  xmax = -1.0E+20
1072  xmin = MINval(detr_therm)
1073  xmax = MAXval(detr_therm)
1074  PRINT*, '(ecart-type) detr_therm:', xmin, xmax
1075
1076  CALL get_field("ALE_BL", ale_bl, found)
1077  IF (.NOT. found) THEN
1078     PRINT*, "phyetat0: Le champ <ale_bl> est absent"
1079     PRINT*, "Depart legerement fausse. Mais je continue"
1080     ale_bl=0.
1081  ENDIF
1082  xmin = 1.0E+20
1083  xmax = -1.0E+20
1084  xmin = MINval(ale_bl)
1085  xmax = MAXval(ale_bl)
1086  PRINT*, '(ecart-type) ale_bl:', xmin, xmax
1087
1088  CALL get_field("ALE_BL_TRIG", ale_bl_trig, found)
1089  IF (.NOT. found) THEN
1090     PRINT*, "phyetat0: Le champ <ale_bl_trig> est absent"
1091     PRINT*, "Depart legerement fausse. Mais je continue"
1092     ale_bl_trig=0.
1093  ENDIF
1094  xmin = 1.0E+20
1095  xmax = -1.0E+20
1096  xmin = MINval(ale_bl_trig)
1097  xmax = MAXval(ale_bl_trig)
1098  PRINT*, '(ecart-type) ale_bl_trig:', xmin, xmax
1099
1100  CALL get_field("ALP_BL", alp_bl, found)
1101  IF (.NOT. found) THEN
1102     PRINT*, "phyetat0: Le champ <alp_bl> est absent"
1103     PRINT*, "Depart legerement fausse. Mais je continue"
1104     alp_bl=0.
1105  ENDIF
1106  xmin = 1.0E+20
1107  xmax = -1.0E+20
1108  xmin = MINval(alp_bl)
1109  xmax = MAXval(alp_bl)
1110  PRINT*, '(ecart-type) alp_bl:', xmin, xmax
1111
1112  ! Read and send field trs to traclmdz
1113
1114  IF (type_trac == 'lmdz') THEN
1115     DO it=1, nbtr
1116        iiq=niadv(it+2)
1117        CALL get_field("trs_"//tname(iiq), trs(:, it), found)
1118        IF (.NOT. found) THEN
1119           PRINT*,  &
1120                "phyetat0: Le champ <trs_"//tname(iiq)//"> est absent"
1121           PRINT*, "Depart legerement fausse. Mais je continue"
1122           trs(:, it) = 0.
1123        ENDIF
1124        xmin = 1.0E+20
1125        xmax = -1.0E+20
1126        xmin = MINval(trs(:, it))
1127        xmax = MAXval(trs(:, it))
1128        PRINT*, "(ecart-type) trs_"//tname(iiq)//" :", xmin, xmax
1129
1130     END DO
1131     CALL traclmdz_from_restart(trs)
1132
1133     IF (carbon_cycle_cpl) THEN
1134        ALLOCATE(co2_send(klon), stat=ierr)
1135        IF (ierr /= 0) CALL abort_gcm &
1136             ('phyetat0', 'pb allocation co2_send', 1)
1137        CALL get_field("co2_send", co2_send, found)
1138        IF (.NOT. found) THEN
1139           PRINT*, "phyetat0: Le champ <co2_send> est absent"
1140           PRINT*, "Initialisation uniforme a co2_ppm=", co2_ppm
1141           co2_send(:) = co2_ppm
1142        END IF
1143     END IF
1144  END IF
1145
1146  if (ok_gwd_rando) then
1147     call get_field("du_gwd_rando", du_gwd_rando, found)
1148     if (.not. found) then
1149        print *, "du_gwd_rando not found, setting it to 0."
1150        du_gwd_rando = 0.
1151     end if
1152
1153     call get_field("dv_gwd_rando", dv_gwd_rando, found)
1154     if (.not. found) then
1155        print *, "dv_gwd_rando not found, setting it to 0."
1156        dv_gwd_rando = 0.
1157     end if
1158  end if
1159
1160  ! Initialize Slab variables
1161  IF ( type_ocean == 'slab' ) THEN
1162      ALLOCATE(tslab(klon,nslay), stat=ierr)
1163      IF (ierr /= 0) CALL abort_gcm &
1164         ('phyetat0', 'pb allocation tslab', 1)
1165      CALL get_field("tslab", tslab, found)
1166      IF (.NOT. found) THEN
1167          PRINT*, "phyetat0: Le champ <tslab> est absent"
1168          PRINT*, "Initialisation a tsol_oce"
1169          DO i=1,nslay
1170              tslab(:,i)=ftsol(:,is_oce)
1171          END DO
1172      END IF
1173      print*, "calling slab_init"
1174      CALL ocean_slab_init(dtime, pctsrf)
1175  END IF ! Slab       
1176
1177  ! on ferme le fichier
1178  CALL close_startphy
1179
1180  ! Initialize module pbl_surface_mod
1181
1182  CALL pbl_surface_init(qsol, fder, snow, qsurf, &
1183       evap, frugs, agesno, tsoil)
1184
1185  ! Initialize module ocean_cpl_mod for the case of coupled ocean
1186  IF ( type_ocean == 'couple' ) THEN
1187     CALL ocean_cpl_init(dtime, rlon, rlat)
1188  ENDIF
1189
1190  CALL init_iophy_new(rlat, rlon)
1191
1192  ! Initilialize module fonte_neige_mod     
1193  CALL fonte_neige_init(run_off_lic_0)
1194
1195END SUBROUTINE phyetat0
Note: See TracBrowser for help on using the repository browser.