source: LMDZ6/trunk/libf/phylmd/phyredem.f90

Last change on this file was 5663, checked in by Laurent Fairhead, 8 weeks ago

Typo

  • Property copyright set to
    Name of program: LMDZ
    Creation date: 1984
    Version: LMDZ5
    License: CeCILL version 2
    Holder: Laboratoire de m\'et\'eorologie dynamique, CNRS, UMR 8539
    See the license file in the root directory
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 18.9 KB
RevLine 
[3080]1!
2! $Id: phyredem.f90 5663 2025-05-20 14:51:40Z jyg $
3!
[1827]4SUBROUTINE phyredem (fichnom)
[2293]5!
6!-------------------------------------------------------------------------------
7! Author: Z.X. Li (LMD/CNRS), 1993/08/18
8!-------------------------------------------------------------------------------
9! Purpose: Write restart state for physics.
10!-------------------------------------------------------------------------------
[5296]11USE compbl_mod_h
12  USE alpale_mod
[5284]13    USE clesphys_mod_h
[2395]14  USE dimphy, ONLY: klon, klev
[1827]15  USE fonte_neige_mod,  ONLY : fonte_neige_final
16  USE pbl_surface_mod,  ONLY : pbl_surface_final
[3888]17  USE phys_state_var_mod, ONLY: radpas, zmasq, pctsrf,                       &
18                                ftsol, beta_aridity, delta_tsurf, falb_dir,  &
[2395]19                                falb_dif, qsol, fevap, radsol, solsw, sollw, &
[4523]20                                sollwdown, rain_fall, snow_fall, bs_fall, z0m, z0h, &
[2499]21                                agesno, zmea, zstd, zsig, zgam, zthe, zpic,  &
22                                zval, rugoro, t_ancien, q_ancien,            &
[4523]23                                prw_ancien, prlw_ancien, prsw_ancien, prbsw_ancien,      &
[5204]24                                ql_ancien, qs_ancien, qbs_ancien, cf_ancien, &
25                                rvc_ancien, u_ancien, v_ancien,              &
26                                clwcon, rnebcon, ratqs, pbl_tke,             &
[2499]27                                wake_delta_pbl_tke, zmax0, f0, sig1, w01,    &
[4744]28                                wake_deltat, wake_deltaq, wake_s, awake_s,   &
29                                wake_dens, awake_dens, cv_gen,               &
[2635]30                                wake_cstar,                                  &
[2499]31                                wake_pe, wake_fip, fm_therm, entr_therm,     &
[3080]32                                detr_therm, ale_bl, ale_bl_trig, alp_bl,     &
33                                ale_wake, ale_bl_stat,                       &
[3815]34                                du_gwd_rando, du_gwd_front, u10m, v10m, &
35                                treedrg, solswfdiff, delta_sal, ds_ns, dt_ns, &
[5662]36!GG                                delta_sst, ratqs_inter_, dter,
37                                !dser, dt_ds
38                                delta_sst, ratqs_inter_, dter, dser,&
[5663]39                                & dt_ds, hice, tice, bilg_cumul, &
40!GG
[5662]41                                frac_tersrf, z0m_tersrf,&
42                                     & ratio_z0m_z0h_tersrf,&
43                                     & albedo_tersrf, beta_tersrf,&
44                                     & inertie_tersrf, hcond_tersrf,&
45                                     & tsurfi_tersrf, tsoili_tersrf,&
46                                     & tsoil_depth, qsurf_tersrf,&
47                                     & tsurf_tersrf, tsoil_tersrf,&
48                                     & tsurf_new_tersrf,&
49                                     & cdragm_tersrf, cdragh_tersrf,&
50                                     & swnet_tersrf, lwnet_tersrf,&
51                                     & fluxsens_tersrf, fluxlat_tersrf
[3815]52
[2395]53  USE geometry_mod, ONLY : longitude_deg, latitude_deg
[3506]54  USE iostart, ONLY: open_restartphy, close_restartphy, enddef_restartphy, put_field, put_var
[1827]55  USE traclmdz_mod, ONLY : traclmdz_to_restart
[4389]56  USE infotrac_phy, ONLY: type_trac, nqtot, tracers, nbtr
[4298]57  USE carbon_cycle_mod, ONLY : carbon_cycle_cpl, co2_send, carbon_cycle_rad, RCO2_glo
[2395]58  USE indice_sol_mod, ONLY: nbsrf, is_oce, is_sic, is_ter, is_lic, epsfra
[5662]59!GG  USE surface_data, ONLY: type_ocean, version_ocean
60  USE surface_data, ONLY: type_ocean, version_ocean, iflag_seaice, iflag_seaice_alb, &
61                          iflag_leads
62!GG
63  USE ocean_slab_mod, ONLY : nslay, tslab, seaice, tice_slab, fsic
[2344]64  USE time_phylmdz_mod, ONLY: annee_ref, day_end, itau_phy, pdtphys
[5282]65  use config_ocean_skin_m, only: activate_ocean_skin
[5273]66  USE dimsoil_mod_h, ONLY: nsoilmx
[1827]67  IMPLICIT none
68  !======================================================================
69  CHARACTER*(*) fichnom
[967]70
[1827]71  ! les variables globales ecrites dans le fichier restart
[782]72
[1827]73  REAL tsoil(klon, nsoilmx, nbsrf)
74  REAL qsurf(klon, nbsrf)
75  REAL snow(klon, nbsrf)
76  real fder(klon)
77  REAL run_off_lic_0(klon)
78  REAL trs(klon, nbtr)
[782]79
[1827]80  INTEGER nid, nvarid, idim1, idim2, idim3
81  INTEGER ierr
82  INTEGER length
83  PARAMETER (length=100)
84  REAL tab_cntrl(length)
[782]85
[2237]86  INTEGER isoil, nsrf,isw
[2656]87  CHARACTER (len=2) :: str2
[2293]88  CHARACTER (len=256) :: nam, lnam
[4056]89  INTEGER           :: it, iq, pass
[524]90
[1827]91  !======================================================================
[524]92
[1827]93  ! Get variables which will be written to restart file from module
94  ! pbl_surface_mod
[4551]95  if ( iflag_physiq <= 1 ) then
[4537]96     CALL pbl_surface_final(fder, snow, qsurf,  tsoil)
97  endif
[1279]98
[1827]99  ! Get a variable calculated in module fonte_neige_mod
100  CALL fonte_neige_final(run_off_lic_0)
[1001]101
[1827]102  !======================================================================
[1001]103
[1827]104  CALL open_restartphy(fichnom)
[1001]105
[3506]106 
[1827]107  DO ierr = 1, length
108     tab_cntrl(ierr) = 0.0
109  ENDDO
[2344]110  tab_cntrl(1) = pdtphys
[1827]111  tab_cntrl(2) = radpas
112  ! co2_ppm : current value of atmospheric CO2
113  tab_cntrl(3) = co2_ppm
114  tab_cntrl(4) = solaire
115  tab_cntrl(5) = iflag_con
116  tab_cntrl(6) = nbapp_rad
[524]117
[3317]118  IF( iflag_cycle_diurne.GE.1 ) tab_cntrl( 7 ) = iflag_cycle_diurne
[1827]119  IF(   soil_model ) tab_cntrl( 8 ) = 1.
[5645]120  IF(     liqice_in_radocond ) tab_cntrl( 9 ) = 1.
[1827]121  IF(     ok_orodr ) tab_cntrl(10 ) = 1.
122  IF(     ok_orolf ) tab_cntrl(11 ) = 1.
[524]123
[1827]124  tab_cntrl(13) = day_end
125  tab_cntrl(14) = annee_ref
126  tab_cntrl(15) = itau_phy
127
128  ! co2_ppm0 : initial value of atmospheric CO2
[4298]129  ! tab_cntrl(16) = co2_ppm0
[1827]130
[4298]131  !  PC -- initial value of RCO2 for the radiation scheme
132  !  tab_cntrl(17) = co2_ppm * 1.0e-06 * RMCO2 / RMD
133  IF (carbon_cycle_rad) tab_cntrl(17) = RCO2_glo
134  !PRINT*, "PC : phyredem RCO2_glo =",RCO2_glo
[5662]135  !GG
136  tab_cntrl(18 ) = iflag_seaice
137  tab_cntrl(19 ) = iflag_seaice_alb
138  tab_cntrl(20 ) = iflag_leads
139  !GG
[4298]140
[3506]141  DO pass=1,2   ! pass=1 netcdf definition ; pass=2 netcdf write
142 
143    CALL put_var(pass, "controle", "Parametres de controle", tab_cntrl)
[1827]144
[3506]145    CALL put_field(pass,"longitude", &
146         "Longitudes de la grille physique", longitude_deg)
[1827]147
[3506]148    CALL put_field(pass,"latitude", "Latitudes de la grille physique", latitude_deg)
[1827]149
[3506]150    ! PB ajout du masque terre/mer
[1827]151
[3506]152    CALL put_field(pass,"masque", "masque terre mer", zmasq)
[1827]153
[3506]154    ! BP ajout des fraction de chaque sous-surface
[1827]155
[3506]156    ! Get last fractions from slab ocean
157    IF (type_ocean == 'slab' .AND. version_ocean == "sicINT") THEN
158        WHERE (1.-zmasq(:).GT.EPSFRA)
159            pctsrf(:,is_oce)=(1.-fsic(:))*(1.-zmasq(:))
160            pctsrf(:,is_sic)=fsic(:)*(1.-zmasq(:))
161        END WHERE
162    END IF
[2209]163
[3506]164    ! 1. fraction de terre
[1827]165
[3506]166    CALL put_field(pass,"FTER", "fraction de continent", pctsrf(:, is_ter))
[1827]167
[3506]168    ! 2. Fraction de glace de terre
[1827]169
[3506]170    CALL put_field(pass,"FLIC", "fraction glace de terre", pctsrf(:, is_lic))
171    ! 3. fraction ocean
[1827]172
[3506]173    CALL put_field(pass,"FOCE", "fraction ocean", pctsrf(:, is_oce))
[1827]174
[3506]175    ! 4. Fraction glace de mer
[1827]176
[3506]177    CALL put_field(pass,"FSIC", "fraction glace mer", pctsrf(:, is_sic))
[1827]178
[3506]179    IF(nbsrf>99) THEN
180      PRINT*, "Trop de sous-mailles";  CALL abort_physic("phyredem", "", 1)
181    END IF
182    IF(nsoilmx>99) THEN
183      PRINT*, "Trop de sous-surfaces"; CALL abort_physic("phyredem", "", 1)
184    END IF
185    IF(nsw>99) THEN
186      PRINT*, "Trop de bandes"; CALL abort_physic("phyredem", "", 1)
187    END IF
[1827]188
[3888]189!    Surface variables
[3506]190    CALL put_field_srf1(pass,"TS","Temperature",ftsol(:,:))
[2293]191
[4035]192    IF (iflag_pbl>1 .AND. iflag_wake>=1  .AND. iflag_pbl_split >=1) then
193       CALL put_field_srf1(pass, "DELTATS", &
194            "w-x surface temperature difference", delta_tsurf(:,:))
195       CALL put_field_srf1(pass,"BETAS","Aridity factor", beta_aridity(:,:))
196    end IF
[3888]197!    End surface variables
198
[2237]199! ================== Albedo =======================================
[3506]200    print*,'PHYREDEM NOUVEAU'
201    CALL put_field_srf2(pass,"A_dir_SW","Albedo direct",falb_dir(:,:,:))
202    CALL put_field_srf2(pass,"A_dif_SW","Albedo diffus",falb_dif(:,:,:))
[2237]203
[3506]204    CALL put_field_srf1(pass,"U10M", "u a 10m", u10m)
[2569]205
[3506]206    CALL put_field_srf1(pass,"V10M", "v a 10m", v10m)
[2569]207
208
[2293]209! ================== Tsoil =========================================
[3506]210    CALL put_field_srf2(pass,"Tsoil","Temperature",tsoil(:,:,:))
[2952]211!FC
212!  CALL put_field_srf2("treedrg","freinage arbres",treedrg(:,:,:))
[3506]213    CALL put_field(pass,"treedrg_ter","freinage arbres",treedrg(:,:,is_ter))
[5627]214!AM
215    CALL put_field_srf1(pass,"frac_tersrf","fraction sous surface", frac_tersrf(:,:))
216    CALL put_field_srf1(pass,"z0m_tersrf","rugosite sous surface", z0m_tersrf(:,:))
217    CALL put_field_srf1(pass,"ratio_z0m_z0h_tersrf","ratio rugosites sous surface", ratio_z0m_z0h_tersrf(:,:))
218    CALL put_field_srf1(pass,"albedo_tersrf","albedo sous surface", albedo_tersrf(:,:))
219    CALL put_field_srf1(pass,"beta_tersrf","beta sous surface", beta_tersrf(:,:))
220    CALL put_field_srf1(pass,"inertie_tersrf","inertie sous surface", inertie_tersrf(:,:))
221    CALL put_field_srf1(pass,"hcond_tersrf","conductivité thermique sous surface", hcond_tersrf(:,:))
222    CALL put_field_srf1(pass,"tsurfi_tersrf","temperature surface sous surface initiale", tsurfi_tersrf(:,:))
223    CALL put_field_srf2(pass,"Tsoili","temperature sol sous surface initiale", tsoili_tersrf(:,:,:))
224    CALL put_field_srf2(pass,"tsoil_depth","profondeur temperature sol sous surface", tsoil_depth(:,:,:))
225    CALL put_field_srf1(pass,"qsurf_tersrf","humidite surface sous surface", qsurf_tersrf(:,:))
226    CALL put_field_srf1(pass,"tsurf_tersrf","temperature surface sous surface", tsurf_tersrf(:,:))
227    CALL put_field_srf1(pass,"tsurf_new_tersrf","temperature surface sous surface", tsurf_new_tersrf(:,:))
228    CALL put_field_srf1(pass,"cdragm_tersrf","coeff trainee quantite mouvement sous surface", cdragm_tersrf(:,:))
229    CALL put_field_srf1(pass,"cdragh_tersrf","coeff trainee chaleur sous surface", cdragh_tersrf(:,:))
230    CALL put_field_srf1(pass,"swnet_tersrf","shortwave net sous surface", swnet_tersrf(:,:))
231    CALL put_field_srf1(pass,"lwnet_tersrf","longwave net sous surface", lwnet_tersrf(:,:))
232    CALL put_field_srf1(pass,"fluxsens_tersrf","flux sensible sous surface", fluxsens_tersrf(:,:))
233    CALL put_field_srf1(pass,"fluxlat_tersrf","flux latent sous surface", fluxlat_tersrf(:,:))
234    CALL put_field_srf2(pass,"tsoil_tersrf","temperature sol sous surface", tsoil_tersrf(:,:,:))
[524]235
[3506]236    CALL put_field_srf1(pass,"QS"  , "Humidite",qsurf(:,:))
[1827]237
[3506]238    CALL put_field     (pass,"QSOL", "Eau dans le sol (mm)", qsol)
[1827]239
[3506]240    CALL put_field_srf1(pass,"EVAP", "Evaporation", fevap(:,:))
[1827]241
[3506]242    CALL put_field_srf1(pass,"SNOW", "Neige", snow(:,:))
[1827]243
[5662]244    !GG
245    CALL put_field(pass,"hice", "Ice thickness", hice)
246    CALL put_field(pass,"tice", "Sea Ice temperature", tice)
247    CALL put_field(pass,"bilg_cumul", "Flux conductivite + transmit sea-ice", bilg_cumul)
248    !GG
249
[3506]250    CALL put_field(pass,"RADS", "Rayonnement net a la surface", radsol)
[1827]251
[3506]252    CALL put_field(pass,"solsw", "Rayonnement solaire a la surface", solsw)
[1827]253
[3756]254    CALL put_field(pass,"solswfdiff", "Fraction du rayonnement solaire a la surface qui est diffus", solswfdiff)
255
[3506]256    CALL put_field(pass,"sollw", "Rayonnement IF a la surface", sollw)
[1827]257
[3506]258    CALL put_field(pass,"sollwdown", "Rayonnement down IF a la surface", sollwdown)
[2188]259
[3506]260    CALL put_field(pass,"fder", "Derive de flux", fder)
[1827]261
[3506]262    CALL put_field(pass,"rain_f", "precipitation liquide", rain_fall)
[1827]263
[3506]264    CALL put_field(pass,"snow_f", "precipitation solide", snow_fall)
[1827]265
[3506]266    CALL put_field_srf1(pass,"Z0m", "rugosite", z0m(:,:))
[1827]267
[3506]268    CALL put_field_srf1(pass,"Z0h", "rugosite", z0h(:,:))
[1827]269
[3506]270    CALL put_field_srf1(pass,"AGESNO", "Age de la neige", agesno(:,:))
[2293]271
[3506]272    CALL put_field(pass,"ZMEA", "ZMEA", zmea)
[1827]273
[3506]274    CALL put_field(pass,"ZSTD", "ZSTD", zstd)
[1827]275
[3506]276    CALL put_field(pass,"ZSIG", "ZSIG", zsig)
[1827]277
[3506]278    CALL put_field(pass,"ZGAM", "ZGAM", zgam)
[1827]279
[3506]280    CALL put_field(pass,"ZTHE", "ZTHE", zthe)
[1827]281
[3506]282    CALL put_field(pass,"ZPIC", "ZPIC", zpic)
[1827]283
[3506]284    CALL put_field(pass,"ZVAL", "ZVAL", zval)
[1827]285
[3506]286    CALL put_field(pass,"RUGSREL", "RUGSREL", rugoro)
[1827]287
[3506]288    CALL put_field(pass,"TANCIEN", "TANCIEN", t_ancien)
[1827]289
[3506]290    CALL put_field(pass,"QANCIEN", "QANCIEN", q_ancien)
[1827]291
[3506]292    CALL put_field(pass,"QLANCIEN", "QLANCIEN", ql_ancien)
[2497]293
[3506]294    CALL put_field(pass,"QSANCIEN", "QSANCIEN", qs_ancien)
[2497]295
[4523]296    IF (ok_bs) THEN
297       CALL put_field(pass,"bs_f", "precipitation neige soufflee", bs_fall)
298       CALL put_field(pass,"QBSANCIEN", "QBSANCIEN", qbs_ancien)
299       CALL put_field(pass,"PRBSWANCIEN", "PRBSWANCIEN", prbsw_ancien)
300    ENDIF
301
[5204]302    IF ( ok_ice_supersat ) THEN
303      CALL put_field(pass,"CFANCIEN", "CFANCIEN", cf_ancien)
304      CALL put_field(pass,"RVCANCIEN", "RVCANCIEN", rvc_ancien)
305    ENDIF
[4059]306
[3506]307    CALL put_field(pass,"PRWANCIEN", "PRWANCIEN", prw_ancien)
[1827]308
[3506]309    CALL put_field(pass,"PRLWANCIEN", "PRLWANCIEN", prlw_ancien)
[1827]310
[3506]311    CALL put_field(pass,"PRSWANCIEN", "PRSWANCIEN", prsw_ancien)
[2499]312
[3506]313    CALL put_field(pass,"UANCIEN", "UANCIEN", u_ancien)
[2499]314
[3506]315    CALL put_field(pass,"VANCIEN", "VANCIEN", v_ancien)
[2499]316
[3506]317    CALL put_field(pass,"CLWCON", "Eau liquide convective", clwcon)
[1827]318
[3506]319    CALL put_field(pass,"RNEBCON", "Nebulosite convective", rnebcon)
[1827]320
[3506]321    CALL put_field(pass,"RATQS", "Ratqs", ratqs)
[1827]322
[3506]323    ! run_off_lic_0
[1827]324
[3506]325    CALL put_field(pass,"RUNOFFLIC0", "Runofflic0", run_off_lic_0)
[1827]326
[3506]327    ! DEB TKE PBL !
[1827]328
[3506]329    IF (iflag_pbl>1) then
330      CALL put_field_srf3(pass,"TKE", "Energ. Cineti. Turb.", &
331           pbl_tke(:,:,:))
332      CALL put_field_srf3(pass,"DELTATKE", "Del TKE wk/env.", &
333           wake_delta_pbl_tke(:,:,:))
334    END IF
[1619]335
[3506]336    ! FIN TKE PBL !
337    !IM ajout zmax0, f0, sig1, w01
338    !IM wake_deltat, wake_deltaq, wake_s, wake_cstar, wake_pe, wake_fip
[1619]339
[3506]340    CALL put_field(pass,"ZMAX0", "ZMAX0", zmax0)
[1619]341
[3506]342    CALL put_field(pass,"F0", "F0", f0)
[878]343
[3506]344    CALL put_field(pass,"sig1", "sig1 Emanuel", sig1)
[1001]345
[3506]346    CALL put_field(pass,"w01", "w01 Emanuel", w01)
[1001]347
[3506]348    ! wake_deltat
349    CALL put_field(pass,"WAKE_DELTAT", "WAKE_DELTAT", wake_deltat)
[1279]350
[3506]351    CALL put_field(pass,"WAKE_DELTAQ", "WAKE_DELTAQ", wake_deltaq)
[1403]352
[3506]353    CALL put_field(pass,"WAKE_S", "Wake frac. area", wake_s)
[1403]354
[4744]355    CALL put_field(pass,"AWAKE_S", "Active Wake frac. area", awake_s)
356
[3506]357    CALL put_field(pass,"WAKE_DENS", "Wake num. /unit area", wake_dens)
[2635]358
[3956]359    CALL put_field(pass,"AWAKE_DENS", "Active Wake num. /unit area", awake_dens)
360
361    CALL put_field(pass,"CV_GEN", "CB birth rate", cv_gen)
362
[3506]363    CALL put_field(pass,"WAKE_CSTAR", "WAKE_CSTAR", wake_cstar)
[1403]364
[3506]365    CALL put_field(pass,"WAKE_PE", "WAKE_PE", wake_pe)
[1403]366
[3506]367    CALL put_field(pass,"WAKE_FIP", "WAKE_FIP", wake_fip)
[1279]368
[3506]369    ! thermiques
[1827]370
[3506]371    CALL put_field(pass,"FM_THERM", "FM_THERM", fm_therm)
[1827]372
[3506]373    CALL put_field(pass,"ENTR_THERM", "ENTR_THERM", entr_therm)
[1827]374
[3506]375    CALL put_field(pass,"DETR_THERM", "DETR_THERM", detr_therm)
[1827]376
[3506]377    CALL put_field(pass,"ALE_BL", "ALE_BL", ale_bl)
[2069]378
[3506]379    CALL put_field(pass,"ALE_BL_TRIG", "ALE_BL_TRIG", ale_bl_trig)
[2069]380
[3506]381    CALL put_field(pass,"ALP_BL", "ALP_BL", alp_bl)
[2069]382
[3506]383    CALL put_field(pass,"ALE_WAKE", "ALE_WAKE", ale_wake)
[3080]384
[3506]385    CALL put_field(pass,"ALE_BL_STAT", "ALE_BL_STAT", ale_bl_stat)
[3080]386
387
[3856]388    ! fisrtilp/clouds
[4613]389    CALL put_field(pass,"RATQS_INTER","Relative width of the lsc sugrid scale water",ratqs_inter_)
[3856]390
391
[4389]392    IF (ANY(type_trac == ['co2i','inco'])) THEN
[4170]393       IF (carbon_cycle_cpl) THEN
394          IF (.NOT. ALLOCATED(co2_send)) THEN
395             ! This is the case of create_etat0_limit, ce0l
396             ALLOCATE(co2_send(klon))
397             co2_send(:) = co2_ppm0
398          END IF
399          CALL put_field(pass,"co2_send", "co2_ppm for coupling", co2_send)
400       END IF
401
[3506]402    ! trs from traclmdz_mod
[4263]403    ELSE IF (type_trac == 'lmdz') THEN
[3506]404       CALL traclmdz_to_restart(trs)
[4056]405       it = 0
406       DO iq = 1, nqtot
[5481]407          IF(.NOT.tracers(iq)%isInPhysics) CYCLE
[4056]408          it = it+1
409          CALL put_field(pass,"trs_"//tracers(iq)%name, "", trs(:, it))
[3506]410       END DO
[3933]411    END IF
412
[3506]413    ! Restart variables for Slab ocean
414    IF (type_ocean == 'slab') THEN
415        IF (nslay.EQ.1) THEN
416          CALL put_field(pass,"tslab", "Slab ocean temperature", tslab)
417        ELSE
418          DO it=1,nslay
419            WRITE(str2,'(i2.2)') it
420            CALL put_field(pass,"tslab"//str2, "Slab ocean temperature", tslab(:,it))
421          END DO
[1827]422        END IF
[3506]423        IF (version_ocean == 'sicINT') THEN
424            CALL put_field(pass,"seaice", "Slab seaice (kg/m2)", seaice)
[5662]425            CALL put_field(pass,"slab_tice", "Slab sea ice temperature", tice_slab)
[3506]426        END IF
427    END IF
[1827]428
[3506]429    if (ok_gwd_rando) call put_field(pass,"du_gwd_rando", &
430         "tendency on zonal wind due to flott gravity waves", du_gwd_rando)
[2057]431
[3506]432    IF (.not. ok_hines .and. ok_gwd_rando) call put_field(pass,"du_gwd_front", &
433         "tendency on zonal wind due to acama gravity waves", du_gwd_front)
[1938]434
[3815]435    if (activate_ocean_skin >= 1) then
436       if (activate_ocean_skin == 2 .and. type_ocean == 'couple') then
437          CALL put_field(pass, "delta_sal", &
438               "ocean-air interface salinity minus bulk salinity", delta_sal)
439          CALL put_field(pass, "delta_SST", &
440               "ocean-air interface temperature minus bulk SST", delta_sst)
[4370]441          CALL put_field(pass, "dter", &
442               "ocean-air interface temperature minus subskin temperature", &
443               dter)
444          CALL put_field(pass, "dser", &
445               "ocean-air interface salinity minus subskin salinity", dser)
446          CALL put_field(pass, "dt_ds", &
447               "(tks / tkt) * dTer", dt_ds)
[3815]448       end if
449       
450       CALL put_field(pass, "dS_ns", "delta salinity near surface", ds_ns)
451       CALL put_field(pass, "dT_ns", "delta temperature near surface", dT_ns)
452    end if
453   
[3506]454    IF (pass==1) CALL enddef_restartphy
455    IF (pass==2) CALL close_restartphy
[4046]456  ENDDO ! DO pass=1,2   ! pass=1 netcdf definition ; pass=2 netcdf write
[3506]457 
[1827]458  !$OMP BARRIER
459
[2293]460
461  CONTAINS
462
463
[3506]464SUBROUTINE put_field_srf1(pass,nam,lnam,field)
[2293]465
466  IMPLICIT NONE
[4056]467  INTEGER, INTENT(IN)           :: pass
[2293]468  CHARACTER(LEN=*),  INTENT(IN) :: nam, lnam
469  REAL,              INTENT(IN) :: field(:,:)
470  CHARACTER(LEN=256) :: nm, lm, str
[2299]471  DO nsrf = 1, SIZE(field,2)
[2293]472    WRITE(str, '(i2.2)') nsrf
473    nm=TRIM(nam)//TRIM(str)
474    lm=TRIM(lnam)//" de surface No. "//TRIM(str)
[3506]475    CALL put_field(pass,nm,lm,field(:,nsrf))
[2293]476  END DO
477
478END SUBROUTINE put_field_srf1
479
480
[3506]481SUBROUTINE put_field_srf2(pass,nam,lnam,field)
[2293]482
483  IMPLICIT NONE
[3506]484  INTEGER, INTENT(IN)            :: pass
[2293]485  CHARACTER(LEN=*),  INTENT(IN) :: nam, lnam
486  REAL,              INTENT(IN) :: field(:,:,:)
487  CHARACTER(LEN=256) :: nm, lm, str
[2299]488  DO nsrf = 1, SIZE(field,3)
489    DO isoil=1, SIZE(field,2)
[2293]490      WRITE(str, '(i2.2,"srf",i2.2)')isoil,nsrf
491!      WRITE(lunout,*)"PHYREDEM ",TRIM(nam)//TRIM(str)
492      nm=TRIM(nam)//TRIM(str)
493      lm=TRIM(lnam)//" du sol No. "//TRIM(str)
[3506]494      CALL put_field(pass,nm,lm,field(:,isoil,nsrf))
[2293]495    END DO
496  END DO
497
498END SUBROUTINE put_field_srf2
499
500
[3506]501SUBROUTINE put_field_srf3(pass,nam,lnam,field)
[2293]502
503  IMPLICIT NONE
[3506]504  INTEGER, INTENT(IN)            :: pass
[2293]505  CHARACTER(LEN=*),  INTENT(IN) :: nam, lnam
506  REAL,              INTENT(IN) :: field(:,:,:)
507  CHARACTER(LEN=256) :: nm, lm, str
[2299]508  DO nsrf = 1, SIZE(field,3)
[2293]509    WRITE(str, '(i2.2)') nsrf
510    nm=TRIM(nam)//TRIM(str)
511    lm=TRIM(lnam)//TRIM(str)
[3506]512    CALL put_field(pass,nm,lm,field(:,1:klev+1,nsrf))
[2293]513  END DO
514
515END SUBROUTINE put_field_srf3
516
517
[1827]518END SUBROUTINE phyredem
Note: See TracBrowser for help on using the repository browser.