# This configuration namelist will overwrite SHARED/namelist_ref
#
if $leg_is_restart
then
    nemo_restart=".TRUE."
else
    nemo_restart=".FALSE."
fi

cat << EOF
!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
!! NEMO/OCE  Configuration namelist : overwrite default values defined in SHARED/namelist_ref
!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
!!             ORCA025 - ICE configuration                            !!
!!======================================================================
!!              ***  Domain & Run management namelists  ***           !!
!!                                                                    !!
!!   namrun       parameters of the run
!!   namdom       space and time domain
!!   namcfg       parameters of the configuration                       (default: user defined GYRE)
!!   namwad       Wetting and drying                                    (default: OFF)
!!   namtsd       data: temperature & salinity                          (default: OFF)
!!   namcrs       coarsened grid (for outputs and/or TOP)               (ln_crs =T)
!!   namc1d       1D configuration options                              (ln_c1d =T)
!!   namc1d_dyndmp 1D newtonian damping applied on currents             (ln_c1d =T)
!!   namc1d_uvd   1D data (currents)                                    (ln_c1d =T)
!!======================================================================
!
!-----------------------------------------------------------------------
&namrun        !   parameters of the run
!-----------------------------------------------------------------------
   cn_exp        =  "${exp_name}" !  experience name
   nn_it000      =  $(( leg_start_sec / nem_time_step_sec + 1 )) !  first time step
   nn_itend      =  $(( leg_end_sec / nem_time_step_sec ))       !  last  time step (std 5475)
   nn_date0      =  ${leg_start_date_yyyymmdd} !  date at nit_0000 (format yyyymmdd)
   ln_rstart     = ${nemo_restart} !  start from rest (F) or from a restart file (T)
   nn_leapy      =  0             !  Leap year calendar (1) or not (0)
   nn_rstctl     =  1             !  restart control ==> activated only if ln_rstart=T
                                  !  = 0 nn_date0 read in namelist ; nn_it000 : read in namelist
                                  !  = 1 nn_date0 read in namelist ; nn_it000 : check consistancy between namelist and restart
                                  !  = 2 nn_date0 read in restart  ; nn_it000 : check consistancy between namelist and restart
   cn_ocerst_in  = "restart_oce"  !  suffix of ocean restart name (input)
   cn_ocerst_indir = "."          !  directory from which to read input ocean restarts
   cn_ocerst_out = "restart_oce"  !  suffix of ocean restart name (output)
   ln_cfmeta   = .true.   !  output additional data to netCDF files required for compliance with the CF metadata standard
/
!-----------------------------------------------------------------------
&namdom        !   time and space domain
!-----------------------------------------------------------------------
   rn_Dt       = ${nem_time_step_sec} !  time step for the dynamics and tracer
   ln_meshmask = .false.   !  =T create a mesh file
/
!-----------------------------------------------------------------------
&namcfg        !   parameters of the configuration                      (default: use namusr_def in namelist_cfg)
!-----------------------------------------------------------------------
   ln_read_cfg = .true.    !  (=T) read the domain configuration file
/
!-----------------------------------------------------------------------
&namtsd        !    Temperature & Salinity Data  (init/dmp)             (default: OFF)
!-----------------------------------------------------------------------
   !                       ! =T  read T-S fields for:
   ln_tsd_init = .true.          !  ocean initialisation
   ln_tsd_dmp  = .false.         !  T-S restoring   (see namtra_dmp)

   cn_dir = './'     !  root directory for the T-S data location
   !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                  ! pairing  !    filename   !
   sn_tem  = 'woce_monthly_init.nc', -1 ,'t_an' , .true. , .true. , 'yearly' , ''  ,   ''    ,    ''
   sn_sal  = 'woce_monthly_init.nc', -1 ,'s_an' , .true. , .true. , 'yearly' , ''  ,   ''    ,    ''
/
!!======================================================================
!!            ***  Surface Boundary Condition namelists  ***          !!
!!                                                                    !!
!!   namsbc          surface boundary condition manager                 (default: NO selection)
!!   namsbc_flx      flux               formulation                     (ln_flx     =T)
!!   namsbc_blk      Bulk formulae formulation                          (ln_blk     =T)
!!   namsbc_cpl      CouPLed            formulation                     ("key_oasis3" )
!!   namsbc_sas      Stand-Alone Surface module                         (SAS_SRC  only)
!!   namsbc_iif      Ice-IF: use observed ice cover                     (nn_ice = 1   )
!!   namtra_qsr      penetrative solar radiation                        (ln_traqsr  =T)
!!   namsbc_ssr      sea surface restoring term (for T and/or S)        (ln_ssr     =T)
!!   namsbc_rnf      river runoffs                                      (ln_rnf     =T)
!!   namsbc_apr      Atmospheric Pressure                               (ln_apr_dyn =T)
!!   namsbc_isf      ice shelf melting/freezing                         (ln_isfcav  =T : read (ln_read_cfg=T) or set or usr_def_zgr )
!!   namsbc_iscpl    coupling option between land ice model and ocean   (ln_isfcav  =T)
!!   namsbc_wave     external fields from wave model                    (ln_wave    =T)
!!   namberg         iceberg floats                                     (ln_icebergs=T)
!!======================================================================
!
!-----------------------------------------------------------------------
&namsbc        !   Surface Boundary Condition manager                   (default: NO selection)
!-----------------------------------------------------------------------
   nn_fsbc     = $(( lim_time_step_sec / nem_time_step_sec )) !  frequency of SBC module call
                           !     (also = the frequency of sea-ice & iceberg model call)
                     ! Type of air-sea fluxes
   ln_blk      = .true.    !  Bulk formulation                          (T => fill namsbc_blk )
                     ! Sea-ice :
   nn_ice      = 2         !  =2 or 3 automatically for SI3 or CICE    ("key_si3" or "key_cice")
                     ! Misc. options of sbc : 
   ln_traqsr   = .true.   !  Light penetration in the ocean            (T => fill namtra_qsr)
   ln_ssr      = .true.   !  Sea Surface Restoring on T and/or S       (T => fill namsbc_ssr)
   ln_rnf      = .true.   !  runoffs                                   (T => fill namsbc_rnf)
/
!-----------------------------------------------------------------------
&namsbc_blk    !   namsbc_blk  generic Bulk formula                     (ln_blk =T)
!-----------------------------------------------------------------------
   !                    !  bulk algorithm :
   ln_NCAR      = .true.     ! "NCAR"      algorithm   (Large and Yeager 2008)
      rn_zqt       =  2.     !  Air temperature & humidity reference height (m)
   !
   cn_dir      = './'      !  root directory for the bulk data location
   !_______!_________________________!___________________!___________!_____________!_________!___________!_____________________________________!__________!_______________!
   !       !  file name              ! frequency (hours) ! variable  ! time interp.!  clim   ! 'yearly'/ !       weights filename              ! rotation !  lsm          !
   !       !                         !  (if <0  months)  !   name    !   (logical) !  (T/F)  ! 'monthly' !                                     !  paring  !               !
   sn_wndi = 'drowned_uas_JRA55'    ,  3.         ,  'uas'    ,    .true.   , .false. , 'yearly'  , 'eORCA025_JRA55_do_c3.0_weights_bicubic_nohls.nc' , 'U1' ,   ''
   sn_wndj = 'drowned_vas_JRA55'    ,  3.         ,  'vas'    ,    .true.   , .false. , 'yearly'  , 'eORCA025_JRA55_do_c3.0_weights_bicubic_nohls.nc' , 'V1' ,   ''
   sn_qsr  = 'drowned_rsds_JRA55'   ,  3.         ,  'rsds'   ,    .true.   , .false. , 'yearly'  , 'eORCA025_JRA55_do_c3.0_weights_bilin_nohls.nc' , ''   ,   ''
   sn_qlw  = 'drowned_rlds_JRA55'   ,  3.         ,  'rlds'   ,    .true.   , .false. , 'yearly'  , 'eORCA025_JRA55_do_c3.0_weights_bilin_nohls.nc' , ''   ,   ''
   sn_tair = 'drowned_tas_JRA55'    ,  3.         ,  'tas'    ,    .true.   , .false. , 'yearly'  , 'eORCA025_JRA55_do_c3.0_weights_bilin_nohls.nc' , ''   ,   ''
   sn_humi = 'drowned_huss_JRA55'   ,  3.         ,  'huss'   ,    .true.   , .false. , 'yearly'  , 'eORCA025_JRA55_do_c3.0_weights_bilin_nohls.nc' , ''   ,   ''
   sn_prec = 'drowned_tprecip_JRA55' , 3.         ,  'tprecip',    .true.   , .false. , 'yearly'  , 'eORCA025_JRA55_do_c3.0_weights_bilin_nohls.nc' , ''   ,   ''
   sn_snow = 'drowned_prsn_JRA55 '  ,  3.         ,  'prsn'   ,    .true.   , .false. , 'yearly'  , 'eORCA025_JRA55_do_c3.0_weights_bilin_nohls.nc' , ''   ,   ''
   sn_slp  = 'drowned_psl_JRA55'    ,  3.         ,  'psl'    ,    .true.   , .false. , 'yearly'  , 'eORCA025_JRA55_do_c3.0_weights_bilin_nohls.nc' , ''   ,   ''
/
!-----------------------------------------------------------------------
&namsbc_sas    !   Stand-Alone Surface module: ocean data               (SAS_SRC  only)
!-----------------------------------------------------------------------
   l_sasread   = .false.    !  =T Read in file ;  =F set all to 0. (see sbcssm)
/
!-----------------------------------------------------------------------
&namtra_qsr    !   penetrative solar radiation                          (ln_traqsr =T)
!-----------------------------------------------------------------------
   !                       ! type of penetration                        (default: NO selection)
   ln_qsr_rgb  = .true.       !  RGB light penetration (Red-Green-Blue)
   rn_abs      =   0.53       !  RGB & 2BD: fraction absorbed in the very near surface  ! std value 0.58. RBB -> 0.53
   nn_chldta   =      1       !  RGB : Chl data (=1) or cst value (=0)

   cn_dir = './'  !  root directory for the chlorophyl data location
   !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                  ! pairing  !    filename   !
   sn_chl      = 'chlorophyl'       , -1.               , 'CHLA'    ,   .true.    , .true. , 'yearly'  , 'chlorophyl_weights_bilin.nc'       , ''       , ''
/
!-----------------------------------------------------------------------
&namsbc_ssr    !   surface boundary condition : sea surface restoring   (ln_ssr =T)
!-----------------------------------------------------------------------
   nn_sssr     =     3     !  add a damping term to the surface freshwater flux
      !                    !  or to SSS only (=1) or no damping term (=0) or read from a file (=3)

   cn_dir      = './'      !  root directory for the SST/SSS data location
   !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                  ! pairing  !    filename   !
   sn_sst      = 'NOT USED'              ,       120         , 'votemper',    .true.   , .false., 'yearly'  , ''               , ''       , ''
   sn_sss      = 'NOT USED'              ,       120         , 'vosaline',    .true.   , .false., 'yearly'  , ''               , ''       , ''
/
!-----------------------------------------------------------------------
&namsbc_ssr_drk !   surface boundary condition : sea surface restoring   (ln_ssr =T)
!-----------------------------------------------------------------------
   ln_sssr_flt  = .false.  ! use filtering of SSS model for sss restoring
   nn_shap_iter =  300     ! number of iteration of the shapiro filter
   ln_sssr_msk  = .true.   ! use a mask near the coast
   !___________!____________________!___________________!__________!_____________!________!___________!__________!__________!_______________!
   !           !  file name         ! frequency (hours) ! variable ! time interp.!  clim  ! 'yearly'/ ! weights  ! rotation ! land/sea mask !
   !           !                    !  (if <0  months)  !   name   !   (logical) !  (T/F) ! 'monthly' ! filename ! pairing  !    filename   !
   sn_coast    = 'distcoast'         ,  0.              , 'Tcoast' , .false.     , .true. , 'yearly'  ,  ''      , ''       , ''
   sn_empc     = 'empc'              , -1.              , 'sowafld', .true.      , .true.,  'yearly'  ,  ''      ,    ''    ,     ''

   rn_dist    =  150.      ! distance to the coast
/
!-----------------------------------------------------------------------
&namsbc_rnf    !   runoffs                                              (ln_rnf =T)
!-----------------------------------------------------------------------
   ln_rnf_mouth = .false.     !  specific treatment at rivers mouths
      rn_hrnf    =  10.e0     !  depth over which enhanced vertical mixing is used    (ln_rnf_mouth=T)
      rn_avt_rnf =   2.e-3    !  value of the additional vertical mixing coef. [m2/s] (ln_rnf_mouth=T)
   ln_rnf_icb   = .false.     !  read in iceberg flux from a file (fill sn_i_rnf if .true.)

   cn_dir      = './'      !  root directory for the runoff data location
   !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                  ! pairing  !    filename   !
   sn_rnf      = 'runoff'                ,        -1.        , 'sorunoff',   .true.    , .true. , 'yearly'  , ''               , ''       , ''
   sn_cnf      = 'runoff'                ,         0.        , 'socoefr' ,   .false.   , .true. , 'yearly'  , ''               , ''       , ''
   sn_s_rnf    = 'NOT_USED'              ,        24.        , 'rosaline',   .true.    , .true. , 'yearly'  , ''               , ''       , ''
   sn_t_rnf    = 'NOT_USED'              ,        24.        , 'rotemper',   .true.    , .true. , 'yearly'  , ''               , ''       , ''
   sn_dep_rnf  = 'NOT_USED'              ,         0.        , 'rodepth' ,   .false.   , .true. , 'yearly'  , ''               , ''       , ''
   sn_i_rnf    = 'bergmelt'              ,       120.        ,'berg_melt',   .true.    , .false., 'yearly'  , ''               , ''       , ''
/
!-----------------------------------------------------------------------
&namisf       !  Top boundary layer (ISF)                               (default: OFF)
!-----------------------------------------------------------------------
   !
   ! ---------------- ice shelf melt formulation -------------------------------
   !
   ln_isf = .true.            ! activate ice shelf module
      !
      ! ---------------- cavities opened -------------------------------
      !
      ln_isfcav_mlt = .true.      ! ice shelf melting into the cavity (need ln_isfcav = .true. in domain_cfg.nc)
         !
         rn_htbl     =  20.      ! thickness of the top boundary layer    (Losh et al. 2008)
         !                       ! 0 => thickness of the tbl = thickness of the first wet cell
         !
         !* 'spe' and 'oasis' case
         !___________!_____________!___________________!___________!_____________!_________!___________!__________!__________!_______________!
         !           !  file name  ! frequency (hours) ! variable  ! time interp.!  clim   ! 'yearly'/ ! weights  ! rotation ! land/sea mask !
         !           !             !  (if <0  months)  !   name    !  (logical)  !  (T/F)  ! 'monthly' ! filename ! pairing  ! filename      !
         sn_isfcav_fwf = 'NOT_USED',      -12.      , 'fwflisf'  ,  .false.    , .true.  , 'yearly'  ,    ''    ,   ''     ,    ''
      !
      ! ---------------- cavities parametrised -------------------------------
      !
      ln_isfpar_mlt = .false.   ! ice shelf melting parametrised
         cn_isfpar_mlt = 'spe'  ! ice shelf melting parametrisation (spe/bg03/oasis)
         !                      ! spe   = fwfisf is read from a forcing field
         !                      ! bg03  = melt computed using Beckmann and Goosse parametrisation
         !                      ! oasis = fwfisf is given by oasis and pattern by file sn_isfpar_fwf
         !
         !* all cases
         !___________!_____________!___________________!___________!_____________!_________!___________!__________!__________!_______________!
         !           !  file name  ! frequency (hours) ! variable  ! time interp.!  clim   ! 'yearly'/ ! weights  ! rotation ! land/sea mask !
         !           !             !  (if <0  months)  !   name    !  (logical)  !  (T/F)  ! 'monthly' ! filename ! pairing  ! filename      !
         sn_isfpar_zmax = 'NOT_USED'  ,       0        ,'sozisfmax',  .false.    , .true.  , 'yearly'  ,    ''    ,   ''     ,    ''
         sn_isfpar_zmin = 'NOT_USED'  ,       0        ,'sozisfmin',  .false.    , .true.  , 'yearly'  ,    ''    ,   ''     ,    ''
         !* 'spe' and 'oasis' case
         sn_isfpar_fwf = 'NOT_USED'   ,      -12.      ,'sofwfisf' ,  .false.    , .true.  , 'yearly'   ,    ''    ,   ''     ,    ''
         !* 'bg03' case
         sn_isfpar_Leff = 'NOT_USED'  ,       0.       ,'Leff'     ,  .false.    , .true.  , 'yearly'   ,    ''    ,   ''     ,    ''
/
!-----------------------------------------------------------------------
&namberg       !   iceberg parameters                                   (default: OFF)
!-----------------------------------------------------------------------
   ln_icebergs = .true.       ! activate iceberg floats (force =F with "key_agrif")
   !
   !                          ! diagnostics:
   nn_verbose_write  = 64            ! Timesteps between verbose messages
   nn_sample_rate    = 64            ! Timesteps between sampling for trajectory storage
   !
   !                          ! iceberg setting:
   rn_distribution   = 0.0003, 0.018, 0.047, 0.097, 0.041, 0.093, 0.085, 0.145, 0.185, 0.276
   nn_test_icebergs        =  -1     ! Create test icebergs of this class (-1 = no)
   rn_speed_limit          = 0.4      ! CFL speed limit for a berg
   !
   ln_M2016                = .true.  ! use Merino et al. (2016) modification (use of 3d ocean data instead of only sea surface data)
   ln_icb_area_mask        = .true. !Avoid the overfilling of a grid cell by too many icebergs
   !
   cn_dir      = './'      !  root directory for the calving data location
   !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                  ! pairing  !    filename   !
   sn_icb     =  'calving'               ,      -12.         ,'soicbclv' ,    .true.   , .true. , 'yearly'  , ''               , ''       , ''
/
!!======================================================================
!!               ***  Lateral boundary condition  ***                 !!
!!                                                                    !!
!!   namlbc        lateral momentum boundary condition                  (default: NO selection)
!!   namagrif      agrif nested grid   (read by child model only)       ("key_agrif")
!!   nam_tide      Tidal forcing                                        (default: OFF)
!!   nambdy        Unstructured open boundaries                         (default: OFF)
!!   nambdy_dta    Unstructured open boundaries - external data         (see  nambdy)
!!   nambdy_tide   tidal forcing at open boundaries                     (default: OFF)
!!======================================================================
!
!-----------------------------------------------------------------------
&namlbc        !   lateral momentum boundary condition                  (default: NO selection)
!-----------------------------------------------------------------------
   rn_shlat    =    0.     !  no slip
/
!-----------------------------------------------------------------------
&namlbc_drk    !   lateral momentum boundary condition                  (default: NO selection)
!-----------------------------------------------------------------------
   ln_shlat2d  = .true.   !  use 2D file for shlat
   cn_dir      = './'
   !___________!____________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
   !           !  file name         ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
   !           !                    !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                  ! pairing  !    filename   !
   sn_shlat2d = 'shlat2d' , -12.          , 'shlat2d' , .false.     , .true. ,  'yearly' , ''               , ''       , ''
/
!-----------------------------------------------------------------------
&namagrif      !  AGRIF zoom                                            ("key_agrif")
!-----------------------------------------------------------------------
/
!!======================================================================
!!                ***  Top/Bottom boundary condition  ***             !!
!!                                                                    !!
!!   namdrg        top/bottom drag coefficient                          (default: NO selection)
!!   namdrg_top    top    friction                                      (ln_OFF=F & ln_isfcav=T)
!!   namdrg_bot    bottom friction                                      (ln_OFF=F)
!!   nambbc        bottom temperature boundary condition                (default: OFF)
!!   nambbl        bottom boundary layer scheme                         (default: OFF)
!!======================================================================
!
!-----------------------------------------------------------------------
&namdrg        !   top/bottom drag coefficient                          (default: NO selection)
!-----------------------------------------------------------------------
   ln_non_lin  = .true.   !  non-linear  drag: Cd = Cd0 |U|
/
!-----------------------------------------------------------------------
&namdrg_top    !   TOP friction                                         (ln_drg_OFF =F & ln_isfcav=T)
!-----------------------------------------------------------------------
   rn_Cd0      =  2.5e-3    !  drag coefficient [-]
   rn_ke0      =  0.0      !  background kinetic energy  [m2/s2] (non-linear cases)
/
!-----------------------------------------------------------------------
&namdrg_bot    !   BOTTOM friction                                      (ln_OFF =F)
!-----------------------------------------------------------------------
   rn_Cd0      =  1.e-3   !  drag coefficient [-]
   ln_boost    = .true.    !  =T regional boost of Cd0 ; =F constant
/
!-----------------------------------------------------------------------
&nambbc        !   bottom temperature boundary condition                (default: OFF)
!-----------------------------------------------------------------------
   ln_trabbc   = .true.    !  Apply a geothermal heating at the ocean bottom

   cn_dir = './'  !  root directory for the geothermal data location
   !___________!____________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
   !           !  file name         ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
   !           !                    !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                  ! pairing  !    filename   !
   sn_qgh      = 'Goutorbe_ghflux.nc'      ,       -12.        , 'gh_flux' ,   .false.   , .true. , 'yearly'  , 'weights_ghflux_bilinear.nc' ,   ''     ,   ''
/
!-----------------------------------------------------------------------
&nambbl        !   bottom boundary layer scheme                         (default: OFF)
!-----------------------------------------------------------------------
   ln_trabbl   = .true.    !  Bottom Boundary Layer parameterisation flag
      nn_bbl_adv  =  1        !  advective bbl (=1/2) or not (=0)
/
!!======================================================================
!!                        Tracer (T-S) namelists                      !!
!!                                                                    !!
!!   nameos        equation of state                                    (default: NO selection)
!!   namtra_adv    advection scheme                                     (default: NO selection)
!!   namtra_ldf    lateral diffusion scheme                             (default: NO selection)
!!   namtra_mle    mixed layer eddy param. (Fox-Kemper param.)          (default: OFF)
!!   namtra_eiv    eddy induced velocity param.                         (default: OFF)
!!   namtra_dmp    T & S newtonian damping                              (default: OFF)
!!======================================================================
!
!-----------------------------------------------------------------------
&nameos        !   ocean Equation Of Seawater                           (default: NO selection)
!-----------------------------------------------------------------------
   ln_teos10   = .true.         !  = Use TEOS-10
/
!-----------------------------------------------------------------------
&namtra_adv    !   advection scheme for tracer                          (default: NO selection)
!-----------------------------------------------------------------------
   ln_traadv_fct = .true.     !  FCT scheme
      nn_fct_h   =  4               !  =2/4, horizontal 2nd / 4th order 
/
!-----------------------------------------------------------------------
&namtra_ldf    !   lateral diffusion scheme for tracers                 (default: NO selection)
!-----------------------------------------------------------------------
   ln_traldf_lap   = .true.    !    laplacian operator
   ln_traldf_iso   = .true.    !  iso-neutral (Standard operator)
   !                       !  Coefficients:
   nn_aht_ijk_t    = 20        !  space/time variation of eddy coef
      !                             !   = 20     aht = 1/2  Ud. max(e1,e2)
      rn_Ud        = 0.011          !  lateral diffusive velocity [m/s] (nn_aht_ijk_t= 0, 10, 20, 30)
/
!-----------------------------------------------------------------------
&namtra_mle    !   mixed layer eddy parametrisation (Fox-Kemper)        (default: OFF)
!-----------------------------------------------------------------------
/
!-----------------------------------------------------------------------
&namtra_eiv    !   eddy induced velocity param.                         (default: OFF)
!-----------------------------------------------------------------------
   ln_ldfeiv   = .true.    ! use eddy induced velocity parameterization
      !                        !  Coefficients:
      nn_aei_ijk_t  = 21          ! space/time variation of the eiv coeficient
      !                                !   = 21 F(i,j,t)  =Treguier et al. JPO 1997 formulation
      !                           !  time invariant coefficients:  aei0 = 1/2  Ue*Le 
      rn_Ue        = 0.03             !  lateral diffusive velocity [m/s] (nn_aht_ijk_t= 0, 10, 20, 30)
      rn_Le        = 10.e+3           !  lateral diffusive length   [m]   (nn_aht_ijk_t= 0, 10)
/
!-----------------------------------------------------------------------
&namtra_dmp    !   tracer: T & S newtonian damping                      (default: OFF)
!-----------------------------------------------------------------------
      cn_resto = 'NOT_USED'   !  Name of file containing restoration coeff. field (use dmp_tools to create this)
/
!!======================================================================
!!                      ***  Dynamics namelists  ***                  !!
!!                                                                    !!
!!   nam_vvl       vertical coordinate options                          (default: z-star)
!!   namdyn_adv    formulation of the momentum advection                (default: NO selection)
!!   namdyn_vor    advection scheme                                     (default: NO selection)
!!   namdyn_hpg    hydrostatic pressure gradient                        (default: NO selection)
!!   namdyn_spg    surface pressure gradient                            (default: NO selection)
!!   namdyn_ldf    lateral diffusion scheme                             (default: NO selection)
!!   namdta_dyn    offline TOP: dynamics read in files                  (OFF_SRC only)
!!======================================================================
!
!-----------------------------------------------------------------------
&nam_vvl       !   vertical coordinate options                          (default: z-star)
!-----------------------------------------------------------------------
   nn_vvl_interp =  0               !  interpolation method of scale factor anomalies at U/V/F points
                                    !  =0 linear even at the bottom (old)
                                    !  =1 linear with bottom correction
                                    !  =2 proportionnal to scale factors at rest ("qco" like)
/
!-----------------------------------------------------------------------
&namdyn_adv    !   formulation of the momentum advection                (default: NO selection)
!-----------------------------------------------------------------------
   ln_dynadv_vec = .true.  !  vector form - 2nd centered scheme
     nn_dynkeg     = 1        ! grad(KE) scheme: =0   C2  ;  =1   Hollingsworth correction
/
!-----------------------------------------------------------------------
&namdyn_vor    !   Vorticity / Coriolis scheme                          (default: NO selection)
!-----------------------------------------------------------------------
   ln_dynvor_een = .true.  !  energy & enstrophy scheme
/
!-----------------------------------------------------------------------
&namdyn_hpg    !   Hydrostatic pressure gradient option                 (default: NO selection)
!-----------------------------------------------------------------------
   ln_hpg_isf  = .true.    !  s-coordinate (sco ) adapted to isf
/
!-----------------------------------------------------------------------
&namdyn_spg    !   surface pressure gradient                            (default: NO selection)
!-----------------------------------------------------------------------
   ln_dynspg_ts  = .true.  !  split-explicit free surface
/
!-----------------------------------------------------------------------
&namdyn_ldf    !   lateral diffusion on momentum                        (default: NO selection)
!-----------------------------------------------------------------------
   ln_dynldf_blp = .true.      !  bilaplacian operator
   ln_dynldf_hor = .true.      !  horizontal  (geopotential)
   nn_ahm_ijk_t  = 20          !  space/time variation of eddy coefficient :
      !                             !  =-30  read in eddy_viscosity_3D.nc file
      !                             !  =-20  read in eddy_viscosity_2D.nc file
      !                             !  =  0  constant
      !                             !  = 10  F(k)=c1d
      !                             !  = 20  F(i,j)=F(grid spacing)=c2d
      !                             !  = 30  F(i,j,k)=c2d*c1d
      !                             !  = 31  F(i,j,k)=F(grid spacing and local velocity)
      !                             !  = 32  F(i,j,k)=F(local gridscale and deformation rate)
      !                        !  time invariant coefficients :  ahm = 1/2  Uv*Lv   (lap case)
      !                             !                            or  = 1/12 Uv*Lv^3 (blp case)
      rn_Uv      = 0.0838           !  lateral viscous velocity [m/s] (nn_ahm_ijk_t= 0, 10, 20, 30)
/
!!======================================================================
!!                     vertical physics namelists                     !!
!!                                                                    !!
!!    namzdf        vertical physics manager                            (default: NO selection)
!!    namzdf_ric    richardson number vertical mixing                   (ln_zdfric=T)
!!    namzdf_tke    TKE vertical mixing                                 (ln_zdftke=T)
!!    namzdf_gls    GLS vertical mixing                                 (ln_zdfgls=T)
!!    namzdf_osm    OSM vertical diffusion                              (ln_zdfosm=T)
!!    namzdf_iwm    tidal mixing parameterization                       (ln_zdfiwm=T)
!!======================================================================
!
!-----------------------------------------------------------------------
&namzdf        !   vertical physics manager                             (default: NO selection)
!-----------------------------------------------------------------------
   !                       ! adaptive-implicit vertical advection
   ln_zad_Aimp = .true.      !  Courant number dependent scheme (Shchepetkin 2015)
   !
   !                       ! type of vertical closure (required)
   ln_zdftke   = .true.       !  Turbulent Kinetic Energy closure       (T =>   fill namzdf_tke)
   !
   !                       ! convection
   ln_zdfevd   = .true.       !  Enhanced Vertical Diffusion scheme
      nn_evdm  =    1            !  evd apply on tracer (=0) or on tracer and momentum (=1)
      rn_evd   =   10.           !  evd mixing coefficient [m2/s]
   !
   ln_zdfddm   = .true.    ! double diffusive mixing
   !
   !                       ! gravity wave-driven vertical mixing
   ln_zdfiwm   = .true.      ! internal wave-induced mixing            (T =>   fill namzdf_iwm)
   !
   !                       !  Coefficients
   rn_avm0     =   1.4e-6     !  vertical eddy viscosity   [m2/s]       (background Kz if ln_zdfcst=F)
   rn_avt0     =   1.4e-7     !  vertical eddy diffusivity [m2/s]       (background Kz if ln_zdfcst=F)
   nn_havtb    =    1         !  horizontal shape for avtb (=1) or not (=0)
/
!-----------------------------------------------------------------------
&namzdf_tke    !   turbulent eddy kinetic dependent vertical diffusion  (ln_zdftke =T)
!-----------------------------------------------------------------------
   rn_emin     =   1.e-10  !  minimum value of tke [m2/s2] (1.e-10 is because of iwm)
      nn_eice     =   3       !  below sea ice: =0 ON ; =4 OFF when ice fraction > 1/4   
/
!-----------------------------------------------------------------------
&namzdf_iwm    !    internal wave-driven mixing parameterization        (ln_zdfiwm =T)
!-----------------------------------------------------------------------
   ln_mevar    = .true.    !  variable (T) or constant (F) mixing efficiency
   ln_tsdiff   = .true.    !  account for differential T/S mixing (T) or not (F)

   cn_dir      = './'      !  root directory for the iwm data location
   !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                  ! pairing  !    filename   !
   sn_mpb      = 'zdfiwm_forcing.nc'      , -12      , 'power_bot'   , .false.  , .true. , 'yearly' , '' , ''  , ''
   sn_mpc      = 'zdfiwm_forcing.nc'      , -12      , 'power_cri'   , .false.  , .true. , 'yearly' , '' , ''  , ''
   sn_mpn      = 'zdfiwm_forcing.nc'      , -12      , 'power_nsq'   , .false.  , .true. , 'yearly' , '' , ''  , ''
   sn_mps      = 'zdfiwm_forcing.nc'      , -12      , 'power_sho'   , .false.  , .true. , 'yearly' , '' , ''  , ''
   sn_dsb      = 'zdfiwm_forcing.nc'      , -12      , 'scale_bot'   , .false.  , .true. , 'yearly' , '' , ''  , ''
   sn_dsc      = 'zdfiwm_forcing.nc'      , -12      , 'scale_cri'   , .false.  , .true. , 'yearly' , '' , ''  , ''
/
!!======================================================================
!!                  ***  Diagnostics namelists  ***                   !!
!!                                                                    !!
!!   namtrd       dynamics and/or tracer trends                         (default: OFF)
!!   namptr       Poleward Transport Diagnostics                        (default: OFF)
!!   namhsb       Heat and salt budgets                                 (default: OFF)
!!   namdiu       Cool skin and warm layer models                       (default: OFF)
!!   namdiu       Cool skin and warm layer models                       (default: OFF)
!!   namflo       float parameters                                      (default: OFF)
!!   nam_diaharm  Harmonic analysis of tidal constituents               (default: OFF)
!!   nam_diadct   transports through some sections                      (default: OFF)
!!   nam_diatmb   Top Middle Bottom Output                              (default: OFF)
!!   nam_dia25h   25h Mean Output                                       (default: OFF)
!!   namnc4       netcdf4 chunking and compression settings             ("key_netcdf4")
!!======================================================================
!-----------------------------------------------------------------------
&namtrd        !   trend diagnostics                                    (default: OFF)
!-----------------------------------------------------------------------
/
!-----------------------------------------------------------------------
&namptr        !   Poleward Transport Diagnostic                        (default: OFF)
!-----------------------------------------------------------------------
/
!-----------------------------------------------------------------------
&nam_diaharm   !   Harmonic analysis of tidal constituents              (default: OFF)
!-----------------------------------------------------------------------
/
!-----------------------------------------------------------------------
&namnc4        !   netcdf4 chunking and compression settings            ("key_netcdf4")
!-----------------------------------------------------------------------
/
!!======================================================================
!!               ***  Observation & Assimilation  ***                 !!
!!                                                                    !!
!!   namobs       observation and model comparison                      (default: OFF)
!!   nam_asminc   assimilation increments                               ('key_asminc')
!!======================================================================
!
!!======================================================================
!!                  ***  Miscellaneous namelists  ***                 !!
!!                                                                    !!
!!   nammpp            Massively Parallel Processing                    ("key_mpp_mpi")
!!   namctl            Control prints                                   (default: OFF)
!!   namsto            Stochastic parametrization of EOS                (default: OFF)
!!======================================================================
!
!-----------------------------------------------------------------------
&nammpp        !   Massively Parallel Processing                        ("key_mpp_mpi")
!-----------------------------------------------------------------------
/
!-----------------------------------------------------------------------
&namctl        !   Control prints                                       (default: OFF)
!-----------------------------------------------------------------------
   ln_timing   = .true.           !  timing by routine write out in timing.output file
/
!-----------------------------------------------------------------------
&namhsb        !  Heat and salt budgets                                 (default: OFF)
!-----------------------------------------------------------------------
/
!-----------------------------------------------------------------------
&namnc4        !   netcdf4 chunking and compression settings            ("key_netcdf4")
!-----------------------------------------------------------------------
   nn_nchunks_i =   4       !  number of chunks in i-dimension
   nn_nchunks_j =   4       !  number of chunks in j-dimension
   nn_nchunks_k =   121     !  number of chunks in k-dimension
   !                       !  setting nn_nchunks_k = jpk will give a chunk size of 1 in the vertical which
   !                       !  is optimal for postprocessing which works exclusively with horizontal slabs
   ln_nc4zip   = .true.    !  (T) use netcdf4 chunking and compression
   !                       !  (F) ignore chunking information and produce netcdf3-compatible files
/
EOF
