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

Last change on this file since 4046 was 4046, checked in by dcugnet, 2 years ago

First commit for new tracers.

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