source: LMDZ6/trunk/libf/phylmdiso/phyredem.F90 @ 4389

Last change on this file since 4389 was 4389, checked in by dcugnet, 17 months ago
  • revert to original "type_trac" management:
    • 4 characters keyword (lmdz, Inca, repr, co2i, into, aeNP, coag
    • no longer a list of component with "|" separator
    • the parsed (with "|" separator) version "types_trac" is no longer used
    • the sole routine using a list of component is readTracFiles
  • fix for INCA and CO2Aer modes: setGeneration is now a function, index corrections for had/vadv.
File size: 20.5 KB
Line 
1!
2! $Id: phyredem.F90 3506 2019-05-16 14:38:11Z ymeurdesoif $
3!
4SUBROUTINE phyredem (fichnom)
5!
6!-------------------------------------------------------------------------------
7! Author: Z.X. Li (LMD/CNRS), 1993/08/18
8!-------------------------------------------------------------------------------
9! Purpose: Write restart state for physics.
10!-------------------------------------------------------------------------------
11  USE dimphy, ONLY: klon, klev
12  USE fonte_neige_mod,  ONLY : fonte_neige_final
13  USE pbl_surface_mod,  ONLY : pbl_surface_final
14  USE phys_state_var_mod, ONLY: radpas, zmasq, pctsrf,                       &
15                                ftsol, beta_aridity, delta_tsurf, falb_dir,  &
16                                falb_dif, qsol, fevap, radsol, solsw, sollw, &
17                                sollwdown, rain_fall, snow_fall, z0m, z0h,   &
18                                agesno, zmea, zstd, zsig, zgam, zthe, zpic,  &
19                                zval, rugoro, t_ancien, q_ancien,            &
20                                prw_ancien, prlw_ancien, prsw_ancien,        &
21                                ql_ancien, qs_ancien,  u_ancien,             &
22                                v_ancien, clwcon, rnebcon, ratqs, pbl_tke,   &
23                                wake_delta_pbl_tke, zmax0, f0, sig1, w01,    &
24                                wake_deltat, wake_deltaq, wake_s, wake_dens, &
25                                awake_dens, cv_gen,                          &
26                                wake_cstar,                                  &
27                                wake_pe, wake_fip, fm_therm, entr_therm,     &
28                                detr_therm, ale_bl, ale_bl_trig, alp_bl,     &
29                                ale_wake, ale_bl_stat,                       &
30                                du_gwd_rando, du_gwd_front, u10m, v10m, &
31                                treedrg, solswfdiff, delta_sal, ds_ns, dt_ns, &
32                                delta_sst, ratqs_inter, dter, dser, dt_ds
33#ifdef ISO
34  USE phys_state_var_mod, ONLY: xtsol, fxtevap,xtrain_fall, xtsnow_fall,     &
35                                xt_ancien, xtl_ancien, xts_ancien,           &
36                                wake_deltaxt                             
37#endif
38  USE geometry_mod, ONLY : longitude_deg, latitude_deg
39  USE iostart, ONLY: open_restartphy, close_restartphy, enddef_restartphy, put_field, put_var
40  USE traclmdz_mod, ONLY : traclmdz_to_restart
41  USE infotrac_phy, ONLY: type_trac, nqtot, tracers, nbtr, niso
42#ifdef ISO
43#ifdef ISOVERIF
44  USE isotopes_verif_mod
45#endif
46#endif
47  USE carbon_cycle_mod, ONLY : carbon_cycle_cpl, co2_send, carbon_cycle_rad, RCO2_glo
48  USE indice_sol_mod, ONLY: nbsrf, is_oce, is_sic, is_ter, is_lic, epsfra
49  USE surface_data, ONLY: type_ocean, version_ocean
50  USE ocean_slab_mod, ONLY : nslay, tslab, seaice, tice, fsic
51  USE time_phylmdz_mod, ONLY: annee_ref, day_end, itau_phy, pdtphys
52  use config_ocean_skin_m, only: activate_ocean_skin 
53
54  IMPLICIT none
55
56  include "dimsoil.h"
57  include "clesphys.h"
58  include "alpale.h"
59  include "compbl.h"
60  !======================================================================
61  CHARACTER*(*) fichnom
62
63  ! les variables globales ecrites dans le fichier restart
64
65  REAL tsoil(klon, nsoilmx, nbsrf)
66  REAL qsurf(klon, nbsrf)
67  REAL snow(klon, nbsrf)
68  real fder(klon)
69  REAL run_off_lic_0(klon)
70  REAL trs(klon, nbtr)
71#ifdef ISO
72  REAL xtsnow(niso,klon, nbsrf)
73  REAL xtrun_off_lic_0(niso,klon)
74  REAL Rland_ice(niso,klon)
75#endif
76
77  INTEGER nid, nvarid, idim1, idim2, idim3
78  INTEGER ierr
79  INTEGER length
80  PARAMETER (length=100)
81  REAL tab_cntrl(length)
82
83  INTEGER isoil, nsrf,isw
84  CHARACTER (len=2) :: str2
85  CHARACTER (len=256) :: nam, lnam
86  INTEGER           :: it, iq, pass
87
88  !======================================================================
89
90  ! Get variables which will be written to restart file from module
91  ! pbl_surface_mod
92  CALL pbl_surface_final(fder, snow, qsurf,  tsoil &
93#ifdef ISO
94       ,xtsnow,Rland_ice &
95#endif       
96       )
97
98  ! Get a variable calculated in module fonte_neige_mod
99  CALL fonte_neige_final(run_off_lic_0 &
100#ifdef ISO
101       ,xtrun_off_lic_0 &
102#endif       
103       )
104
105  !======================================================================
106
107  CALL open_restartphy(fichnom)
108
109 
110  DO ierr = 1, length
111     tab_cntrl(ierr) = 0.0
112  ENDDO
113  tab_cntrl(1) = pdtphys
114  tab_cntrl(2) = radpas
115  ! co2_ppm : current value of atmospheric CO2
116  tab_cntrl(3) = co2_ppm
117  tab_cntrl(4) = solaire
118  tab_cntrl(5) = iflag_con
119  tab_cntrl(6) = nbapp_rad
120
121  IF( iflag_cycle_diurne.GE.1 ) tab_cntrl( 7 ) = iflag_cycle_diurne
122  IF(   soil_model ) tab_cntrl( 8 ) = 1.
123  IF(     new_oliq ) tab_cntrl( 9 ) = 1.
124  IF(     ok_orodr ) tab_cntrl(10 ) = 1.
125  IF(     ok_orolf ) tab_cntrl(11 ) = 1.
126
127  tab_cntrl(13) = day_end
128  tab_cntrl(14) = annee_ref
129  tab_cntrl(15) = itau_phy
130
131  ! co2_ppm0 : initial value of atmospheric CO2
132  ! tab_cntrl(16) = co2_ppm0
133
134  !  PC -- initial value of RCO2 for the radiation scheme
135  !  tab_cntrl(17) = co2_ppm * 1.0e-06 * RMCO2 / RMD
136  IF (carbon_cycle_rad) tab_cntrl(17) = RCO2_glo
137  !PRINT*, "PC : phyredem RCO2_glo =",RCO2_glo
138
139  DO pass=1,2   ! pass=1 netcdf definition ; pass=2 netcdf write
140 
141    CALL put_var(pass, "controle", "Parametres de controle", tab_cntrl)
142
143    CALL put_field(pass,"longitude", &
144         "Longitudes de la grille physique", longitude_deg)
145
146    CALL put_field(pass,"latitude", "Latitudes de la grille physique", latitude_deg)
147
148    ! PB ajout du masque terre/mer
149
150    CALL put_field(pass,"masque", "masque terre mer", zmasq)
151
152    ! BP ajout des fraction de chaque sous-surface
153
154    ! Get last fractions from slab ocean
155    IF (type_ocean == 'slab' .AND. version_ocean == "sicINT") THEN
156        WHERE (1.-zmasq(:).GT.EPSFRA)
157            pctsrf(:,is_oce)=(1.-fsic(:))*(1.-zmasq(:))
158            pctsrf(:,is_sic)=fsic(:)*(1.-zmasq(:))
159        END WHERE
160    END IF
161
162    ! 1. fraction de terre
163
164    CALL put_field(pass,"FTER", "fraction de continent", pctsrf(:, is_ter))
165
166    ! 2. Fraction de glace de terre
167
168    CALL put_field(pass,"FLIC", "fraction glace de terre", pctsrf(:, is_lic))
169
170    ! 3. fraction ocean
171
172    CALL put_field(pass,"FOCE", "fraction ocean", pctsrf(:, is_oce))
173
174    ! 4. Fraction glace de mer
175
176    CALL put_field(pass,"FSIC", "fraction glace mer", pctsrf(:, is_sic))
177
178    IF(nbsrf  >99) CALL abort_physic("phyredem", "Trop de sous-mailles", 1)
179    IF(nsoilmx>99) CALL abort_physic("phyredem", "Trop de sous-mailles", 1)
180    IF(nsw    >99) CALL abort_physic("phyredem", "Trop de bandes", 1)
181
182!    Surface variables
183    CALL put_field_srf1(pass,"TS","Temperature",ftsol(:,:))
184
185    IF (iflag_pbl>1 .AND. iflag_wake>=1  .AND. iflag_pbl_split >=1) then
186       CALL put_field_srf1(pass, "DELTATS", &
187                      "w-x surface temperature difference",  delta_tsurf(:,:))
188       CALL put_field_srf1(pass, "BETAS", "Aridity factor", beta_aridity(:,:))
189    end IF
190!    End surface variables
191
192! ================== Albedo =======================================
193    print*,'PHYREDEM NOUVEAU'
194    CALL put_field_srf2(pass,"A_dir_SW","Albedo direct",falb_dir(:,:,:))
195    CALL put_field_srf2(pass,"A_dif_SW","Albedo diffus",falb_dif(:,:,:))
196
197    CALL put_field_srf1(pass,"U10M", "u a 10m", u10m)
198
199    CALL put_field_srf1(pass,"V10M", "v a 10m", v10m)
200
201
202! ================== Tsoil =========================================
203    CALL put_field_srf2(pass,"Tsoil","Temperature",tsoil(:,:,:))
204!FC
205!  CALL put_field_srf2("treedrg","freinage arbres",treedrg(:,:,:))
206    CALL put_field(pass,"treedrg_ter","freinage arbres",treedrg(:,:,is_ter))
207
208
209    CALL put_field_srf1(pass,"QS"  , "Humidite",qsurf(:,:))
210
211    CALL put_field     (pass,"QSOL", "Eau dans le sol (mm)", qsol)
212
213    CALL put_field_srf1(pass,"EVAP", "Evaporation", fevap(:,:))
214
215    CALL put_field_srf1(pass,"SNOW", "Neige", snow(:,:))
216
217    CALL put_field(pass,"RADS", "Rayonnement net a la surface", radsol)
218
219    CALL put_field(pass,"solsw", "Rayonnement solaire a la surface", solsw)
220
221    CALL put_field(pass,"solswfdiff", "Fraction du rayonnement solaire a la surface qui est diffus", solswfdiff)
222
223    CALL put_field(pass,"sollw", "Rayonnement IF a la surface", sollw)
224
225    CALL put_field(pass,"sollwdown", "Rayonnement down IF a la surface", sollwdown)
226
227    CALL put_field(pass,"fder", "Derive de flux", fder)
228
229    CALL put_field(pass,"rain_f", "precipitation liquide", rain_fall)
230
231    CALL put_field(pass,"snow_f", "precipitation solide", snow_fall)
232
233    CALL put_field_srf1(pass,"Z0m", "rugosite", z0m(:,:))
234
235    CALL put_field_srf1(pass,"Z0h", "rugosite", z0h(:,:))
236
237    CALL put_field_srf1(pass,"AGESNO", "Age de la neige", agesno(:,:))
238
239    CALL put_field(pass,"ZMEA", "ZMEA", zmea)
240
241    CALL put_field(pass,"ZSTD", "ZSTD", zstd)
242
243    CALL put_field(pass,"ZSIG", "ZSIG", zsig)
244
245    CALL put_field(pass,"ZGAM", "ZGAM", zgam)
246
247    CALL put_field(pass,"ZTHE", "ZTHE", zthe)
248
249    CALL put_field(pass,"ZPIC", "ZPIC", zpic)
250
251    CALL put_field(pass,"ZVAL", "ZVAL", zval)
252
253    CALL put_field(pass,"RUGSREL", "RUGSREL", rugoro)
254
255    CALL put_field(pass,"TANCIEN", "TANCIEN", t_ancien)
256
257    CALL put_field(pass,"QANCIEN", "QANCIEN", q_ancien)
258
259    CALL put_field(pass,"QLANCIEN", "QLANCIEN", ql_ancien)
260
261    CALL put_field(pass,"QSANCIEN", "QSANCIEN", qs_ancien)
262
263    CALL put_field(pass,"PRWANCIEN", "PRWANCIEN", prw_ancien)
264
265    CALL put_field(pass,"PRLWANCIEN", "PRLWANCIEN", prlw_ancien)
266
267    CALL put_field(pass,"PRSWANCIEN", "PRSWANCIEN", prsw_ancien)
268
269    CALL put_field(pass,"UANCIEN", "UANCIEN", u_ancien)
270
271    CALL put_field(pass,"VANCIEN", "VANCIEN", v_ancien)
272
273    CALL put_field(pass,"CLWCON", "Eau liquide convective", clwcon)
274
275    CALL put_field(pass,"RNEBCON", "Nebulosite convective", rnebcon)
276
277    CALL put_field(pass,"RATQS", "Ratqs", ratqs)
278
279    ! run_off_lic_0
280
281    CALL put_field(pass,"RUNOFFLIC0", "Runofflic0", run_off_lic_0)
282
283    ! DEB TKE PBL !
284
285    IF (iflag_pbl>1) then
286      CALL put_field_srf3(pass,"TKE", "Energ. Cineti. Turb.", &
287           pbl_tke(:,:,:))
288      CALL put_field_srf3(pass,"DELTATKE", "Del TKE wk/env.", &
289           wake_delta_pbl_tke(:,:,:))
290    END IF
291
292    ! FIN TKE PBL !
293    !IM ajout zmax0, f0, sig1, w01
294    !IM wake_deltat, wake_deltaq, wake_s, wake_cstar, wake_pe, wake_fip
295
296    CALL put_field(pass,"ZMAX0", "ZMAX0", zmax0)
297
298    CALL put_field(pass,"F0", "F0", f0)
299
300    CALL put_field(pass,"sig1", "sig1 Emanuel", sig1)
301
302    CALL put_field(pass,"w01", "w01 Emanuel", w01)
303
304    ! wake_deltat
305    CALL put_field(pass,"WAKE_DELTAT", "WAKE_DELTAT", wake_deltat)
306
307    CALL put_field(pass,"WAKE_DELTAQ", "WAKE_DELTAQ", wake_deltaq)
308
309    CALL put_field(pass,"WAKE_S", "Wake frac. area", wake_s)
310
311    CALL put_field(pass,"WAKE_DENS", "Wake num. /unit area", wake_dens)
312
313    CALL put_field(pass,"AWAKE_DENS", "Active Wake num. /unit area", awake_dens)
314
315    CALL put_field(pass,"CV_GEN", "CB birth rate", cv_gen)
316
317    CALL put_field(pass,"WAKE_CSTAR", "WAKE_CSTAR", wake_cstar)
318
319    CALL put_field(pass,"WAKE_PE", "WAKE_PE", wake_pe)
320
321    CALL put_field(pass,"WAKE_FIP", "WAKE_FIP", wake_fip)
322
323    ! thermiques
324
325    CALL put_field(pass,"FM_THERM", "FM_THERM", fm_therm)
326
327    CALL put_field(pass,"ENTR_THERM", "ENTR_THERM", entr_therm)
328
329    CALL put_field(pass,"DETR_THERM", "DETR_THERM", detr_therm)
330
331    CALL put_field(pass,"ALE_BL", "ALE_BL", ale_bl)
332
333    CALL put_field(pass,"ALE_BL_TRIG", "ALE_BL_TRIG", ale_bl_trig)
334
335    CALL put_field(pass,"ALP_BL", "ALP_BL", alp_bl)
336
337    CALL put_field(pass,"ALE_WAKE", "ALE_WAKE", ale_wake)
338
339    CALL put_field(pass,"ALE_BL_STAT", "ALE_BL_STAT", ale_bl_stat)
340
341
342    ! fisrtilp/clouds
343    CALL put_field(pass,"RATQS_INTER","Relative width of the lsc sugrid scale water",ratqs_inter)
344
345
346    IF (ANY(type_trac == ['co2i','inco'])) THEN
347       IF (carbon_cycle_cpl) THEN
348          IF (.NOT. ALLOCATED(co2_send)) THEN
349             ! This is the case of create_etat0_limit, ce0l
350             ALLOCATE(co2_send(klon))
351             co2_send(:) = co2_ppm0
352          END IF
353          CALL put_field(pass,"co2_send", "co2_ppm for coupling", co2_send)
354       END IF
355
356    ! trs from traclmdz_mod
357    ELSE IF (type_trac == 'lmdz') THEN
358       CALL traclmdz_to_restart(trs)
359       it = 0
360       DO iq = 1, nqtot
361          IF(.NOT.(tracers(iq)%isAdvected .AND. tracers(iq)%isInPhysics)) CYCLE
362          it = it+1
363          CALL put_field(pass,"trs_"//tracers(iq)%name, "", trs(:, it))
364       END DO
365    END IF
366
367    ! Restart variables for Slab ocean
368    IF (type_ocean == 'slab') THEN
369        IF (nslay.EQ.1) THEN
370          CALL put_field(pass,"tslab", "Slab ocean temperature", tslab)
371        ELSE
372          DO it=1,nslay
373            WRITE(str2,'(i2.2)') it
374            CALL put_field(pass,"tslab"//str2, "Slab ocean temperature", tslab(:,it))
375          END DO
376        END IF
377        IF (version_ocean == 'sicINT') THEN
378            CALL put_field(pass,"seaice", "Slab seaice (kg/m2)", seaice)
379            CALL put_field(pass,"slab_tice", "Slab sea ice temperature", tice)
380        END IF
381    END IF
382
383    if (ok_gwd_rando) call put_field(pass,"du_gwd_rando", &
384         "tendency on zonal wind due to flott gravity waves", du_gwd_rando)
385
386    IF (.not. ok_hines .and. ok_gwd_rando) call put_field(pass,"du_gwd_front", &
387         "tendency on zonal wind due to acama gravity waves", du_gwd_front)
388
389    if (activate_ocean_skin >= 1) then
390       if (activate_ocean_skin == 2 .and. type_ocean == 'couple') then
391          CALL put_field(pass, "delta_sal", &
392               "ocean-air interface salinity minus bulk salinity", delta_sal)
393          CALL put_field(pass, "delta_SST", &
394               "ocean-air interface temperature minus bulk SST", delta_sst)
395          CALL put_field(pass, "dter", &
396               "ocean-air interface temperature minus subskin temperature", &
397               dter)
398          CALL put_field(pass, "dser", &
399               "ocean-air interface salinity minus subskin salinity", dser)
400          CALL put_field(pass, "dt_ds", &
401               "(tks / tkt) * dTer", dt_ds)
402       end if
403       
404       CALL put_field(pass, "dS_ns", "delta salinity near surface", ds_ns)
405       CALL put_field(pass, "dT_ns", "delta temperature near surface", dT_ns)
406    end if
407
408#ifdef ISO
409      write(*,*) 'phyredem 342'
410      call phyisoredem (pass, &
411     &           xtsnow, &
412     &           xtrun_off_lic_0,Rland_ice, &
413     &           run_off_lic_0)
414#endif
415
416    IF (pass==1) CALL enddef_restartphy
417    IF (pass==2) CALL close_restartphy
418  ENDDO ! DO pass=1,2   ! pass=1 netcdf definition ; pass=2 netcdf write
419 
420  !$OMP BARRIER
421
422
423  CONTAINS
424
425
426SUBROUTINE put_field_srf1(pass,nam,lnam,field)
427
428  IMPLICIT NONE
429  INTEGER, INTENT(IN)           :: pass
430  CHARACTER(LEN=*),  INTENT(IN) :: nam, lnam
431  REAL,              INTENT(IN) :: field(:,:)
432  CHARACTER(LEN=256) :: nm, lm, str
433  DO nsrf = 1, SIZE(field,2)
434    WRITE(str, '(i2.2)') nsrf
435    nm=TRIM(nam)//TRIM(str)
436    lm=TRIM(lnam)//" de surface No. "//TRIM(str)
437    CALL put_field(pass,nm,lm,field(:,nsrf))
438  END DO
439
440END SUBROUTINE put_field_srf1
441
442
443SUBROUTINE put_field_srf2(pass,nam,lnam,field)
444
445  IMPLICIT NONE
446  INTEGER, INTENT(IN)            :: pass
447  CHARACTER(LEN=*),  INTENT(IN) :: nam, lnam
448  REAL,              INTENT(IN) :: field(:,:,:)
449  CHARACTER(LEN=256) :: nm, lm, str
450  DO nsrf = 1, SIZE(field,3)
451    DO isoil=1, SIZE(field,2)
452      WRITE(str, '(i2.2,"srf",i2.2)')isoil,nsrf
453!      WRITE(lunout,*)"PHYREDEM ",TRIM(nam)//TRIM(str)
454      nm=TRIM(nam)//TRIM(str)
455      lm=TRIM(lnam)//" du sol No. "//TRIM(str)
456      CALL put_field(pass,nm,lm,field(:,isoil,nsrf))
457    END DO
458  END DO
459
460END SUBROUTINE put_field_srf2
461
462
463SUBROUTINE put_field_srf3(pass,nam,lnam,field)
464
465  IMPLICIT NONE
466  INTEGER, INTENT(IN)            :: pass
467  CHARACTER(LEN=*),  INTENT(IN) :: nam, lnam
468  REAL,              INTENT(IN) :: field(:,:,:)
469  CHARACTER(LEN=256) :: nm, lm, str
470  DO nsrf = 1, SIZE(field,3)
471    WRITE(str, '(i2.2)') nsrf
472    nm=TRIM(nam)//TRIM(str)
473    lm=TRIM(lnam)//TRIM(str)
474    CALL put_field(pass,nm,lm,field(:,1:klev+1,nsrf))
475  END DO
476
477END SUBROUTINE put_field_srf3
478
479#ifdef ISO
480! je voulais mettre cette subroutine dans isotopes_mod, mais elle a besoin de put_field_srf1 qui est contenue dans la subroutine phyredem. Si on veut mettre cette routine dans isotopes_mod, il faudrait convertir ce fichier en module pour pouvoir en appeler des routines
481
482      SUBROUTINE phyisoredem (pass, &
483     &          xtsnow, &
484     &          xtrun_off_lic_0,Rland_ice, &
485     &          run_off_lic_0)
486      USE dimphy
487      !USE mod_grid_phy_lmdz
488      !USE mod_phys_lmdz_para
489      USE phys_state_var_mod, ONLY: q_ancien,xt_ancien,wake_deltaq,wake_deltaxt, &
490        xtrain_fall,xtsnow_fall, ql_ancien,xtl_ancien,qs_ancien,xts_ancien, &
491        xtsol,fxtevap
492      USE infotrac_phy,ONLY: niso, ntiso
493      !USE control_mod
494      USE indice_sol_mod, ONLY: nbsrf
495      USE iostart, ONLY: put_field
496      USE isotopes_mod, ONLY: isoName,iso_eau
497#ifdef ISOVERIF
498      USE isotopes_verif_mod
499#endif
500#ifdef ISOTRAC
501    use isotrac_mod, only: index_zone,index_iso,strtrac
502#endif
503      !USE phyredem, ONLY: put_field_srf1
504
505        implicit none
506
507        ! equivalent isotopique de phyredem
508
509#include "dimsoil.h"
510#include "clesphys.h"
511#include "alpale.h"
512#include "compbl.h"     
513      ! inputs
514      !REAL xtsol(niso,klon)
515      REAL xtsnow(niso,klon,nbsrf)
516      !REAL xtevap(ntiso,klon,nbsrf)     
517      REAL xtrun_off_lic_0(niso,klon)
518      REAL Rland_ice(niso,klon)
519      real run_off_lic_0(klon)
520      integer, intent(in) :: pass
521
522      ! locals
523      real iso_tmp(klon)
524      real iso_tmp_lonlev(klon,klev)
525      real iso_tmp_lonsrf(klon,nbsrf)
526      integer i,ixt,k,nsrf
527      INTEGER nid, nvarid
528      INTEGER ierr
529      CHARACTER*7 str7
530      CHARACTER*2 str2
531      CHARACTER*50 outiso
532      integer lnblnk
533#ifdef ISOTRAC
534      integer iiso,izone
535#endif     
536
537      write(*,*) 'phyisoredem 41: entrée'
538#ifdef ISOVERIF
539     if (iso_eau.gt.0) then
540      do k=1,klev
541        do i=1,klon
542           call iso_verif_egalite(xt_ancien(iso_eau,i,k),q_ancien(i,k), &
543     &           'phyisoredem 50a')
544           call iso_verif_egalite(xtl_ancien(iso_eau,i,k),ql_ancien(i,k), &
545     &           'phyisoredem 50b')
546           call iso_verif_egalite(xts_ancien(iso_eau,i,k),qs_ancien(i,k), &
547     &           'phyisoredem 50c')
548         
549        enddo !do i=1,klon
550      enddo !do k=1,klev
551      do i=1,klon
552        DO nsrf = 1, nbsrf
553           call iso_verif_egalite(fxtevap(iso_eau,i,nsrf),fevap(i,nsrf), &
554     &           'phyisoredem 50d')
555        enddo !DO nsrf = 1, nbsrf
556       enddo
557      endif !if (iso_eau.gt.0) then
558      do i=1,klon
559       do ixt=1,niso
560        call iso_verif_noNaN(xtsol(ixt,i),'phyisoredem 72')
561       enddo !do ixt=1,niso
562      enddo !do i=1,klon
563#ifdef ISOTRAC       
564      do k=1,klev
565        do i=1,klon 
566          call iso_verif_traceur(xt_ancien(1,i,k), &
567     &                   'phyisoredem 60') 
568        enddo !do i=1,klon
569      enddo !do k=1,kle
570#endif
571#endif
572
573   do ixt=1,ntiso
574
575      outiso = TRIM(isoName(ixt))
576      i = INDEX(outiso, '_', .TRUE.)
577      outiso = outiso(1:i-1)//outiso(i+1:LEN_TRIM(outiso))
578      write(*,*) 'phyredem 550: ixt,outiso=',ixt,TRIM(outiso)
579     
580      iso_tmp_lonsrf(:,:)=fxtevap(ixt,:,:)
581      CALL put_field_srf1(pass, "XTEVAP"//TRIM(outiso), "Evaporation de surface",iso_tmp_lonsrf)
582
583      iso_tmp_lonsrf(:,:)=xtsnow(ixt,:,:)
584      CALL put_field_srf1(pass, "XTSNOW"//TRIM(outiso), "NEIGE",       iso_tmp_lonsrf)       
585
586      iso_tmp(:)=xtrain_fall(ixt,:)
587      CALL put_field(pass,    "xtrain_f"//TRIM(outiso), "precipitation liquide",iso_tmp)
588
589      iso_tmp(:)=xtsnow_fall(ixt,:)
590      CALL put_field(pass,    "xtsnow_f"//TRIM(outiso), "precipitation solide",iso_tmp)
591
592      iso_tmp_lonlev(:,:)=xt_ancien(ixt,:,:)
593      CALL put_field(pass,    "XTANCIEN"//TRIM(outiso), "QANCIEN",     iso_tmp_lonlev)
594
595      iso_tmp_lonlev(:,:)=xtl_ancien(ixt,:,:)
596      CALL put_field(pass,   "XTLANCIEN"//TRIM(outiso), "QLANCIEN",    iso_tmp_lonlev)
597
598      iso_tmp_lonlev(:,:)=xts_ancien(ixt,:,:)
599      CALL put_field(pass,   "XTSANCIEN"//TRIM(outiso), "QSANCIEN",    iso_tmp_lonlev)
600
601      iso_tmp_lonlev(:,:)=wake_deltaxt(ixt,:,:)
602      CALL put_field(pass,"WAKE_DELTAXT"//TRIM(outiso), "WAKE_DELTAQ", iso_tmp_lonlev)
603
604      iso_tmp(:)=xtrun_off_lic_0(ixt,:)
605      CALL put_field(pass,"XTRUNOFFLIC0"//TRIM(outiso), "Runofflic0",  iso_tmp)
606
607      iso_tmp_lonlev(:,:)=wake_deltaxt(ixt,:,:)
608      CALL put_field(pass,"WAKE_DELTAXT"//TRIM(outiso), "WAKE_DELTAXT",iso_tmp_lonlev)
609
610      ! variables seulement pour niso:
611      if (ixt.le.niso) then
612
613      iso_tmp(:)=xtsol(ixt,:)
614      CALL put_field(pass,      "XTSOL"//TRIM(outiso), "Eau dans le sol (mm)",iso_tmp)
615
616      iso_tmp(:)=Rland_ice(ixt,:)
617      CALL put_field(pass,  "Rland_ice"//TRIM(outiso), "ratio land ice",      iso_tmp)
618
619      endif ! if (ixt.le.niso) then
620
621      enddo !do ixt=1,niso
622
623      write(*,*) 'phyisoredem 261: sortie'
624      END SUBROUTINE phyisoredem
625#endif
626
627END SUBROUTINE phyredem
Note: See TracBrowser for help on using the repository browser.