source: LMDZ6/branches/blowing_snow/libf/phylmdiso/phyredem.F90 @ 4506

Last change on this file since 4506 was 4506, checked in by evignon, 18 months ago

commit sur des modifications propres aux isotopes pour la neige soufflee

File size: 20.9 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, bs_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, prbsw_ancien,      &
21                                ql_ancien, qs_ancien, qbs_ancien, rneb_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    IF (ok_bs) THEN
264       CALL put_field(pass,"bs_f", "precipitation neige soufflee", bs_fall)
265       CALL put_field(pass,"QBSANCIEN", "QBSANCIEN", qbs_ancien)
266       CALL put_field(pass,"PRBSWANCIEN", "PRBSWANCIEN", prbsw_ancien)
267    ENDIF
268
269    CALL put_field(pass,"RNEBANCIEN", "RNEBANCIEN", rneb_ancien)
270
271    CALL put_field(pass,"PRWANCIEN", "PRWANCIEN", prw_ancien)
272
273    CALL put_field(pass,"PRLWANCIEN", "PRLWANCIEN", prlw_ancien)
274
275    CALL put_field(pass,"PRSWANCIEN", "PRSWANCIEN", prsw_ancien)
276
277    CALL put_field(pass,"UANCIEN", "UANCIEN", u_ancien)
278
279    CALL put_field(pass,"VANCIEN", "VANCIEN", v_ancien)
280
281    CALL put_field(pass,"CLWCON", "Eau liquide convective", clwcon)
282
283    CALL put_field(pass,"RNEBCON", "Nebulosite convective", rnebcon)
284
285    CALL put_field(pass,"RATQS", "Ratqs", ratqs)
286
287    ! run_off_lic_0
288
289    CALL put_field(pass,"RUNOFFLIC0", "Runofflic0", run_off_lic_0)
290
291    ! DEB TKE PBL !
292
293    IF (iflag_pbl>1) then
294      CALL put_field_srf3(pass,"TKE", "Energ. Cineti. Turb.", &
295           pbl_tke(:,:,:))
296      CALL put_field_srf3(pass,"DELTATKE", "Del TKE wk/env.", &
297           wake_delta_pbl_tke(:,:,:))
298    END IF
299
300    ! FIN TKE PBL !
301    !IM ajout zmax0, f0, sig1, w01
302    !IM wake_deltat, wake_deltaq, wake_s, wake_cstar, wake_pe, wake_fip
303
304    CALL put_field(pass,"ZMAX0", "ZMAX0", zmax0)
305
306    CALL put_field(pass,"F0", "F0", f0)
307
308    CALL put_field(pass,"sig1", "sig1 Emanuel", sig1)
309
310    CALL put_field(pass,"w01", "w01 Emanuel", w01)
311
312    ! wake_deltat
313    CALL put_field(pass,"WAKE_DELTAT", "WAKE_DELTAT", wake_deltat)
314
315    CALL put_field(pass,"WAKE_DELTAQ", "WAKE_DELTAQ", wake_deltaq)
316
317    CALL put_field(pass,"WAKE_S", "Wake frac. area", wake_s)
318
319    CALL put_field(pass,"WAKE_DENS", "Wake num. /unit area", wake_dens)
320
321    CALL put_field(pass,"AWAKE_DENS", "Active Wake num. /unit area", awake_dens)
322
323    CALL put_field(pass,"CV_GEN", "CB birth rate", cv_gen)
324
325    CALL put_field(pass,"WAKE_CSTAR", "WAKE_CSTAR", wake_cstar)
326
327    CALL put_field(pass,"WAKE_PE", "WAKE_PE", wake_pe)
328
329    CALL put_field(pass,"WAKE_FIP", "WAKE_FIP", wake_fip)
330
331    ! thermiques
332
333    CALL put_field(pass,"FM_THERM", "FM_THERM", fm_therm)
334
335    CALL put_field(pass,"ENTR_THERM", "ENTR_THERM", entr_therm)
336
337    CALL put_field(pass,"DETR_THERM", "DETR_THERM", detr_therm)
338
339    CALL put_field(pass,"ALE_BL", "ALE_BL", ale_bl)
340
341    CALL put_field(pass,"ALE_BL_TRIG", "ALE_BL_TRIG", ale_bl_trig)
342
343    CALL put_field(pass,"ALP_BL", "ALP_BL", alp_bl)
344
345    CALL put_field(pass,"ALE_WAKE", "ALE_WAKE", ale_wake)
346
347    CALL put_field(pass,"ALE_BL_STAT", "ALE_BL_STAT", ale_bl_stat)
348
349
350    ! fisrtilp/clouds
351    CALL put_field(pass,"RATQS_INTER","Relative width of the lsc sugrid scale water",ratqs_inter)
352
353
354    IF (ANY(type_trac == ['co2i','inco'])) THEN
355       IF (carbon_cycle_cpl) THEN
356          IF (.NOT. ALLOCATED(co2_send)) THEN
357             ! This is the case of create_etat0_limit, ce0l
358             ALLOCATE(co2_send(klon))
359             co2_send(:) = co2_ppm0
360          END IF
361          CALL put_field(pass,"co2_send", "co2_ppm for coupling", co2_send)
362       END IF
363
364    ! trs from traclmdz_mod
365    ELSE IF (type_trac == 'lmdz') THEN
366       CALL traclmdz_to_restart(trs)
367       it = 0
368       DO iq = 1, nqtot
369          IF(.NOT.(tracers(iq)%isAdvected .AND. tracers(iq)%isInPhysics)) CYCLE
370          it = it+1
371          CALL put_field(pass,"trs_"//tracers(iq)%name, "", trs(:, it))
372       END DO
373    END IF
374
375    ! Restart variables for Slab ocean
376    IF (type_ocean == 'slab') THEN
377        IF (nslay.EQ.1) THEN
378          CALL put_field(pass,"tslab", "Slab ocean temperature", tslab)
379        ELSE
380          DO it=1,nslay
381            WRITE(str2,'(i2.2)') it
382            CALL put_field(pass,"tslab"//str2, "Slab ocean temperature", tslab(:,it))
383          END DO
384        END IF
385        IF (version_ocean == 'sicINT') THEN
386            CALL put_field(pass,"seaice", "Slab seaice (kg/m2)", seaice)
387            CALL put_field(pass,"slab_tice", "Slab sea ice temperature", tice)
388        END IF
389    END IF
390
391    if (ok_gwd_rando) call put_field(pass,"du_gwd_rando", &
392         "tendency on zonal wind due to flott gravity waves", du_gwd_rando)
393
394    IF (.not. ok_hines .and. ok_gwd_rando) call put_field(pass,"du_gwd_front", &
395         "tendency on zonal wind due to acama gravity waves", du_gwd_front)
396
397    if (activate_ocean_skin >= 1) then
398       if (activate_ocean_skin == 2 .and. type_ocean == 'couple') then
399          CALL put_field(pass, "delta_sal", &
400               "ocean-air interface salinity minus bulk salinity", delta_sal)
401          CALL put_field(pass, "delta_SST", &
402               "ocean-air interface temperature minus bulk SST", delta_sst)
403          CALL put_field(pass, "dter", &
404               "ocean-air interface temperature minus subskin temperature", &
405               dter)
406          CALL put_field(pass, "dser", &
407               "ocean-air interface salinity minus subskin salinity", dser)
408          CALL put_field(pass, "dt_ds", &
409               "(tks / tkt) * dTer", dt_ds)
410       end if
411       
412       CALL put_field(pass, "dS_ns", "delta salinity near surface", ds_ns)
413       CALL put_field(pass, "dT_ns", "delta temperature near surface", dT_ns)
414    end if
415
416#ifdef ISO
417      write(*,*) 'phyredem 342'
418      call phyisoredem (pass, &
419     &           xtsnow, &
420     &           xtrun_off_lic_0,Rland_ice, &
421     &           run_off_lic_0)
422#endif
423
424    IF (pass==1) CALL enddef_restartphy
425    IF (pass==2) CALL close_restartphy
426  ENDDO ! DO pass=1,2   ! pass=1 netcdf definition ; pass=2 netcdf write
427 
428  !$OMP BARRIER
429
430
431  CONTAINS
432
433
434SUBROUTINE put_field_srf1(pass,nam,lnam,field)
435
436  IMPLICIT NONE
437  INTEGER, INTENT(IN)           :: pass
438  CHARACTER(LEN=*),  INTENT(IN) :: nam, lnam
439  REAL,              INTENT(IN) :: field(:,:)
440  CHARACTER(LEN=256) :: nm, lm, str
441  DO nsrf = 1, SIZE(field,2)
442    WRITE(str, '(i2.2)') nsrf
443    nm=TRIM(nam)//TRIM(str)
444    lm=TRIM(lnam)//" de surface No. "//TRIM(str)
445    CALL put_field(pass,nm,lm,field(:,nsrf))
446  END DO
447
448END SUBROUTINE put_field_srf1
449
450
451SUBROUTINE put_field_srf2(pass,nam,lnam,field)
452
453  IMPLICIT NONE
454  INTEGER, INTENT(IN)            :: pass
455  CHARACTER(LEN=*),  INTENT(IN) :: nam, lnam
456  REAL,              INTENT(IN) :: field(:,:,:)
457  CHARACTER(LEN=256) :: nm, lm, str
458  DO nsrf = 1, SIZE(field,3)
459    DO isoil=1, SIZE(field,2)
460      WRITE(str, '(i2.2,"srf",i2.2)')isoil,nsrf
461!      WRITE(lunout,*)"PHYREDEM ",TRIM(nam)//TRIM(str)
462      nm=TRIM(nam)//TRIM(str)
463      lm=TRIM(lnam)//" du sol No. "//TRIM(str)
464      CALL put_field(pass,nm,lm,field(:,isoil,nsrf))
465    END DO
466  END DO
467
468END SUBROUTINE put_field_srf2
469
470
471SUBROUTINE put_field_srf3(pass,nam,lnam,field)
472
473  IMPLICIT NONE
474  INTEGER, INTENT(IN)            :: pass
475  CHARACTER(LEN=*),  INTENT(IN) :: nam, lnam
476  REAL,              INTENT(IN) :: field(:,:,:)
477  CHARACTER(LEN=256) :: nm, lm, str
478  DO nsrf = 1, SIZE(field,3)
479    WRITE(str, '(i2.2)') nsrf
480    nm=TRIM(nam)//TRIM(str)
481    lm=TRIM(lnam)//TRIM(str)
482    CALL put_field(pass,nm,lm,field(:,1:klev+1,nsrf))
483  END DO
484
485END SUBROUTINE put_field_srf3
486
487#ifdef ISO
488! 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
489
490      SUBROUTINE phyisoredem (pass, &
491     &          xtsnow, &
492     &          xtrun_off_lic_0,Rland_ice, &
493     &          run_off_lic_0)
494      USE dimphy
495      !USE mod_grid_phy_lmdz
496      !USE mod_phys_lmdz_para
497      USE phys_state_var_mod, ONLY: q_ancien,xt_ancien,wake_deltaq,wake_deltaxt, &
498        xtrain_fall,xtsnow_fall, ql_ancien,xtl_ancien,qs_ancien,xts_ancien, &
499        xtsol,fxtevap
500      USE infotrac_phy,ONLY: niso, ntiso
501      !USE control_mod
502      USE indice_sol_mod, ONLY: nbsrf
503      USE iostart, ONLY: put_field
504      USE isotopes_mod, ONLY: isoName,iso_eau
505#ifdef ISOVERIF
506      USE isotopes_verif_mod
507#endif
508#ifdef ISOTRAC
509    use isotrac_mod, only: index_zone,index_iso,strtrac
510#endif
511      !USE phyredem, ONLY: put_field_srf1
512
513        implicit none
514
515        ! equivalent isotopique de phyredem
516
517#include "dimsoil.h"
518#include "clesphys.h"
519#include "alpale.h"
520#include "compbl.h"     
521      ! inputs
522      !REAL xtsol(niso,klon)
523      REAL xtsnow(niso,klon,nbsrf)
524      !REAL xtevap(ntiso,klon,nbsrf)     
525      REAL xtrun_off_lic_0(niso,klon)
526      REAL Rland_ice(niso,klon)
527      real run_off_lic_0(klon)
528      integer, intent(in) :: pass
529
530      ! locals
531      real iso_tmp(klon)
532      real iso_tmp_lonlev(klon,klev)
533      real iso_tmp_lonsrf(klon,nbsrf)
534      integer i,ixt,k,nsrf
535      INTEGER nid, nvarid
536      INTEGER ierr
537      CHARACTER*7 str7
538      CHARACTER*2 str2
539      CHARACTER*50 outiso
540      integer lnblnk
541#ifdef ISOTRAC
542      integer iiso,izone
543#endif     
544
545      write(*,*) 'phyisoredem 41: entrée'
546#ifdef ISOVERIF
547     if (iso_eau.gt.0) then
548      do k=1,klev
549        do i=1,klon
550           call iso_verif_egalite(xt_ancien(iso_eau,i,k),q_ancien(i,k), &
551     &           'phyisoredem 50a')
552           call iso_verif_egalite(xtl_ancien(iso_eau,i,k),ql_ancien(i,k), &
553     &           'phyisoredem 50b')
554           call iso_verif_egalite(xts_ancien(iso_eau,i,k),qs_ancien(i,k), &
555     &           'phyisoredem 50c')
556         
557        enddo !do i=1,klon
558      enddo !do k=1,klev
559      do i=1,klon
560        DO nsrf = 1, nbsrf
561           call iso_verif_egalite(fxtevap(iso_eau,i,nsrf),fevap(i,nsrf), &
562     &           'phyisoredem 50d')
563        enddo !DO nsrf = 1, nbsrf
564       enddo
565      endif !if (iso_eau.gt.0) then
566      do i=1,klon
567       do ixt=1,niso
568        call iso_verif_noNaN(xtsol(ixt,i),'phyisoredem 72')
569       enddo !do ixt=1,niso
570      enddo !do i=1,klon
571#ifdef ISOTRAC       
572      do k=1,klev
573        do i=1,klon 
574          call iso_verif_traceur(xt_ancien(1,i,k), &
575     &                   'phyisoredem 60') 
576        enddo !do i=1,klon
577      enddo !do k=1,kle
578#endif
579#endif
580
581   do ixt=1,ntiso
582
583      outiso = TRIM(isoName(ixt))
584      i = INDEX(outiso, '_', .TRUE.)
585      outiso = outiso(1:i-1)//outiso(i+1:LEN_TRIM(outiso))
586      write(*,*) 'phyredem 550: ixt,outiso=',ixt,TRIM(outiso)
587     
588      iso_tmp_lonsrf(:,:)=fxtevap(ixt,:,:)
589      CALL put_field_srf1(pass, "XTEVAP"//TRIM(outiso), "Evaporation de surface",iso_tmp_lonsrf)
590
591      iso_tmp_lonsrf(:,:)=xtsnow(ixt,:,:)
592      CALL put_field_srf1(pass, "XTSNOW"//TRIM(outiso), "NEIGE",       iso_tmp_lonsrf)       
593
594      iso_tmp(:)=xtrain_fall(ixt,:)
595      CALL put_field(pass,    "xtrain_f"//TRIM(outiso), "precipitation liquide",iso_tmp)
596
597      iso_tmp(:)=xtsnow_fall(ixt,:)
598      CALL put_field(pass,    "xtsnow_f"//TRIM(outiso), "precipitation solide",iso_tmp)
599
600      iso_tmp_lonlev(:,:)=xt_ancien(ixt,:,:)
601      CALL put_field(pass,    "XTANCIEN"//TRIM(outiso), "QANCIEN",     iso_tmp_lonlev)
602
603      iso_tmp_lonlev(:,:)=xtl_ancien(ixt,:,:)
604      CALL put_field(pass,   "XTLANCIEN"//TRIM(outiso), "QLANCIEN",    iso_tmp_lonlev)
605
606      iso_tmp_lonlev(:,:)=xts_ancien(ixt,:,:)
607      CALL put_field(pass,   "XTSANCIEN"//TRIM(outiso), "QSANCIEN",    iso_tmp_lonlev)
608
609      iso_tmp_lonlev(:,:)=wake_deltaxt(ixt,:,:)
610      CALL put_field(pass,"WAKE_DELTAXT"//TRIM(outiso), "WAKE_DELTAQ", iso_tmp_lonlev)
611
612      iso_tmp(:)=xtrun_off_lic_0(ixt,:)
613      CALL put_field(pass,"XTRUNOFFLIC0"//TRIM(outiso), "Runofflic0",  iso_tmp)
614
615      iso_tmp_lonlev(:,:)=wake_deltaxt(ixt,:,:)
616      CALL put_field(pass,"WAKE_DELTAXT"//TRIM(outiso), "WAKE_DELTAXT",iso_tmp_lonlev)
617
618      ! variables seulement pour niso:
619      if (ixt.le.niso) then
620
621      iso_tmp(:)=xtsol(ixt,:)
622      CALL put_field(pass,      "XTSOL"//TRIM(outiso), "Eau dans le sol (mm)",iso_tmp)
623
624      iso_tmp(:)=Rland_ice(ixt,:)
625      CALL put_field(pass,  "Rland_ice"//TRIM(outiso), "ratio land ice",      iso_tmp)
626
627      endif ! if (ixt.le.niso) then
628
629      enddo !do ixt=1,niso
630
631      write(*,*) 'phyisoredem 261: sortie'
632      END SUBROUTINE phyisoredem
633#endif
634
635END SUBROUTINE phyredem
Note: See TracBrowser for help on using the repository browser.