Ignore:
Timestamp:
Jan 30, 2019, 5:55:48 PM (6 years ago)
Author:
lguez
Message:

Introduce variable activate_ocean_skin in module config_ocean_skin_m.

Bug fix in phys_state_var_end: we need to deallocate variables for
lmdz1d (although it is useless for a 3D run).

Location:
LMDZ6/branches/Ocean_skin/libf/phylmd
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/branches/Ocean_skin/libf/phylmd/pbl_surface_mod.F90

    r3429 r3458  
    2727!!                                  wx_pbl_fuse, wx_pbl_split
    2828                                  wx_pbl0_fuse, wx_pbl0_split
     29  use config_ocean_skin_m, only: activate_ocean_skin
    2930
    3031  IMPLICIT NONE
     
    963964    rh2m_x(:) = 0. ; qsat2m_x(:) = 0. ; rh2m_w(:) = 0. ; qsat2m_w(:) = 0.
    964965
    965     t_int = nf90_fill_real
    966     s_int = nf90_fill_real
    967     dter = nf90_fill_real
    968     dser = nf90_fill_real
    969     tkt = nf90_fill_real
    970     tks = nf90_fill_real
    971     rf = nf90_fill_real
    972     taur = nf90_fill_real
     966    if (activate_ocean_skin >= 1) then
     967       t_int = nf90_fill_real
     968       s_int = nf90_fill_real
     969       dter = nf90_fill_real
     970       dser = nf90_fill_real
     971       tkt = nf90_fill_real
     972       tks = nf90_fill_real
     973       rf = nf90_fill_real
     974       taur = nf90_fill_real
     975    end if
    973976
    974977! 2b) Initialization of all local variables that will be compressed later
     
    14311434       ENDIF
    14321435
    1433        if (nsrf == is_oce) then
     1436       if (nsrf == is_oce .and. activate_ocean_skin >= 1) then
    14341437          yds_ns(:knon) = ds_ns(ni(:knon))
    14351438          ydt_ns(:knon) = dt_ns(ni(:knon))
     
    25612564       ENDIF
    25622565
    2563        if (nsrf == is_oce) then
     2566       if (nsrf == is_oce .and. activate_ocean_skin >= 1) then
    25642567          dt_ns = nf90_fill_real
    25652568          ds_ns = nf90_fill_real
     
    31883191    USE indice_sol_mod
    31893192    use phys_state_var_mod, only: ds_ns, dt_ns
     3193    use config_ocean_skin_m, only: activate_ocean_skin
    31903194
    31913195    INCLUDE "dimsoil.h"
     
    32743278                      alb_dif(i,k,nsrf) = 0.06
    32753279                   ENDDO
    3276                    ds_ns(i) = 0.
    3277                    dt_ns(i) = 0.
     3280                   if (activate_ocean_skin >= 1) then
     3281                      ds_ns(i) = 0.
     3282                      dt_ns(i) = 0.
     3283                   end if
    32783284                ELSE IF (nsrf.EQ.is_sic) THEN
    32793285                   tsurf(i,nsrf) = 271.35
  • LMDZ6/branches/Ocean_skin/libf/phylmd/phyetat0.F90

    r3429 r3458  
    3030  USE time_phylmdz_mod, ONLY: init_iteration, pdtphys, itau_phy
    3131  use netcdf, only: nf90_fill_real
     32  use config_ocean_skin_m, only: activate_ocean_skin
    3233
    3334  IMPLICIT none
     
    529530  CALL fonte_neige_init(run_off_lic_0)
    530531
    531   found = phyetat0_get(1, ds_ns, "ds_ns", "delta salinity near surface", 0.)
    532   found = phyetat0_get(1, dt_ns, "dT_ns", "delta temperature near surface", 0.)
    533 
    534   where (pctsrf(:, is_oce) == 0.)
    535      ds_ns = nf90_fill_real
    536      dt_ns = nf90_fill_real
    537   end where
     532  if (activate_ocean_skin >= 1) then
     533     found = phyetat0_get(1, ds_ns, "ds_ns", "delta salinity near surface", 0.)
     534     found = phyetat0_get(1, dt_ns, "dT_ns", "delta temperature near surface", &
     535          0.)
     536
     537     where (pctsrf(:, is_oce) == 0.)
     538        ds_ns = nf90_fill_real
     539        dt_ns = nf90_fill_real
     540     end where
     541  end if
    538542
    539543END SUBROUTINE phyetat0
  • LMDZ6/branches/Ocean_skin/libf/phylmd/phyredem.F90

    r3429 r3458  
    3737  USE ocean_slab_mod, ONLY : nslay, tslab, seaice, tice, fsic
    3838  USE time_phylmdz_mod, ONLY: annee_ref, day_end, itau_phy, pdtphys
     39  use config_ocean_skin_m, only: activate_ocean_skin 
    3940
    4041  IMPLICIT none
     
    337338       "tendency on zonal wind due to acama gravity waves", du_gwd_front)
    338339
    339   CALL put_field("ds_ns", "delta salinity near surface", ds_ns)
    340   CALL put_field("dT_ns", "delta temperature near surface", dT_ns)
     340  if (activate_ocean_skin >= 1) then
     341     CALL put_field("ds_ns", "delta salinity near surface", ds_ns)
     342     CALL put_field("dT_ns", "delta temperature near surface", dT_ns)
     343  end if
    341344 
    342345  CALL close_restartphy
  • LMDZ6/branches/Ocean_skin/libf/phylmd/phys_output_var_mod.F90

    r3429 r3458  
    167167  SUBROUTINE phys_output_var_init
    168168    use dimphy
     169    use config_ocean_skin_m, only: activate_ocean_skin
    169170
    170171    IMPLICIT NONE
     
    220221    IF (ok_gwd_rando) allocate(zustr_gwd_rando(klon), zvstr_gwd_rando(klon))
    221222
    222     allocate(t_int(klon), s_int(klon), dter(klon), dser(klon), tkt(klon), &
    223          tks(klon), rf(klon), taur(klon))
     223    if (activate_ocean_skin >= 1) allocate(t_int(klon), s_int(klon), &
     224         dter(klon), dser(klon), tkt(klon), tks(klon), rf(klon), taur(klon))
    224225
    225226  END SUBROUTINE phys_output_var_init
  • LMDZ6/branches/Ocean_skin/libf/phylmd/phys_output_write_mod.F90

    r3429 r3458  
    376376#endif
    377377    USE tracinca_mod, ONLY: config_inca
     378    use config_ocean_skin_m, only: activate_ocean_skin
    378379
    379380    IMPLICIT NONE
     
    21112112       ENDIF   !(iflag_phytrac==1)
    21122113
    2113        CALL histwrite_phy(o_t_int, t_int)
    2114        CALL histwrite_phy(o_s_int, s_int)
    2115        CALL histwrite_phy(o_ds_ns, ds_ns)
    2116        CALL histwrite_phy(o_dt_ns, dt_ns)
    2117        CALL histwrite_phy(o_dter, dter)
    2118        CALL histwrite_phy(o_dser, dser)
    2119        CALL histwrite_phy(o_tkt, tkt)
    2120        CALL histwrite_phy(o_tks, tks)
    2121        CALL histwrite_phy(o_rf, rf)
    2122        CALL histwrite_phy(o_taur, taur)
     2114       if (activate_ocean_skin >= 1) then
     2115          CALL histwrite_phy(o_t_int, t_int)
     2116          CALL histwrite_phy(o_s_int, s_int)
     2117          CALL histwrite_phy(o_ds_ns, ds_ns)
     2118          CALL histwrite_phy(o_dt_ns, dt_ns)
     2119          CALL histwrite_phy(o_dter, dter)
     2120          CALL histwrite_phy(o_dser, dser)
     2121          CALL histwrite_phy(o_tkt, tkt)
     2122          CALL histwrite_phy(o_tks, tks)
     2123          CALL histwrite_phy(o_rf, rf)
     2124          CALL histwrite_phy(o_taur, taur)
     2125       end if
    21232126
    21242127       IF (.NOT.vars_defined) THEN
  • LMDZ6/branches/Ocean_skin/libf/phylmd/phys_state_var_mod.F90

    r3429 r3458  
    439439USE infotrac_phy, ONLY : nbtr
    440440USE indice_sol_mod
     441use config_ocean_skin_m, only: activate_ocean_skin
    441442IMPLICIT NONE
    442443
     
    621622      if (.not. ok_hines .and. ok_gwd_rando) allocate(du_gwd_front(klon, klev))
    622623
    623       ALLOCATE(ds_ns(klon), dt_ns(klon))
     624      if (activate_ocean_skin >= 1) ALLOCATE(ds_ns(klon), dt_ns(klon))
    624625
    625626    END SUBROUTINE phys_state_var_init
    626627
    627628!======================================================================
    628 SUBROUTINE phys_state_var_end
     629    SUBROUTINE phys_state_var_end
     630      ! Useful only for lmdz1d.
    629631!USE dimphy
    630632USE indice_sol_mod
     633use config_ocean_skin_m, only: activate_ocean_skin
    631634IMPLICIT NONE
    632635include "clesphys.h"
     
    754757      deallocate(ale_bl_trig)
    755758!!! fin nrlmd le 10/04/2012
     759      if (activate_ocean_skin >= 1) deALLOCATE(ds_ns, dt_ns)
    756760
    757761END SUBROUTINE phys_state_var_end
  • LMDZ6/branches/Ocean_skin/libf/phylmd/surf_ocean_mod.F90

    r3432 r3458  
    3333    USE limit_read_mod
    3434    use sens_heat_rain_m, only: sens_heat_rain
     35    use config_ocean_skin_m, only: activate_ocean_skin
    3536    !
    3637    ! This subroutine will make a call to ocean_XXX_noice according to the ocean mode (force,
     
    103104    REAL, intent(out):: t_int(:) ! (knon) interface temperature, in K
    104105    real, intent(out):: s_int(:) ! (knon) interface salinity, in ppt
    105    
     106
    106107    REAL, intent(out):: dter(:) ! (knon)
    107108    ! Temperature variation in the diffusive microlayer, that is
     
    311312    ENDIF
    312313
    313     rhoa = PS(:KNON) / (Rd * temp_air(:knon) * (1. + retv * spechum(:knon)))
    314     xlv = rlvtt
    315     precip_tot = precip_rain(:knon) + precip_snow(:knon)
    316     rf =  sens_heat_rain(precip_tot, temp_air(:knon), spechum(:knon), rhoa, &
    317          xlv, tsurf_new(:knon), ps(:knon))
    318     s1 = 35.
    319     call bulk_flux(tkt, tks, taur, dter, dser, t_int, s_int, ds_ns, dt_ns, &
    320          u = windsp(:knon), t_ocean_1 = tsurf_new(:knon), s1 = s1, &
    321          rain = precip_tot, hf = - fluxsens(:knon), hlb = - fluxlat(:knon), &
    322          rnl = - lwnet(:knon), &
    323          tau = sqrt(flux_u1(:knon)**2 + flux_v1(:knon)**2), rhoa = rhoa, &
    324          xlv = xlv, rf = rf, dtime = dtime, rns = swnet(:knon))
     314    if (activate_ocean_skin >= 1) then
     315       rhoa = PS(:KNON) / (Rd * temp_air(:knon) * (1. + retv * spechum(:knon)))
     316       xlv = rlvtt
     317       precip_tot = precip_rain(:knon) + precip_snow(:knon)
     318       rf =  sens_heat_rain(precip_tot, temp_air(:knon), spechum(:knon), rhoa, &
     319            xlv, tsurf_new(:knon), ps(:knon))
     320       s1 = 35.
     321       call bulk_flux(tkt, tks, taur, dter, dser, t_int, s_int, ds_ns, dt_ns, &
     322            u = windsp(:knon), t_ocean_1 = tsurf_new(:knon), s1 = s1, &
     323            rain = precip_tot, hf = - fluxsens(:knon), hlb = - fluxlat(:knon), &
     324            rnl = - lwnet(:knon), &
     325            tau = sqrt(flux_u1(:knon)**2 + flux_v1(:knon)**2), rhoa = rhoa, &
     326            xlv = xlv, rf = rf, dtime = dtime, rns = swnet(:knon))
     327    end if
     328   
     329    if (activate_ocean_skin == 2) tsurf_new(:knon) = t_int
    325330
    326331  END SUBROUTINE surf_ocean
    327   !******************************************************************************
     332  !****************************************************************************
    328333  !
    329334END MODULE surf_ocean_mod
Note: See TracChangeset for help on using the changeset viewer.