New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 12150 – NEMO

Changeset 12150


Ignore:
Timestamp:
2019-12-10T15:16:33+01:00 (4 years ago)
Author:
davestorkey
Message:

2019/dev_r11943_MERGE_2019: Merge in UKMO_MERGE_2019.

Location:
NEMO/branches/2019/dev_r11943_MERGE_2019
Files:
4 deleted
58 edited
5 copied

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2019/dev_r11943_MERGE_2019/cfgs/AGRIF_DEMO/EXPREF/file_def_nemo-ice.xml

    r9896 r12150  
    2525       <field field_ref="icevolu"          name="sivolu" /> 
    2626       <field field_ref="iceconc"          name="siconc" /> 
    27        <field field_ref="icesalt"          name="sisali" /> 
    2827       <field field_ref="iceapnd"          name="siapnd" /> 
    2928       <field field_ref="icevpnd"          name="sivpnd" /> 
    3029       <field field_ref="sst_m"            name="sst_m"  /> 
    3130       <field field_ref="sss_m"            name="sss_m"  /> 
    32         
    33        <!-- heat --> 
    34        <field field_ref="icetemp"          name="sitemp" /> 
    35        <field field_ref="icettop"          name="sittop" /> 
    36        <field field_ref="icetbot"          name="sitbot" /> 
    37        <field field_ref="icetsni"          name="sitsni" /> 
    3831        
    3932       <!-- momentum --> 
     
    8073       <!-- categories --> 
    8174       <field field_ref="icemask_cat"      name="simskcat"/> 
    82        <field field_ref="snwthic_cat"      name="snthicat"/> 
    8375       <field field_ref="iceconc_cat"      name="siconcat"/> 
    84        <field field_ref="icethic_cat"      name="sithicat"/> 
    85        <field field_ref="icesalt_cat"      name="sisalcat"/> 
    86        <field field_ref="icetemp_cat"      name="sitemcat"/> 
    8776        
    8877     </file> 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/cfgs/ORCA2_ICE_PISCES/EXPREF/file_def_nemo-ice.xml

    r11536 r12150  
    2525       <field field_ref="icevolu"          name="sivolu" /> 
    2626       <field field_ref="iceconc"          name="siconc" /> 
    27        <field field_ref="icesalt"          name="sisali" /> 
    2827       <field field_ref="iceapnd"          name="siapnd" /> 
    2928       <field field_ref="icevpnd"          name="sivpnd" /> 
    3029       <field field_ref="sst_m"            name="sst_m"  /> 
    3130       <field field_ref="sss_m"            name="sss_m"  /> 
    32         
    33        <!-- heat --> 
    34        <field field_ref="icetemp"          name="sitemp" /> 
    35        <field field_ref="snwtemp"          name="sntemp" /> 
    36        <field field_ref="icettop"          name="sittop" /> 
    37        <field field_ref="icetbot"          name="sitbot" /> 
    38        <field field_ref="icetsni"          name="sitsni" /> 
    3931        
    4032       <!-- momentum --> 
     
    8173       <!-- categories --> 
    8274       <field field_ref="icemask_cat"      name="simskcat"/> 
    83        <field field_ref="snwthic_cat"      name="snthicat"/> 
    8475       <field field_ref="iceconc_cat"      name="siconcat"/> 
    85        <field field_ref="icethic_cat"      name="sithicat"/> 
    86        <field field_ref="icesalt_cat"      name="sisalcat"/> 
    87        <field field_ref="icetemp_cat"      name="sitemcat"/> 
    88        <field field_ref="snwtemp_cat"      name="sntemcat"/> 
    89        <field field_ref="icettop_cat"      name="sitopcat"/> 
    9076 
    9177     </file> 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/cfgs/ORCA2_SAS_ICE/EXPREF/file_def_nemo-ice.xml

    r9896 r12150  
    2525       <field field_ref="icevolu"          name="sivolu" /> 
    2626       <field field_ref="iceconc"          name="siconc" /> 
    27        <field field_ref="icesalt"          name="sisali" /> 
    2827       <field field_ref="iceapnd"          name="siapnd" /> 
    2928       <field field_ref="icevpnd"          name="sivpnd" /> 
    3029       <field field_ref="sst_m"            name="sst_m"  /> 
    3130       <field field_ref="sss_m"            name="sss_m"  /> 
    32         
    33        <!-- heat --> 
    34        <field field_ref="icetemp"          name="sitemp" /> 
    35        <field field_ref="icettop"          name="sittop" /> 
    36        <field field_ref="icetbot"          name="sitbot" /> 
    37        <field field_ref="icetsni"          name="sitsni" /> 
    3831        
    3932       <!-- momentum --> 
     
    8073       <!-- categories --> 
    8174       <field field_ref="icemask_cat"      name="simskcat"/> 
    82        <field field_ref="snwthic_cat"      name="snthicat"/> 
    8375       <field field_ref="iceconc_cat"      name="siconcat"/> 
    84        <field field_ref="icethic_cat"      name="sithicat"/> 
    85        <field field_ref="icesalt_cat"      name="sisalcat"/> 
    86        <field field_ref="icetemp_cat"      name="sitemcat"/> 
    8776        
    8877     </file> 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/cfgs/SHARED/field_def_nemo-oce.xml

    r11536 r12150  
    250250          <field id="runoffs"      long_name="River Runoffs"                        standard_name="water_flux_into_sea_water_from_rivers"                                unit="kg/m2/s"   /> 
    251251          <field id="precip"       long_name="Total precipitation"                  standard_name="precipitation_flux"                                                   unit="kg/m2/s"   /> 
     252          <field id="wclosea"      long_name="closed sea empmr correction"          standard_name="closea_empmr"                                                         unit="kg/m2/s"   /> 
    252253      
    253254          <field id="qt"           long_name="Net Downward Heat Flux"                standard_name="surface_downward_heat_flux_in_sea_water"                              unit="W/m2"                           /> 
     
    256257          <field id="qsr3d"        long_name="Shortwave Radiation 3D distribution"   standard_name="downwelling_shortwave_flux_in_sea_water"                              unit="W/m2"      grid_ref="grid_T_3D" /> 
    257258          <field id="qrp"          long_name="Surface Heat Flux: Damping"            standard_name="heat_flux_into_sea_water_due_to_newtonian_relaxation"                 unit="W/m2"                           /> 
     259          <field id="qclosea"      long_name="closed sea heat content flux"          standard_name="closea_heat_content_downward_flux"                                    unit="W/m2"     /> 
    258260          <field id="erp"          long_name="Surface Water Flux: Damping"           standard_name="water_flux_out_of_sea_water_due_to_newtonian_relaxation"              unit="kg/m2/s"                        /> 
    259261          <field id="taum"         long_name="wind stress module"                    standard_name="magnitude_of_surface_downward_stress"                                 unit="N/m2"                           /> 
     
    264266 
    265267          <!-- * variable related to ice shelf forcing * --> 
    266           <field id="fwfisf"       long_name="Ice shelf melting"                             unit="kg/m2/s"  /> 
    267           <field id="fwfisf3d"     long_name="Ice shelf melting"                             unit="kg/m2/s"  grid_ref="grid_T_3D" /> 
    268           <field id="qlatisf"      long_name="Ice shelf latent heat flux"                    unit="W/m2"     /> 
    269           <field id="qlatisf3d"    long_name="Ice shelf latent heat flux"                    unit="W/m2"     grid_ref="grid_T_3D" /> 
    270           <field id="qhcisf"       long_name="Ice shelf heat content flux"                   unit="W/m2"     /> 
    271           <field id="qhcisf3d"     long_name="Ice shelf heat content flux"                   unit="W/m2"     grid_ref="grid_T_3D" /> 
    272           <field id="isfgammat"    long_name="transfert coefficient for isf (temperature) "  unit="m/s"      /> 
    273           <field id="isfgammas"    long_name="transfert coefficient for isf (salinity)    "  unit="m/s"      /> 
    274           <field id="stbl"         long_name="salinity in the Losh tbl                    "  unit="PSU"      /> 
    275           <field id="ttbl"         long_name="temperature in the Losh tbl                 "  unit="C"        /> 
    276           <field id="utbl"         long_name="zonal current in the Losh tbl at T point    "  unit="m/s"      /> 
    277           <field id="vtbl"         long_name="merid current in the Losh tbl at T point    "  unit="m/s"      /> 
    278           <field id="thermald"     long_name="thermal driving of ice shelf melting        "  unit="C"        /> 
    279           <field id="tfrz"         long_name="top freezing point (used to compute melt)   "  unit="C"        /> 
    280           <field id="tinsitu"      long_name="top insitu temperature (used to cmpt melt)  "  unit="C"        /> 
    281           <field id="ustar"        long_name="ustar at T point used in ice shelf melting  "  unit="m/s"      /> 
     268          <field id="isftfrz_cav"     long_name="freezing point temperature at ocean/isf interface"                unit="degC"     /> 
     269          <field id="isftfrz_par"     long_name="freezing point temperature in the parametrization boundary layer" unit="degC"     /> 
     270          <field id="fwfisf_cav"      long_name="Ice shelf melt rate"                           unit="kg/m2/s"  /> 
     271          <field id="fwfisf_par"      long_name="Ice shelf melt rate"                           unit="kg/m2/s"  /> 
     272          <field id="qoceisf_cav"     long_name="Ice shelf ocean  heat flux"                    unit="W/m2"     /> 
     273          <field id="qoceisf_par"     long_name="Ice shelf ocean  heat flux"                    unit="W/m2"     /> 
     274          <field id="qlatisf_cav"     long_name="Ice shelf latent heat flux"                    unit="W/m2"     /> 
     275          <field id="qlatisf_par"     long_name="Ice shelf latent heat flux"                    unit="W/m2"     /> 
     276          <field id="qhcisf_cav"      long_name="Ice shelf heat content flux of injected water" unit="W/m2"     /> 
     277          <field id="qhcisf_par"      long_name="Ice shelf heat content flux of injected water" unit="W/m2"     /> 
     278          <field id="fwfisf3d_cav"    long_name="Ice shelf melt rate"                           unit="kg/m2/s"  grid_ref="grid_T_3D" /> 
     279          <field id="fwfisf3d_par"    long_name="Ice shelf melt rate"                           unit="kg/m2/s"  grid_ref="grid_T_3D" /> 
     280          <field id="qoceisf3d_cav"   long_name="Ice shelf ocean  heat flux"                    unit="W/m2"     grid_ref="grid_T_3D" /> 
     281          <field id="qoceisf3d_par"   long_name="Ice shelf ocean  heat flux"                    unit="W/m2"     grid_ref="grid_T_3D" /> 
     282          <field id="qlatisf3d_cav"   long_name="Ice shelf latent heat flux"                    unit="W/m2"     grid_ref="grid_T_3D" /> 
     283          <field id="qlatisf3d_par"   long_name="Ice shelf latent heat flux"                    unit="W/m2"     grid_ref="grid_T_3D" /> 
     284          <field id="qhcisf3d_cav"    long_name="Ice shelf heat content flux of injected water" unit="W/m2"     grid_ref="grid_T_3D" /> 
     285          <field id="qhcisf3d_par"    long_name="Ice shelf heat content flux of injected water" unit="W/m2"     grid_ref="grid_T_3D" /> 
     286          <field id="ttbl_cav"        long_name="temperature in Losch tbl"                      unit="degC"     /> 
     287          <field id="ttbl_par"        long_name="temperature in the parametrisation boundary layer" unit="degC" /> 
     288          <field id="isfthermald_cav" long_name="thermal driving of ice shelf melting"          unit="degC"     /> 
     289          <field id="isfthermald_par" long_name="thermal driving of ice shelf melting"          unit="degC"     /> 
     290          <field id="isfgammat"       long_name="Ice shelf heat-transfert velocity"             unit="m/s"      /> 
     291          <field id="isfgammas"       long_name="Ice shelf salt-transfert velocity"             unit="m/s"      /> 
     292          <field id="stbl"            long_name="salinity in the Losh tbl"                      unit="1e-3"     /> 
     293          <field id="utbl"            long_name="zonal current in the Losh tbl at T point"      unit="m/s"      /> 
     294          <field id="vtbl"            long_name="merid current in the Losh tbl at T point"      unit="m/s"      /> 
     295          <field id="isfustar"        long_name="ustar at T point used in ice shelf melting"    unit="m/s"      /> 
     296          <field id="qconisf"         long_name="Conductive heat flux through the ice shelf"    unit="W/m2"     /> 
    282297 
    283298          <!-- *_oce variables available with ln_blk_clio or ln_blk_core --> 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/cfgs/SHARED/namelist_ref

    r11814 r12150  
    55!! namelists    2 - Surface boundary (namsbc, namsbc_flx, namsbc_blk, namsbc_cpl, 
    66!!                                    namsbc_sas, namtra_qsr, namsbc_rnf, 
    7 !!                                    namsbc_isf, namsbc_iscpl, namsbc_apr,  
     7!!                                    namisf, namsbc_apr,  
    88!!                                    namsbc_ssr, namsbc_wave, namberg) 
    99!!              3 - lateral boundary (namlbc, namagrif, nambdy, nambdy_tide) 
     
    5151      cn_ocerst_out   = "restart"   !  suffix of ocean restart name (output) 
    5252      cn_ocerst_outdir = "."        !  directory in which to write output ocean restarts 
    53    ln_iscpl    = .false.   !  cavity evolution forcing or coupling to ice sheet model 
    5453   nn_istate   =       0   !  output the initial state (1) or not (0) 
    5554   ln_rst_list = .false.   !  output restarts at list of times using nn_stocklist (T) or at set frequency with nn_stock (F) 
     
    7271!----------------------------------------------------------------------- 
    7372   ln_linssh   = .false.   !  =T  linear free surface  ==>>  model level are fixed in time 
    74    rn_isfhmin  =    1.00   !  treshold [m] to discriminate grounding ice from floating ice 
    7573   ! 
    7674   rn_rdt      = 5400.     !  time step for the dynamics and tracer 
     
    7977   ln_crs      = .false.   !  Logical switch for coarsening module      (T => fill namcrs) 
    8078   ! 
    81    ln_meshmask = .false.   !  =T create a mesh file 
     79   ln_meshmask = .true.   !  =T create a mesh file 
    8280/ 
    8381!----------------------------------------------------------------------- 
    8482&namcfg        !   parameters of the configuration                      (default: use namusr_def in namelist_cfg) 
    8583!----------------------------------------------------------------------- 
    86    ln_read_cfg = .false.   !  (=T) read the domain configuration file 
    87       !                    !  (=F) user defined configuration           (F => create/check namusr_def) 
     84   ln_read_cfg = .false.     !  (=T) read the domain configuration file 
     85      !                      !  (=F) user defined configuration           (F => create/check namusr_def) 
    8886      cn_domcfg = "domain_cfg"  ! domain configuration filename 
    8987      ! 
    90       ln_closea    = .false.    !  T => keep closed seas (defined by closea_mask field) in the   
    91       !                         !       domain and apply special treatment of freshwater fluxes. 
    92       !                         !  F => suppress closed seas (defined by closea_mask field)  
    93       !                         !       from the bathymetry at runtime. 
    94       !                         !  If closea_mask field doesn't exist in the domain_cfg file 
    95       !                         !       then this logical does nothing. 
    96    ln_write_cfg = .false.   !  (=T) create the domain configuration file 
     88      ln_closea    = .false. !  (=T => fill namclo)  
     89      !                      !  (=F) no control of net precip/evap over closed sea 
     90      ! 
     91   ln_write_cfg = .false.    !  (=T) create the domain configuration file 
    9792      cn_domcfg_out = "domain_cfg_out" ! newly created domain configuration filename 
    9893      ! 
    99    ln_use_jattr = .false.  !  use (T) the file attribute: open_ocean_jstart, if present 
    100    !                       !  in netcdf input files, as the start j-row for reading 
     94   ln_use_jattr = .false.    !  use (T) the file attribute: open_ocean_jstart, if present 
     95   !                         !  in netcdf input files, as the start j-row for reading 
     96/ 
     97!----------------------------------------------------------------------- 
     98&namclo        !   parameters of the closed sea (cs) behavior                (default: OFF) 
     99!----------------------------------------------------------------------- 
     100   ln_maskcs = .false.        ! (=T) cs are masked ; So, in this case ln_mask_csundef and ln_clo_rnf have no effect. 
     101      !                       ! (=F => set ln_mask_csundef and ln_clo_rnf)  
     102      !                       ! cs masks are read and net evap/precip over closed sea spread out depending on domain_cfg.nc masks. 
     103      !                       ! See ln_mask_csundef and ln_clo_rnf for specific option related to this case 
     104      ! 
     105      ln_mask_csundef = .true.   ! (=T) undefined closed seas are masked ;  
     106      !                          ! (=F) undefined closed seas are kept and no specific treatment is done for these closed seas 
     107      ! 
     108      ln_clo_rnf = .true.        ! (=T) river mouth specified in domain_cfg.nc masks (rnf and emp case) are added to the runoff mask. 
     109      !                          !      allow the treatment of closed sea outflow grid-points to be the same as river mouth grid-points 
    101110/ 
    102111!----------------------------------------------------------------------- 
     
    184193!!   namsbc_rnf      river runoffs                                      (ln_rnf     =T) 
    185194!!   namsbc_apr      Atmospheric Pressure                               (ln_apr_dyn =T) 
    186 !!   namsbc_isf      ice shelf melting/freezing                         (ln_isfcav  =T : read (ln_read_cfg=T) or set or usr_def_zgr ) 
    187 !!   namsbc_iscpl    coupling option between land ice model and ocean   (ln_isfcav  =T) 
    188195!!   namsbc_wave     external fields from wave model                    (ln_wave    =T) 
    189196!!   namberg         iceberg floats                                     (ln_icebergs=T) 
     
    222229   ln_rnf      = .false.   !  runoffs                                   (T => fill namsbc_rnf) 
    223230   ln_apr_dyn  = .false.   !  Patm gradient added in ocean & ice Eqs.   (T => fill namsbc_apr ) 
    224    ln_isf      = .false.   !  ice shelf                                 (T   => fill namsbc_isf & namsbc_iscpl) 
    225231   ln_wave     = .false.   !  Activate coupling with wave  (T => fill namsbc_wave) 
    226232   ln_cdgw     = .false.   !  Neutral drag coefficient read from wave model (T => ln_wave=.true. & fill namsbc_wave) 
     
    439445/ 
    440446!----------------------------------------------------------------------- 
    441 &namsbc_isf    !  Top boundary layer (ISF)                              (ln_isfcav =T : read (ln_read_cfg=T)  
    442 !-----------------------------------------------------------------------             or set or usr_def_zgr ) 
    443    !                 ! type of top boundary layer  
    444    nn_isf      = 1         !  ice shelf melting/freezing 
    445                            !  1 = presence of ISF   ;  2 = bg03 parametrisation  
    446                            !  3 = rnf file for ISF  ;  4 = ISF specified freshwater flux 
    447                            !  options 1 and 4 need ln_isfcav = .true. (domzgr) 
    448       !              !  nn_isf = 1 or 2 cases: 
    449       rn_gammat0  = 1.e-4     ! gammat coefficient used in blk formula 
    450       rn_gammas0  = 1.e-4     ! gammas coefficient used in blk formula 
    451       !              !  nn_isf = 1 or 4 cases: 
    452       rn_hisf_tbl =  30.      ! thickness of the top boundary layer    (Losh et al. 2008) 
    453       !                       ! 0 => thickness of the tbl = thickness of the first wet cell 
    454       !              ! nn_isf = 1 case 
    455       nn_isfblk   = 1         ! 1 ISOMIP  like: 2 equations formulation (Hunter et al., 2006) 
    456       !                       ! 2 ISOMIP+ like: 3 equations formulation (Asay-Davis et al., 2015) 
    457       nn_gammablk = 1         ! 0 = cst Gammat (= gammat/s) 
    458       !                       ! 1 = velocity dependend Gamma (u* * gammat/s)  (Jenkins et al. 2010) 
    459       !                       ! 2 = velocity and stability dependent Gamma    (Holland et al. 1999) 
    460  
    461    !___________!_____________!___________________!___________!_____________!_________!___________!__________!__________!_______________! 
    462    !           !  file name  ! frequency (hours) ! variable  ! time interp.!  clim   ! 'yearly'/ ! weights  ! rotation ! land/sea mask ! 
    463    !           !             !  (if <0  months)  !   name    !  (logical)  !  (T/F)  ! 'monthly' ! filename ! pairing  ! filename      ! 
    464 !* nn_isf = 4 case 
    465    sn_fwfisf   = 'rnfisf'    ,         -12.      ,'sowflisf' ,  .false.    , .true.  , 'yearly'  ,    ''    ,   ''     ,    '' 
    466 !* nn_isf = 3 case 
    467    sn_rnfisf   = 'rnfisf'    ,         -12.      ,'sofwfisf' ,  .false.    , .true.  , 'yearly'  ,    ''    ,   ''     ,    '' 
    468 !* nn_isf = 2 and 3 cases  
    469    sn_depmax_isf ='rnfisf'   ,         -12.      ,'sozisfmax',  .false.    , .true.  , 'yearly'  ,    ''    ,   ''     ,    '' 
    470    sn_depmin_isf ='rnfisf'   ,         -12.      ,'sozisfmin',  .false.    , .true.  , 'yearly'  ,    ''    ,   ''     ,    '' 
    471 !* nn_isf = 2 case 
    472    sn_Leff_isf = 'rnfisf'    ,         -12.      ,'Leff'     ,  .false.    , .true.  , 'yearly'  ,    ''    ,   ''     ,    '' 
    473 / 
    474 !----------------------------------------------------------------------- 
    475 &namsbc_iscpl  !   land ice / ocean coupling option                     (ln_isfcav =T : read (ln_read_cfg=T)  
    476 !-----------------------------------------------------------------------             or set or usr_def_zgr ) 
    477    nn_drown    = 10        ! number of iteration of the extrapolation loop (fill the new wet cells) 
    478    ln_hsb      = .false.   ! activate conservation module (conservation exact after a time of rn_fiscpl) 
    479    nn_fiscpl   = 43800     ! (number of time step) conservation period (maybe should be fix to the coupling frequencey of restart frequency) 
     447&namisf       !  Top boundary layer (ISF)                               (default: OFF) 
     448!----------------------------------------------------------------------- 
     449   ! 
     450   ! ---------------- ice shelf load ------------------------------- 
     451   ! 
     452   cn_isfload = 'uniform'      ! scheme to compute ice shelf load (ln_isfcav = .true. in domain_cfg.nc) 
     453      rn_isfload_T = -1.9 
     454      rn_isfload_S = 34.4 
     455   ! 
     456   ! ---------------- ice shelf melt formulation ------------------------------- 
     457   ! 
     458   ln_isf = .false.           ! activate ice shelf module 
     459      ln_isfdebug = .false.      ! add debug print in ISF code (global min/max/sum of specific variable) 
     460      cn_isfdir   = './'         ! directory for all ice shelf input file 
     461      ! 
     462      ! ---------------- cavities opened ------------------------------- 
     463      ! 
     464      ln_isfcav_mlt = .false.    ! ice shelf melting into the cavity (need ln_isfcav = .true. in domain_cfg.nc) 
     465         cn_isfcav_mlt = '3eq'   ! ice shelf melting formulation (spe/2eq/3eq/oasis) 
     466         !                       ! spe = fwfisf is read from a forcing field 
     467         !                       ! 2eq = ISOMIP  like: 2 equations formulation (Hunter et al., 2006 for a short description) 
     468         !                       ! 3eq = ISOMIP+ like: 3 equations formulation (Asay-Davis et al., 2016 for a short description) 
     469         !                       ! oasis = fwfisf is given by oasis and pattern by file sn_isfcav_fwf 
     470         !              !  cn_isfcav_mlt = 2eq or 3eq cases: 
     471         cn_gammablk = 'vel'     ! scheme to compute gammat/s (spe,ad15,hj99) 
     472         !                       ! spe      = constant transfert velocity (rn_gammat0, rn_gammas0) 
     473         !                       ! vel      = velocity dependent transfert velocity (u* * gammat/s) (Asay-Davis et al. 2016 for a short description) 
     474         !                       ! vel_stab = velocity and stability dependent transfert coeficient (Holland et al. 1999 for a complete description) 
     475         rn_gammat0  = 1.4e-2    ! gammat coefficient used in spe, vel and vel_stab gamma computation method 
     476         rn_gammas0  = 4.0e-4    ! gammas coefficient used in spe, vel and vel_stab gamma computation method 
     477         ! 
     478         rn_htbl     =  30.      ! thickness of the top boundary layer    (Losh et al. 2008) 
     479         !                       ! 0 => thickness of the tbl = thickness of the first wet cell 
     480         ! 
     481         !* 'spe' and 'oasis' case 
     482         !___________!_____________!___________________!___________!_____________!_________!___________!__________!__________!_______________! 
     483         !           !  file name  ! frequency (hours) ! variable  ! time interp.!  clim   ! 'yearly'/ ! weights  ! rotation ! land/sea mask ! 
     484         !           !             !  (if <0  months)  !   name    !  (logical)  !  (T/F)  ! 'monthly' ! filename ! pairing  ! filename      ! 
     485         sn_isfcav_fwf = 'isfmlt_cav',      -12.      , 'fwflisf'  ,  .false.    , .true.  , 'yearly'  ,    ''    ,   ''     ,    '' 
     486      ! 
     487      ! ---------------- cavities parametrised ------------------------------- 
     488      ! 
     489      ln_isfpar_mlt = .false.   ! ice shelf melting parametrised 
     490         cn_isfpar_mlt = 'spe'  ! ice shelf melting parametrisation (spe/bg03/oasis) 
     491         !                      ! spe   = fwfisf is read from a forcing field 
     492         !                      ! bg03  = melt computed using Beckmann and Goosse parametrisation 
     493         !                      ! oasis = fwfisf is given by oasis and pattern by file sn_isfpar_fwf 
     494         ! 
     495         !* all cases 
     496         !___________!_____________!___________________!___________!_____________!_________!___________!__________!__________!_______________! 
     497         !           !  file name  ! frequency (hours) ! variable  ! time interp.!  clim   ! 'yearly'/ ! weights  ! rotation ! land/sea mask ! 
     498         !           !             !  (if <0  months)  !   name    !  (logical)  !  (T/F)  ! 'monthly' ! filename ! pairing  ! filename      ! 
     499         sn_isfpar_zmax = 'isfmlt_par',       0        ,'sozisfmax',  .false.    , .true.  , 'yearly'  ,    ''    ,   ''     ,    '' 
     500         sn_isfpar_zmin = 'isfmlt_par',       0        ,'sozisfmin',  .false.    , .true.  , 'yearly'  ,    ''    ,   ''     ,    '' 
     501         !* 'spe' and 'oasis' case 
     502         sn_isfpar_fwf = 'isfmlt_par' ,      -12.      ,'sofwfisf' ,  .false.    , .true.  , 'yearly'   ,    ''    ,   ''     ,    '' 
     503         !* 'bg03' case 
     504         sn_isfpar_Leff = 'isfmlt_par',       0.       ,'Leff'     ,  .false.    , .true.  , 'yearly'   ,    ''    ,   ''     ,    '' 
     505      ! 
     506      ! ---------------- ice sheet coupling ------------------------------- 
     507      ! 
     508      ln_isfcpl = .false. 
     509         nn_drown       = 10        ! number of iteration of the extrapolation loop (fill the new wet cells) 
     510         ln_isfcpl_cons = .false. 
    480511/ 
    481512!----------------------------------------------------------------------- 
     
    12001231&nam_diatmb    !  Top Middle Bottom Output                              (default: OFF) 
    12011232!----------------------------------------------------------------------- 
    1202    ln_diatmb   = .false.   !  Choose Top Middle and Bottom output or not 
     1233   ln_diatmb   = .true.   !  Choose Top Middle and Bottom output or not 
    12031234/ 
    12041235!----------------------------------------------------------------------- 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/cfgs/ref_cfgs.txt

    r9775 r12150  
    99ORCA2_ICE_PISCES OCE TOP ICE NST 
    1010SPITZ12 OCE ICE 
     11WED025 OCE ICE 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/BDY/bdyvol.F90

    r11536 r12150  
    1414   USE bdy_oce        ! ocean open boundary conditions 
    1515   USE sbc_oce        ! ocean surface boundary conditions 
     16   USE isf_oce, ONLY : fwfisf_cav, fwfisf_par  ! ice shelf 
    1617   USE dom_oce        ! ocean space and time domain  
    1718   USE phycst         ! physical constants 
    18    USE sbcisf         ! ice shelf 
    1919   ! 
    2020   USE in_out_manager ! I/O manager 
     
    7777      ! Calculate the cumulate surface Flux z_cflxemp (m3/s) over all the domain 
    7878      ! ----------------------------------------------------------------------- 
    79       IF ( kc == 1 ) z_cflxemp = glob_sum( 'bdyvol', ( emp(:,:) - rnf(:,:) + fwfisf(:,:) ) * bdytmask(:,:) * e1e2t(:,:)  ) / rau0 
     79      IF ( kc == 1 ) z_cflxemp = glob_sum( 'bdyvol', ( emp(:,:) - rnf(:,:) + fwfisf_cav(:,:) + fwfisf_par(:,:) ) * bdytmask(:,:) * e1e2t(:,:)  ) / rau0 
    8080 
    8181      ! Compute bdy surface each cycle if non linear free surface 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/DIA/diahsb.F90

    r11960 r12150  
    1717   USE phycst         ! physical constants 
    1818   USE sbc_oce        ! surface thermohaline fluxes 
     19   USE isf_oce        ! ice shelf fluxes 
    1920   USE sbcrnf         ! river runoff 
    20    USE sbcisf         ! ice shelves 
    2121   USE domvvl         ! vertical scale factors 
    2222   USE traqsr         ! penetrative solar radiation 
     
    4848   REAL(wp), DIMENSION(:,:)  , ALLOCATABLE ::   ssh_hc_loc_ini, ssh_sc_loc_ini   ! 
    4949   REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::   hc_loc_ini, sc_loc_ini, e3t_ini  ! 
     50   REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::   tmask_ini 
    5051 
    5152   !! * Substitutions 
     
    9293      ! 1 - Trends due to forcing ! 
    9394      ! ------------------------- ! 
    94       z_frc_trd_v = r1_rau0 * glob_sum( 'diahsb', - ( emp(:,:) - rnf(:,:) + fwfisf(:,:) ) * surf(:,:) )   ! volume fluxes 
     95      z_frc_trd_v = r1_rau0 * glob_sum( 'diahsb', - ( emp(:,:) - rnf(:,:) + fwfisf_cav(:,:) + fwfisf_par(:,:) ) * surf(:,:) )   ! volume fluxes 
    9596      z_frc_trd_t =           glob_sum( 'diahsb', sbc_tsc(:,:,jp_tem) * surf(:,:) )                       ! heat fluxes 
    9697      z_frc_trd_s =           glob_sum( 'diahsb', sbc_tsc(:,:,jp_sal) * surf(:,:) )                       ! salt fluxes 
     
    99100      IF( ln_rnf_sal)   z_frc_trd_s = z_frc_trd_s + glob_sum( 'diahsb', rnf_tsc(:,:,jp_sal) * surf(:,:) ) 
    100101      !                    ! Add ice shelf heat & salt input 
    101       IF( ln_isf    )   z_frc_trd_t = z_frc_trd_t + glob_sum( 'diahsb', risf_tsc(:,:,jp_tem) * surf(:,:) ) 
     102      IF( ln_isf    )   z_frc_trd_t = z_frc_trd_t & 
     103         &                          + glob_sum( 'diahsb', ( risf_cav_tsc(:,:,jp_tem) + risf_par_tsc(:,:,jp_tem) ) * surf(:,:) ) 
    102104      !                    ! Add penetrative solar radiation 
    103105      IF( ln_traqsr )   z_frc_trd_t = z_frc_trd_t + r1_rau0_rcp * glob_sum( 'diahsb', qsr     (:,:) * surf(:,:) ) 
     
    156158      ! 
    157159      DO jk = 1, jpkm1           ! volume variation (calculated with scale factors) 
    158          zwrk(:,:,jk) = ( surf(:,:)*e3t(:,:,jk,Kmm) - surf_ini(:,:)*e3t_ini(:,:,jk) ) * tmask(:,:,jk) 
     160         zwrk(:,:,jk) = surf(:,:)*e3t(:,:,jk,Kmm)*tmask(:,:,jk) - surf_ini(:,:)*e3t_ini(:,:,jk)*tmask_ini(:,:,jk) 
    159161      END DO 
    160       zdiff_v2 = glob_sum_full( 'diahsb', zwrk(:,:,:) ) 
     162      zdiff_v2 = glob_sum_full( 'diahsb', zwrk(:,:,:) )     ! glob_sum_full needed as tmask and tmask_ini could be different 
    161163      DO jk = 1, jpkm1           ! heat content variation 
    162          zwrk(:,:,jk) = ( surf(:,:)*e3t(:,:,jk,Kmm)*ts(:,:,jk,jp_tem,Kmm) - surf_ini(:,:)*hc_loc_ini(:,:,jk) ) * tmask(:,:,jk) 
     164         zwrk(:,:,jk) = ( surf(:,:)*e3t(:,:,jk,Kmm)*ts(:,:,jk,jp_tem,Kmm) - surf_ini(:,:)*hc_loc_ini(:,:,jk) ) 
    163165      END DO 
    164166      zdiff_hc = glob_sum_full( 'diahsb', zwrk(:,:,:) ) 
    165167      DO jk = 1, jpkm1           ! salt content variation 
    166          zwrk(:,:,jk) = ( surf(:,:)*e3t(:,:,jk,Kmm)*ts(:,:,jk,jp_sal,Kmm) - surf_ini(:,:)*sc_loc_ini(:,:,jk) ) * tmask(:,:,jk) 
     168         zwrk(:,:,jk) = ( surf(:,:)*e3t(:,:,jk,Kmm)*ts(:,:,jk,jp_sal,Kmm) - surf_ini(:,:)*sc_loc_ini(:,:,jk) ) 
    167169      END DO 
    168170      zdiff_sc = glob_sum_full( 'diahsb', zwrk(:,:,:) ) 
     
    188190         zwrk(:,:,jk) = surf(:,:) * e3t(:,:,jk,Kmm) * tmask(:,:,jk) 
    189191      END DO 
    190       zvol_tot = glob_sum_full( 'diahsb', zwrk(:,:,:) ) 
     192      zvol_tot = glob_sum( 'diahsb', zwrk(:,:,:) ) 
    191193 
    192194!!gm to be added ? 
     
    272274            CALL iom_get( numror, jpdom_autoglo, 'ssh_ini'   , ssh_ini   , ldxios = lrxios ) 
    273275            CALL iom_get( numror, jpdom_autoglo, 'e3t_ini'   , e3t_ini   , ldxios = lrxios ) 
     276            CALL iom_get( numror, jpdom_autoglo, 'tmask_ini' , tmask_ini , ldxios = lrxios ) 
    274277            CALL iom_get( numror, jpdom_autoglo, 'hc_loc_ini', hc_loc_ini, ldxios = lrxios ) 
    275278            CALL iom_get( numror, jpdom_autoglo, 'sc_loc_ini', sc_loc_ini, ldxios = lrxios ) 
     
    287290              ! if ice sheet/oceqn coupling, need to mask ini variables here (mask could change at the next NEMO instance). 
    288291               e3t_ini   (:,:,jk) = e3t(:,:,jk,Kmm)                      * tmask(:,:,jk)  ! initial vertical scale factors 
     292               tmask_ini (:,:,jk) = tmask(:,:,jk)                                       ! initial mask 
    289293               hc_loc_ini(:,:,jk) = ts(:,:,jk,jp_tem,Kmm) * e3t(:,:,jk,Kmm) * tmask(:,:,jk)  ! initial heat content 
    290294               sc_loc_ini(:,:,jk) = ts(:,:,jk,jp_sal,Kmm) * e3t(:,:,jk,Kmm) * tmask(:,:,jk)  ! initial salt content 
     
    327331         CALL iom_rstput( kt, nitrst, numrow, 'ssh_ini'   , ssh_ini   , ldxios = lwxios ) 
    328332         CALL iom_rstput( kt, nitrst, numrow, 'e3t_ini'   , e3t_ini   , ldxios = lwxios ) 
     333         CALL iom_rstput( kt, nitrst, numrow, 'tmask_ini' , tmask_ini , ldxios = lwxios ) 
    329334         CALL iom_rstput( kt, nitrst, numrow, 'hc_loc_ini', hc_loc_ini, ldxios = lwxios ) 
    330335         CALL iom_rstput( kt, nitrst, numrow, 'sc_loc_ini', sc_loc_ini, ldxios = lwxios ) 
     
    398403      ! ------------------- ! 
    399404      ALLOCATE( hc_loc_ini(jpi,jpj,jpk), sc_loc_ini(jpi,jpj,jpk), surf_ini(jpi,jpj), & 
    400          &      e3t_ini(jpi,jpj,jpk), surf(jpi,jpj),  ssh_ini(jpi,jpj), STAT=ierror  ) 
     405         &      e3t_ini(jpi,jpj,jpk), surf(jpi,jpj),  ssh_ini(jpi,jpj), tmask_ini(jpi,jpj,jpk),STAT=ierror  ) 
    401406      IF( ierror > 0 ) THEN 
    402407         CALL ctl_stop( 'dia_hsb_init: unable to allocate hc_loc_ini' )   ;   RETURN 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/DIA/diawri.F90

    r11949 r12150  
    2626   !!---------------------------------------------------------------------- 
    2727   USE oce            ! ocean dynamics and tracers  
     28   USE isf_oce 
     29   USE isfcpl 
    2830   USE dom_oce        ! ocean space and time domain 
    2931   USE phycst         ! physical constants 
     
    881883      INTEGER           , INTENT( in ) ::   Kmm              ! time level index 
    882884      CHARACTER (len=* ), INTENT( in ) ::   cdfile_name      ! name of the file created 
     885      REAL(wp), DIMENSION(jpi,jpj,jpk) :: zisfdebug 
    883886      !! 
    884       INTEGER :: inum 
     887      INTEGER :: inum, jk 
    885888      !!---------------------------------------------------------------------- 
    886889      !  
     
    906909         CALL iom_rstput( 0, 0, inum, 'vovecrtz', ww             )    ! now k-velocity 
    907910      ENDIF 
     911      CALL iom_rstput( 0, 0, inum, 'risfdep', risfdep            )    ! now k-velocity 
     912      CALL iom_rstput( 0, 0, inum, 'ht'     , ht                 )    ! now water column height 
     913 
     914      IF ( ln_isf ) THEN 
     915         IF (ln_isfcav_mlt) THEN 
     916            CALL iom_rstput( 0, 0, inum, 'fwfisf_cav', fwfisf_cav          )    ! now k-velocity 
     917            CALL iom_rstput( 0, 0, inum, 'rhisf_cav_tbl', rhisf_tbl_cav    )    ! now k-velocity 
     918            CALL iom_rstput( 0, 0, inum, 'rfrac_cav_tbl', rfrac_tbl_cav    )    ! now k-velocity 
     919            CALL iom_rstput( 0, 0, inum, 'misfkb_cav', REAL(misfkb_cav,8)    )    ! now k-velocity 
     920            CALL iom_rstput( 0, 0, inum, 'misfkt_cav', REAL(misfkt_cav,8)    )    ! now k-velocity 
     921            CALL iom_rstput( 0, 0, inum, 'mskisf_cav', REAL(mskisf_cav,8), ktype = jp_i1 ) 
     922         END IF 
     923         IF (ln_isfpar_mlt) THEN 
     924            CALL iom_rstput( 0, 0, inum, 'isfmsk_par', REAL(mskisf_par,8)  )    ! now k-velocity 
     925            CALL iom_rstput( 0, 0, inum, 'fwfisf_par', fwfisf_par          )    ! now k-velocity 
     926            CALL iom_rstput( 0, 0, inum, 'rhisf_par_tbl', rhisf_tbl_par    )    ! now k-velocity 
     927            CALL iom_rstput( 0, 0, inum, 'rfrac_par_tbl', rfrac_tbl_par    )    ! now k-velocity 
     928            CALL iom_rstput( 0, 0, inum, 'misfkb_par', REAL(misfkb_par,8)    )    ! now k-velocity 
     929            CALL iom_rstput( 0, 0, inum, 'misfkt_par', REAL(misfkt_par,8)    )    ! now k-velocity 
     930            CALL iom_rstput( 0, 0, inum, 'mskisf_par', REAL(mskisf_par,8), ktype = jp_i1 ) 
     931         END IF 
     932      END IF 
     933 
    908934      IF( ALLOCATED(ahtu) ) THEN 
    909935         CALL iom_rstput( 0, 0, inum,  'ahtu', ahtu              )    ! aht at u-point 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/DOM/closea.F90

    r10425 r12150  
    1111   !!             4.0  !  2016-06  (G. Madec)  move to usrdef_closea, remove clo_ups 
    1212   !!             4.0  !  2017-12  (D. Storkey) new formulation based on masks read from file 
     13   !!             4.1  !  2019-07  (P. Mathiot) update to the new domcfg.nc input file 
    1314   !!---------------------------------------------------------------------- 
    1415 
    1516   !!---------------------------------------------------------------------- 
    1617   !!   dom_clo    : read in masks which define closed seas and runoff areas 
    17    !!   sbc_clo    : Special handling of freshwater fluxes over closed seas 
    1818   !!   clo_rnf    : set close sea outflows as river mouths (see sbcrnf) 
    19    !!   clo_bat    : set to zero a field over closed sea (see domzgr) 
    20    !!---------------------------------------------------------------------- 
    21    USE oce             ! dynamics and tracers 
    22    USE dom_oce         ! ocean space and time domain 
    23    USE phycst          ! physical constants 
    24    USE sbc_oce         ! ocean surface boundary conditions 
    25    USE iom             ! I/O routines 
     19   !!   clo_msk    : set to zero a field over closed sea (see domzgr) 
     20   !!---------------------------------------------------------------------- 
     21   USE in_out_manager  ! I/O manager 
    2622   ! 
    27    USE in_out_manager  ! I/O manager 
    28    USE lib_fortran,    ONLY: glob_sum 
    29    USE lbclnk          ! lateral boundary condition - MPP exchanges 
    30    USE lib_mpp         ! MPP library 
    31    USE timing          ! Timing 
     23   USE diu_bulk    , ONLY: ln_diurnal_only            ! used for sanity check 
     24   USE iom         , ONLY: iom_open, iom_get, iom_close, jpdom_data ! I/O routines 
     25   USE lib_fortran , ONLY: glob_sum                   ! fortran library 
     26   USE lib_mpp     , ONLY: mpp_max, ctl_nam, ctl_stop ! MPP library 
    3227 
    3328   IMPLICIT NONE 
     29 
    3430   PRIVATE 
    3531 
    3632   PUBLIC dom_clo      ! called by domain module 
    37    PUBLIC sbc_clo      ! called by sbcmod module 
    3833   PUBLIC clo_rnf      ! called by sbcrnf module 
    39    PUBLIC clo_bat      ! called in domzgr module 
    40  
    41    LOGICAL, PUBLIC :: ln_closea  !:  T => keep closed seas (defined by closea_mask field) in the domain and apply 
    42                                  !:       special treatment of freshwater fluxes. 
    43                                  !:  F => suppress closed seas (defined by closea_mask field) from the bathymetry 
    44                                  !:       at runtime. 
    45                                  !:  If there is no closea_mask field in the domain_cfg file or we do not use 
    46                                  !:  a domain_cfg file then this logical does nothing. 
    47                                  !: 
    48    LOGICAL, PUBLIC :: l_sbc_clo  !: T => Closed seas defined, apply special treatment of freshwater fluxes. 
    49                                  !: F => No closed seas defined (closea_mask field not found). 
    50    LOGICAL, PUBLIC :: l_clo_rnf  !: T => Some closed seas output freshwater (RNF or EMPMR) to specified runoff points. 
    51    INTEGER, PUBLIC :: jncs       !: number of closed seas (inferred from closea_mask field) 
    52    INTEGER, PUBLIC :: jncsr      !: number of closed seas rnf mappings (inferred from closea_mask_rnf field) 
    53    INTEGER, PUBLIC :: jncse      !: number of closed seas empmr mappings (inferred from closea_mask_empmr field) 
    54     
    55    INTEGER, PUBLIC, ALLOCATABLE, DIMENSION(:,:) ::  closea_mask       !: mask of integers defining closed seas 
    56    INTEGER, PUBLIC, ALLOCATABLE, DIMENSION(:,:) ::  closea_mask_rnf   !: mask of integers defining closed seas rnf mappings 
    57    INTEGER, PUBLIC, ALLOCATABLE, DIMENSION(:,:) ::  closea_mask_empmr !: mask of integers defining closed seas empmr mappings 
    58    REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:)  ::   surf         !: closed sea surface areas  
    59                                                                   !: (and residual global surface area)  
    60    REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:)  ::   surfr        !: closed sea target rnf surface areas  
    61    REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:)  ::   surfe        !: closed sea target empmr surface areas  
     34   PUBLIC clo_msk      ! called in domzgr module 
     35 
     36   LOGICAL, PUBLIC :: ln_maskcs        !: logical to mask all closed sea 
     37   LOGICAL, PUBLIC :: ln_mask_csundef  !: logical to mask all undefined closed sea 
     38   LOGICAL, PUBLIC :: ln_clo_rnf       !: closed sea treated as runoff (update rnf mask) 
     39 
     40   LOGICAL, PUBLIC :: l_sbc_clo  !: T => net evap/precip over closed seas spread outover the globe/river mouth 
     41   LOGICAL, PUBLIC :: l_clo_rnf  !: T => Some closed seas output freshwater (RNF) to specified runoff points. 
     42 
     43   INTEGER, PUBLIC :: ncsg      !: number of closed seas global mappings (inferred from closea_mask_glo field) 
     44   INTEGER, PUBLIC :: ncsr      !: number of closed seas rnf    mappings (inferred from closea_mask_rnf field) 
     45   INTEGER, PUBLIC :: ncse      !: number of closed seas empmr  mappings (inferred from closea_mask_emp field) 
     46 
     47   INTEGER, PUBLIC, SAVE, ALLOCATABLE, DIMENSION(:,:) :: mask_opnsea, mask_csundef  !: mask defining the open sea and the undefined closed sea 
     48  
     49   INTEGER, PUBLIC, SAVE, ALLOCATABLE, DIMENSION(:,:) :: mask_csglo , mask_csgrpglo !: mask of integers defining closed seas 
     50   INTEGER, PUBLIC, SAVE, ALLOCATABLE, DIMENSION(:,:) :: mask_csrnf , mask_csgrprnf !: mask of integers defining closed seas rnf mappings 
     51   INTEGER, PUBLIC, SAVE, ALLOCATABLE, DIMENSION(:,:) :: mask_csemp , mask_csgrpemp !: mask of integers defining closed seas empmr mappings 
    6252 
    6353   !! * Substitutions 
     
    7666      !! ** Purpose :   Closed sea domain initialization 
    7767      !! 
    78       !! ** Method  :   if a closed sea is located only in a model grid point 
    79       !!                just the thermodynamic processes are applied. 
    80       !! 
    81       !! ** Action  :   Read closea_mask* fields (if they exist) from domain_cfg file and infer 
    82       !!                number of closed seas from closea_mask field. 
    83       !!                closea_mask       : integer values defining closed seas (or groups of closed seas) 
    84       !!                closea_mask_rnf   : integer values defining mappings from closed seas or groups of 
    85       !!                                    closed seas to a runoff area for downwards flux only. 
    86       !!                closea_mask_empmr : integer values defining mappings from closed seas or groups of 
    87       !!                                    closed seas to a runoff area for net fluxes. 
    88       !! 
    89       !!                Python code to generate the closea_masks* fields from the old-style indices 
    90       !!                definitions is available at TOOLS/DOMAINcfg/make_closea_masks.py 
    91       !!---------------------------------------------------------------------- 
    92       INTEGER ::   inum    ! input file identifier 
    93       INTEGER ::   ierr    ! error code 
    94       INTEGER ::   id      ! netcdf variable ID 
    95  
    96       REAL(wp), DIMENSION(jpi,jpj) :: zdata_in ! temporary real array for input 
    97       !!---------------------------------------------------------------------- 
    98       ! 
     68      !! ** Action  :   Read mask_cs* fields (if needed) from domain_cfg file and infer 
     69      !!                number of closed seas for each case (glo, rnf, emp) from mask_cs* field. 
     70      !! 
     71      !! ** Output  :   mask_csglo and mask_csgrpglo  : integer values defining mappings from closed seas and associated groups to the open ocean for net fluxes. 
     72      !!                mask_csrnf and mask_csgrprnf  : integer values defining mappings from closed seas and associated groups to a runoff area for downwards flux only. 
     73      !!                mask_csemp and mask_csgrpemp  : integer values defining mappings from closed seas and associated groups to a runoff area for net fluxes. 
     74      !!---------------------------------------------------------------------- 
     75      INTEGER ::   ios     ! io status 
     76      !! 
     77      NAMELIST/namclo/ ln_maskcs, ln_mask_csundef, ln_clo_rnf 
     78      !!--------------------------------------------------------------------- 
     79      !! 
     80      READ  ( numnam_ref, namclo, IOSTAT = ios, ERR = 901 ) 
     81901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namclo in reference namelist' ) 
     82      READ  ( numnam_cfg, namclo, IOSTAT = ios, ERR = 902 ) 
     83902   IF( ios >  0 )   CALL ctl_nam ( ios , 'namclo in configuration namelist' ) 
     84      IF(lwm) WRITE ( numond, namclo ) 
     85      !! 
    9986      IF(lwp) WRITE(numout,*) 
    10087      IF(lwp) WRITE(numout,*)'dom_clo : read in masks to define closed seas ' 
    10188      IF(lwp) WRITE(numout,*)'~~~~~~~' 
     89      IF(lwp) WRITE(numout,*) 
     90      !! 
     91      !! check option compatibility 
     92      IF( .NOT. ln_read_cfg ) THEN 
     93         CALL ctl_stop('Suppression of closed seas does not work with ln_read_cfg = .true. . Set ln_closea = .false. .') 
     94      ENDIF 
     95      !! 
     96      IF( (.NOT. ln_maskcs) .AND. ln_diurnal_only ) THEN 
     97         CALL ctl_stop('Special handling of freshwater fluxes over closed seas not compatible with ln_diurnal_only.') 
     98      END IF 
    10299      ! 
    103100      ! read the closed seas masks (if they exist) from domain_cfg file (if it exists) 
    104101      ! ------------------------------------------------------------------------------ 
    105102      ! 
    106       IF( ln_read_cfg) THEN 
    107          ! 
    108          CALL iom_open( cn_domcfg, inum ) 
    109          ! 
    110          id = iom_varid(inum, 'closea_mask', ldstop = .false.) 
    111          IF( id > 0 ) THEN  
    112             l_sbc_clo = .true. 
    113             ALLOCATE( closea_mask(jpi,jpj) , STAT=ierr ) 
    114             IF( ierr /= 0 )   CALL ctl_stop( 'STOP', 'dom_clo: failed to allocate closea_mask array') 
    115             zdata_in(:,:) = 0.0 
    116             CALL iom_get ( inum, jpdom_data, 'closea_mask', zdata_in ) 
    117             closea_mask(:,:) = NINT(zdata_in(:,:)) * tmask(:,:,1) 
    118             ! number of closed seas = global maximum value in closea_mask field 
    119             jncs = maxval(closea_mask(:,:)) 
    120             CALL mpp_max('closea', jncs) 
    121             IF( jncs > 0 ) THEN 
    122                IF( lwp ) WRITE(numout,*) 'Number of closed seas : ',jncs 
    123             ELSE 
    124                CALL ctl_stop( 'Problem with closea_mask field in domain_cfg file. Has no values > 0 so no closed seas defined.') 
    125             ENDIF 
    126          ELSE  
    127             IF( lwp ) WRITE(numout,*) 
    128             IF( lwp ) WRITE(numout,*) '   ==>>>   closea_mask field not found in domain_cfg file.' 
    129             IF( lwp ) WRITE(numout,*) '           No closed seas defined.' 
    130             IF( lwp ) WRITE(numout,*) 
    131             l_sbc_clo = .false. 
    132             jncs = 0  
    133          ENDIF 
    134  
    135          l_clo_rnf = .false. 
    136  
    137          IF( l_sbc_clo ) THEN ! No point reading in closea_mask_rnf or closea_mask_empmr fields if no closed seas defined. 
    138  
    139             id = iom_varid(inum, 'closea_mask_rnf', ldstop = .false.) 
    140             IF( id > 0 ) THEN  
    141                l_clo_rnf = .true.             
    142                ALLOCATE( closea_mask_rnf(jpi,jpj) , STAT=ierr ) 
    143                IF( ierr /= 0 )   CALL ctl_stop( 'STOP', 'dom_clo: failed to allocate closea_mask_rnf array') 
    144                CALL iom_get ( inum, jpdom_data, 'closea_mask_rnf', zdata_in ) 
    145                closea_mask_rnf(:,:) = NINT(zdata_in(:,:)) * tmask(:,:,1) 
    146                ! number of closed seas rnf mappings = global maximum in closea_mask_rnf field 
    147                jncsr = maxval(closea_mask_rnf(:,:)) 
    148                CALL mpp_max('closea', jncsr) 
    149                IF( jncsr > 0 ) THEN 
    150                   IF( lwp ) WRITE(numout,*) 'Number of closed seas rnf mappings : ',jncsr 
    151                ELSE 
    152                   CALL ctl_stop( 'Problem with closea_mask_rnf field in domain_cfg file. Has no values > 0 so no closed seas rnf mappings defined.') 
    153                ENDIF 
    154             ELSE  
    155                IF( lwp ) WRITE(numout,*) 'closea_mask_rnf field not found in domain_cfg file. No closed seas rnf mappings defined.' 
    156                jncsr = 0 
    157             ENDIF 
    158   
    159             id = iom_varid(inum, 'closea_mask_empmr', ldstop = .false.) 
    160             IF( id > 0 ) THEN  
    161                l_clo_rnf = .true.             
    162                ALLOCATE( closea_mask_empmr(jpi,jpj) , STAT=ierr ) 
    163                IF( ierr /= 0 )   CALL ctl_stop( 'STOP', 'dom_clo: failed to allocate closea_mask_empmr array') 
    164                CALL iom_get ( inum, jpdom_data, 'closea_mask_empmr', zdata_in ) 
    165                closea_mask_empmr(:,:) = NINT(zdata_in(:,:)) * tmask(:,:,1) 
    166                ! number of closed seas empmr mappings = global maximum value in closea_mask_empmr field 
    167                jncse = maxval(closea_mask_empmr(:,:)) 
    168                CALL mpp_max('closea', jncse) 
    169                IF( jncse > 0 ) THEN  
    170                   IF( lwp ) WRITE(numout,*) 'Number of closed seas empmr mappings : ',jncse 
    171                ELSE 
    172                   CALL ctl_stop( 'Problem with closea_mask_empmr field in domain_cfg file. Has no values > 0 so no closed seas empmr mappings defined.') 
    173                ENDIF 
    174             ELSE  
    175                IF( lwp ) WRITE(numout,*) 'closea_mask_empmr field not found in domain_cfg file. No closed seas empmr mappings defined.' 
    176                jncse = 0 
    177             ENDIF 
    178  
    179          ENDIF ! l_sbc_clo 
    180          ! 
    181          CALL iom_close( inum ) 
    182          ! 
    183       ELSE ! ln_read_cfg = .false. so no domain_cfg file 
    184          IF( lwp ) WRITE(numout,*) 'No domain_cfg file so no closed seas defined.' 
    185          l_sbc_clo = .false. 
    186          l_clo_rnf = .false. 
    187       ENDIF 
    188       ! 
     103      ! load mask of open sea 
     104      CALL alloc_csmask( mask_opnsea ) 
     105      CALL read_csmask( cn_domcfg, 'mask_opensea' , mask_opnsea  ) 
     106      ! 
     107      IF ( ln_maskcs ) THEN 
     108         ! closed sea are masked 
     109         IF(lwp) WRITE(numout,*)'          ln_maskcs = T : all closed seas are masked' 
     110         IF(lwp) WRITE(numout,*) 
     111         ! no special treatment of closed sea 
     112         ! no redistribution of emp unbalance over closed sea into river mouth/open ocean 
     113         l_sbc_clo = .false. ; l_clo_rnf = .false. 
     114      ELSE 
     115         ! redistribution of emp unbalance over closed sea into river mouth/open ocean 
     116         IF(lwp) WRITE(numout,*)'          ln_maskcs = F : net emp is corrected over defined closed seas' 
     117         ! 
     118         l_sbc_clo = .true. 
     119         ! 
     120         ! river mouth from lakes added to rnf mask for special treatment 
     121         IF ( ln_clo_rnf) l_clo_rnf = .true. 
     122         ! 
     123         IF ( ln_mask_csundef) THEN 
     124            ! closed sea not defined (ie not in the domcfg namelist used to build the domcfg.nc file) are masked  
     125            IF(lwp) WRITE(numout,*)'          ln_mask_csundef = T : all undefined closed seas are masked' 
     126            ! 
     127            CALL alloc_csmask( mask_csundef ) 
     128            CALL read_csmask( cn_domcfg, 'mask_csundef', mask_csundef ) 
     129            ! revert the mask for masking of undefined closed seas in domzgr  
     130            ! (0 over the undefined closed sea and 1 elsewhere) 
     131            mask_csundef(:,:) = 1 - mask_csundef(:,:) 
     132         END IF 
     133         IF(lwp) WRITE(numout,*) 
     134         ! 
     135         ! allocate source mask for each cases 
     136         CALL alloc_csmask( mask_csglo ) 
     137         CALL alloc_csmask( mask_csrnf ) 
     138         CALL alloc_csmask( mask_csemp ) 
     139         ! 
     140         ! load source mask of cs for each cases 
     141         CALL read_csmask( cn_domcfg, 'mask_csglo', mask_csglo ) 
     142         CALL read_csmask( cn_domcfg, 'mask_csrnf', mask_csrnf ) 
     143         CALL read_csmask( cn_domcfg, 'mask_csemp', mask_csemp ) 
     144         ! 
     145         ! compute number of cs for each cases 
     146         ncsg = MAXVAL( mask_csglo(:,:) ) ; CALL mpp_max( 'closea', ncsg ) 
     147         ncsr = MAXVAL( mask_csrnf(:,:) ) ; CALL mpp_max( 'closea', ncsr ) 
     148         ncse = MAXVAL( mask_csemp(:,:) ) ; CALL mpp_max( 'closea', ncse ) 
     149         ! 
     150         ! allocate closed sea group masks  
     151         !(used to defined the target area in case multiple lakes have the same river mouth (great lakes for example)) 
     152         CALL alloc_csmask( mask_csgrpglo ) 
     153         CALL alloc_csmask( mask_csgrprnf ) 
     154         CALL alloc_csmask( mask_csgrpemp ) 
     155 
     156         ! load mask of cs group for each cases 
     157         CALL read_csmask( cn_domcfg, 'mask_csgrpglo', mask_csgrpglo ) 
     158         CALL read_csmask( cn_domcfg, 'mask_csgrprnf', mask_csgrprnf ) 
     159         CALL read_csmask( cn_domcfg, 'mask_csgrpemp', mask_csgrpemp ) 
     160         ! 
     161      END IF 
    189162   END SUBROUTINE dom_clo 
    190163 
    191  
    192    SUBROUTINE sbc_clo( kt ) 
    193       !!--------------------------------------------------------------------- 
    194       !!                  ***  ROUTINE sbc_clo  *** 
    195       !!                     
    196       !! ** Purpose :   Special handling of closed seas 
    197       !! 
    198       !! ** Method  :   Water flux is forced to zero over closed sea 
    199       !!      Excess is shared between remaining ocean, or 
    200       !!      put as run-off in open ocean. 
    201       !! 
    202       !! ** Action  :   emp updated surface freshwater fluxes and associated heat content at kt 
    203       !!---------------------------------------------------------------------- 
    204       INTEGER         , INTENT(in   ) ::   kt       ! ocean model time step 
    205       ! 
    206       INTEGER             ::   ierr 
    207       INTEGER             ::   jc, jcr, jce   ! dummy loop indices 
    208       REAL(wp), PARAMETER ::   rsmall = 1.e-20_wp    ! Closed sea correction epsilon 
    209       REAL(wp)            ::   zfwf_total, zcoef, zcoef1         !  
    210       REAL(wp), DIMENSION(jncs)    ::   zfwf      !: 
    211       REAL(wp), DIMENSION(jncsr+1) ::   zfwfr     !: freshwater fluxes over closed seas 
    212       REAL(wp), DIMENSION(jncse+1) ::   zfwfe     !:  
    213       REAL(wp), DIMENSION(jpi,jpj) ::   ztmp2d   ! 2D workspace 
    214       !!---------------------------------------------------------------------- 
    215       ! 
    216       IF( ln_timing )  CALL timing_start('sbc_clo') 
    217       ! 
    218       !                                                   !------------------!  
    219       IF( kt == nit000 ) THEN                             !  Initialisation  ! 
    220          !                                                !------------------! 
    221          IF(lwp) WRITE(numout,*) 
    222          IF(lwp) WRITE(numout,*)'sbc_clo : closed seas ' 
    223          IF(lwp) WRITE(numout,*)'~~~~~~~' 
    224  
    225          ALLOCATE( surf(jncs+1) , STAT=ierr ) 
    226          IF( ierr /= 0 )   CALL ctl_stop( 'STOP', 'sbc_clo: failed to allocate surf array') 
    227          surf(:) = 0.e0_wp 
    228          ! 
    229          ! jncsr can be zero so add 1 to avoid allocating zero-length array 
    230          ALLOCATE( surfr(jncsr+1) , STAT=ierr ) 
    231          IF( ierr /= 0 )   CALL ctl_stop( 'STOP', 'sbc_clo: failed to allocate surfr array') 
    232          surfr(:) = 0.e0_wp 
    233          ! 
    234          ! jncse can be zero so add 1 to avoid allocating zero-length array 
    235          ALLOCATE( surfe(jncse+1) , STAT=ierr ) 
    236          IF( ierr /= 0 )   CALL ctl_stop( 'STOP', 'sbc_clo: failed to allocate surfe array') 
    237          surfe(:) = 0.e0_wp 
    238          ! 
    239          surf(jncs+1) = glob_sum( 'closea', e1e2t(:,:) )   ! surface of the global ocean 
    240          ! 
    241          !                                        ! surface areas of closed seas  
    242          DO jc = 1, jncs 
    243             ztmp2d(:,:) = 0.e0_wp 
    244             WHERE( closea_mask(:,:) == jc ) ztmp2d(:,:) = e1e2t(:,:) * tmask_i(:,:) 
    245             surf(jc) = glob_sum( 'closea', ztmp2d(:,:) ) 
    246          END DO 
    247          ! 
    248          ! jncs+1 : surface area of global ocean, closed seas excluded 
    249          surf(jncs+1) = surf(jncs+1) - SUM(surf(1:jncs)) 
    250          ! 
    251          !                                        ! surface areas of rnf target areas 
    252          IF( jncsr > 0 ) THEN 
    253             DO jcr = 1, jncsr 
    254                ztmp2d(:,:) = 0.e0_wp 
    255                WHERE( closea_mask_rnf(:,:) == jcr .and. closea_mask(:,:) == 0 ) ztmp2d(:,:) = e1e2t(:,:) * tmask_i(:,:) 
    256                surfr(jcr) = glob_sum( 'closea', ztmp2d(:,:) ) 
    257             END DO 
    258          ENDIF 
    259          ! 
    260          !                                        ! surface areas of empmr target areas 
    261          IF( jncse > 0 ) THEN 
    262             DO jce = 1, jncse 
    263                ztmp2d(:,:) = 0.e0_wp 
    264                WHERE( closea_mask_empmr(:,:) == jce .and. closea_mask(:,:) == 0 ) ztmp2d(:,:) = e1e2t(:,:) * tmask_i(:,:) 
    265                surfe(jce) = glob_sum( 'closea', ztmp2d(:,:) ) 
    266             END DO 
    267          ENDIF 
    268          ! 
    269          IF(lwp) WRITE(numout,*)'     Closed sea surface areas (km2)' 
    270          DO jc = 1, jncs 
    271             IF(lwp) WRITE(numout,FMT='(1I3,5X,ES12.2)') jc, surf(jc) * 1.0e-6 
    272          END DO 
    273          IF(lwp) WRITE(numout,FMT='(A,ES12.2)') 'Global surface area excluding closed seas (km2): ', surf(jncs+1) * 1.0e-6 
    274          ! 
    275          IF(jncsr > 0) THEN 
    276             IF(lwp) WRITE(numout,*)'     Closed sea target rnf surface areas (km2)' 
    277             DO jcr = 1, jncsr 
    278                IF(lwp) WRITE(numout,FMT='(1I3,5X,ES12.2)') jcr, surfr(jcr) * 1.0e-6 
    279             END DO 
    280          ENDIF 
    281          ! 
    282          IF(jncse > 0) THEN 
    283             IF(lwp) WRITE(numout,*)'     Closed sea target empmr surface areas (km2)' 
    284             DO jce = 1, jncse 
    285                IF(lwp) WRITE(numout,FMT='(1I3,5X,ES12.2)') jce, surfe(jce) * 1.0e-6 
    286             END DO 
    287          ENDIF 
    288       ENDIF 
    289       ! 
    290       !                                                      !--------------------! 
    291       !                                                      !  update emp        ! 
    292       !                                                      !--------------------! 
    293  
    294       zfwf_total = 0._wp 
    295  
    296       ! 
    297       ! 1. Work out total freshwater fluxes over closed seas from EMP - RNF. 
    298       ! 
    299       zfwf(:) = 0.e0_wp            
    300       DO jc = 1, jncs 
    301          ztmp2d(:,:) = 0.e0_wp 
    302          WHERE( closea_mask(:,:) == jc ) ztmp2d(:,:) = e1e2t(:,:) * ( emp(:,:)-rnf(:,:) ) * tmask_i(:,:) 
    303          zfwf(jc) = glob_sum( 'closea', ztmp2d(:,:) ) 
    304       END DO 
    305       zfwf_total = SUM(zfwf) 
    306  
    307       zfwfr(:) = 0.e0_wp            
    308       IF( jncsr > 0 ) THEN 
    309          ! 
    310          ! 2. Work out total FW fluxes over rnf source areas and add to rnf target areas.  
    311          !    Where zfwf is negative add flux at specified runoff points and subtract from fluxes for global redistribution. 
    312          !    Where positive leave in global redistribution total. 
    313          ! 
    314          DO jcr = 1, jncsr 
    315             ! 
    316             ztmp2d(:,:) = 0.e0_wp 
    317             WHERE( closea_mask_rnf(:,:) == jcr .and. closea_mask(:,:) > 0 ) ztmp2d(:,:) = e1e2t(:,:) * ( emp(:,:)-rnf(:,:) ) * tmask_i(:,:) 
    318             zfwfr(jcr) = glob_sum( 'closea', ztmp2d(:,:) ) 
    319             ! 
    320             ! The following if avoids the redistribution of the round off 
    321             IF ( ABS(zfwfr(jcr) / surf(jncs+1) ) > rsmall) THEN 
    322                ! 
    323                ! Add residuals to target runoff points if negative and subtract from total to be added globally 
    324                IF( zfwfr(jcr) < 0.0 ) THEN  
    325                   zfwf_total = zfwf_total - zfwfr(jcr) 
    326                   zcoef    = zfwfr(jcr) / surfr(jcr) 
    327                   zcoef1   = rcp * zcoef 
    328                   WHERE( closea_mask_rnf(:,:) == jcr .and. closea_mask(:,:) == 0.0) 
    329                      emp(:,:) = emp(:,:) + zcoef 
    330                      qns(:,:) = qns(:,:) - zcoef1 * sst_m(:,:) 
    331                   ENDWHERE 
    332                ENDIF 
    333                ! 
    334             ENDIF 
    335          END DO 
    336       ENDIF  ! jncsr > 0     
    337       ! 
    338       zfwfe(:) = 0.e0_wp            
    339       IF( jncse > 0 ) THEN 
    340          ! 
    341          ! 3. Work out total fluxes over empmr source areas and add to empmr target areas.  
    342          ! 
    343          DO jce = 1, jncse 
    344             ! 
    345             ztmp2d(:,:) = 0.e0_wp 
    346             WHERE( closea_mask_empmr(:,:) == jce .and. closea_mask(:,:) > 0 ) ztmp2d(:,:) = e1e2t(:,:) * ( emp(:,:)-rnf(:,:) ) * tmask_i(:,:) 
    347             zfwfe(jce) = glob_sum( 'closea', ztmp2d(:,:) ) 
    348             ! 
    349             ! The following if avoids the redistribution of the round off 
    350             IF ( ABS( zfwfe(jce) / surf(jncs+1) ) > rsmall ) THEN 
    351                ! 
    352                ! Add residuals to runoff points and subtract from total to be added globally 
    353                zfwf_total = zfwf_total - zfwfe(jce) 
    354                zcoef    = zfwfe(jce) / surfe(jce) 
    355                zcoef1   = rcp * zcoef 
    356                WHERE( closea_mask_empmr(:,:) == jce .and. closea_mask(:,:) == 0.0) 
    357                   emp(:,:) = emp(:,:) + zcoef 
    358                   qns(:,:) = qns(:,:) - zcoef1 * sst_m(:,:) 
    359                ENDWHERE 
    360                ! 
    361             ENDIF 
    362          END DO 
    363       ENDIF ! jncse > 0     
    364  
    365       ! 
    366       ! 4. Spread residual flux over global ocean.  
    367       ! 
    368       ! The following if avoids the redistribution of the round off 
    369       IF ( ABS(zfwf_total / surf(jncs+1) ) > rsmall) THEN 
    370          zcoef    = zfwf_total / surf(jncs+1) 
    371          zcoef1   = rcp * zcoef 
    372          WHERE( closea_mask(:,:) == 0 ) 
    373             emp(:,:) = emp(:,:) + zcoef 
    374             qns(:,:) = qns(:,:) - zcoef1 * sst_m(:,:) 
    375          ENDWHERE 
    376       ENDIF 
    377  
    378       ! 
    379       ! 5. Subtract area means from emp (and qns) over closed seas to give zero mean FW flux over each sea. 
    380       ! 
    381       DO jc = 1, jncs 
    382          ! The following if avoids the redistribution of the round off 
    383          IF ( ABS(zfwf(jc) / surf(jncs+1) ) > rsmall) THEN 
    384             ! 
    385             ! Subtract residuals from fluxes over closed sea 
    386             zcoef    = zfwf(jc) / surf(jc) 
    387             zcoef1   = rcp * zcoef 
    388             WHERE( closea_mask(:,:) == jc ) 
    389                emp(:,:) = emp(:,:) - zcoef 
    390                qns(:,:) = qns(:,:) + zcoef1 * sst_m(:,:) 
    391             ENDWHERE 
    392             ! 
    393          ENDIF 
    394       END DO 
    395       ! 
    396       emp (:,:) = emp (:,:) * tmask(:,:,1) 
    397       ! 
    398       CALL lbc_lnk( 'closea', emp , 'T', 1._wp ) 
    399       ! 
    400    END SUBROUTINE sbc_clo 
    401  
    402164   SUBROUTINE clo_rnf( p_rnfmsk ) 
    403165      !!--------------------------------------------------------------------- 
    404       !!                  ***  ROUTINE sbc_rnf  *** 
     166      !!                  ***  ROUTINE clo_rnf  *** 
    405167      !!                     
    406168      !! ** Purpose :   allow the treatment of closed sea outflow grid-points 
     
    412174      !! ** Action  :   update (p_)mskrnf (set 1 at closed sea outflow) 
    413175      !!---------------------------------------------------------------------- 
     176      !! subroutine parameter 
    414177      REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) ::   p_rnfmsk   ! river runoff mask (rnfmsk array) 
    415       !!---------------------------------------------------------------------- 
    416       ! 
    417       IF( jncsr > 0 ) THEN 
    418          WHERE( closea_mask_rnf(:,:) > 0 .and. closea_mask(:,:) == 0 ) 
    419             p_rnfmsk(:,:) = MAX( p_rnfmsk(:,:), 1.0_wp ) 
    420          ENDWHERE 
    421       ENDIF 
    422       ! 
    423       IF( jncse > 0 ) THEN 
    424          WHERE( closea_mask_empmr(:,:) > 0 .and. closea_mask(:,:) == 0 ) 
    425             p_rnfmsk(:,:) = MAX( p_rnfmsk(:,:), 1.0_wp ) 
    426          ENDWHERE 
    427       ENDIF 
     178      !! 
     179      !! local variables 
     180      REAL(wp), DIMENSION(jpi,jpj) :: zmsk 
     181      !!---------------------------------------------------------------------- 
     182      ! 
     183      ! zmsk > 0 where cs river mouth defined (case rnf and emp) 
     184      zmsk(:,:) = ( mask_csgrprnf (:,:) + mask_csgrpemp(:,:) ) * mask_opnsea(:,:) 
     185      WHERE( zmsk(:,:) > 0 ) 
     186         p_rnfmsk(:,:) = 1.0_wp 
     187      END WHERE 
    428188      ! 
    429189   END SUBROUTINE clo_rnf 
    430     
    431190       
    432    SUBROUTINE clo_bat( k_top, k_bot ) 
    433       !!--------------------------------------------------------------------- 
    434       !!                  ***  ROUTINE clo_bat  *** 
     191   SUBROUTINE clo_msk( k_top, k_bot, k_mask, cd_prt ) 
     192      !!--------------------------------------------------------------------- 
     193      !!                  ***  ROUTINE clo_msk  *** 
    435194      !!                     
    436195      !! ** Purpose :   Suppress closed sea from the domain 
    437196      !! 
    438       !! ** Method  :   Read in closea_mask field (if it exists) from domain_cfg file. 
    439       !!                Where closea_mask > 0 set first and last ocean level to 0 
     197      !! ** Method  :   Where closea_mask > 0 set first and last ocean level to 0 
    440198      !!                (As currently coded you can't define a closea_mask field in  
    441199      !!                usr_def_zgr). 
     
    443201      !! ** Action  :   set k_top=0 and k_bot=0 over closed seas 
    444202      !!---------------------------------------------------------------------- 
     203      !! subroutine parameter 
    445204      INTEGER, DIMENSION(:,:), INTENT(inout) ::   k_top, k_bot   ! ocean first and last level indices 
    446       INTEGER                           :: inum, id 
    447       INTEGER,  DIMENSION(jpi,jpj) :: closea_mask ! closea_mask field 
    448       REAL(wp), DIMENSION(jpi,jpj) :: zdata_in ! temporary real array for input 
    449       !!---------------------------------------------------------------------- 
    450       ! 
    451       IF(lwp) THEN                     ! Control print 
     205      INTEGER, DIMENSION(:,:), INTENT(in   ) ::   k_mask         ! mask used to mask ktop and k_bot 
     206      CHARACTER(LEN=*),        INTENT(in   ) ::   cd_prt         ! text for control print 
     207      !! 
     208      !! local variables 
     209      !!---------------------------------------------------------------------- 
     210      !! 
     211      IF ( lwp ) THEN 
    452212         WRITE(numout,*) 
    453          WRITE(numout,*) 'clo_bat : suppression of closed seas' 
     213         WRITE(numout,*) 'clo_msk : Suppression closed seas based on ',TRIM(cd_prt),' field.' 
    454214         WRITE(numout,*) '~~~~~~~' 
     215         WRITE(numout,*) 
    455216      ENDIF 
    456       ! 
    457       IF( ln_read_cfg ) THEN 
    458          ! 
    459          CALL iom_open( cn_domcfg, inum ) 
    460          ! 
    461          id = iom_varid(inum, 'closea_mask', ldstop = .false.)       
    462          IF( id > 0 ) THEN 
    463             IF( lwp ) WRITE(numout,*) 'Suppressing closed seas in bathymetry based on closea_mask field,' 
    464             CALL iom_get ( inum, jpdom_data, 'closea_mask', zdata_in ) 
    465             closea_mask(:,:) = NINT(zdata_in(:,:)) 
    466             WHERE( closea_mask(:,:) > 0 ) 
    467                k_top(:,:) = 0    
    468                k_bot(:,:) = 0    
    469             ENDWHERE 
    470          ELSE 
    471             IF( lwp ) WRITE(numout,*) 'No closea_mask field found in domain_cfg file. No suppression of closed seas.' 
    472          ENDIF 
    473          ! 
    474          CALL iom_close(inum) 
    475          ! 
    476       ELSE 
    477          IF( lwp ) WRITE(numout,*) 'No domain_cfg file => no suppression of closed seas.' 
    478       ENDIF 
    479       ! 
    480       ! Initialise l_sbc_clo and l_clo_rnf for this case (ln_closea=.false.) 
    481       l_sbc_clo = .false. 
    482       l_clo_rnf = .false. 
    483       ! 
    484    END SUBROUTINE clo_bat 
    485  
    486    !!====================================================================== 
     217      !! 
     218      k_top(:,:) = k_top(:,:) * k_mask(:,:) 
     219      k_bot(:,:) = k_bot(:,:) * k_mask(:,:) 
     220      !! 
     221   END SUBROUTINE clo_msk 
     222 
     223   SUBROUTINE read_csmask(cd_file, cd_var, k_mskout) 
     224      !!--------------------------------------------------------------------- 
     225      !!                  ***  ROUTINE read_csmask  *** 
     226      !!                     
     227      !! ** Purpose : read mask in cd_filec file 
     228      !!---------------------------------------------------------------------- 
     229      ! subroutine parameter 
     230      CHARACTER(LEN=256),          INTENT(in   ) :: cd_file    ! netcdf file     name 
     231      CHARACTER(LEN= * ),          INTENT(in   ) :: cd_var     ! netcdf variable name 
     232      INTEGER, DIMENSION(:,:), INTENT(  out) :: k_mskout            ! output mask variable 
     233      ! 
     234      ! local variables 
     235      INTEGER :: ics                       ! netcdf id 
     236      REAL(wp), DIMENSION(jpi,jpj) :: zdta ! netcdf data 
     237      !!---------------------------------------------------------------------- 
     238      ! 
     239      CALL iom_open ( cd_file, ics ) 
     240      CALL iom_get  ( ics, jpdom_data, TRIM(cd_var), zdta ) 
     241      CALL iom_close( ics ) 
     242      k_mskout(:,:) = NINT(zdta(:,:)) 
     243      ! 
     244   END SUBROUTINE read_csmask 
     245 
     246   SUBROUTINE alloc_csmask( kmask ) 
     247      !!--------------------------------------------------------------------- 
     248      !!                  ***  ROUTINE alloc_csmask  *** 
     249      !!                     
     250      !! ** Purpose : allocated cs mask 
     251      !!---------------------------------------------------------------------- 
     252      ! subroutine parameter 
     253      INTEGER, ALLOCATABLE, DIMENSION(:,:), INTENT(inout) :: kmask 
     254      ! 
     255      ! local variables 
     256      INTEGER :: ierr 
     257      !!---------------------------------------------------------------------- 
     258      ! 
     259      ALLOCATE( kmask(jpi,jpj) , STAT=ierr ) 
     260      IF( ierr /= 0 )   CALL ctl_stop( 'STOP', 'alloc_csmask: failed to allocate surf array') 
     261      ! 
     262   END SUBROUTINE 
     263 
    487264END MODULE closea 
    488  
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/DOM/dom_oce.F90

    r11949 r12150  
    3333   LOGICAL , PUBLIC ::   ln_linssh      !: =T  linear free surface ==>> model level are fixed in time 
    3434   LOGICAL , PUBLIC ::   ln_meshmask    !: =T  create a mesh-mask file (mesh_mask.nc) 
    35    REAL(wp), PUBLIC ::   rn_isfhmin     !: threshold to discriminate grounded ice to floating ice 
    3635   REAL(wp), PUBLIC ::   rn_rdt         !: time step for the dynamics and tracer 
    3736   REAL(wp), PUBLIC ::   rn_atfp        !: asselin time filter parameter 
    3837   INTEGER , PUBLIC ::   nn_euler       !: =0 start with forward time step or not (=1) 
    39    LOGICAL , PUBLIC ::   ln_iscpl       !: coupling with ice sheet 
    4038   LOGICAL , PUBLIC ::   ln_crs         !: Apply grid coarsening to dynamical model output or online passive tracers 
    4139 
     
    166164   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)   ::   e3t_1d  , e3w_1d   !: reference vertical scale factors at T- and W-pts (m) 
    167165 
     166   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   risfdep, bathy 
    168167 
    169168   !!---------------------------------------------------------------------- 
     
    178177   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   tmask_h            !: internal domain T-point mask (Figure 8.5 NEMO book) 
    179178 
    180    INTEGER , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   misfdep                 !: top first ocean level             (ISF) 
    181    INTEGER , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   mikt, miku, mikv, mikf  !: top first wet T-, U-, V-, F-level (ISF) 
    182    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   risfdep                 !: Iceshelf draft                    (ISF) 
     179   INTEGER , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   mikt, miku, mikv, mikf  !: top first wet T-, U-, V-, F-level           (ISF) 
    183180 
    184181   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   ssmask, ssumask, ssvmask             !: surface mask at T-,U-, V- and F-pts 
     
    276273         &                      STAT=ierr(6)  ) 
    277274         ! 
    278          ! 
    279       ALLOCATE( gdept_1d(jpk) , gdepw_1d(jpk) , e3t_1d(jpk) , e3w_1d(jpk) , STAT=ierr(7) ) 
     275      ALLOCATE( risfdep(jpi,jpj) , bathy(jpi,jpj) , STAT=ierr(7)  )  
     276         ! 
     277      ALLOCATE( gdept_1d(jpk) , gdepw_1d(jpk) , e3t_1d(jpk) , e3w_1d(jpk) , STAT=ierr(8) ) 
    280278         ! 
    281279      ALLOCATE( tmask_i(jpi,jpj) , tmask_h(jpi,jpj) ,                        &  
     
    283281         &      mbkt   (jpi,jpj) , mbku   (jpi,jpj) , mbkv   (jpi,jpj) , STAT=ierr(9) ) 
    284282         ! 
    285       ALLOCATE( misfdep(jpi,jpj) , mikt(jpi,jpj) , miku(jpi,jpj) ,     & 
    286          &      risfdep(jpi,jpj) , mikv(jpi,jpj) , mikf(jpi,jpj) , STAT=ierr(10) ) 
     283      ALLOCATE( mikt(jpi,jpj), miku(jpi,jpj), mikv(jpi,jpj), mikf(jpi,jpj), STAT=ierr(10) ) 
    287284         ! 
    288285      ALLOCATE( tmask(jpi,jpj,jpk) , umask(jpi,jpj,jpk) ,     &  
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/DOM/domain.F90

    r11960 r12150  
    3030   USE trc_oce        ! shared ocean & passive tracers variab 
    3131   USE phycst         ! physical constants 
    32    USE closea         ! closed seas 
    3332   USE domhgr         ! domain: set the horizontal mesh 
    3433   USE domzgr         ! domain: set the vertical mesh 
     
    3837   USE c1d            ! 1D configuration 
    3938   USE dyncor_c1d     ! 1D configuration: Coriolis term    (cor_c1d routine) 
    40    USE wet_dry,  ONLY : ll_wd 
     39   USE wet_dry, ONLY : ll_wd 
     40   USE closea , ONLY : dom_clo ! closed seas 
    4141   ! 
    4242   USE in_out_manager ! I/O manager 
     
    136136      ENDIF 
    137137      ! 
    138       CALL dom_hgr                     ! Horizontal mesh 
    139       CALL dom_zgr( ik_top, ik_bot )   ! Vertical mesh and bathymetry 
    140       CALL dom_msk( ik_top, ik_bot )   ! Masks 
    141       IF( ln_closea )   CALL dom_clo   ! ln_closea=T : closed seas included in the simulation 
    142                                        ! Read in masks to define closed seas and lakes  
    143       ! 
    144       DO jj = 1, jpj                   ! depth of the iceshelves 
    145          DO ji = 1, jpi 
    146             ik = mikt(ji,jj) 
    147             risfdep(ji,jj) = gdepw_0(ji,jj,ik) 
    148          END DO 
    149       END DO 
     138      CALL dom_hgr                      ! Horizontal mesh 
     139 
     140      IF( ln_closea ) CALL dom_clo      ! Read in masks to define closed seas and lakes 
     141 
     142      CALL dom_zgr( ik_top, ik_bot )    ! Vertical mesh and bathymetry 
     143 
     144      CALL dom_msk( ik_top, ik_bot )    ! Masks 
    150145      ! 
    151146      ht_0(:,:) = 0._wp  ! Reference ocean thickness 
     
    194189      IF( lk_c1d         )   CALL cor_c1d       ! 1D configuration: Coriolis set at T-point 
    195190      ! 
    196       IF( ln_meshmask .AND. .NOT.ln_iscpl )                        CALL dom_wri     ! Create a domain file 
    197       IF( ln_meshmask .AND.      ln_iscpl .AND. .NOT.ln_rstart )   CALL dom_wri     ! Create a domain file 
    198       IF(                                       .NOT.ln_rstart )   CALL dom_ctl     ! Domain control 
    199       ! 
    200       IF( ln_write_cfg )   CALL cfg_write         ! create the configuration file 
     191      IF( ln_meshmask    )   CALL dom_wri       ! Create a domain file 
     192      IF( .NOT.ln_rstart )   CALL dom_ctl       ! Domain control 
     193      ! 
     194      IF( ln_write_cfg   )   CALL cfg_write     ! create the configuration file 
    201195      ! 
    202196      IF(lwp) THEN 
     
    294288         &             nn_it000, nn_itend , nn_date0    , nn_time0     , nn_leapy  , nn_istate ,     & 
    295289         &             nn_stock, nn_write , ln_mskland  , ln_clobber   , nn_chunksz, nn_euler  ,     & 
    296          &             ln_cfmeta, ln_iscpl, ln_xios_read, nn_wxios 
    297       NAMELIST/namdom/ ln_linssh, rn_isfhmin, rn_rdt, rn_atfp, ln_crs, ln_meshmask 
     290         &             ln_cfmeta, ln_xios_read, nn_wxios 
     291      NAMELIST/namdom/ ln_linssh, rn_rdt, rn_atfp, ln_crs, ln_meshmask 
    298292#if defined key_netcdf4 
    299293      NAMELIST/namnc4/ nn_nchunks_i, nn_nchunks_j, nn_nchunks_k, ln_nc4zip 
     
    343337         WRITE(numout,*) '      overwrite an existing file      ln_clobber      = ', ln_clobber 
    344338         WRITE(numout,*) '      NetCDF chunksize (bytes)        nn_chunksz      = ', nn_chunksz 
    345          WRITE(numout,*) '      IS coupling at the restart step ln_iscpl        = ', ln_iscpl 
    346339         IF( TRIM(Agrif_CFixed()) == '0' ) THEN 
    347340            WRITE(numout,*) '      READ restart for a single file using XIOS ln_xios_read =', ln_xios_read 
     
    415408         WRITE(numout,*) '      linear free surface (=T)                ln_linssh   = ', ln_linssh 
    416409         WRITE(numout,*) '      create mesh/mask file                   ln_meshmask = ', ln_meshmask 
    417          WRITE(numout,*) '      treshold to open the isf cavity         rn_isfhmin  = ', rn_isfhmin, ' [m]' 
    418410         WRITE(numout,*) '      ocean time step                         rn_rdt      = ', rn_rdt 
    419411         WRITE(numout,*) '      asselin time filter parameter           rn_atfp     = ', rn_atfp 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/DOM/domvvl.F90

    r11960 r12150  
    3737 
    3838   PUBLIC  dom_vvl_init       ! called by domain.F90 
     39   PUBLIC  dom_vvl_zgr        ! called by isfcpl.F90 
    3940   PUBLIC  dom_vvl_sf_nxt     ! called by step.F90 
    4041   PUBLIC  dom_vvl_sf_update  ! called by step.F90 
     
    118119      INTEGER, INTENT(in) :: Kbb, Kmm, Kaa 
    119120      ! 
     121      IF(lwp) WRITE(numout,*) 
     122      IF(lwp) WRITE(numout,*) 'dom_vvl_init : Variable volume activated' 
     123      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~' 
     124      ! 
     125      CALL dom_vvl_ctl     ! choose vertical coordinate (z_star, z_tilde or layer) 
     126      ! 
     127      !                    ! Allocate module arrays 
     128      IF( dom_vvl_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'dom_vvl_init : unable to allocate arrays' ) 
     129      ! 
     130      !                    ! Read or initialize e3t_(b/n), tilde_e3t_(b/n) and hdiv_lf 
     131      CALL dom_vvl_rst( nit000, Kbb, Kmm, 'READ' ) 
     132      e3t(:,:,jpk,Kaa) = e3t_0(:,:,jpk)  ! last level always inside the sea floor set one for all 
     133      ! 
     134      CALL dom_vvl_zgr(Kbb, Kmm, Kaa) ! interpolation scale factor, depth and water column 
     135      ! 
     136   END SUBROUTINE dom_vvl_init 
     137   ! 
     138   SUBROUTINE dom_vvl_zgr(Kbb, Kmm, Kaa) 
     139      !!---------------------------------------------------------------------- 
     140      !!                ***  ROUTINE dom_vvl_init  *** 
     141      !!                    
     142      !! ** Purpose :  Interpolation of all scale factors,  
     143      !!               depths and water column heights 
     144      !! 
     145      !! ** Method  :  - interpolate scale factors 
     146      !! 
     147      !! ** Action  : - e3t_(n/b) and tilde_e3t_(n/b) 
     148      !!              - Regrid: e3(u/v)_n 
     149      !!                        e3(u/v)_b        
     150      !!                        e3w_n            
     151      !!                        e3(u/v)w_b       
     152      !!                        e3(u/v)w_n       
     153      !!                        gdept_n, gdepw_n and gde3w_n 
     154      !!              - h(t/u/v)_0 
     155      !!              - frq_rst_e3t and frq_rst_hdv 
     156      !! 
     157      !! Reference  : Leclair, M., and G. Madec, 2011, Ocean Modelling. 
     158      !!---------------------------------------------------------------------- 
     159      INTEGER, INTENT(in) :: Kbb, Kmm, Kaa 
     160      !!---------------------------------------------------------------------- 
    120161      INTEGER ::   ji, jj, jk 
    121162      INTEGER ::   ii0, ii1, ij0, ij1 
    122163      REAL(wp)::   zcoef 
    123164      !!---------------------------------------------------------------------- 
    124       ! 
    125       IF(lwp) WRITE(numout,*) 
    126       IF(lwp) WRITE(numout,*) 'dom_vvl_init : Variable volume activated' 
    127       IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~' 
    128       ! 
    129       CALL dom_vvl_ctl     ! choose vertical coordinate (z_star, z_tilde or layer) 
    130       ! 
    131       !                    ! Allocate module arrays 
    132       IF( dom_vvl_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'dom_vvl_init : unable to allocate arrays' ) 
    133       ! 
    134       !                    ! Read or initialize e3t_(b/n), tilde_e3t_(b/n) and hdiv_lf 
    135       CALL dom_vvl_rst( nit000, Kbb, Kmm, 'READ' ) 
    136       e3t(:,:,jpk,Kaa) = e3t_0(:,:,jpk)  ! last level always inside the sea floor set one for all 
    137165      ! 
    138166      !                    !== Set of all other vertical scale factors  ==!  (now and before) 
     
    266294      ENDIF 
    267295      ! 
    268    END SUBROUTINE dom_vvl_init 
     296   END SUBROUTINE dom_vvl_zgr 
    269297 
    270298 
     
    811839            id4 = iom_varid( numror, 'tilde_e3t_n', ldstop = .FALSE. ) 
    812840            id5 = iom_varid( numror, 'hdiv_lf', ldstop = .FALSE. ) 
     841            ! 
    813842            !                             ! --------- ! 
    814843            !                             ! all cases ! 
    815844            !                             ! --------- ! 
     845            ! 
    816846            IF( MIN( id1, id2 ) > 0 ) THEN       ! all required arrays exist 
    817847               CALL iom_get( numror, jpdom_autoglo, 'e3t_b', e3t(:,:,:,Kbb), ldxios = lrxios ) 
     
    10271057      ! 
    10281058      IF( ioptio /= 1 )   CALL ctl_stop( 'Choose ONE vertical coordinate in namelist nam_vvl' ) 
    1029       IF( .NOT. ln_vvl_zstar .AND. ln_isf ) CALL ctl_stop( 'Only vvl_zstar has been tested with ice shelf cavity' ) 
    10301059      ! 
    10311060      IF(lwp) THEN                   ! Print the choice 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/DOM/domwri.F90

    r11532 r12150  
    1616   !!   dom_stiff      : diagnose maximum grid stiffness/hydrostatic consistency (s-coordinate) 
    1717   !!---------------------------------------------------------------------- 
     18   ! 
    1819   USE dom_oce         ! ocean space and time domain 
    1920   USE phycst ,   ONLY :   rsmall 
     
    155156       
    156157      ! note that mbkt is set to 1 over land ==> use surface tmask 
    157       zprt(:,:) = ssmask(:,:) * REAL( mbkt(:,:) , wp ) 
     158      zprt(:,:) = REAL( mbkt(:,:) , wp ) 
    158159      CALL iom_rstput( 0, 0, inum, 'mbathy', zprt, ktype = jp_i4 )     !    ! nb of ocean T-points 
    159       zprt(:,:) = ssmask(:,:) * REAL( mikt(:,:) , wp ) 
     160      zprt(:,:) = REAL( mikt(:,:) , wp ) 
    160161      CALL iom_rstput( 0, 0, inum, 'misf', zprt, ktype = jp_i4 )       !    ! nb of ocean T-points 
    161       zprt(:,:) = ssmask(:,:) * REAL( risfdep(:,:) , wp ) 
    162       CALL iom_rstput( 0, 0, inum, 'isfdraft', zprt, ktype = jp_r8 )   !    ! nb of ocean T-points 
    163162      !                                                         ! vertical mesh 
    164163      CALL iom_rstput( 0, 0, inum, 'e3t_1d', e3t_1d, ktype = jp_r8  )    !    ! scale factors 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/DOM/domzgr.F90

    r10425 r12150  
    7171      INTEGER, DIMENSION(:,:), INTENT(out) ::   k_top, k_bot   ! ocean first and last level indices 
    7272      ! 
    73       INTEGER  ::   jk                  ! dummy loop index 
     73      INTEGER  ::   ji,jj,jk            ! dummy loop index 
     74      INTEGER  ::   ikt, ikb            ! top/bot index 
    7475      INTEGER  ::   ioptio, ibat, ios   ! local integer 
    7576      REAL(wp) ::   zrefdep             ! depth of the reference level (~10m) 
     
    118119      ! Any closed seas (defined by closea_mask > 0 in domain_cfg file) to be filled  
    119120      ! in at runtime if ln_closea=.false. 
    120       IF( .NOT.ln_closea )   CALL clo_bat( k_top, k_bot ) 
     121      IF( ln_closea ) THEN 
     122         IF ( ln_maskcs ) THEN 
     123            ! mask all the closed sea 
     124            CALL clo_msk( k_top, k_bot, mask_opnsea, 'mask_opensea' ) 
     125         ELSE IF ( ln_mask_csundef ) THEN 
     126            ! defined closed sea are kept 
     127            ! mask all the undefined closed sea 
     128            CALL clo_msk( k_top, k_bot, mask_csundef, 'mask_csundef' ) 
     129         END IF 
     130      END IF 
    121131      ! 
    122132      IF(lwp) THEN                     ! Control print 
     
    138148      !                                ! top/bottom ocean level indices for t-, u- and v-points (f-point also for top) 
    139149      CALL zgr_top_bot( k_top, k_bot )      ! with a minimum value set to 1 
    140        
    141  
     150      ! 
     151      !                                ! ice shelf draft and bathymetry 
     152      DO jj = 1,jpj 
     153         DO ji = 1,jpi 
     154            ikt = mikt(ji,jj) 
     155            ikb = mbkt(ji,jj) 
     156            bathy  (ji,jj) = gdepw_0(ji,jj,ikb+1) 
     157            risfdep(ji,jj) = gdepw_0(ji,jj,ikt  ) 
     158         END DO 
     159      END DO 
     160      ! 
    142161      !                                ! deepest/shallowest W level Above/Below ~10m 
    143162!!gm BUG in s-coordinate this does not work! 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/DOM/istate.F90

    r11949 r12150  
    2828   USE dtauvd         ! data: U & V current             (dta_uvd routine) 
    2929   USE domvvl          ! varying vertical mesh 
    30    USE iscplrst        ! ice sheet coupling 
    3130   USE wet_dry         ! wetting and drying (needed for wad_istate) 
    3231   USE usrdef_istate   ! User defined initial state 
     
    8887         !                                    ! ------------------- 
    8988         CALL rst_read( Kbb, Kmm )            ! Read the restart file 
    90          IF (ln_iscpl)       CALL iscpl_stp( Kbb, Kmm )   ! extrapolate restart to wet and dry 
    9189         CALL day_init                        ! model calendar (using both namelist and restart infos) 
    9290         ! 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/DYN/divhor.F90

    r11949 r12150  
    2020   USE oce             ! ocean dynamics and tracers 
    2121   USE dom_oce         ! ocean space and time domain 
    22    USE sbc_oce, ONLY : ln_rnf, ln_isf ! surface boundary condition: ocean 
    23    USE sbcrnf          ! river runoff  
    24    USE sbcisf          ! ice shelf 
    25    USE iscplhsb        ! ice sheet / ocean coupling 
    26    USE iscplini        ! ice sheet / ocean coupling 
     22   USE sbc_oce, ONLY : ln_rnf      ! river runoff 
     23   USE sbcrnf , ONLY : sbc_rnf_div ! river runoff  
     24   USE isf_oce, ONLY : ln_isf      ! ice shelf 
     25   USE isfhdiv, ONLY : isf_hdiv    ! ice shelf 
    2726#if defined key_asminc    
    2827   USE asminc          ! Assimilation increment 
     
    6564      INTEGER  ::   ji, jj, jk    ! dummy loop indices 
    6665      REAL(wp) ::   zraur, zdep   ! local scalars 
     66      REAL(wp), DIMENSION(jpi,jpj) :: ztmp 
    6767      !!---------------------------------------------------------------------- 
    6868      ! 
     
    8686         END DO   
    8787      END DO 
     88      ! 
    8889#if defined key_agrif 
    8990      IF( .NOT. Agrif_Root() ) THEN 
     
    101102      !  
    102103#endif 
    103       IF( ln_isf )   CALL sbc_isf_div( hdiv, Kmm )                     !==  ice shelf  ==!   (update hdiv field) 
    104104      ! 
    105       IF( ln_iscpl .AND. ln_hsb )   CALL iscpl_div( Kmm, hdiv ) !==  ice sheet  ==!   (update hdiv field) 
     105      IF( ln_isf )                      CALL isf_hdiv( kt, Kmm, hdiv )           !==  ice shelf         ==!   (update hdiv field) 
    106106      ! 
    107107      CALL lbc_lnk( 'divhor', hdiv, 'T', 1. )   !   (no sign change) 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/DYN/dynatf.F90

    r11949 r12150  
    3030   USE sbc_oce        ! Surface boundary condition: ocean fields 
    3131   USE sbcrnf         ! river runoffs 
    32    USE sbcisf         ! ice shelf 
    3332   USE phycst         ! physical constants 
    3433   USE dynadv         ! dynamics: vector invariant versus flux form 
     
    4241   USE trddyn         ! trend manager: dynamics 
    4342   USE trdken         ! trend manager: kinetic energy 
     43   USE isf_oce   , ONLY: ln_isf     ! ice shelf 
     44   USE isfdynatf , ONLY: isf_dynatf ! ice shelf volume filter correction subroutine  
    4445   ! 
    4546   USE in_out_manager ! I/O manager 
     
    145146# endif 
    146147      ! 
    147       CALL lbc_lnk_multi( 'dynnxt', puu(:,:,:,Kaa), 'U', -1., pvv(:,:,:,Kaa), 'V', -1. )     !* local domain boundaries 
     148      CALL lbc_lnk_multi( 'dynatf', puu(:,:,:,Kaa), 'U', -1., pvv(:,:,:,Kaa), 'V', -1. )     !* local domain boundaries 
    148149      ! 
    149150      !                                !* BDY open boundaries 
     
    218219               ENDIF 
    219220            END IF 
    220  
    221             IF ( ln_isf ) THEN   ! if ice shelf melting 
    222                DO jk = 1, jpkm1 ! Deal with isf separetely, as can be through depth too 
    223                   DO jj = 1, jpj 
    224                      DO ji = 1, jpi 
    225                         IF( misfkt(ji,jj) <=jk .and. jk < misfkb(ji,jj)  ) THEN 
    226                            ze3t_f(ji,jj,jk) = ze3t_f(ji,jj,jk) - zcoef * ( fwfisf_b(ji,jj) - fwfisf(ji,jj) ) & 
    227                                 &          * ( pe3t(ji,jj,jk,Kmm) * r1_hisf_tbl(ji,jj) ) * tmask(ji,jj,jk) 
    228                         ELSEIF ( jk==misfkb(ji,jj) ) THEN 
    229                            ze3t_f(ji,jj,jk) = ze3t_f(ji,jj,jk) - zcoef * ( fwfisf_b(ji,jj) - fwfisf(ji,jj) ) & 
    230                                 &          * ( pe3t(ji,jj,jk,Kmm) * r1_hisf_tbl(ji,jj) ) * ralpha(ji,jj) * tmask(ji,jj,jk) 
    231                         ENDIF 
    232                      END DO 
    233                   END DO 
    234                END DO 
    235             END IF 
     221            ! 
     222            ! ice shelf melting (deal separately as it can be in depth) 
     223            ! PM: we could probably define a generic subroutine to do the in depth correction 
     224            !     to manage rnf, isf and possibly in the futur icb, tide water glacier (...) 
     225            !     ...(kt, coef, ktop, kbot, hz, fwf_b, fwf) 
     226            IF ( ln_isf ) CALL isf_dynatf( kt, Kmm, ze3t_f, atfp * rdt ) 
    236227            ! 
    237228            pe3t(:,:,1:jpkm1,Kmm) = ze3t_f(:,:,1:jpkm1)        ! filtered scale factor at T-points 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/DYN/dynhpg.F90

    r11960 r12150  
    3131   !!---------------------------------------------------------------------- 
    3232   USE oce             ! ocean dynamics and tracers 
     33   USE isf_oce , ONLY : risfload  ! ice shelf  (risfload variable) 
     34   USE isfload , ONLY : isf_load  ! ice shelf  (isf_load routine ) 
    3335   USE sbc_oce         ! surface variable (only for the flag with ice shelf) 
    3436   USE dom_oce         ! ocean space and time domain 
     
    216218      ENDIF 
    217219      !                           
    218       IF ( .NOT. ln_isfcav ) THEN     !--- no ice shelf load 
    219          riceload(:,:) = 0._wp 
    220          ! 
    221       ELSE                            !--- set an ice shelf load 
    222          ! 
    223          IF(lwp) WRITE(numout,*) 
    224          IF(lwp) WRITE(numout,*) '   ice shelf case: set the ice-shelf load' 
    225          ALLOCATE( zts_top(jpi,jpj,jpts) , zrhd(jpi,jpj,jpk) , zrhdtop_isf(jpi,jpj) , ziceload(jpi,jpj) )  
    226          ! 
    227          znad = 1._wp                     !- To use density and not density anomaly 
    228          ! 
    229          !                                !- assume water displaced by the ice shelf is at T=-1.9 and S=34.4 (rude) 
    230          zts_top(:,:,jp_tem) = -1.9_wp   ;   zts_top(:,:,jp_sal) = 34.4_wp 
    231          ! 
    232          DO jk = 1, jpk                   !- compute density of the water displaced by the ice shelf  
    233             CALL eos( zts_top(:,:,:), gdept(:,:,jk,Kmm), zrhd(:,:,jk) ) 
    234          END DO 
    235          ! 
    236          !                                !- compute rhd at the ice/oce interface (ice shelf side) 
    237          CALL eos( zts_top , risfdep, zrhdtop_isf ) 
    238          ! 
    239          !                                !- Surface value + ice shelf gradient 
    240          ziceload = 0._wp                       ! compute pressure due to ice shelf load  
    241          DO jj = 1, jpj                         ! (used to compute hpgi/j for all the level from 1 to miku/v) 
    242             DO ji = 1, jpi                      ! divided by 2 later 
    243                ikt = mikt(ji,jj) 
    244                ziceload(ji,jj) = ziceload(ji,jj) + (znad + zrhd(ji,jj,1) ) * e3w(ji,jj,1,Kmm) * (1._wp - tmask(ji,jj,1)) 
    245                DO jk = 2, ikt-1 
    246                   ziceload(ji,jj) = ziceload(ji,jj) + (2._wp * znad + zrhd(ji,jj,jk-1) + zrhd(ji,jj,jk)) * e3w(ji,jj,jk,Kmm) & 
    247                      &                              * (1._wp - tmask(ji,jj,jk)) 
    248                END DO 
    249                IF (ikt  >=  2) ziceload(ji,jj) = ziceload(ji,jj) + (2._wp * znad + zrhdtop_isf(ji,jj) + zrhd(ji,jj,ikt-1)) & 
    250                   &                                              * ( risfdep(ji,jj) - gdept(ji,jj,ikt-1,Kmm) ) 
    251             END DO 
    252          END DO 
    253          riceload(:,:) = ziceload(:,:)  ! need to be saved for diaar5 
    254          ! 
    255          DEALLOCATE( zts_top , zrhd , zrhdtop_isf , ziceload )  
    256       ENDIF 
    257       ! 
    258220   END SUBROUTINE dyn_hpg_init 
    259221 
     
    581543      !!         puu(:,:,:,Krhs) = puu(:,:,:,Krhs) - 1/e1u * zhpi 
    582544      !!         pvv(:,:,:,Krhs) = pvv(:,:,:,Krhs) - 1/e2v * zhpj 
    583       !!      iceload is added and partial cell case are added to the top and bottom 
     545      !!      iceload is added 
    584546      !!       
    585547      !! ** Action : - Update (puu(:,:,:,Krhs),pvv(:,:,:,Krhs)) with the now hydrastatic pressure trend 
     
    628590               &                                  - 0.5_wp * e3w(ji,jj,ikt,Kmm)                                         & 
    629591               &                                    * ( 2._wp * znad + rhd(ji,jj,ikt) + zrhdtop_oce(ji,jj) )          & 
    630                &                                  + ( riceload(ji+1,jj) - riceload(ji,jj))                            )  
     592               &                                  + ( risfload(ji+1,jj) - risfload(ji,jj))                            )  
    631593            zhpj(ji,jj,1) = zcoef0 / e2v(ji,jj) * ( 0.5_wp * e3w(ji,jj+1,iktp1j,Kmm)                                    & 
    632594               &                                    * ( 2._wp * znad + rhd(ji,jj+1,iktp1j) + zrhdtop_oce(ji,jj+1) )   & 
    633595               &                                  - 0.5_wp * e3w(ji,jj,ikt,Kmm)                                         &  
    634596               &                                    * ( 2._wp * znad + rhd(ji,jj,ikt) + zrhdtop_oce(ji,jj) )          & 
    635                &                                  + ( riceload(ji,jj+1) - riceload(ji,jj))                            )  
     597               &                                  + ( risfload(ji,jj+1) - risfload(ji,jj))                            )  
    636598            ! s-coordinate pressure gradient correction (=0 if z coordinate) 
    637599            zuap = -zcoef0 * ( rhd    (ji+1,jj,1) + rhd    (ji,jj,1) + 2._wp * znad )   & 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/DYN/dynspg_ts.F90

    r12145 r12150  
    3131   USE dom_oce         ! ocean space and time domain 
    3232   USE sbc_oce         ! surface boundary condition: ocean 
     33   USE isf_oce         ! ice shelf variable (fwfisf) 
    3334   USE zdf_oce         ! vertical physics: variables 
    3435   USE zdfdrg          ! vertical physics: top/bottom drag coef. 
    35    USE sbcisf          ! ice shelf variable (fwfisf) 
    3636   USE sbcapr          ! surface boundary condition: atmospheric pressure 
    3737   USE dynadv    , ONLY: ln_dynadv_vec 
     
    337337      !                                   ! ---------------------------------------------------  ! 
    338338      IF (ln_bt_fw) THEN                          ! FORWARD integration: use kt+1/2 fluxes (NOW+1/2) 
    339          zssh_frc(:,:) = r1_rau0 * ( emp(:,:)             - rnf(:,:)              + fwfisf(:,:)                  ) 
     339         zssh_frc(:,:) = r1_rau0 * ( emp(:,:) - rnf(:,:) + fwfisf_cav(:,:) + fwfisf_par(:,:) ) 
    340340      ELSE                                        ! CENTRED integration: use kt-1/2 + kt+1/2 fluxes (NOW) 
    341341         zztmp = r1_rau0 * r1_2 
    342          zssh_frc(:,:) = zztmp * (  emp(:,:) + emp_b(:,:) - rnf(:,:) - rnf_b(:,:) + fwfisf(:,:) + fwfisf_b(:,:)  ) 
     342         zssh_frc(:,:) = zztmp * (  emp(:,:)        + emp_b(:,:)                    & 
     343                &                 - rnf(:,:)        - rnf_b(:,:)                    & 
     344                &                 + fwfisf_cav(:,:) + fwfisf_cav_b(:,:)             & 
     345                &                 + fwfisf_par(:,:) + fwfisf_par_b(:,:)             ) 
    343346      ENDIF 
    344347      !                                   !=  Add Stokes drift divergence  =!   (if exist) 
     
    346349         zssh_frc(:,:) = zssh_frc(:,:) + div_sd(:,:) 
    347350      ENDIF 
     351      ! 
     352      !                                         ! ice sheet coupling 
     353      IF ( ln_isf .AND. ln_isfcpl ) THEN 
     354         ! 
     355         ! ice sheet coupling 
     356         IF( ln_rstart .AND. kt == nit000 ) THEN 
     357            zssh_frc(:,:) = zssh_frc(:,:) + risfcpl_ssh(:,:) 
     358         END IF 
     359         ! 
     360         ! conservation option 
     361         IF( ln_isfcpl_cons ) THEN 
     362            zssh_frc(:,:) = zssh_frc(:,:) + risfcpl_cons_ssh(:,:) 
     363         END IF 
     364         ! 
     365      END IF 
    348366      ! 
    349367#if defined key_asminc 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/DYN/dynzdf.F90

    r11949 r12150  
    430430                  ikv = mikv(ji,jj)       ! (first wet ocean u- and v-points) 
    431431                  ze3va =  ( 1._wp - r_vvl ) * e3v(ji,jj,ikv,Kmm) + r_vvl * e3v(ji,jj,ikv,Kaa)   ! after scale factor at T-point 
    432                   zwd(ji,jj,iku) = zwd(ji,jj,iku) - r2dt * 0.5*( rCdU_top(ji+1,jj)+rCdU_top(ji,jj) ) / ze3va 
     432                  zwd(ji,jj,ikv) = zwd(ji,jj,ikv) - r2dt * 0.5*( rCdU_top(ji,jj+1)+rCdU_top(ji,jj) ) / ze3va 
    433433               END DO 
    434434            END DO 
     
    448448      !   m is decomposed in the product of an upper and lower triangular matrix 
    449449      !   The 3 diagonal terms are in 2d arrays: zwd, zws, zwi 
    450       !   The solution (after velocity) is in 2d array pvv(:,:,:,Kaa) 
     450      !   The solution (after velocity) is in 2d array va 
    451451      !----------------------------------------------------------------------- 
    452452      ! 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/DYN/sshwzv.F90

    r11949 r12150  
    1919   !!---------------------------------------------------------------------- 
    2020   USE oce            ! ocean dynamics and tracers variables 
     21   USE isf_oce        ! ice shelf 
    2122   USE dom_oce        ! ocean space and time domain variables  
    2223   USE sbc_oce        ! surface boundary condition: ocean 
     
    256257            zcoef = atfp * rdt * r1_rau0 
    257258            pssh(:,:,Kmm) = pssh(:,:,Kmm) - zcoef * (     emp_b(:,:) - emp   (:,:)   & 
    258                &                             -    rnf_b(:,:) + rnf   (:,:)   & 
    259                &                             + fwfisf_b(:,:) - fwfisf(:,:)   ) * ssmask(:,:) 
     259               &                             - rnf_b(:,:)        + rnf   (:,:)       & 
     260               &                             + fwfisf_cav_b(:,:) - fwfisf_cav(:,:)   & 
     261               &                             + fwfisf_par_b(:,:) - fwfisf_par(:,:)   ) * ssmask(:,:) 
     262 
     263            ! ice sheet coupling 
     264            IF ( ln_isf .AND. ln_isfcpl .AND. kt == nit000+1) pssh(:,:,Kbb) = pssh(:,:,Kbb) - atfp * rdt * ( risfcpl_ssh(:,:) - 0.0 ) * ssmask(:,:) 
     265 
    260266         ENDIF 
    261267      ENDIF 
     
    350356                  zCu = MAX( Cu_adv(ji,jj,jk) , Cu_adv(ji,jj,jk-1) ) 
    351357! alt: 
    352 !                  IF ( wn(ji,jj,jk) > 0._wp ) THEN  
     358!                  IF ( ww(ji,jj,jk) > 0._wp ) THEN  
    353359!                     zCu =  Cu_adv(ji,jj,jk)  
    354360!                  ELSE 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/IOM/iom.F90

    r11949 r12150  
    374374        CALL iom_set_rstw_var_active('sshn') 
    375375        CALL iom_set_rstw_var_active('rhop') 
    376      ! extra variable needed for the ice sheet coupling 
    377         IF ( ln_iscpl ) THEN 
    378              CALL iom_set_rstw_var_active('tmask') 
    379              CALL iom_set_rstw_var_active('umask') 
    380              CALL iom_set_rstw_var_active('vmask') 
    381              CALL iom_set_rstw_var_active('smask') 
    382              CALL iom_set_rstw_var_active('e3t_n') 
    383              CALL iom_set_rstw_var_active('e3u_n') 
    384              CALL iom_set_rstw_var_active('e3v_n') 
    385              CALL iom_set_rstw_var_active('gdepw_n') 
    386         END IF 
    387376      ENDIF 
    388377      IF(ln_diurnal) CALL iom_set_rstw_var_active('Dsst') 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/IOM/restart.F90

    r11949 r12150  
    162162                     CALL iom_rstput( kt, nitrst, numrow, 'sshn'   ,ssh(:,:         ,Kmm), ldxios = lwxios      ) 
    163163                     CALL iom_rstput( kt, nitrst, numrow, 'rhop'   , rhop, ldxios = lwxios      ) 
    164                   ! extra variable needed for the ice sheet coupling 
    165                   IF ( ln_iscpl ) THEN  
    166                      CALL iom_rstput( kt, nitrst, numrow, 'tmask'  , tmask, ldxios = lwxios ) ! need to extrapolate T/S 
    167                      CALL iom_rstput( kt, nitrst, numrow, 'umask'  , umask, ldxios = lwxios ) ! need to correct barotropic velocity 
    168                      CALL iom_rstput( kt, nitrst, numrow, 'vmask'  , vmask, ldxios = lwxios ) ! need to correct barotropic velocity 
    169                      CALL iom_rstput( kt, nitrst, numrow, 'smask'  , ssmask, ldxios = lwxios) ! need to correct barotropic velocity 
    170                      CALL iom_rstput( kt, nitrst, numrow, 'e3t_n', e3t(:,:,:,Kmm), ldxios = lwxios )   ! need to compute temperature correction 
    171                      CALL iom_rstput( kt, nitrst, numrow, 'e3u_n', e3u(:,:,:,Kmm), ldxios = lwxios )   ! need to compute bt conservation 
    172                      CALL iom_rstput( kt, nitrst, numrow, 'e3v_n', e3v(:,:,:,Kmm), ldxios = lwxios )   ! need to compute bt conservation 
    173                      CALL iom_rstput( kt, nitrst, numrow, 'gdepw_n', gdepw(:,:,:,Kmm), ldxios = lwxios ) ! need to compute extrapolation if vvl 
    174                   END IF 
    175164      ENDIF 
    176165       
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/ISF/isfstp.F90

    r12077 r12150  
    291291      !!---------------------------------------------------------------------- 
    292292      ! 
    293       REWIND( numnam_ref )              ! Namelist namsbc_rnf in reference namelist : Runoffs  
    294293      READ  ( numnam_ref, namisf, IOSTAT = ios, ERR = 901) 
    295294901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namisf in reference namelist' ) 
    296295      ! 
    297       REWIND( numnam_cfg )              ! Namelist namsbc_rnf in configuration namelist : Runoffs 
    298296      READ  ( numnam_cfg, namisf, IOSTAT = ios, ERR = 902 ) 
    299297902   IF( ios >  0 )   CALL ctl_nam ( ios , 'namisf in configuration namelist' ) 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/LDF/ldfslp.F90

    r11949 r12150  
    2121   !!---------------------------------------------------------------------- 
    2222   USE oce            ! ocean dynamics and tracers 
     23   USE isf_oce        ! ice shelf 
    2324   USE dom_oce        ! ocean space and time domain 
    2425!   USE ldfdyn         ! lateral diffusion: eddy viscosity coef. 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/LDF/ldftra.F90

    r11960 r12150  
    660660                  ! eddies using the isopycnal slopes calculated in ldfslp.F :  
    661661                  ! T^-1 = sqrt(m_jpk(N^2*(r1^2+r2^2)*e3w)) 
    662                   ze3w = e3w(ji,jj,jk,Kmm) * tmask(ji,jj,jk) 
     662                  ze3w = e3w(ji,jj,jk,Kmm) * wmask(ji,jj,jk) 
    663663                  zah(ji,jj) = zah(ji,jj) + zn2 * wslp2(ji,jj,jk) * ze3w 
    664664                  zhw(ji,jj) = zhw(ji,jj) + ze3w 
     
    678678                  ! eddies using the isopycnal slopes calculated in ldfslp.F :  
    679679                  ! T^-1 = sqrt(m_jpk(N^2*(r1^2+r2^2)*e3w)) 
    680                   ze3w = e3w(ji,jj,jk,Kmm) * tmask(ji,jj,jk) 
     680                  ze3w = e3w(ji,jj,jk,Kmm) * wmask(ji,jj,jk) 
    681681                  zah(ji,jj) = zah(ji,jj) + zn2 * ( wslpi(ji,jj,jk) * wslpi(ji,jj,jk)   & 
    682682                     &                            + wslpj(ji,jj,jk) * wslpj(ji,jj,jk) ) * ze3w 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/SBC/sbc_oce.F90

    r10882 r12150  
    4343   LOGICAL , PUBLIC ::   ln_dm2dc       !: Daily mean to Diurnal Cycle short wave (qsr) 
    4444   LOGICAL , PUBLIC ::   ln_rnf         !: runoffs / runoff mouths 
    45    LOGICAL , PUBLIC ::   ln_isf         !: ice shelf melting 
    4645   LOGICAL , PUBLIC ::   ln_ssr         !: Sea Surface restoring on SST and/or SSS       
    4746   LOGICAL , PUBLIC ::   ln_apr_dyn     !: Atmospheric pressure forcing used on dynamics (ocean & ice) 
     
    122121   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   emp_tot           !: total E-P over ocean and ice                 [Kg/m2/s] 
    123122   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   fmmflx            !: freshwater budget: freezing/melting          [Kg/m2/s] 
    124    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   rnf    , rnf_b    !: river runoff        [Kg/m2/s]   
    125    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   fwfisf , fwfisf_b !: ice shelf melting   [Kg/m2/s]   
    126    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   fwficb , fwficb_b !: iceberg melting [Kg/m2/s]   
    127  
     123   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   rnf    , rnf_b    !: river runoff                                 [Kg/m2/s]   
     124   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   fwficb , fwficb_b !: iceberg melting                              [Kg/m2/s]   
    128125   !! 
    129126   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::  sbc_tsc, sbc_tsc_b  !: sbc content trend                      [K.m/s] jpi,jpj,jpts 
     
    174171         &      sfx    (jpi,jpj) , sfx_b(jpi,jpj) , emp_tot(jpi,jpj), fmmflx(jpi,jpj), STAT=ierr(2) ) 
    175172         ! 
    176       ALLOCATE( fwfisf  (jpi,jpj), rnf  (jpi,jpj) , sbc_tsc  (jpi,jpj,jpts) , qsr_hc  (jpi,jpj,jpk) ,  & 
    177          &      fwfisf_b(jpi,jpj), rnf_b(jpi,jpj) , sbc_tsc_b(jpi,jpj,jpts) , qsr_hc_b(jpi,jpj,jpk) ,  & 
     173      ALLOCATE( rnf  (jpi,jpj) , sbc_tsc  (jpi,jpj,jpts) , qsr_hc  (jpi,jpj,jpk) ,  & 
     174         &      rnf_b(jpi,jpj) , sbc_tsc_b(jpi,jpj,jpts) , qsr_hc_b(jpi,jpj,jpk) ,  & 
    178175         &      fwficb  (jpi,jpj), fwficb_b(jpi,jpj), STAT=ierr(3) ) 
    179176         ! 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/SBC/sbccpl.F90

    r11960 r12150  
    2727   USE sbcwave         ! surface boundary condition: waves 
    2828   USE phycst          ! physical constants 
     29   USE isf_oce , ONLY : l_isfoasis, fwfisf_oasis ! ice shelf boundary condition 
    2930#if defined key_si3 
    3031   USE ice            ! ice variables 
     
    3637   USE eosbn2         !  
    3738   USE sbcrnf  , ONLY : l_rnfcpl 
    38    USE sbcisf  , ONLY : l_isfcpl 
    3939#if defined key_cice 
    4040   USE ice_domain_size, only: ncat 
     
    472472      srcv(jpr_icb)%clname = 'OIceberg'   ;  IF( TRIM( sn_rcv_icb%cldes) == 'coupled' )   srcv(jpr_icb)%laction = .TRUE. 
    473473 
    474       IF( srcv(jpr_isf)%laction .AND. ln_isf ) THEN 
    475          l_isfcpl             = .TRUE.                      ! -> no need to read isf in sbcisf 
     474      IF( srcv(jpr_isf)%laction ) THEN 
     475         l_isfoasis = .TRUE.  ! -> isf fwf comes from oasis 
    476476         IF(lwp) WRITE(numout,*) 
    477477         IF(lwp) WRITE(numout,*) '   iceshelf received from oasis ' 
     478         CALL ctl_stop('STOP','not coded') 
    478479      ENDIF 
    479480      ! 
     
    14041405             rnf(:,:)    = rnf(:,:) + fwficb(:,:)   ! iceberg added to runfofs 
    14051406         ENDIF 
    1406          IF( srcv(jpr_isf)%laction )  fwfisf(:,:) = - frcv(jpr_isf)%z3(:,:,1)  ! fresh water flux from the isf (fwfisf <0 mean melting)   
     1407         ! 
     1408         ! ice shelf fwf 
     1409         IF( srcv(jpr_isf)%laction )  THEN 
     1410            fwfisf_oasis(:,:) = - frcv(jpr_isf)%z3(:,:,1)  ! fresh water flux from the isf (fwfisf <0 mean melting)   
     1411         END IF 
    14071412         
    14081413         IF( ln_mixcpl ) THEN   ;   emp(:,:) = emp(:,:) * xcplmask(:,:,0) + zemp(:,:) * zmsk(:,:) 
     
    17071712      ENDIF 
    17081713      IF( srcv(jpr_isf)%laction ) THEN   ! iceshelf (fwfisf <0 mean melting) 
    1709         fwfisf(:,:) = - frcv(jpr_isf)%z3(:,:,1)   
     1714        fwfisf_oasis(:,:) = - frcv(jpr_isf)%z3(:,:,1)   
    17101715      ENDIF 
    17111716 
     
    17461751      ENDIF 
    17471752      IF( srcv(jpr_isf)%laction ) THEN   ! iceshelf (fwfisf <0 mean melting) 
    1748         fwfisf(:,:) = - frcv(jpr_isf)%z3(:,:,1) 
     1753        fwfisf_oasis(:,:) = - frcv(jpr_isf)%z3(:,:,1) 
    17491754      ENDIF 
    17501755      ! 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/SBC/sbcfwb.F90

    r11949 r12150  
    1717   USE dom_oce        ! ocean space and time domain 
    1818   USE sbc_oce        ! surface ocean boundary condition 
     19   USE isf_oce , ONLY : fwfisf_cav, fwfisf_par                    ! ice shelf melting contribution 
    1920   USE sbc_ice , ONLY : snwice_mass, snwice_mass_b, snwice_fmass 
    2021   USE phycst         ! physical constants 
    2122   USE sbcrnf         ! ocean runoffs 
    22    USE sbcisf         ! ice shelf melting contribution 
    2323   USE sbcssr         ! Sea-Surface damping terms 
    2424   ! 
     
    105105         ! 
    106106         IF( MOD( kt-1, kn_fsbc ) == 0 ) THEN 
    107             y_fwfnow(1) = local_sum( e1e2t(:,:) * ( emp(:,:) - rnf(:,:) + fwfisf(:,:) - snwice_fmass(:,:) ) ) 
     107            y_fwfnow(1) = local_sum( e1e2t(:,:) * ( emp(:,:) - rnf(:,:) + fwfisf_cav(:,:) + fwfisf_par(:,:) - snwice_fmass(:,:) ) ) 
    108108            CALL mpp_delay_sum( 'sbcfwb', 'fwb', y_fwfnow(:), z_fwfprv(:), kt == nitend - nn_fsbc + 1 ) 
    109109            z_fwfprv(1) = z_fwfprv(1) / area 
     
    160160            ztmsk_neg(:,:) = tmask_i(:,:) - ztmsk_pos(:,:) 
    161161            !                                                  ! fwf global mean (excluding ocean to ice/snow exchanges)  
    162             z_fwf     = glob_sum( 'sbcfwb', e1e2t(:,:) * ( emp(:,:) - rnf(:,:) + fwfisf(:,:) - snwice_fmass(:,:) ) ) / area 
     162            z_fwf     = glob_sum( 'sbcfwb', e1e2t(:,:) * ( emp(:,:) - rnf(:,:) + fwfisf_cav(:,:) + fwfisf_par(:,:) - snwice_fmass(:,:) ) ) / area 
    163163            !             
    164164            IF( z_fwf < 0._wp ) THEN         ! spread out over >0 erp area to increase evaporation 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/SBC/sbcmod.F90

    r11960 r12150  
    2424   USE oce            ! ocean dynamics and tracers 
    2525   USE dom_oce        ! ocean space and time domain 
     26   USE closea         ! closed seas 
    2627   USE phycst         ! physical constants 
    2728   USE sbc_oce        ! Surface boundary condition: ocean fields 
     
    3738#endif 
    3839   USE sbcice_cice    ! surface boundary condition: CICE sea-ice model 
    39    USE sbcisf         ! surface boundary condition: ice-shelf 
    4040   USE sbccpl         ! surface boundary condition: coupled formulation 
    4141   USE cpl_oasis3     ! OASIS routines for coupling 
     42   USE sbcclo         ! surface boundary condition: closed sea correction 
    4243   USE sbcssr         ! surface boundary condition: sea surface restoring 
    4344   USE sbcrnf         ! surface boundary condition: runoffs 
    4445   USE sbcapr         ! surface boundary condition: atmo pressure  
    45    USE sbcisf         ! surface boundary condition: ice shelf 
    4646   USE sbcfwb         ! surface boundary condition: freshwater budget 
    4747   USE icbstp         ! Icebergs 
     
    9292      LOGICAL ::   ll_purecpl, ll_opa, ll_not_nemo   ! local logical 
    9393      !! 
    94       NAMELIST/namsbc/ nn_fsbc  ,                                                    & 
    95          &             ln_usr   , ln_flx   , ln_blk       ,                          & 
    96          &             ln_cpl   , ln_mixcpl, nn_components,                          & 
    97          &             nn_ice   , ln_ice_embd,                                       & 
    98          &             ln_traqsr, ln_dm2dc ,                                         & 
    99          &             ln_rnf   , nn_fwb   , ln_ssr   , ln_isf    , ln_apr_dyn ,     & 
    100          &             ln_wave  , ln_cdgw  , ln_sdw   , ln_tauwoc  , ln_stcor   ,     & 
    101          &             ln_tauw  , nn_lsm, nn_sdrift 
     94      NAMELIST/namsbc/ nn_fsbc  ,                                                  & 
     95         &             ln_usr   , ln_flx     , ln_blk       ,                      & 
     96         &             ln_cpl   , ln_mixcpl  , nn_components,                      & 
     97         &             nn_ice   , ln_ice_embd,                                     & 
     98         &             ln_traqsr, ln_dm2dc   ,                                     & 
     99         &             ln_rnf   , nn_fwb     , ln_ssr   , ln_apr_dyn,              & 
     100         &             ln_wave  , ln_cdgw    , ln_sdw   , ln_tauwoc , ln_stcor,    & 
     101         &             ln_tauw  , nn_lsm     , nn_sdrift 
    102102      !!---------------------------------------------------------------------- 
    103103      ! 
     
    152152         WRITE(numout,*) '         Patm gradient added in ocean & ice Eqs.    ln_apr_dyn    = ', ln_apr_dyn 
    153153         WRITE(numout,*) '         runoff / runoff mouths                     ln_rnf        = ', ln_rnf 
    154          WRITE(numout,*) '         iceshelf formulation                       ln_isf        = ', ln_isf 
    155154         WRITE(numout,*) '         nb of iterations if land-sea-mask applied  nn_lsm        = ', nn_lsm 
    156155         WRITE(numout,*) '         surface wave                               ln_wave       = ', ln_wave 
     
    239238#endif 
    240239      ! 
    241       IF( .NOT.ln_isf ) THEN        !* No ice-shelf in the domain : allocate and set to zero 
    242          IF( sbc_isf_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'sbc_init : unable to allocate sbc_isf arrays' ) 
    243          fwfisf  (:,:)   = 0._wp   ;   risf_tsc  (:,:,:) = 0._wp 
    244          fwfisf_b(:,:)   = 0._wp   ;   risf_tsc_b(:,:,:) = 0._wp 
    245       END IF 
    246240      IF( nn_ice == 0 ) THEN        !* No sea-ice in the domain : ice fraction is always zero 
    247241         IF( nn_components /= jp_iam_opa )   fr_i(:,:) = 0._wp    ! except for OPA in SAS-OPA coupled case 
     
    329323                          CALL sbc_ssm_init ( Kbb, Kmm ) ! Sea-surface mean fields initialization 
    330324      ! 
     325      IF( l_sbc_clo   )   CALL sbc_clo_init              ! closed sea surface initialisation 
     326      ! 
    331327      IF( ln_blk      )   CALL sbc_blk_init              ! bulk formulae initialization 
    332328 
    333329      IF( ln_ssr      )   CALL sbc_ssr_init              ! Sea-Surface Restoring initialization 
    334330      ! 
    335       IF( ln_isf      )   CALL sbc_isf_init( Kmm )       ! Compute iceshelves 
    336331      ! 
    337332                          CALL sbc_rnf_init( Kmm )       ! Runof initialization 
     
    402397            rnf_b    (:,:  ) = rnf    (:,:  ) 
    403398            rnf_tsc_b(:,:,:) = rnf_tsc(:,:,:) 
    404          ENDIF 
    405          IF( ln_isf )  THEN 
    406             fwfisf_b  (:,:  ) = fwfisf  (:,:  )                
    407             risf_tsc_b(:,:,:) = risf_tsc(:,:,:)               
    408399         ENDIF 
    409400        ! 
     
    456447      ENDIF 
    457448 
    458       IF( ln_isf         )   CALL sbc_isf( kt, Kmm )                   ! compute iceshelves 
    459  
    460       IF( ln_rnf         )   CALL sbc_rnf( kt )                        ! add runoffs to fresh water fluxes 
     449      IF( ln_rnf         )   CALL sbc_rnf( kt )                   ! add runoffs to fresh water fluxes 
    461450 
    462451      IF( ln_ssr         )   CALL sbc_ssr( kt )                        ! add SST/SSS damping term 
     
    466455      ! Special treatment of freshwater fluxes over closed seas in the model domain 
    467456      ! Should not be run if ln_diurnal_only 
    468       IF( l_sbc_clo .AND. (.NOT. ln_diurnal_only) )   CALL sbc_clo( kt )    
     457      IF( l_sbc_clo     )   CALL sbc_clo( kt )    
    469458 
    470459!!$!RBbug do not understand why see ticket 667 
     
    559548      ! 
    560549      IF(ln_ctl) THEN         ! print mean trends (used for debugging) 
    561          CALL prt_ctl(tab2d_1=fr_i                , clinfo1=' fr_i    - : ' , mask1=tmask ) 
    562          CALL prt_ctl(tab2d_1=(emp-rnf + fwfisf)  , clinfo1=' emp-rnf - : ' , mask1=tmask ) 
    563          CALL prt_ctl(tab2d_1=(sfx-rnf + fwfisf)  , clinfo1=' sfx-rnf - : ' , mask1=tmask ) 
    564          CALL prt_ctl(tab2d_1=qns                 , clinfo1=' qns      - : ', mask1=tmask ) 
    565          CALL prt_ctl(tab2d_1=qsr                 , clinfo1=' qsr      - : ', mask1=tmask ) 
    566          CALL prt_ctl(tab3d_1=tmask               , clinfo1=' tmask    - : ', mask1=tmask, kdim=jpk ) 
     550         CALL prt_ctl(tab2d_1=fr_i             , clinfo1=' fr_i     - : ', mask1=tmask ) 
     551         CALL prt_ctl(tab2d_1=(emp-rnf)        , clinfo1=' emp-rnf  - : ', mask1=tmask ) 
     552         CALL prt_ctl(tab2d_1=(sfx-rnf)        , clinfo1=' sfx-rnf  - : ', mask1=tmask ) 
     553         CALL prt_ctl(tab2d_1=qns              , clinfo1=' qns      - : ', mask1=tmask ) 
     554         CALL prt_ctl(tab2d_1=qsr              , clinfo1=' qsr      - : ', mask1=tmask ) 
     555         CALL prt_ctl(tab3d_1=tmask            , clinfo1=' tmask    - : ', mask1=tmask, kdim=jpk ) 
    567556         CALL prt_ctl(tab3d_1=ts(:,:,:,jp_tem,Kmm), clinfo1=' sst      - : ', mask1=tmask, kdim=1   ) 
    568557         CALL prt_ctl(tab3d_1=ts(:,:,:,jp_sal,Kmm), clinfo1=' sss      - : ', mask1=tmask, kdim=1   ) 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/SBC/sbcrnf.F90

    r11960 r12150  
    1919   USE phycst         ! physical constants 
    2020   USE sbc_oce        ! surface boundary condition variables 
    21    USE sbcisf         ! PM we could remove it I think 
    2221   USE eosbn2         ! Equation Of State 
    23    USE closea        ! closed seas 
     22   USE closea, ONLY: l_clo_rnf, clo_rnf ! closed seas 
    2423   ! 
    2524   USE in_out_manager ! I/O manager 
     
    127126               rnf_tsc(:,:,jp_tem) = sst_m(:,:) * rnf(:,:) * r1_rau0 
    128127            END WHERE 
    129             WHERE( sf_t_rnf(1)%fnow(:,:,1) == -222._wp )             ! where fwf comes from melting of ice shelves or iceberg 
    130                rnf_tsc(:,:,jp_tem) = ztfrz(:,:) * rnf(:,:) * r1_rau0 - rnf(:,:) * rLfusisf * r1_rau0_rcp 
    131             END WHERE 
    132128         ELSE                                                        ! use SST as runoffs temperature 
    133129            !CEOD River is fresh water so must at least be 0 unless we consider ice 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/SBC/sbcssm.F90

    r11949 r12150  
    6161      ! 
    6262      !                                        !* surface T-, U-, V- ocean level variables (T, S, depth, velocity) 
    63       DO jj = 1, jpj 
    64          DO ji = 1, jpi 
    65             zts(ji,jj,jp_tem) = ts(ji,jj,mikt(ji,jj),jp_tem,Kmm) 
    66             zts(ji,jj,jp_sal) = ts(ji,jj,mikt(ji,jj),jp_sal,Kmm) 
    67          END DO 
    68       END DO 
     63      zts(:,:,jp_tem) = ts(:,:,1,jp_tem,Kmm) 
     64      zts(:,:,jp_sal) = ts(:,:,1,jp_sal,Kmm) 
    6965      ! 
    7066      IF( nn_fsbc == 1 ) THEN                             !   Instantaneous surface fields        ! 
     
    7369         ssv_m(:,:) = vv(:,:,1,Kbb) 
    7470         IF( l_useCT )  THEN    ;   sst_m(:,:) = eos_pt_from_ct( zts(:,:,jp_tem), zts(:,:,jp_sal) ) 
    75          ELSE                    ;   sst_m(:,:) = zts(:,:,jp_tem) 
     71         ELSE                   ;   sst_m(:,:) = zts(:,:,jp_tem) 
    7672         ENDIF 
    7773         sss_m(:,:) = zts(:,:,jp_sal) 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/TRA/eosbn2.F90

    r11960 r12150  
    2929   !!   eos_insitu_pot: Compute the insitu and surface referenced potential volumic mass 
    3030   !!   eos_insitu_2d : Compute the in situ density for 2d fields 
    31    !!   bn2           : Compute the Brunt-Vaisala frequency 
    3231   !!   bn2           : compute the Brunt-Vaisala frequency 
    3332   !!   eos_pt_from_ct: compute the potential temperature from the Conservative Temperature 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/TRA/traatf.F90

    r11949 r12150  
    2929   USE sbc_oce         ! surface boundary condition: ocean 
    3030   USE sbcrnf          ! river runoffs 
    31    USE sbcisf          ! ice shelf melting 
     31   USE isf_oce         ! ice shelf melting 
    3232   USE zdf_oce         ! ocean vertical mixing 
    3333   USE domvvl          ! variable volume 
     
    302302                  ! 
    303303                  IF( jk == mikt(ji,jj) ) THEN           ! first level  
    304                      ze3t_f = ze3t_f - zfact2 * ( (emp_b(ji,jj)    - emp(ji,jj)   )  & 
    305                             &                   + (fwfisf_b(ji,jj) - fwfisf(ji,jj))  ) 
     304                     ze3t_f = ze3t_f - zfact2 * ( emp_b(ji,jj)    - emp(ji,jj) ) 
    306305                     ztc_f  = ztc_f  - zfact1 * ( psbc_tc(ji,jj,jn) - psbc_tc_b(ji,jj,jn) ) 
    307306                  ENDIF 
    308307                  IF( ln_rnf_depth ) THEN 
    309308                     ! Rivers are not just at the surface must go down to nk_rnf(ji,jj) 
    310                      IF( mikt(ji,jj) <=jk .and. jk <= nk_rnf(ji,jj)  ) THEN 
     309                     IF( jk <= nk_rnf(ji,jj)  ) THEN 
    311310                        ze3t_f = ze3t_f - zfact2 * ( - (rnf_b(ji,jj) - rnf(ji,jj)   )  ) & 
    312311                    &                            * ( e3t(ji,jj,jk,Kmm) / h_rnf(ji,jj) )  
    313312                     ENDIF 
    314313                  ELSE 
    315                      IF( jk == mikt(ji,jj) ) THEN           ! first level  
     314                     IF( jk == 1 ) THEN           ! first level  
    316315                        ze3t_f = ze3t_f - zfact2 * ( - (rnf_b(ji,jj)    - rnf(ji,jj)   ) )  
    317316                     ENDIF 
    318317                  ENDIF 
     318                  ! 
     319                  IF( ll_rnf .AND. jk <= nk_rnf(ji,jj) )                                          & 
     320                     &     ztc_f  = ztc_f  - zfact1 * ( rnf_tsc(ji,jj,jn) - rnf_tsc_b(ji,jj,jn) ) &  
     321                     &                              * e3t(ji,jj,jk,Kmm) / h_rnf(ji,jj) 
    319322 
    320323                  ! 
     
    323326                     &     ztc_f  = ztc_f  - zfact1 * ( qsr_hc(ji,jj,jk) - qsr_hc_b(ji,jj,jk) )  
    324327                     ! 
    325                   ! river runoff 
    326                   IF( ll_rnf .AND. jk <= nk_rnf(ji,jj) )                                          & 
    327                      &     ztc_f  = ztc_f  - zfact1 * ( rnf_tsc(ji,jj,jn) - rnf_tsc_b(ji,jj,jn) ) &  
    328                      &                              * e3t(ji,jj,jk,Kmm) / h_rnf(ji,jj) 
    329                      ! 
     328                  ! 
    330329                  ! ice shelf 
    331330                  IF( ll_isf ) THEN 
    332                      ! level fully include in the Losch_2008 ice shelf boundary layer 
    333                      IF ( jk >= misfkt(ji,jj) .AND. jk < misfkb(ji,jj) )                          & 
    334                         ztc_f  = ztc_f  - zfact1 * ( risf_tsc(ji,jj,jn) - risf_tsc_b(ji,jj,jn) )  & 
    335                                &                 * e3t(ji,jj,jk,Kmm) * r1_hisf_tbl (ji,jj) 
    336                      ! level partially include in Losch_2008 ice shelf boundary layer  
    337                      IF ( jk == misfkb(ji,jj) )                                                   & 
    338                         ztc_f  = ztc_f  - zfact1 * ( risf_tsc(ji,jj,jn) - risf_tsc_b(ji,jj,jn) )  & 
    339                                &                 * e3t(ji,jj,jk,Kmm) * r1_hisf_tbl (ji,jj) * ralpha(ji,jj) 
     331                     ! 
     332                     ! melt in the cavity 
     333                     IF ( ln_isfcav_mlt ) THEN 
     334                        ! level fully include in the Losch_2008 ice shelf boundary layer 
     335                        IF ( jk >= misfkt_cav(ji,jj) .AND. jk < misfkb_cav(ji,jj) ) THEN 
     336                           ztc_f  = ztc_f  - zfact1 * ( risf_cav_tsc(ji,jj,jn) - risf_cav_tsc_b(ji,jj,jn) ) & 
     337                              &                     * e3t(ji,jj,jk,Kmm) / rhisf_tbl_cav(ji,jj) 
     338                           ze3t_f = ze3t_f - zfact2 * ( fwfisf_cav_b(ji,jj) - fwfisf_cav(ji,jj) )           & 
     339                              &                     * e3t(ji,jj,jk,Kmm) / rhisf_tbl_cav(ji,jj) 
     340                        END IF 
     341                        ! level partially include in Losch_2008 ice shelf boundary layer  
     342                        IF ( jk == misfkb_cav(ji,jj) ) THEN 
     343                           ztc_f  = ztc_f  - zfact1 * ( risf_cav_tsc(ji,jj,jn) - risf_cav_tsc_b(ji,jj,jn) )  & 
     344                                  &                 * e3t(ji,jj,jk,Kmm) / rhisf_tbl_cav(ji,jj) * rfrac_tbl_cav(ji,jj) 
     345                           ze3t_f = ze3t_f - zfact2 * ( fwfisf_cav_b(ji,jj) - fwfisf_cav(ji,jj) )            & 
     346                              &                     * e3t(ji,jj,jk,Kmm) / rhisf_tbl_cav(ji,jj) * rfrac_tbl_cav(ji,jj) 
     347                        END IF 
     348                     END IF 
     349                     ! 
     350                     ! parametrised melt (cavity closed) 
     351                     IF ( ln_isfpar_mlt ) THEN 
     352                        ! level fully include in the Losch_2008 ice shelf boundary layer 
     353                        IF ( jk >= misfkt_par(ji,jj) .AND. jk < misfkb_par(ji,jj) ) THEN 
     354                           ztc_f  = ztc_f  - zfact1 * ( risf_par_tsc(ji,jj,jn) - risf_par_tsc_b(ji,jj,jn) )  & 
     355                                  &                 * e3t(ji,jj,jk,Kmm) / rhisf_tbl_par(ji,jj) 
     356                           ze3t_f = ze3t_f - zfact2 * ( fwfisf_par_b(ji,jj) - fwfisf_par(ji,jj) )            & 
     357                              &                     * e3t(ji,jj,jk,Kmm) / rhisf_tbl_par(ji,jj) 
     358                        END IF 
     359                        ! level partially include in Losch_2008 ice shelf boundary layer  
     360                        IF ( jk == misfkb_par(ji,jj) ) THEN 
     361                           ztc_f  = ztc_f  - zfact1 * ( risf_par_tsc(ji,jj,jn) - risf_par_tsc_b(ji,jj,jn) )  & 
     362                                  &                 * e3t(ji,jj,jk,Kmm) / rhisf_tbl_par(ji,jj) * rfrac_tbl_par(ji,jj) 
     363                           ze3t_f = ze3t_f - zfact2 * ( fwfisf_par_b(ji,jj) - fwfisf_par(ji,jj) )            & 
     364                              &                     * e3t(ji,jj,jk,Kmm) / rhisf_tbl_par(ji,jj) * rfrac_tbl_par(ji,jj) 
     365                        END IF 
     366                     END IF 
     367                     ! 
     368                     ! ice sheet coupling correction 
     369                     IF ( ln_isfcpl ) THEN 
     370                        ! 
     371                        ! at kt = nit000,  risfcpl_vol_n = 0 and risfcpl_vol_b = risfcpl_vol so contribution nul 
     372                        IF ( ln_rstart .AND. kt == nit000+1 ) THEN 
     373                           ztc_f  = ztc_f  + zfact1 * risfcpl_tsc(ji,jj,jk,jn) * r1_e1e2t(ji,jj) 
     374                           ze3t_f = ze3t_f - zfact1 * risfcpl_vol(ji,jj,jk   ) * r1_e1e2t(ji,jj) 
     375                        END IF 
     376                        ! 
     377                     END IF 
     378                     ! 
    340379                  END IF 
    341380                  ! 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/TRA/trasbc.F90

    r11949 r12150  
    1010   !!             -   !  2010-09  (C. Ethe, G. Madec) Merge TRA-TRC 
    1111   !!            3.6  !  2014-11  (P. Mathiot) isf melting forcing  
     12   !!            4.1  !  2019-09  (P. Mathiot) isf moved in traisf 
    1213   !!---------------------------------------------------------------------- 
    1314 
     
    2223   USE sbcmod         ! ln_rnf   
    2324   USE sbcrnf         ! River runoff   
    24    USE sbcisf         ! Ice shelf    
    25    USE iscplini       ! Ice sheet coupling 
    2625   USE traqsr         ! solar radiation penetration 
    2726   USE trd_oce        ! trends: ocean variables 
     
    6261      !!      (1) Fext, external forcing (i.e. flux through the (air+ice)-sea interface);  
    6362      !!      (2) Fwe , tracer carried with the water that is exchanged with air+ice.  
    64       !!               The input forcing fields (emp, rnf, sfx, isf) contain Fext+Fwe, 
     63      !!               The input forcing fields (emp, rnf, sfx) contain Fext+Fwe, 
    6564      !!             they are simply added to the tracer trend (ts(Krhs)). 
    6665      !!               In linear free surface case (ln_linssh=T), the volume of the 
     
    155154         IF( lwxios ) CALL iom_swap(      cxios_context          ) 
    156155      ENDIF 
    157       ! 
    158       !---------------------------------------- 
    159       !       Ice Shelf effects (ISF) 
    160       !     tbl treated as in Losh (2008) JGR 
    161       !---------------------------------------- 
    162       ! 
    163 !!gm BUG ?   Why no differences between non-linear and linear free surface ? 
    164 !!gm         probably taken into account in r1_hisf_tbl : to be verified 
    165       IF( ln_isf ) THEN 
    166          zfact = 0.5_wp 
    167          DO jj = 2, jpj 
    168             DO ji = fs_2, fs_jpim1 
    169                ! 
    170                ikt = misfkt(ji,jj) 
    171                ikb = misfkb(ji,jj) 
    172                ! 
    173                ! level fully include in the ice shelf boundary layer 
    174                ! sign - because fwf sign of evapo (rnf sign of precip) 
    175                DO jk = ikt, ikb - 1 
    176                ! compute trend 
    177                   pts(ji,jj,jk,jp_tem,Krhs) = pts(ji,jj,jk,jp_tem,Krhs)                                      & 
    178                      &                      + zfact * ( risf_tsc_b(ji,jj,jp_tem) + risf_tsc(ji,jj,jp_tem) )  & 
    179                      &                      * r1_hisf_tbl(ji,jj) 
    180                END DO 
    181     
    182                ! level partially include in ice shelf boundary layer  
    183                ! compute trend 
    184                pts(ji,jj,ikb,jp_tem,Krhs) = pts(ji,jj,ikb,jp_tem,Krhs)                                       & 
    185                   &                       + zfact * ( risf_tsc_b(ji,jj,jp_tem) + risf_tsc(ji,jj,jp_tem) )    & 
    186                   &                       * r1_hisf_tbl(ji,jj) * ralpha(ji,jj) 
    187  
    188             END DO 
    189          END DO 
    190       END IF 
    191156      ! 
    192157      !---------------------------------------- 
     
    244209#endif 
    245210      ! 
    246       !---------------------------------------- 
    247       !        Ice Sheet coupling imbalance correction to have conservation 
    248       !---------------------------------------- 
    249       ! 
    250       IF( ln_iscpl .AND. ln_hsb) THEN         ! input of heat and salt due to river runoff  
    251          DO jk = 1,jpk 
    252             DO jj = 2, jpj  
    253                DO ji = fs_2, fs_jpim1 
    254                   zdep = 1._wp / e3t(ji,jj,jk,Kmm)  
    255                   pts(ji,jj,jk,jp_tem,Krhs) = pts(ji,jj,jk,jp_tem,Krhs) - htsc_iscpl(ji,jj,jk,jp_tem) * zdep 
    256                   pts(ji,jj,jk,jp_sal,Krhs) = pts(ji,jj,jk,jp_sal,Krhs) - htsc_iscpl(ji,jj,jk,jp_sal) * zdep   
    257                END DO   
    258             END DO   
    259          END DO 
    260       ENDIF 
    261  
    262211      IF( l_trdtra )   THEN                      ! save the horizontal diffusive trends for further diagnostics 
    263212         ztrdt(:,:,:) = pts(:,:,:,jp_tem,Krhs) - ztrdt(:,:,:) 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/ZDF/zdfmxl.F90

    r11949 r12150  
    1212   !!---------------------------------------------------------------------- 
    1313   USE oce            ! ocean dynamics and tracers variables 
     14   USE isf_oce        ! ice shelf 
    1415   USE dom_oce        ! ocean space and time domain variables 
    1516   USE trc_oce  , ONLY: l_offline         ! ocean space and time domain variables 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/nemogcm.F90

    r11960 r12150  
    6161   USE diaharm        ! tidal harmonics diagnostics  (dia_harm_init routine) 
    6262   USE step           ! NEMO time-stepping                 (stp     routine) 
     63   USE isfstp         ! ice shelf                     (isf_stp_init routine) 
    6364   USE icbini         ! handle bergs, initialisation 
    6465   USE icbstp         ! handle bergs, calving, themodynamics and transport 
     
    432433         RETURN                                       ! end of initialization 
    433434      ENDIF 
     435      ! 
    434436       
    435437                           CALL  istate_init( Nbb, Nnn, Naa )    ! ocean initial state (Dynamics and tracers) 
     
    472474      !                                      ! Icebergs 
    473475                           CALL icb_init( rdt, nit000)   ! initialise icebergs instance 
     476 
     477                                                ! ice shelf 
     478                           CALL isf_init( Nbb, Nnn, Naa ) 
    474479 
    475480      !                                      ! Misc. options 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/par_oce.F90

    r11949 r12150  
    2727   !                                   !  with the extended grids used in the under ice shelf configurations to  
    2828   !                                   !  be used without redundant rows when the ice shelves are not in use. 
     29   LOGICAL       ::   ln_closea        !: (=T) special treatment of closed sea 
    2930   !  
    3031 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/step.F90

    r11949 r12150  
    115115 
    116116      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    117       ! Update external forcing (tides, open boundaries, and surface boundary condition (including sea-ice) 
     117      ! Update external forcing (tides, open boundaries, ice shelf interaction and surface boundary condition (including sea-ice) 
    118118      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    119119      IF( ln_tide    )   CALL sbc_tide( kstp )                        ! update tide potential 
    120120      IF( ln_apr_dyn )   CALL sbc_apr ( kstp )                        ! atmospheric pressure (NB: call before bdy_dta which needs ssh_ib)  
    121121      IF( ln_bdy     )   CALL bdy_dta ( kstp, Nnn, kt_offset = +1 )   ! update dynamic & tracer data at open boundaries 
     122      IF( ln_isf     )   CALL isf_stp ( kstp, Nnn ) 
    122123                         CALL sbc     ( kstp, Nbb, Nnn )              ! Sea Boundary Condition (including sea-ice) 
    123124 
     
    237238                         CALL tra_sbc    ( kstp,      Nnn, ts, Nrhs )  ! surface boundary condition 
    238239      IF( ln_traqsr  )   CALL tra_qsr    ( kstp,      Nnn, ts, Nrhs )  ! penetrative solar radiation qsr 
     240      IF( ln_isf     )   CALL tra_isf    ( kstp,      Nnn, ts, Nrhs )  ! ice shelf heat flux 
    239241      IF( ln_trabbc  )   CALL tra_bbc    ( kstp,      Nnn, ts, Nrhs )  ! bottom heat flux 
    240242      IF( ln_trabbl  )   CALL tra_bbl    ( kstp, Nbb, Nnn, ts, Nrhs )  ! advective (and/or diffusive) bottom boundary layer scheme 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/step_oce.F90

    r11949 r12150  
    2222   USE sbcwave         ! Wave intialisation 
    2323 
     24   USE isf_oce         ! ice shelf boundary condition 
     25   USE isfstp          ! ice shelf boundary condition     (isf_stp routine) 
     26 
    2427   USE traqsr          ! solar radiation penetration      (tra_qsr routine) 
     28   USE traisf          ! ice shelf                        (tra_isf routine) 
    2529   USE trasbc          ! surface boundary condition       (tra_sbc routine) 
    2630   USE trabbc          ! bottom boundary condition        (tra_bbc routine) 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/tests/ICE_AGRIF/EXPREF/file_def_nemo-ice.xml

    r11159 r12150  
    2626        <field field_ref="icevolu"          name="sivolu" /> 
    2727        <field field_ref="iceconc"          name="siconc" /> 
    28         <field field_ref="icesalt"          name="sisali" /> 
    2928        <field field_ref="iceapnd"          name="siapnd" /> 
    3029        <field field_ref="icevpnd"          name="sivpnd" /> 
    3130        <field field_ref="sst_m"            name="sst_m"  /> 
    3231        <field field_ref="sss_m"            name="sss_m"  /> 
    33  
    34         <!-- heat --> 
    35         <field field_ref="icetemp"          name="sitemp" /> 
    36         <field field_ref="icettop"          name="sittop" /> 
    37         <field field_ref="icetbot"          name="sitbot" /> 
    38         <field field_ref="icetsni"          name="sitsni" /> 
    3932 
    4033        <!-- momentum --> 
     
    8174        <!-- categories --> 
    8275        <field field_ref="icemask_cat"      name="simskcat"/> 
    83         <field field_ref="snwthic_cat"      name="snthicat"/> 
    8476        <field field_ref="iceconc_cat"      name="siconcat"/> 
    85         <field field_ref="icethic_cat"      name="sithicat"/> 
    86         <field field_ref="icesalt_cat"      name="sisalcat"/> 
    87         <field field_ref="icetemp_cat"      name="sitemcat"/> 
    8877 
    8978        </file> 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/tests/ISOMIP/EXPREF/file_def_nemo-oce.xml

    r9572 r12150  
    2727     <field field_ref="ssh"          name="sossheig"  /> 
    2828          <!-- variable for ice shelf --> 
    29           <field field_ref="qlatisf"      name="sohflisf"  /> 
    30           <field field_ref="fwfisf"       name="sowflisf"  /> 
     29          <field field_ref="fwfisf_cav"       name="sowflisf"  /> 
    3130          <field field_ref="isfgammat"    name="sogammat"  /> 
    3231          <field field_ref="isfgammas"    name="sogammas"  /> 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/tests/ISOMIP/EXPREF/namelist_cfg

    r11536 r12150  
    4646   rn_rdt      = 1800.     !  time step for the dynamics (and tracer if nn_acc=0) 
    4747/ 
     48!----------------------------------------------------------------------- 
     49&namcfg        !   parameters of the configuration                      (default: use namusr_def in namelist_cfg) 
     50!----------------------------------------------------------------------- 
     51/ 
     52!----------------------------------------------------------------------- 
     53&namtsd        !    Temperature & Salinity Data  (init/dmp)             (default: OFF) 
     54!----------------------------------------------------------------------- 
     55    
     56/ 
     57!----------------------------------------------------------------------- 
     58&namwad        !   Wetting and Drying (WaD)                             (default: OFF) 
     59!----------------------------------------------------------------------- 
     60/ 
     61!----------------------------------------------------------------------- 
     62&namcrs        !   coarsened grid (for outputs and/or TOP)              (ln_crs =T) 
     63!----------------------------------------------------------------------- 
     64/ 
     65!----------------------------------------------------------------------- 
     66&namc1d        !   1D configuration options                             ("key_c1d" default: PAPA station) 
     67!----------------------------------------------------------------------- 
     68/ 
     69!----------------------------------------------------------------------- 
     70&namc1d_dyndmp !   U & V newtonian damping                              ("key_c1d" default: OFF) 
     71!----------------------------------------------------------------------- 
     72/ 
     73!----------------------------------------------------------------------- 
     74&namc1d_uvd    !   data: U & V currents                                 ("key_c1d" default: OFF) 
     75!----------------------------------------------------------------------- 
     76 
     77/ 
     78 
    4879!!====================================================================== 
    4980!!            ***  Surface Boundary Condition namelists  ***          !! 
     
    5990!!   namsbc_rnf      river runoffs                                      (ln_rnf     =T) 
    6091!!   namsbc_apr      Atmospheric Pressure                               (ln_apr_dyn =T) 
    61 !!   namsbc_isf      ice shelf melting/freezing                         (ln_isfcav  =T : read (ln_read_cfg=T) or set or usr_def_zgr ) 
    62 !!   namsbc_iscpl    coupling option between land ice model and ocean   (ln_isfcav  =T) 
    6392!!   namsbc_wave     external fields from wave model                    (ln_wave    =T) 
    6493!!   namberg         iceberg floats                                     (ln_icebergs=T) 
     
    6695! 
    6796!----------------------------------------------------------------------- 
    68 &namsbc        !   Surface Boundary Condition (surface module) 
    69 !----------------------------------------------------------------------- 
    70    nn_fsbc     = 1         !  frequency of surface boundary condition computation 
     97&namsbc        !   Surface Boundary Condition manager                   (default: NO selection) 
     98!----------------------------------------------------------------------- 
     99   nn_fsbc     = 1         !  frequency of SBC module call 
     100      !                    !  (control sea-ice & iceberg model call) 
    71101   ln_usr      = .true.    !  user defined formulation                  (T => check usrdef_sbc) 
    72    ln_isf      = .true.    !  ice shelf melting/freezing                (T => fill namsbc_isf) 
    73 / 
    74 !----------------------------------------------------------------------- 
    75 &namsbc_isf    !  Top boundary layer (ISF)                              (ln_isfcav =T : read (ln_read_cfg=T)  
    76 !-----------------------------------------------------------------------             or set or usr_def_zgr ) 
    77 !              ! file name ! frequency (hours) ! variable ! time interpol. !  clim   ! 'yearly'/ ! weights  ! rotation ! land/sea mask ! 
    78 !              !           !  (if <0  months)  !   name   !    (logical)   !  (T/F)  ! 'monthly' ! filename ! pairing  ! filename      ! 
    79 ! nn_isf == 4 
    80    sn_fwfisf   = 'rnfisf'  ,         -12.      ,'sowflisf',     .false.    , .true.  , 'yearly'  ,  ''      ,   ''     , '' 
    81 ! nn_isf == 3 
    82    sn_rnfisf   = 'rnfisf'  ,         -12.      ,'sofwfisf',     .false.    , .true.  , 'yearly'  ,  ''      ,   ''     , '' 
    83 ! nn_isf == 2 and 3 
    84    sn_depmax_isf = 'rnfisf' ,        -12.      ,'sozisfmax' ,   .false.    , .true.  , 'yearly'  ,  ''      ,   ''     , '' 
    85    sn_depmin_isf = 'rnfisf' ,        -12.      ,'sozisfmin' ,   .false.    , .true.  , 'yearly'  ,  ''      ,   ''     , '' 
    86 ! nn_isf == 2 
    87    sn_Leff_isf = 'rnfisf'  ,         -12.      ,'Leff'    ,     .false.    , .true.  , 'yearly'  ,  ''      ,   ''     , '' 
    88 ! for all case 
    89    nn_isf      = 1         !  ice shelf melting/freezing 
    90                            !  1 = presence of ISF    2 = bg03 parametrisation  
    91                            !  3 = rnf file for isf   4 = ISF fwf specified 
    92                            !  option 1 and 4 need ln_isfcav = .true. (domzgr) 
    93 ! only for nn_isf = 1 or 2 
    94    rn_gammat0  = 1.0e-4   ! gammat coefficient used in blk formula 
    95    rn_gammas0  = 1.0e-4   ! gammas coefficient used in blk formula 
    96 ! only for nn_isf = 1 or 4 
    97    rn_hisf_tbl =  30.      ! thickness of the top boundary layer    (Losh et al. 2008) 
    98                           ! 0 => thickness of the tbl = thickness of the first wet cell 
    99 ! only for nn_isf = 1 
    100    nn_isfblk   = 1        ! 1 ISOMIP  like: 2 equations formulation (Hunter et al., 2006) 
    101                           ! 2 ISOMIP+ like: 3 equations formulation (Asay-Davis et al., 2015) 
    102    nn_gammablk = 0        ! 0 = cst Gammat (= gammat/s) 
    103                           ! 1 = velocity dependend Gamma (u* * gammat/s)  (Jenkins et al. 2010) 
    104                           ! 2 = velocity and stability dependent Gamma    (Holland et al. 1999) 
    105 / 
    106 !----------------------------------------------------------------------- 
    107 &namsbc_iscpl  !   land ice / ocean coupling option                      
    108 !----------------------------------------------------------------------- 
    109 / 
     102/ 
     103!----------------------------------------------------------------------- 
     104&namsbc_flx    !   surface boundary condition : flux formulation        (ln_flx =T) 
     105!----------------------------------------------------------------------- 
     106/ 
     107!----------------------------------------------------------------------- 
     108&namsbc_blk    !   namsbc_blk  generic Bulk formula                     (ln_blk =T) 
     109!----------------------------------------------------------------------- 
     110 
     111/ 
     112!----------------------------------------------------------------------- 
     113&namsbc_cpl    !   coupled ocean/atmosphere model                       ("key_oasis3") 
     114!----------------------------------------------------------------------- 
     115 
     116/ 
     117!----------------------------------------------------------------------- 
     118&namsbc_sas    !   Stand-Alone Surface module: ocean data               (SAS_SRC  only) 
     119!----------------------------------------------------------------------- 
     120 
     121/ 
     122!----------------------------------------------------------------------- 
     123&namsbc_iif    !   Ice-IF : use observed ice cover                      (nn_ice = 1) 
     124!----------------------------------------------------------------------- 
     125/ 
     126!----------------------------------------------------------------------- 
     127&namtra_qsr    !   penetrative solar radiation                          (ln_traqsr =T) 
     128!----------------------------------------------------------------------- 
     129    
     130/ 
     131!----------------------------------------------------------------------- 
     132&namsbc_ssr    !   surface boundary condition : sea surface restoring   (ln_ssr =T) 
     133!----------------------------------------------------------------------- 
     134 
     135/ 
     136!----------------------------------------------------------------------- 
     137&namsbc_rnf    !   runoffs                                              (ln_rnf =T) 
     138!----------------------------------------------------------------------- 
     139 
     140/ 
     141!----------------------------------------------------------------------- 
     142&namsbc_apr    !   Atmospheric pressure used as ocean forcing           (ln_apr_dyn =T) 
     143!----------------------------------------------------------------------- 
     144 
     145/ 
     146!----------------------------------------------------------------------- 
     147&namisf       !  Top boundary layer (ISF)                               (default: OFF) 
     148!----------------------------------------------------------------------- 
     149   ! 
     150   ! ---------------- ice shelf load ------------------------------- 
     151   ! 
     152   ! 
     153   ! ---------------- ice shelf melt formulation ------------------------------- 
     154   ! 
     155   ln_isf = .true.           ! activate ice shelf module 
     156      cn_isfdir = './'           ! directory for all ice shelf input file 
     157      ! 
     158      ! ---------------- cavities opened ------------------------------- 
     159      ! 
     160      ln_isfcav_mlt = .true.    ! ice shelf melting into the cavity (need ln_isfcav = .true. in domain_cfg.nc) 
     161         cn_isfcav_mlt = '2eq'   ! ice shelf melting formulation (spe/2eq/3eq/oasis) 
     162         !                       ! spe = fwfisf is read from a forcing field 
     163         !                       ! 2eq = ISOMIP  like: 2 equations formulation (Hunter et al., 2006) 
     164         !                       ! 3eq = ISOMIP+ like: 3 equations formulation (Asay-Davis et al., 2015) 
     165         !                       ! oasis = fwfisf is given by oasis and pattern by file sn_isfcav_fwf 
     166         !              !  cn_isfcav_mlt = 2eq or 3eq cases: 
     167         cn_gammablk = 'spe'    ! scheme to compute gammat/s (spe,ad15,hj99) 
     168         !                       ! ad15 = velocity dependend Gamma (u* * gammat/s)  (Jenkins et al. 2010) 
     169         !                       ! hj99 = velocity and stability dependent Gamma    (Holland et al. 1999) 
     170         rn_gammat0  = 1.e-4     ! gammat coefficient used in blk formula 
     171         rn_gammas0  = 1.e-4     ! gammas coefficient used in blk formula 
     172         ! 
     173         rn_htbl     =  30.      ! thickness of the top boundary layer    (Losh et al. 2008) 
     174         !                       ! 0 => thickness of the tbl = thickness of the first wet cell 
     175         ! 
     176/ 
     177!----------------------------------------------------------------------- 
     178&namsbc_wave   ! External fields from wave model                        (ln_wave=T) 
     179!----------------------------------------------------------------------- 
     180/ 
     181!----------------------------------------------------------------------- 
     182&namberg       !   iceberg parameters                                   (default: OFF) 
     183!----------------------------------------------------------------------- 
     184 
     185/ 
     186 
    110187!!====================================================================== 
    111188!!               ***  Lateral boundary condition  ***                 !! 
     
    124201   rn_shlat    =    0.     !  free slip 
    125202/ 
     203!----------------------------------------------------------------------- 
     204&namagrif      !  AGRIF zoom                                            ("key_agrif") 
     205!----------------------------------------------------------------------- 
     206/ 
     207!----------------------------------------------------------------------- 
     208&nam_tide      !   tide parameters                                      (default: OFF) 
     209!----------------------------------------------------------------------- 
     210/ 
     211!----------------------------------------------------------------------- 
     212&nambdy        !  unstructured open boundaries                          (default: OFF) 
     213!----------------------------------------------------------------------- 
     214/ 
     215!----------------------------------------------------------------------- 
     216&nambdy_dta    !  open boundaries - external data                       (see nam_bdy) 
     217!----------------------------------------------------------------------- 
     218 
     219/ 
     220!----------------------------------------------------------------------- 
     221&nambdy_tide   !  tidal forcing at open boundaries                      (default: OFF) 
     222!----------------------------------------------------------------------- 
     223/ 
     224 
    126225!!====================================================================== 
    127226!!                ***  Top/Bottom boundary condition  ***             !! 
     
    145244/ 
    146245!----------------------------------------------------------------------- 
    147 &namdrg_top    !   TOP friction                                         (ln_isfcav=T) 
     246&namdrg_top    !   TOP friction                                         (ln_OFF =F & ln_isfcav=T) 
    148247!----------------------------------------------------------------------- 
    149248   rn_Cd0     =  2.5e-3    !  drag coefficient [-] 
     
    156255/ 
    157256!----------------------------------------------------------------------- 
    158 &namdrg_bot    !   BOTTOM friction                                   
     257&namdrg_bot    !   BOTTOM friction                                      (ln_OFF =F) 
    159258!----------------------------------------------------------------------- 
    160259   rn_Cd0     =  1.e-3    !  drag coefficient [-] 
     
    166265      rn_boost =  50.         !  local boost factor  [-] 
    167266/ 
     267!----------------------------------------------------------------------- 
     268&nambbc        !   bottom temperature boundary condition                (default: OFF) 
     269!----------------------------------------------------------------------- 
     270 
     271/ 
     272!----------------------------------------------------------------------- 
     273&nambbl        !   bottom boundary layer scheme                         (default: OFF) 
     274!----------------------------------------------------------------------- 
     275/ 
     276 
    168277!!====================================================================== 
    169278!!                        Tracer (T-S) namelists                      !! 
     
    178287! 
    179288!----------------------------------------------------------------------- 
    180 &nameos        !   ocean Equation Of Seawater                           (default: OFF) 
     289&nameos        !   ocean Equation Of Seawater                           (default: NO selection) 
    181290!----------------------------------------------------------------------- 
    182291   ln_eos80    = .true.          !  = Use EOS80 equation of state 
     
    199308      rn_Ld        = 10.e+3         !  lateral diffusive length   [m] 
    200309/ 
     310!----------------------------------------------------------------------- 
     311&namtra_mle    !   mixed layer eddy parametrisation (Fox-Kemper)       (default: OFF) 
     312!----------------------------------------------------------------------- 
     313/ 
     314!----------------------------------------------------------------------- 
     315&namtra_eiv    !   eddy induced velocity param.                         (default: OFF) 
     316!----------------------------------------------------------------------- 
     317/ 
     318!----------------------------------------------------------------------- 
     319&namtra_dmp    !   tracer: T & S newtonian damping                      (default: OFF) 
     320!----------------------------------------------------------------------- 
     321/ 
     322 
    201323!!====================================================================== 
    202324!!                      ***  Dynamics namelists  ***                  !! 
     
    212334! 
    213335!----------------------------------------------------------------------- 
     336&nam_vvl       !   vertical coordinate options                          (default: z-star) 
     337!----------------------------------------------------------------------- 
     338/ 
     339!----------------------------------------------------------------------- 
    214340&namdyn_adv    !   formulation of the momentum advection                (default: NO selection) 
    215341!----------------------------------------------------------------------- 
     
    218344/ 
    219345!----------------------------------------------------------------------- 
    220 &namdyn_vor    !   Vorticity / Coriolis scheme                          (default: OFF) 
     346&namdyn_vor    !   Vorticity / Coriolis scheme                          (default: NO selection) 
    221347!----------------------------------------------------------------------- 
    222348   ln_dynvor_ene = .true.  !  energy conserving scheme 
     
    241367      rn_Lv      = 10.e+3           !  lateral viscous length   [m] 
    242368/ 
     369!----------------------------------------------------------------------- 
     370&namdta_dyn    !   offline ocean input files                            (OFF_SRC only) 
     371!----------------------------------------------------------------------- 
     372 
     373/ 
     374 
    243375!!====================================================================== 
    244376!!                     vertical physics namelists                     !! 
     
    253385! 
    254386!----------------------------------------------------------------------- 
    255 &namzdf        !   vertical physics                                     (default: NO selection) 
    256 !----------------------------------------------------------------------- 
    257    !                       ! type of vertical closure 
     387&namzdf        !   vertical physics manager                             (default: NO selection) 
     388!----------------------------------------------------------------------- 
     389   !                       ! type of vertical closure (required) 
    258390   ln_zdfcst   = .true.       !  constant mixing 
     391   ! 
     392   !                       ! convection 
    259393   ln_zdfevd   = .true.       !  enhanced vertical diffusion 
    260       nn_evdm     =    1         ! apply on tracer (=0) or on tracer and momentum (=1) 
    261       rn_evd      =   0.1        ! mixing coefficient [m2/s] 
     394   rn_evd      =  0.1         ! mixing coefficient [m2/s] 
     395   ! 
    262396   !                       ! coefficients 
    263    rn_avm0     =   1.e-3     !  vertical eddy viscosity   [m2/s] 
    264    rn_avt0     =   5.e-5     !  vertical eddy diffusivity [m2/s] 
    265 / 
     397   rn_avm0     =   1.e-3      !  vertical eddy viscosity   [m2/s]       (background Kz if ln_zdfcst) 
     398   rn_avt0     =   5.e-5      !  vertical eddy diffusivity [m2/s]       (background Kz if ln_zdfcst) 
     399/ 
     400!----------------------------------------------------------------------- 
     401&namzdf_ric    !   richardson number dependent vertical diffusion       (ln_zdfric =T) 
     402!----------------------------------------------------------------------- 
     403/ 
     404!----------------------------------------------------------------------- 
     405&namzdf_tke    !   turbulent eddy kinetic dependent vertical diffusion  (ln_zdftke =T) 
     406!----------------------------------------------------------------------- 
     407/ 
     408!----------------------------------------------------------------------- 
     409&namzdf_gls    !   GLS vertical diffusion                               (ln_zdfgls =T) 
     410!----------------------------------------------------------------------- 
     411/ 
     412!----------------------------------------------------------------------- 
     413&namzdf_osm    !   OSM vertical diffusion                               (ln_zdfosm =T) 
     414!----------------------------------------------------------------------- 
     415/ 
     416!----------------------------------------------------------------------- 
     417&namzdf_iwm    !    internal wave-driven mixing parameterization        (ln_zdfiwm =T) 
     418!----------------------------------------------------------------------- 
     419/ 
     420 
    266421!!====================================================================== 
    267422!!                  ***  Diagnostics namelists  ***                   !! 
     
    280435!!====================================================================== 
    281436! 
     437!----------------------------------------------------------------------- 
     438&namtrd        !   trend diagnostics                                    (default: OFF) 
     439!----------------------------------------------------------------------- 
     440/ 
     441!----------------------------------------------------------------------- 
     442&namptr        !   Poleward Transport Diagnostic                        (default: OFF) 
     443!----------------------------------------------------------------------- 
     444/ 
     445!----------------------------------------------------------------------- 
     446&namhsb        !  Heat and salt budgets                                 (default: OFF) 
     447!----------------------------------------------------------------------- 
     448/ 
     449!----------------------------------------------------------------------- 
     450&namdiu        !   Cool skin and warm layer models                      (default: OFF) 
     451!----------------------------------------------------------------------- 
     452/ 
     453!----------------------------------------------------------------------- 
     454&namflo        !   float parameters                                     ("key_float") 
     455!----------------------------------------------------------------------- 
     456/ 
     457!----------------------------------------------------------------------- 
     458&nam_diaharm   !   Harmonic analysis of tidal constituents              ("key_diaharm") 
     459!----------------------------------------------------------------------- 
     460/ 
     461!----------------------------------------------------------------------- 
     462&namdct        ! transports through some sections                       ("key_diadct") 
     463!----------------------------------------------------------------------- 
     464/ 
     465!----------------------------------------------------------------------- 
     466&nam_diatmb    !  Top Middle Bottom Output                              (default: OFF) 
     467!----------------------------------------------------------------------- 
     468/ 
     469!----------------------------------------------------------------------- 
     470&nam_dia25h    !  25h Mean Output                                       (default: OFF) 
     471!----------------------------------------------------------------------- 
     472/ 
     473!----------------------------------------------------------------------- 
     474&namnc4        !   netcdf4 chunking and compression settings            ("key_netcdf4") 
     475!----------------------------------------------------------------------- 
     476/ 
     477 
    282478!!====================================================================== 
    283479!!               ***  Observation & Assimilation  ***                 !! 
     
    287483!!====================================================================== 
    288484! 
     485!----------------------------------------------------------------------- 
     486&namobs        !  observation usage switch                              (default: OFF) 
     487!----------------------------------------------------------------------- 
     488/ 
     489!----------------------------------------------------------------------- 
     490&nam_asminc    !   assimilation increments                              ('key_asminc') 
     491!----------------------------------------------------------------------- 
     492/ 
     493 
    289494!!====================================================================== 
    290495!!                  ***  Miscellaneous namelists  ***                 !! 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/tests/LOCK_EXCHANGE/EXPREF/namelist_FCT2_flux_cen2_cfg

    r10075 r12150  
    3232!----------------------------------------------------------------------- 
    3333   ln_linssh   = .false.   !  =T  linear free surface  ==>>  model level are fixed in time 
    34    ! 
    35    rn_isfhmin  =    0.00   !  treshold (m) to discriminate grounding ice to floating ice 
    3634   ! 
    3735   rn_rdt      =    1.     !  time step for the dynamics (and tracer if nn_acc=0) 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/tests/LOCK_EXCHANGE/EXPREF/namelist_FCT2_flux_ubs_cfg

    r11536 r12150  
    4646!----------------------------------------------------------------------- 
    4747   ln_linssh   = .false.   !  =T  linear free surface  ==>>  model level are fixed in time 
    48    ! 
    49    rn_isfhmin  =    0.00   !  treshold (m) to discriminate grounding ice to floating ice 
    5048   ! 
    5149   rn_rdt      =    1.     !  time step for the dynamics (and tracer if nn_acc=0) 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/tests/LOCK_EXCHANGE/EXPREF/namelist_FCT2_vect_eenH_cfg

    r10075 r12150  
    3232!----------------------------------------------------------------------- 
    3333   ln_linssh   = .false.   !  =T  linear free surface  ==>>  model level are fixed in time 
    34    ! 
    35    rn_isfhmin  =    0.00   !  treshold (m) to discriminate grounding ice to floating ice 
    3634   ! 
    3735   rn_rdt      =    1.     !  time step for the dynamics (and tracer if nn_acc=0) 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/tests/LOCK_EXCHANGE/EXPREF/namelist_FCT2_vect_een_cfg

    r10075 r12150  
    3232!----------------------------------------------------------------------- 
    3333   ln_linssh   = .false.   !  =T  linear free surface  ==>>  model level are fixed in time 
    34    ! 
    35    rn_isfhmin  =    0.00   !  treshold (m) to discriminate grounding ice to floating ice 
    3634   ! 
    3735   rn_rdt      =    1.     !  time step for the dynamics (and tracer if nn_acc=0) 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/tests/LOCK_EXCHANGE/EXPREF/namelist_FCT2_vect_ene_cfg

    r10075 r12150  
    3232!----------------------------------------------------------------------- 
    3333   ln_linssh   = .false.   !  =T  linear free surface  ==>>  model level are fixed in time 
    34    ! 
    35    rn_isfhmin  =    0.00   !  treshold (m) to discriminate grounding ice to floating ice 
    3634   ! 
    3735   rn_rdt      =    1.     !  time step for the dynamics (and tracer if nn_acc=0) 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/tests/LOCK_EXCHANGE/EXPREF/namelist_FCT2_vect_ens_cfg

    r10075 r12150  
    3232!----------------------------------------------------------------------- 
    3333   ln_linssh   = .false.   !  =T  linear free surface  ==>>  model level are fixed in time 
    34    ! 
    35    rn_isfhmin  =    0.00   !  treshold (m) to discriminate grounding ice to floating ice 
    3634   ! 
    3735   rn_rdt      =    1.     !  time step for the dynamics (and tracer if nn_acc=0) 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/tests/LOCK_EXCHANGE/EXPREF/namelist_FCT4_flux_cen2_cfg

    r10075 r12150  
    3232!----------------------------------------------------------------------- 
    3333   ln_linssh   = .false.   !  =T  linear free surface  ==>>  model level are fixed in time 
    34    ! 
    35    rn_isfhmin  =    0.00   !  treshold (m) to discriminate grounding ice to floating ice 
    3634   ! 
    3735   rn_rdt      =    1.     !  time step for the dynamics (and tracer if nn_acc=0) 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/tests/LOCK_EXCHANGE/EXPREF/namelist_FCT4_flux_ubs_cfg

    r10075 r12150  
    3232!----------------------------------------------------------------------- 
    3333   ln_linssh   = .false.   !  =T  linear free surface  ==>>  model level are fixed in time 
    34    ! 
    35    rn_isfhmin  =    0.00   !  treshold (m) to discriminate grounding ice to floating ice 
    3634   ! 
    3735   rn_rdt      =    1.     !  time step for the dynamics (and tracer if nn_acc=0) 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/tests/LOCK_EXCHANGE/EXPREF/namelist_FCT4_vect_eenH_cfg

    r10075 r12150  
    3232!----------------------------------------------------------------------- 
    3333   ln_linssh   = .false.   !  =T  linear free surface  ==>>  model level are fixed in time 
    34    ! 
    35    rn_isfhmin  =    0.00   !  treshold (m) to discriminate grounding ice to floating ice 
    3634   ! 
    3735   rn_rdt      =    1.     !  time step for the dynamics (and tracer if nn_acc=0) 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/tests/LOCK_EXCHANGE/EXPREF/namelist_FCT4_vect_een_cfg

    r10075 r12150  
    3232!----------------------------------------------------------------------- 
    3333   ln_linssh   = .false.   !  =T  linear free surface  ==>>  model level are fixed in time 
    34    ! 
    35    rn_isfhmin  =    0.00   !  treshold (m) to discriminate grounding ice to floating ice 
    3634   ! 
    3735   rn_rdt      =    1.     !  time step for the dynamics (and tracer if nn_acc=0) 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/tests/LOCK_EXCHANGE/EXPREF/namelist_FCT4_vect_ene_cfg

    r10075 r12150  
    3232!----------------------------------------------------------------------- 
    3333   ln_linssh   = .false.   !  =T  linear free surface  ==>>  model level are fixed in time 
    34    ! 
    35    rn_isfhmin  =    0.00   !  treshold (m) to discriminate grounding ice to floating ice 
    3634   ! 
    3735   rn_rdt      =    1.     !  time step for the dynamics (and tracer if nn_acc=0) 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/tests/LOCK_EXCHANGE/EXPREF/namelist_FCT4_vect_ens_cfg

    r10075 r12150  
    3232!----------------------------------------------------------------------- 
    3333   ln_linssh   = .false.   !  =T  linear free surface  ==>>  model level are fixed in time 
    34    ! 
    35    rn_isfhmin  =    0.00   !  treshold (m) to discriminate grounding ice to floating ice 
    3634   ! 
    3735   rn_rdt      =    1.     !  time step for the dynamics (and tracer if nn_acc=0) 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/tests/VORTEX/MY_SRC/domvvl.F90

    r11960 r12150  
    3737 
    3838   PUBLIC  dom_vvl_init       ! called by domain.F90 
     39   PUBLIC  dom_vvl_zgr        ! called by isfcpl.F90 
    3940   PUBLIC  dom_vvl_sf_nxt     ! called by step.F90 
    4041   PUBLIC  dom_vvl_sf_update  ! called by step.F90 
     
    118119      INTEGER, INTENT(in) :: Kbb, Kmm, Kaa 
    119120      ! 
     121      IF(lwp) WRITE(numout,*) 
     122      IF(lwp) WRITE(numout,*) 'dom_vvl_init : Variable volume activated' 
     123      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~' 
     124      ! 
     125      CALL dom_vvl_ctl     ! choose vertical coordinate (z_star, z_tilde or layer) 
     126      ! 
     127      !                    ! Allocate module arrays 
     128      IF( dom_vvl_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'dom_vvl_init : unable to allocate arrays' ) 
     129      ! 
     130      !                    ! Read or initialize e3t_(b/n), tilde_e3t_(b/n) and hdiv_lf 
     131      CALL dom_vvl_rst( nit000, Kbb, Kmm, 'READ' ) 
     132      e3t(:,:,jpk,Kaa) = e3t_0(:,:,jpk)  ! last level always inside the sea floor set one for all 
     133      ! 
     134      CALL dom_vvl_zgr(Kbb, Kmm, Kaa) ! interpolation scale factor, depth and water column 
     135      ! 
     136   END SUBROUTINE dom_vvl_init 
     137   ! 
     138   SUBROUTINE dom_vvl_zgr(Kbb, Kmm, Kaa) 
     139      !!---------------------------------------------------------------------- 
     140      !!                ***  ROUTINE dom_vvl_init  *** 
     141      !!                    
     142      !! ** Purpose :  Interpolation of all scale factors,  
     143      !!               depths and water column heights 
     144      !! 
     145      !! ** Method  :  - interpolate scale factors 
     146      !! 
     147      !! ** Action  : - e3t_(n/b) and tilde_e3t_(n/b) 
     148      !!              - Regrid: e3(u/v)_n 
     149      !!                        e3(u/v)_b        
     150      !!                        e3w_n            
     151      !!                        e3(u/v)w_b       
     152      !!                        e3(u/v)w_n       
     153      !!                        gdept_n, gdepw_n and gde3w_n 
     154      !!              - h(t/u/v)_0 
     155      !!              - frq_rst_e3t and frq_rst_hdv 
     156      !! 
     157      !! Reference  : Leclair, M., and G. Madec, 2011, Ocean Modelling. 
     158      !!---------------------------------------------------------------------- 
     159      INTEGER, INTENT(in) :: Kbb, Kmm, Kaa 
     160      !!---------------------------------------------------------------------- 
    120161      INTEGER ::   ji, jj, jk 
    121162      INTEGER ::   ii0, ii1, ij0, ij1 
    122163      REAL(wp)::   zcoef 
    123164      !!---------------------------------------------------------------------- 
    124       ! 
    125       IF(lwp) WRITE(numout,*) 
    126       IF(lwp) WRITE(numout,*) 'dom_vvl_init : Variable volume activated' 
    127       IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~' 
    128       ! 
    129       CALL dom_vvl_ctl     ! choose vertical coordinate (z_star, z_tilde or layer) 
    130       ! 
    131       !                    ! Allocate module arrays 
    132       IF( dom_vvl_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'dom_vvl_init : unable to allocate arrays' ) 
    133       ! 
    134       !                    ! Read or initialize e3t_(b/n), tilde_e3t_(b/n) and hdiv_lf 
    135       CALL dom_vvl_rst( nit000, Kbb, Kmm, 'READ' ) 
    136       e3t(:,:,jpk,Kaa) = e3t_0(:,:,jpk)  ! last level always inside the sea floor set one for all 
    137165      ! 
    138166      !                    !== Set of all other vertical scale factors  ==!  (now and before) 
     
    266294      ENDIF 
    267295      ! 
    268    END SUBROUTINE dom_vvl_init 
     296   END SUBROUTINE dom_vvl_zgr 
    269297 
    270298 
     
    10281056      ! 
    10291057      IF( ioptio /= 1 )   CALL ctl_stop( 'Choose ONE vertical coordinate in namelist nam_vvl' ) 
    1030       IF( .NOT. ln_vvl_zstar .AND. ln_isf ) CALL ctl_stop( 'Only vvl_zstar has been tested with ice shelf cavity' ) 
    10311058      ! 
    10321059      IF(lwp) THEN                   ! Print the choice 
  • NEMO/branches/2019/dev_r11943_MERGE_2019/tests/demo_cfgs.txt

    r10516 r12150  
    11CANAL OCE 
    22ISOMIP OCE 
     3ISOMIP+ OCE 
    34LOCK_EXCHANGE OCE 
    45OVERFLOW OCE 
Note: See TracChangeset for help on using the changeset viewer.