source: LMDZ6/branches/cirrus/libf/phylmdiso/phyredem.F90 @ 5202

Last change on this file since 5202 was 5055, checked in by evignon, 2 months ago

coherence entre phylmdiso et phylmd

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