Changeset 3628 for LMDZ6/branches


Ignore:
Timestamp:
Feb 4, 2020, 10:36:32 PM (5 years ago)
Author:
lguez
Message:

If the ocean skin parameterization is working actively
(activate_ocean_skin == 2) and we are coupled to the ocean then send
ocean-air interface salinity to the ocean. New dummy argument s_int
of procedures ocean_cpl_noice and cpl_send_ocean_fields. We can
only send interface salinity from the previous time-step since
communication with the ocean is before the call to bulk_flux. So make
s_int a state variable: move s_int from phys_output_var_mod to
phys_state_var_mod. Still, we only read s_int from startphy,
define it before the call to surf_ocean and write it to restartphy
if activate_ocean_skin == 2 and type_ocean == 'couple'. In
procedure pbl_surface, for clarity, move the definition of output
variables t_int, dter, dser, tkt, tks, rf, taur to missing_val to
after the call to surf_ocean, with the definition of s_int,
ds_ns, dt_ns to missing_val. This does not change anything for
t_int, dter, dser, tkt, tks, rf, taur. In pbl_surface_newfrac, we
choose to set s_int to 35 for an appearing ocean point, this is
questionable. In surf_ocean, change the intent of s_int from out
to inout.

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

Legend:

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

    r3627 r3628  
    4949  !$OMP THREADPRIVATE(cpl_snow,cpl_evap,cpl_tsol)
    5050
    51   REAL, ALLOCATABLE, SAVE:: cpl_t_int(:)
    52   !$OMP THREADPRIVATE(cpl_t_int)
     51  REAL, ALLOCATABLE, SAVE:: cpl_t_int(:), cpl_s_int(:)
     52  !$OMP THREADPRIVATE(cpl_t_int, cpl_s_int)
    5353 
    5454  REAL, ALLOCATABLE, DIMENSION(:,:), SAVE   :: cpl_fder, cpl_albe, cpl_taux, cpl_tauy
     
    9494  !$OMP THREADPRIVATE(cpl_snow2D, cpl_evap2D, cpl_tsol2D)
    9595
    96   REAL, ALLOCATABLE, SAVE:: cpl_t_int_2D(:,:)
    97   !$OMP THREADPRIVATE(cpl_t_int_2D)
     96  REAL, ALLOCATABLE, SAVE:: cpl_t_int_2D(:,:), cpl_s_int_2D(:,:)
     97  !$OMP THREADPRIVATE(cpl_t_int_2D, cpl_s_int_2D)
    9898
    9999  REAL, ALLOCATABLE, DIMENSION(:,:,:), SAVE :: cpl_fder2D, cpl_albe2D
     
    237237   
    238238       if (activate_ocean_skin == 2) then
    239           ALLOCATE(cpl_t_int(klon), stat = error)
     239          ALLOCATE(cpl_t_int(klon), cpl_s_int(klon), stat = error)
    240240          sum_error = sum_error + error
    241241       end if
     
    645645       swdown, lwdown, fluxlat, fluxsens, &
    646646       precip_rain, precip_snow, evap, tsurf, fder, albsol, taux, tauy, windsp,&
    647        sens_prec_liq, sens_prec_sol, lat_prec_liq, lat_prec_sol, t_int)
     647       sens_prec_liq, sens_prec_sol, lat_prec_liq, lat_prec_sol, t_int, s_int)
    648648
    649649    ! This subroutine cumulates some fields for each time-step during
     
    672672    REAL, DIMENSION(klon), INTENT(IN)       :: lat_prec_liq, lat_prec_sol
    673673    real, intent(in):: t_int(:) ! (klon) ocean-air interface temperature, in K
     674    real, intent(in):: s_int(:) ! (knon) ocean-air interface salinity, in ppt
    674675
    675676! Local variables
     
    707708       cpl_taumod(1:knon,cpl_index) = 0.0
    708709       IF (carbon_cycle_cpl) cpl_atm_co2(1:knon,cpl_index) = 0.0
    709        if (activate_ocean_skin == 2) cpl_t_int(:knon) = 0.
     710
     711       if (activate_ocean_skin == 2) then
     712          cpl_t_int(:knon) = 0.
     713          cpl_s_int = 0.
     714       end if
    710715    ENDIF
    711716       
     
    750755       ENDIF
    751756
    752        if (activate_ocean_skin == 2) &
    753             cpl_t_int(ig) = cpl_t_int(ig) + t_int(ig) / REAL(nexca)
     757       if (activate_ocean_skin == 2) then
     758          cpl_t_int(ig) = cpl_t_int(ig) + t_int(ig) / REAL(nexca)
     759          cpl_s_int(ig) = cpl_s_int(ig) + s_int(ig) / REAL(nexca)
     760       end if
    754761     ENDDO
    755762
     
    799806
    800807          if (activate_ocean_skin == 2) then
    801              ALLOCATE(cpl_t_int_2D(nbp_lon, jj_nb), stat = error)
     808             ALLOCATE(cpl_t_int_2D(nbp_lon, jj_nb), &
     809                  cpl_s_int_2D(nbp_lon, jj_nb), stat = error)
    802810             sum_error = sum_error + error
    803811          end if
     
    857865       IF (carbon_cycle_cpl) &
    858866            CALL gath2cpl(cpl_atm_co2(:,cpl_index), cpl_atm_co22D(:,:), knon, knindex)
    859        if (activate_ocean_skin == 2) &
    860             CALL gath2cpl(cpl_t_int, cpl_t_int_2D, knon, knindex)
     867       if (activate_ocean_skin == 2) then
     868          CALL gath2cpl(cpl_t_int, cpl_t_int_2D, knon, knindex)
     869          CALL gath2cpl(cpl_s_int, cpl_s_int_2D, knon, knindex)
     870       end if
    861871    ENDIF
    862872
     
    12521262    tab_flds(:,:,ids_qraiic) = cpl_sens_rain2D(:,:,2)
    12531263    tab_flds(:,:,ids_qsnoic) = cpl_sens_snow2D(:,:,2)
    1254     if (activate_ocean_skin == 2) tab_flds(:, :, ids_t_int) = cpl_t_int_2D
     1264
     1265    if (activate_ocean_skin == 2) then
     1266       tab_flds(:, :, ids_t_int) = cpl_t_int_2D
     1267       tab_flds(:, :, ids_s_int) = cpl_s_int_2D
     1268    end if
    12551269   
    12561270    IF (version_ocean=='nemo') THEN
     
    14891503    ENDIF
    14901504
    1491     if (activate_ocean_skin == 2) deallocate(cpl_t_int_2d)
     1505    if (activate_ocean_skin == 2) deallocate(cpl_t_int_2d, cpl_s_int_2d)
    14921506
    14931507    IF (sum_error /= 0) THEN
  • LMDZ6/branches/Ocean_skin/libf/phylmd/oasis.F90

    r3627 r3628  
    5959  INTEGER, PARAMETER :: ids_qraiic = 28
    6060  INTEGER, PARAMETER :: ids_qsnoic = 29
    61   INTEGER, PARAMETER :: ids_t_int = 30
    62  
    63   INTEGER, PARAMETER :: maxsend    = 30  ! Maximum number of fields to send
     61  INTEGER, PARAMETER :: ids_t_int = 30, ids_s_int = 31
     62 
     63  INTEGER, PARAMETER :: maxsend    = 31  ! Maximum number of fields to send
    6464 
    6565  ! Id for fields received from ocean
     
    193193       infosend(ids_t_int)%action = .TRUE.
    194194       infosend(ids_t_int)%name = 'T_int'
     195       infosend(ids_s_int)%action = .TRUE.
     196       infosend(ids_s_int)%name = 'S_int'
    195197    end if
    196198           
  • LMDZ6/branches/Ocean_skin/libf/phylmd/ocean_cpl_mod.F90

    r3627 r3628  
    5555       radsol, snow, agesno, &
    5656       qsurf, evap, fluxsens, fluxlat, flux_u1, flux_v1, &
    57        tsurf_new, dflux_s, dflux_l, sss)
     57       tsurf_new, dflux_s, dflux_l, sss, s_int)
    5858
    5959!
     
    9292    REAL, DIMENSION(klon), INTENT(IN)        :: u1, v1, gustiness
    9393    REAL, DIMENSION(klon), INTENT(IN)        :: tsurf_in
     94    real, intent(in):: s_int(:) ! (knon) ocean-air interface salinity, in ppt
    9495
    9596! In/Output arguments
     
    205206!****************************************************************************************
    206207
    207     CALL cpl_send_ocean_fields(itime, knon, knindex, &
    208          swnet, lwnet, fluxlat, fluxsens, &
    209          precip_rain, precip_snow, evap, tsurf_new, fder_new, alb1, flux_u1, flux_v1, windsp,&
    210          sens_prec_liq, sens_prec_sol, lat_prec_liq, lat_prec_sol, tsurf_in)
    211    
     208    CALL cpl_send_ocean_fields(itime, knon, knindex, swnet, lwnet, fluxlat, &
     209         fluxsens, precip_rain, precip_snow, evap, tsurf_new, fder_new, alb1, &
     210         flux_u1, flux_v1, windsp, sens_prec_liq, sens_prec_sol, lat_prec_liq, &
     211         lat_prec_sol, tsurf_in, s_int)
    212212
    213213  END SUBROUTINE ocean_cpl_noice
  • LMDZ6/branches/Ocean_skin/libf/phylmd/pbl_surface_mod.F90

    r3626 r3628  
    292292    USE print_control_mod,  ONLY : prt_level,lunout
    293293    USE ioipsl_getin_p_mod, ONLY : getin_p
    294     use phys_state_var_mod, only: ds_ns, dt_ns
    295     use phys_output_var_mod, only: t_int, s_int, dter, dser, tkt, tks, rf, taur
     294    use phys_state_var_mod, only: s_int, ds_ns, dt_ns
     295    use phys_output_var_mod, only: t_int, dter, dser, tkt, tks, rf, taur
    296296#ifdef CPP_XIOS
    297297    USE wxios, ONLY: missing_val
     
    969969    rh2m_x(:) = 0. ; qsat2m_x(:) = 0. ; rh2m_w(:) = 0. ; qsat2m_w(:) = 0.
    970970
    971     if (activate_ocean_skin >= 1) then
    972        t_int = missing_val
    973        s_int = missing_val
    974        dter = missing_val
    975        dser = missing_val
    976        tkt = missing_val
    977        tks = missing_val
    978        rf = missing_val
    979        taur = missing_val
    980     end if
    981 
    982971! 2b) Initialization of all local variables that will be compressed later
    983972!****************************************************************************************
     
    14401429
    14411430       if (nsrf == is_oce .and. activate_ocean_skin >= 1) then
     1431          if (activate_ocean_skin == 2 .and. type_ocean == "couple") &
     1432               ys_int(:knon) = s_int(ni(:knon))
    14421433          yds_ns(:knon) = ds_ns(ni(:knon))
    14431434          ydt_ns(:knon) = dt_ns(ni(:knon))
     
    25702561
    25712562       if (nsrf == is_oce .and. activate_ocean_skin >= 1) then
     2563          s_int = missing_val
     2564          ds_ns = missing_val
    25722565          dt_ns = missing_val
    2573           ds_ns = missing_val
     2566          t_int = missing_val
     2567          dter = missing_val
     2568          dser = missing_val
     2569          tkt = missing_val
     2570          tks = missing_val
     2571          rf = missing_val
     2572          taur = missing_val
     2573         
     2574          s_int(ni(:knon)) = ys_int(:knon)
    25742575          ds_ns(ni(:knon)) = yds_ns(:knon)
    25752576          dt_ns(ni(:knon)) = ydt_ns(:knon)
    2576 
    25772577          t_int(ni(:knon)) = yt_int(:knon)
    2578           s_int(ni(:knon)) = ys_int(:knon)
    25792578          dter(ni(:knon)) = ydter(:knon)
    25802579          dser(ni(:knon)) = ydser(:knon)
     
    31953194
    31963195    USE indice_sol_mod
    3197     use phys_state_var_mod, only: ds_ns, dt_ns
     3196    use phys_state_var_mod, only: s_int, ds_ns, dt_ns
    31983197    use config_ocean_skin_m, only: activate_ocean_skin
    31993198
     
    32843283                   ENDDO
    32853284                   if (activate_ocean_skin >= 1) then
     3285                      if (activate_ocean_skin == 2 &
     3286                           .and. type_ocean == "couple") s_int(i) = 35.
    32863287                      ds_ns(i) = 0.
    32873288                      dt_ns(i) = 0.
  • LMDZ6/branches/Ocean_skin/libf/phylmd/phyetat0.F90

    r3626 r3628  
    1919       wake_s, wake_dens, zgam, zmax0, zmea, zpic, zsig, &
    2020       zstd, zthe, zval, ale_bl, ale_bl_trig, alp_bl, u10m, v10m, treedrg, &
    21        ale_wake, ale_bl_stat, ds_ns, dt_ns
     21       ale_wake, ale_bl_stat, s_int, ds_ns, dt_ns
    2222!FC
    2323  USE geometry_mod, ONLY : longitude_deg, latitude_deg
     
    541541
    542542  if (activate_ocean_skin >= 1) then
    543      found = phyetat0_get(1, ds_ns, "ds_ns", "delta salinity near surface", 0.)
     543     if (activate_ocean_skin == 2 .and. type_ocean == 'couple') found &
     544          = phyetat0_get(1, s_int, "S_int", "salinity at air-ocean interface", &
     545          35.)
     546     found = phyetat0_get(1, ds_ns, "dS_ns", "delta salinity near surface", 0.)
    544547     found = phyetat0_get(1, dt_ns, "dT_ns", "delta temperature near surface", &
    545548          0.)
    546549
    547550     where (pctsrf(:, is_oce) == 0.)
     551        s_int = missing_val
    548552        ds_ns = missing_val
    549553        dt_ns = missing_val
  • LMDZ6/branches/Ocean_skin/libf/phylmd/phyredem.F90

    r3605 r3628  
    2727                                ale_wake, ale_bl_stat,                       &
    2828                                du_gwd_rando, du_gwd_front, u10m, v10m,      &
    29                                 treedrg, ds_ns, dt_ns
     29                                treedrg, s_int, ds_ns, dt_ns
    3030  USE geometry_mod, ONLY : longitude_deg, latitude_deg
    3131  USE iostart, ONLY: open_restartphy, close_restartphy, enddef_restartphy, put_field, put_var
     
    342342
    343343    if (activate_ocean_skin >= 1) then
    344        CALL put_field(pass, "ds_ns", "delta salinity near surface", ds_ns)
     344       if (activate_ocean_skin == 2 .and. type_ocean == 'couple') &
     345            CALL put_field(pass, "S_int", "salinity at air-ocean interface", &
     346            s_int)
     347       CALL put_field(pass, "dS_ns", "delta salinity near surface", ds_ns)
    345348       CALL put_field(pass, "dT_ns", "delta temperature near surface", dT_ns)
    346349    end if
  • LMDZ6/branches/Ocean_skin/libf/phylmd/phys_output_var_mod.F90

    r3601 r3628  
    136136 
    137137  REAL, ALLOCATABLE, SAVE:: t_int(:) ! interface temperature, in K
    138   REAL, ALLOCATABLE, SAVE:: s_int(:) ! interface salinity, in ppt
    139138
    140139  REAL, ALLOCATABLE, SAVE:: dter(:)
     
    160159  ! momentum flux due to rain, in Pa
    161160 
    162   !$OMP THREADPRIVATE(t_int, s_int, dter, dser, tkt, tks, rf, taur)
     161  !$OMP THREADPRIVATE(t_int, dter, dser, tkt, tks, rf, taur)
    163162
    164163CONTAINS
     
    221220    IF (ok_gwd_rando) allocate(zustr_gwd_rando(klon), zvstr_gwd_rando(klon))
    222221
    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))
     222    if (activate_ocean_skin >= 1) allocate(t_int(klon), dter(klon), &
     223         dser(klon), tkt(klon), tks(klon), rf(klon), taur(klon))
    225224
    226225  END SUBROUTINE phys_output_var_init
  • LMDZ6/branches/Ocean_skin/libf/phylmd/phys_output_write_mod.F90

    r3605 r3628  
    248248         T2sumSTD, nlevSTD, du_gwd_rando, du_gwd_front, &
    249249         ulevSTD, vlevSTD, wlevSTD, philevSTD, qlevSTD, tlevSTD, &
    250          rhlevSTD, O3STD, O3daySTD, uvSTD, vqSTD, vTSTD, wqSTD, &
    251          vphiSTD, wTSTD, u2STD, v2STD, T2STD, missing_val_nf90, ds_ns, dt_ns
     250         rhlevSTD, O3STD, O3daySTD, uvSTD, vqSTD, vTSTD, wqSTD, vphiSTD, &
     251         wTSTD, u2STD, v2STD, T2STD, missing_val_nf90, s_int, ds_ns, dt_ns
    252252
    253253    USE phys_local_var_mod, ONLY: zxfluxlat, slp, ptstar, pt0, zxtsol, zt2m, &
     
    360360         alt_tropo, &
    361361!Ionela
    362          ok_4xCO2atm, t_int, s_int, dter, dser, tkt, tks, rf, taur
     362         ok_4xCO2atm, t_int, dter, dser, tkt, tks, rf, taur
    363363
    364364    USE ocean_slab_mod, ONLY: nslay, tslab, slab_bilg, tice, seaice, &
  • LMDZ6/branches/Ocean_skin/libf/phylmd/phys_state_var_mod.F90

    r3605 r3628  
    431431
    432432      ! Ocean-atmosphere interface, subskin ocean and near-surface ocean:
     433
     434      REAL, ALLOCATABLE, SAVE:: s_int(:) ! interface salinity, in ppt
    433435     
    434436      REAL, ALLOCATABLE, SAVE:: ds_ns(:)
     
    442444      ! minus foundation temperature. (Can be negative.) In K.
    443445     
    444       !$OMP THREADPRIVATE(ds_ns, dt_ns)
     446      !$OMP THREADPRIVATE(s_int, ds_ns, dt_ns)
    445447
    446448    CONTAINS
     
    650652        du_gwd_front(:,:) = 0 !ym missing init   
    651653      ENDIF
    652       if (activate_ocean_skin >= 1) ALLOCATE(ds_ns(klon), dt_ns(klon))
     654      if (activate_ocean_skin >= 1) ALLOCATE(s_int(klon), ds_ns(klon), &
     655           dt_ns(klon))
    653656
    654657    END SUBROUTINE phys_state_var_init
     
    788791!!! fin nrlmd le 10/04/2012
    789792
    790       if (activate_ocean_skin >= 1) deALLOCATE(ds_ns, dt_ns)
     793      if (activate_ocean_skin >= 1) deALLOCATE(s_int, ds_ns, dt_ns)
    791794
    792795      is_initialized=.FALSE.
  • LMDZ6/branches/Ocean_skin/libf/phylmd/surf_ocean_mod.F90

    r3627 r3628  
    7777    REAL, DIMENSION(klon), INTENT(inOUT):: z0h
    7878
     79    real, intent(inout):: s_int(:) ! (knon) ocean-air interface salinity, in ppt
     80
    7981    REAL, intent(inout):: ds_ns(:) ! (knon)
    8082    ! "delta salinity near surface". Salinity variation in the
     
    103105
    104106    REAL, intent(out):: t_int(:) ! (knon) ocean-air interface temperature, in K
    105     real, intent(out):: s_int(:) ! (knon) ocean-air interface salinity, in ppt
    106107
    107108    REAL, intent(out):: dter(:) ! (knon)
     
    190191            radsol, snow, agesno, &
    191192            qsurf, evap, fluxsens, fluxlat, flux_u1, flux_v1, &
    192             tsurf_new, dflux_s, dflux_l, sss)
     193            tsurf_new, dflux_s, dflux_l, sss, s_int)
    193194
    194195    CASE('slab')
Note: See TracChangeset for help on using the changeset viewer.