#!/bin/sh

if $leg_is_restart
then
    nemo_restart=".TRUE."
else
    if [[ $rstctl -eq 1 ]]; then
       nemo_restart=".FALSE."
    else
       nemo_restart=".TRUE."
    fi
fi

case $advsch in
  cen2) LCEN2=.true.
        LTVD=.false.;;
  tvd)  LCEN2=.false.
        LTVD=.true.;;
  *    ) print "Unknown testcase"
         exit 1;;
esac

cat << EOF
!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
!! NEMO/OPA  :  1 - run manager      (namrun)
!! namelists    2 - Domain           (namzgr, namzgr_sco, namdom, namdta_tem, namdta_sal)
!!              3 - Surface boundary (namsbc, namsbc_ana, namsbc_flx, namsbc_clio, namsbc_core
!!                                    namsbc_cpl, namsbc_cpl_co2 namtra_qsr, namsbc_rnf,
!!                                    namsbc_apr, namsbc_ssr, namsbc_alb)
!!              4 - lateral boundary (namlbc, namcla, namobc, namagrif, nambdy, nambdy_tide)
!!              5 - bottom  boundary (nambfr, nambbc, nambbl)
!!              6 - Tracer           (nameos, namtra_adv, namtra_ldf, namtra_dmp)
!!              7 - dynamics         (namdyn_adv, namdyn_vor, namdyn_hpg, namdyn_spg, namdyn_ldf)
!!              8 - Verical physics  (namzdf, namzdf_ric, namzdf_tke, namzdf_kpp, namzdf_ddm, namzdf_tmx)
!!              9 - diagnostics      (namnc4, namtrd, namspr, namflo, namptr, namhsb)
!!             10 - miscellaneous    (namsol, nammpp, nammpp_dyndist, namctl)
!!             11 - Obs & Assim      (namobs, nam_asminc)
!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

!!======================================================================
!!                   ***  Run management namelists  ***
!!======================================================================
!!   namrun        parameters of the run
!!======================================================================
!
!-----------------------------------------------------------------------
&namrun        !   parameters of the run
!-----------------------------------------------------------------------
   nn_no       =       0   !  job number
   cn_exp      = "${exp_name}"
   nn_it000    =  $(( leg_start_sec / nem_time_step_sec + 1 ))
   nn_itend    =  $(( leg_end_sec / nem_time_step_sec ))
   nn_date0    =  ${leg_start_date_yyyymmdd}
   nn_leapy    =       1   !  Leap year calendar (1) or not (0)
   ln_rstart   = ${nemo_restart}   !  start from rest (F) or from a restart file (T)
   nn_rstctl   = ${rstctl}   !  restart control = 0 nn_it000 is not compared to the restart file value
                           !                  = 1 use nn_date0 in namelist (not the value in the restart file)
                           !                  = 2 calendar parameters read in the restart file
   cn_ocerst_in  = "restart_oce"  !  suffix of ocean restart name (input)
   cn_ocerst_out = "restart_oce"  !  suffix of ocean restart name (output)
   nn_istate   =       0       !  output the initial state (1) or not (0)
   nn_stock    =       0       !  frequency of creation of a restart file (modulo referenced to 1)
   nn_write    =      -1       !  frequency of write in the output file   (modulo referenced to nn_it000)
   ln_dimgnnn  = .false.       !  DIMG file format: 1 file for all processors (F) or by processor (T)
   ln_mskland  = .false.       !  mask land points in NetCDF outputs (costly: + ~15%)
   ln_clobber  = .false.       !  clobber (overwrite) an existing file
   nn_chunksz  =       0       !  chunksize (bytes) for NetCDF file (works only with iom_nf90 routines)
/
!======================================================================
!!                      ***  Domain namelists  ***
!!======================================================================
!!   namzgr       vertical coordinate
!!   namzgr_sco   s-coordinate or hybrid z-s-coordinate
!!   namdom       space and time domain (bathymetry, mesh, timestep)
!!   namdta_tem   data: temperature                                     ("key_dtatem")
!!   namdta_sal   data: salinity                                        ("key_dtasal")
!!======================================================================
!
!-----------------------------------------------------------------------
&namzgr        !   vertical coordinate
!-----------------------------------------------------------------------
   ln_zco      = .false.   !  z-coordinate - full    steps   (T/F)      ("key_zco" may also be defined)
   ln_zps      = .true.    !  z-coordinate - partial steps   (T/F)
   ln_sco      = .false.   !  s- or hybrid z-s-coordinate    (T/F)
/
!-----------------------------------------------------------------------
&namzgr_sco    !   s-coordinate or hybrid z-s-coordinate
!-----------------------------------------------------------------------
   rn_sbot_min =  300.     !  minimum depth of s-bottom surface (>0) (m)
   rn_sbot_max = 5250.     !  maximum depth of s-bottom surface (= ocean depth) (>0) (m)
   rn_theta    =    6.0    !  surface control parameter (0<=rn_theta<=20)
   rn_thetb    =    0.75   !  bottom control parameter  (0<=rn_thetb<= 1)
   rn_rmax     =    0.15   !  maximum cut-off r-value allowed (0<rn_max<1)
   ln_s_sigma  = .false.   !  hybrid s-sigma coordinates
   rn_bb       =    0.8    !  stretching with s-sigma
   rn_hc       =  150.0    !  critical depth with s-sigma
/
!-----------------------------------------------------------------------
&namdom        !   space and time domain (bathymetry, mesh, timestep)
!-----------------------------------------------------------------------
   nn_bathy    =    1      !  compute (=0) or read (=1) the bathymetry file
   nn_closea    =   0      !  remove (=0) or keep (=1) closed seas and lakes (ORCA)
   nn_msh      =    0      !  create (=1) a mesh file or not (=0)
   rn_hmin     =   -3.     !  min depth of the ocean (>0) or min number of ocean level (<0)
   rn_e3zps_min=   20.     !  partial step thickness is set larger than the minimum of
   rn_e3zps_rat=    0.1    !  rn_e3zps_min and rn_e3zps_rat*e3t, with 0<rn_e3zps_rat<1
                           !
   rn_rdt      = ${nem_time_step_sec}  !  time step for the dynamics (and tracer if nn_acc=0)
   nn_baro     =   64      !  number of barotropic time step            ("key_dynspg_ts")
   rn_atfp     =    0.1    !  asselin time filter parameter
   nn_acc      =    0      !  acceleration of convergence : =1      used, rdt < rdttra(k)
                           !                                =0, not used, rdt = rdttra
   rn_rdtmin   = 28800.    !  minimum time step on tracers (used if nn_acc=1)
   rn_rdtmax   = 28800.    !  maximum time step on tracers (used if nn_acc=1)
   rn_rdth     =  800.     !  depth variation of tracer time step  (used if nn_acc=1)
/
!-----------------------------------------------------------------------
&namdta_tem    !   data : temperature                                   ("key_dtatem")
!-----------------------------------------------------------------------
!              ! file name ! frequency (hours)    ! variable ! time interp. ! clim  !'yearly' or ! weights  ! rotation !
!              !           !  (if <0  months)     !   name   !  (logical)   ! (T/F) ! 'monthly'  ! filename ! pairing  !
   sn_tem =    'temperature',        -1           ,'votemper',    .false.   , .true., 'monthly'  ,     ''   ,    ''
!
   cn_dir = "${ini_data_dir}/nemo/${nem_grid}/" !  root directory for the location of the files
/
!-----------------------------------------------------------------------
&namdta_sal    !   data : salinity                                      ("key_dtasal")
!-----------------------------------------------------------------------
!              ! file name ! frequency (hours)    ! variable ! time interp. ! clim  !'yearly' or ! weights  ! rotation !
!              !           !  (if <0  months)     !   name   !   (logical)  ! (T/F) ! 'monthly'  ! filename ! pairing  !
   sn_sal =     'salinity' ,          -1          ,'vosaline',    .false.   , .true., 'monthly'  ,     ''   ,    ''
!
   cn_dir = "./" !  root directory for the location of the files
/
!!======================================================================
!!            ***  Surface Boundary Condition namelists  ***
!!======================================================================
!!   namsbc          surface boundary condition
!!   namsbc_ana      analytical         formulation
!!   namsbc_flx      flux               formulation
!!   namsbc_clio     CLIO bulk formulae formulation
!!   namsbc_core     CORE bulk formulae formulation
!!   namsbc_cpl      CouPLed            formulation                     ("key_coupled")
!!   namsbc_cpl_co2  coupled ocean/biogeo/atmosphere model              ("key_cpl_carbon_cycle")
!!   namtra_qsr      penetrative solar radiation
!!   namsbc_rnf      river runoffs
!!   namsbc_apr      Atmospheric Pressure
!!   namsbc_ssr      sea surface restoring term (for T and/or S)
!!   namsbc_alb      albedo parameters
!!======================================================================
!
&namsbc        !  Surface Boundary Condition (surface module)
!-----------------------------------------------------------------------
   nn_fsbc     = $(( lim_time_step_sec / nem_time_step_sec ))  !  frequency of surface boundary condition computation
                           !     (also = the frequency of sea-ice model call)
   ln_ana      = .false.   !  analytical formulation                    (T => fill namsbc_ana )
   ln_flx      = .false.   !  flux formulation                          (T => fill namsbc_flx )
   ln_blk_clio = .false.   !  CLIO bulk formulation                     (T => fill namsbc_clio)
   ln_blk_core = .true.      !  CORE bulk formulation                     (T => fill namsbc_core)
   ln_cpl      = .false.     !  Coupled formulation                       (T => fill namsbc_cpl )
   ln_apr_dyn  = .false.   !  Patm gradient added in ocean & ice Eqs.   (T => fill namsbc_apr )
   nn_ice      = 2         !  =0 no ice boundary condition   ,
                           !  =1 use observed ice-cover      ,
                           !  =2 ice-model used                         ("key_lim3" or "key_lim2)
   ln_dm2dc    = .false.   !  daily mean to diurnal cycle on short wave
   ln_rnf      = .false.   !  runoffs                                   (T => fill namsbc_rnf)
   ln_ssr      = .false.   !  Sea Surface Restoring on T and/or S       (T => fill namsbc_ssr)
   nn_fwb      = 0         !  FreshWater Budget: =0 unchecked
                           !     =1 global mean of e-p-r set to zero at each time step
                           !     =2 annual global mean of e-p-r set to zero
                           !     =3 global emp set to zero and spread out over erp area
/
!-----------------------------------------------------------------------
&namsbc_ana    !   analytical surface boundary condition
!-----------------------------------------------------------------------
   nn_tau000   =   0       !  gently increase the stress over the first ntau_rst time-steps
   rn_utau0    =   0.5     !  uniform value for the i-stress
   rn_vtau0    =   0.e0    !  uniform value for the j-stress
   rn_qns0     =   0.e0    !  uniform value for the total heat flux
   rn_qsr0     =   0.e0    !  uniform value for the solar radiation
   rn_emp0     =   0.e0    !  uniform value for the freswater budget (E-P)
/
!-----------------------------------------------------------------------
&namsbc_flx    !   surface boundary condition : flux formulation
!-----------------------------------------------------------------------
!              !  file name  ! frequency (hours) ! variable  ! time interp. !  clim  ! 'yearly'/ ! weights  ! rotation !
!              !             !  (if <0  months)  !   name    !   (logical)  !  (T/F) ! 'monthly' ! filename ! pairing  !
   sn_utau     = 'utau'      ,        24         , 'utau'    , .false.      , .false., 'yearly'  , ''       , ''
   sn_vtau     = 'vtau'      ,        24         , 'vtau'    , .false.      , .false., 'yearly'  , ''       , ''
   sn_qtot     = 'qtot'      ,        24         , 'qtot'    , .false.      , .false., 'yearly'  , ''       , ''
   sn_qsr      = 'qsr'       ,        24         , 'qsr'     , .false.      , .false., 'yearly'  , ''       , ''
   sn_emp      = 'emp'       ,        24         , 'emp'     , .false.      , .false., 'yearly'  , ''       , ''

   cn_dir      = './'      !  root directory for the location of the flux files
/
!-----------------------------------------------------------------------
&namsbc_clio   !   namsbc_clio  CLIO bulk formulea
!-----------------------------------------------------------------------
!              !  file name  ! frequency (hours) ! variable  ! time interp. !  clim  ! 'yearly'/ ! weights  ! rotation !
!              !             !  (if <0  months)  !   name    !   (logical)  !  (T/F) ! 'monthly' ! filename ! pairing  !
   sn_utau     = 'taux_1m'   ,       -1          , 'sozotaux',   .true.     , .true. , 'yearly'  , ''       , ''
   sn_vtau     = 'tauy_1m'   ,       -1          , 'sometauy',   .true.     , .true. , 'yearly'  , ''       , ''
   sn_wndm     = 'flx'       ,       -1          , 'socliowi',   .true.     , .true. , 'yearly'  , ''       , ''
   sn_tair     = 'flx'       ,       -1          , 'socliot2',   .true.     , .true. , 'yearly'  , ''       , ''
   sn_humi     = 'flx'       ,       -1          , 'socliohu',   .true.     , .true. , 'yearly'  , ''       , ''
   sn_ccov     = 'flx'       ,       -1          , 'socliocl',   .false.    , .true. , 'yearly'  , ''       , ''
   sn_prec     = 'flx'       ,       -1          , 'socliopl',   .false.    , .true. , 'yearly'  , ''       , ''

   cn_dir      = './'      !  root directory for the location of the bulk files are
/
!-----------------------------------------------------------------------
&namsbc_core   !   namsbc_core  CORE bulk formulae
!-----------------------------------------------------------------------
!              !  file name                    ! frequency (hours) ! variable  ! time interp. !  clim  ! 'yearly'/ ! weights  ! rotation !
!              !                               !  (if <0  months)  !   name    !   (logical)  !  (T/F) ! 'monthly' ! filename ! pairing  !
sn_wndi = 'u10_DFS4.3_${leg_start_date_yyyy}_sht'    ,  6, 'u10',    .false., .true., 'yearly', 'weight_bicub_320x161-ORCA1', 'Uwnd'
sn_wndj = 'v10_DFS4.3_${leg_start_date_yyyy}_sht'    ,  6, 'v10',    .false., .true., 'yearly', 'weight_bicub_320x161-ORCA1', 'Vwnd'
sn_qsr  = 'radsw_DFS4.3_${leg_start_date_yyyy}'  , 24, 'radsw',  .false., .true., 'yearly', 'weight_bilin_192x94-ORCA1', ''
sn_qlw  = 'radlw_DFS4.3_${leg_start_date_yyyy}'  , 24, 'radlw',  .false., .true., 'yearly', 'weight_bilin_192x94-ORCA1', ''
sn_tair = 't2_DFS4.3_${leg_start_date_yyyy}_sht'     ,  6, 't2',     .false., .true., 'yearly', 'weight_bilin_320x161-ORCA1', ''
sn_humi = 'q2_DFS4.3_${leg_start_date_yyyy}_sht'     ,  6, 'q2',     .false., .true., 'yearly', 'weight_bilin_320x161-ORCA1', ''
sn_prec = 'precip_DFS4.3_${leg_start_date_yyyy}' , -1, 'precip', .false., .true., 'yearly', 'weight_bilin_192x94-ORCA1', ''
sn_snow = 'snow_DFS4.3_${leg_start_date_yyyy}'   , -1, 'snow',   .false., .true., 'yearly', 'weight_bilin_192x94-ORCA1', ''
sn_tdif = 'taudif_core'        , 24, 'taudif', .false., .true., 'yearly'  , ''       , ''

   cn_dir      = './'      !  root directory for the location of the bulk files
   ln_2m       = .true.    !  air temperature and humidity referenced at 2m (T) instead 10m (F)
   ln_taudif   = .false.   !  HF tau contribution: use "mean of stress module - module of the mean stress" data
   rn_pfac     = 1.        !  multiplicative factor for precipitation (total & snow)
/
!-----------------------------------------------------------------------
&namtra_qsr    !  Penetrative solar radiation
!-----------------------------------------------------------------------
!              !  file name  ! frequency (hours) ! variable  ! time interp. !  clim  ! 'yearly'/ ! weights  ! rotation !
!              !             !  (if <0  months)  !   name    !   (logical)  !  (T/F) ! 'monthly' ! filename ! pairing  !
   sn_chl      ='chlorophyll',        -1         , 'CHLA'    ,   .true.     , .true. , 'yearly'  , ''       , ''

   cn_dir      = './'      !  root directory for the location of the runoff files
   ln_traqsr   = .true.    !  Light penetration (T) or not (F)
   ln_qsr_rgb  = .false.   !  RGB (Red-Green-Blue) light penetration
   ln_qsr_2bd  = .true.    !  2 bands              light penetration
   ln_qsr_bio  = .false.   !  bio-model light penetration
   nn_chldta   =      0    !  RGB : Chl data (=1) or cst value (=0)
   rn_abs      =   0.58    !  RGB & 2 bands: fraction of light (rn_si1)
   rn_si0      =   0.35    !  RGB & 2 bands: shortess depth of extinction
   rn_si1      =   23.0    !  2 bands: longest depth of extinction
/
!-----------------------------------------------------------------------
&namsbc_rnf    !   runoffs namelist surface boundary condition
!-----------------------------------------------------------------------
!              !  file name           ! frequency (hours) ! variable  ! time interp. !  clim  ! 'yearly'/ ! weights  ! rotation !
!              !                      !  (if <0  months)  !   name    !   (logical)  !  (T/F) ! 'monthly' ! filename ! pairing  !
   sn_rnf      = 'runoff_1m_nomask'   ,        -1         , 'sorunoff',   .true.     , .true. , 'yearly'  , ''       , ''
   sn_cnf      = 'runoff_1m_nomask'   ,         0         , 'socoefr0',   .false.    , .true. , 'yearly'  , ''       , ''
   sn_s_rnf    = 'runoffs'            ,        24         , 'rosaline',   .true.     , .true. , 'yearly'  , ''       , ''
   sn_t_rnf    = 'runoffs'            ,        24         , 'rotemper',   .true.     , .true. , 'yearly'  , ''       , ''
   sn_dep_rnf  = 'runoffs'            ,         0         , 'rodepth' ,   .false.    , .true. , 'yearly'  , ''       , ''

   cn_dir       = './'      !  root directory for the location of the runoff files
   ln_rnf_emp   = .false.   !  runoffs included into precipitation field (T) or into a file (F)
   ln_rnf_mouth = .false.   !  specific treatment at rivers mouths
   rn_hrnf      =  15.e0    !  depth over which enhanced vertical mixing is used
   rn_avt_rnf   =   1.e-3   !  value of the additional vertical mixing coef. [m2/s]
   rn_rfact     =   1.e0    !  multiplicative factor for runoff
   ln_rnf_depth = .false.   !  read in depth information for runoff
   ln_rnf_tem   = .false.   !  read in temperature information for runoff
   ln_rnf_sal   = .false.   !  read in salinity information for runoff
/
!-----------------------------------------------------------------------
&namsbc_apr    !   Atmospheric pressure used as ocean forcing or in bulk
!-----------------------------------------------------------------------
!              ! file name ! frequency (hours) ! variable ! time interpol. !  clim   ! 'yearly'/ ! weights  ! rotation !
!              !           !  (if <0  months)  !   name   !    (logical)   !  (T/F)  ! 'monthly' ! filename ! pairing  !
   sn_apr      = 'patm'    ,         -1        ,'somslpre',    .true.      , .true.  , 'yearly'  ,  ''      ,   ''

   cn_dir      = './'      !  root directory for the location of the bulk files
   ln_ref_apr  = .false.   !  ref. pressure: global mean Patm (T) or a constant (F)
/
!-----------------------------------------------------------------------
&namsbc_ssr    !   surface boundary condition : sea surface restoring
!-----------------------------------------------------------------------
!              !  file name  ! frequency (hours) ! variable  ! time interp. !  clim  ! 'yearly'/ ! weights  ! rotation !
!              !             !  (if <0  months)  !   name    !   (logical)  !  (T/F) ! 'monthly' ! filename ! pairing  !
   sn_sst      = 'sst_data'  ,        24         ,  'sst'    ,    .false.   , .false., 'yearly'  , ''       , ''
   sn_sss      = 'sss_data'  ,        -1         ,  'sss'    ,    .true.    , .true. , 'yearly'  , ''       , ''

   cn_dir      = './'      !  root directory for the location of the runoff files
   nn_sstr     =     0     !  add a retroaction term in the surface heat       flux (=1) or not (=0)
   nn_sssr     =     0     !  add a damping     term in the surface freshwater flux (=2)
                           !  or to SSS only (=1) or no damping term (=0)
   rn_dqdt     =   0.      !  magnitude of the retroaction on temperature   [W/m2/K]
   rn_deds     =   -27.7   !  magnitude of the damping on salinity   [mm/day]
   ln_sssr_bnd =   .true.  !  flag to bound erp term (associated with nn_sssr=2)
   rn_sssr_bnd =   4.e0    !  ABS(Max/Min) value of the damping erp term [mm/day]
/
!-----------------------------------------------------------------------
&namsbc_alb    !   albedo parameters
!-----------------------------------------------------------------------
   rn_cloud    =    0.06   !  cloud correction to snow and ice albedo
   rn_albice   =    0.40   !  albedo of melting ice in the arctic and antarctic
   rn_alphd    =    0.80   !  coefficients for linear interpolation used to
   rn_alphc    =    0.60   !  compute albedo between two extremes values
   rn_alphdi   =    0.67   !  (Pyane, 1972)
/

!!======================================================================
!!               ***  Lateral boundary condition  ***
!!======================================================================
!!   namlbc        lateral momentum boundary condition
!!   namcla        cross land advection
!!   namobc        open boundaries parameters                           ("key_obc")
!!   namagrif      agrif nested grid ( read by child model only )       ("key_agrif")
!!   nambdy        Unstructured open boundaries                         ("key_bdy")
!!   namtide       Tidal forcing at open boundaries                     ("key_bdy_tides")
!!======================================================================
!
!-----------------------------------------------------------------------
&namlbc        !   lateral momentum boundary condition
!-----------------------------------------------------------------------
   rn_shlat    =    2.     !  shlat = 0  !  0 < shlat < 2  !  shlat = 2  !  2 < shlat
                           !  free slip  !   partial slip  !   no slip   ! strong slip
/
!-----------------------------------------------------------------------
&namcla        !   cross land advection
!-----------------------------------------------------------------------
   nn_cla      =    0      !  advection between 2 ocean pts separates by land
/
!-----------------------------------------------------------------------
&namobc        !   open boundaries parameters                           ("key_obc")
!-----------------------------------------------------------------------
   ln_obc_clim = .false.   !  climatological obc data files (T) or not (F)
   ln_vol_cst  = .true.    !  impose the total volume conservation (T) or not (F)
   ln_obc_fla  = .false.   !  Flather open boundary condition
   nn_obcdta   =    1      !  = 0 the obc data are equal to the initial state
                           !  = 1 the obc data are read in 'obc.dta' files
   cn_obcdta   = 'annual'  !  set to annual if obc datafile hold 1 year of data
                           !  set to monthly if obc datafile hold 1 month of data
   rn_dpein    =    1.     !  damping time scale for inflow at east  open boundary
   rn_dpwin    =    1.     !     -           -         -       west    -      -
   rn_dpnin    =    1.     !     -           -         -       north   -      -
   rn_dpsin    =    1.     !     -           -         -       south   -      -
   rn_dpeob    = 3000.     !  time relaxation (days) for the east  open boundary
   rn_dpwob    =   15.     !     -           -         -     west    -      -
   rn_dpnob    = 3000.     !     -           -         -     north   -      -
   rn_dpsob    =   15.     !     -           -         -     south   -      -
   rn_volemp   =    1.     !  = 0 the total volume change with the surface flux (E-P-R)
                           !  = 1 the total volume remains constant
/
!-----------------------------------------------------------------------
&namagrif      !  AGRIF zoom                                            ("key_agrif")
!-----------------------------------------------------------------------
   nn_cln_update =    3    !  baroclinic update frequency
   ln_spc_dyn    = .true.  !  use 0 as special value for dynamics
   rn_sponge_tra = 2880.   !  coefficient for tracer   sponge layer [m2/s]
   rn_sponge_dyn = 2880.   !  coefficient for dynamics sponge layer [m2/s]
/
!-----------------------------------------------------------------------
&nambdy        !  unstructured open boundaries                          ("key_bdy")
!-----------------------------------------------------------------------
   cn_mask     =  ''                     !  name of mask file (ln_mask=T)
   cn_dta_frs_T= 'bdydata_grid_T.nc'     !  name of data file (T-points)
   cn_dta_frs_U= 'bdydata_grid_U.nc'     !  name of data file (U-points)
   cn_dta_frs_V= 'bdydata_grid_V.nc'     !  name of data file (V-points)
   cn_dta_fla_T= 'bdydata_bt_grid_T.nc'  !  name of data file for Flather condition (T-points)
   cn_dta_fla_U= 'bdydata_bt_grid_U.nc'  !  name of data file for Flather condition (U-points)
   cn_dta_fla_V= 'bdydata_bt_grid_V.nc'  !  name of data file for Flather condition (V-points)

   ln_clim     = .false.   !  contain 1 (T) or 12 (F) time dumps and be cyclic
   ln_vol      = .false.   !  total volume correction (see volbdy parameter)
   ln_mask     = .false.   !  boundary mask from filbdy_mask (T), boundaries are on edges of domain (F)
   ln_tides    = .false.   !  Apply tidal harmonic forcing with Flather condition
   ln_dyn_fla  = .false.   !  Apply Flather condition to velocities
   ln_tra_frs  = .false.   !  Apply FRS condition to temperature and salinity
   ln_dyn_frs  = .false.   !  Apply FRS condition to velocities
   nn_rimwidth =  9        !  width of the relaxation zone
   nn_dtactl   =  1        !  = 0, bdy data are equal to the initial state
                           !  = 1, bdy data are read in 'bdydata   .nc' files
   nn_volctl   =  0        !  = 0, the total water flux across open boundaries is zero
                           !  = 1, the total volume of the system is conserved
/
!-----------------------------------------------------------------------
&nambdy_tide   !  tidal forcing at unstructured boundaries
!-----------------------------------------------------------------------
   filtide     = 'bdytide_'           !  file name root of tidal forcing files
   tide_cpt    = 'M2','S1'            !  names of tidal components used
   tide_speed  = 28.984106, 15.000001 !  phase speeds of tidal components (deg/hour)
   ln_tide_date= .false.              !  adjust tidal harmonics for start date of run
/

!!======================================================================
!!                 ***  Bottom boundary condition  ***
!!======================================================================
!!   nambfr        bottom friction
!!   nambbc        bottom temperature boundary condition
!!   nambbl        bottom boundary layer scheme                         ("key_trabbl")
!!======================================================================
!
!-----------------------------------------------------------------------
&nambfr        !   bottom friction
!-----------------------------------------------------------------------
   nn_bfr      =    1      !  type of bottom friction :   = 0 : free slip,  = 1 : linear friction
                           !                              = 2 : nonlinear friction
   rn_bfri1    =    4.e-4  !  bottom drag coefficient (linear case)
   rn_bfri2    =    1.e-3  !  bottom drag coefficient (non linear case)
   rn_bfeb2    =    2.5e-3 !  bottom turbulent kinetic energy background  (m2/s2)
   ln_bfr2d    = .false.   !  horizontal variation of the bottom friction coef (read a 2D mask file )
   rn_bfrien   =    50.    !  local multiplying factor of bfr (ln_bfr2d=T)
/
!-----------------------------------------------------------------------
&nambbc        !   bottom temperature boundary condition
!-----------------------------------------------------------------------
   ln_trabbc   = .true.    !  Apply a geothermal heating at the ocean bottom
   nn_geoflx   =    1      !  geothermal heat flux: = 0 no flux
                           !     = 1 constant flux
                           !     = 2 variable flux (read in geothermal_heating.nc in mW/m2)
   rn_geoflx_cst = 86.4e-3 !  Constant value of geothermal heat flux [W/m2]
/
!-----------------------------------------------------------------------
&nambbl        !   bottom boundary layer scheme
!-----------------------------------------------------------------------
   nn_bbl_ldf  =  1      !  diffusive bbl (=1)   or not (=0)
   nn_bbl_adv  =  0      !  advective bbl (=1/2) or not (=0)
   rn_ahtbbl   =  1000.  !  lateral mixing coefficient in the bbl  [m2/s]
   rn_gambbl   =  10.    !  advective bbl coefficient                 [s]
/

!!======================================================================
!!                        Tracer (T & S ) namelists
!!======================================================================
!!   nameos        equation of state
!!   namtra_adv    advection scheme
!!   namtra_ldf    lateral diffusion scheme
!!   namtra_dmp    T & S newtonian damping                              ("key_tradmp")
!!======================================================================
!
!-----------------------------------------------------------------------
&nameos        !   ocean physical parameters
!-----------------------------------------------------------------------
   nn_eos      =   0       !  type of equation of state and Brunt-Vaisala frequency
                           !     = 0, UNESCO (formulation of Jackett and McDougall (1994) and of McDougall (1987) )
                           !     = 1, linear: rho(T)   = rau0 * ( 1.028 - ralpha * T )
                           !     = 2, linear: rho(T,S) = rau0 * ( rbeta * S - ralpha * T )
   rn_alpha    =   2.0e-4  !  thermal expension coefficient (nn_eos= 1 or 2)
   rn_beta     =   7.7e-4  !  saline  expension coefficient (nn_eos= 2)
/
!-----------------------------------------------------------------------
&namtra_adv    !   advection scheme for tracer
!-----------------------------------------------------------------------
   ln_traadv_cen2   =  $LCEN2  !  2nd order centered scheme
   ln_traadv_tvd    =  $LTVD   !  TVD scheme
   ln_traadv_muscl  =  .false.  !  MUSCL scheme
   ln_traadv_muscl2 =  .false.  !  MUSCL2 scheme + cen2 at boundaries
   ln_traadv_ubs    =  .false.  !  UBS scheme
   ln_traadv_qck    =  .false.  !  QUICKEST scheme
/
!-----------------------------------------------------------------------
&namtra_ldf    !   lateral diffusion scheme for tracer
!-----------------------------------------------------------------------
   !                       !  Type of the operator :
   ln_traldf_lap    =  .true.   !  laplacian operator
   ln_traldf_bilap  =  .false.  !  bilaplacian operator
   !                       !  Direction of action  :
   ln_traldf_level  =  .false.  !  iso-level
   ln_traldf_hor    =  .false.  !  horizontal (geopotential)            (require "key_ldfslp" when ln_sco=T)
   ln_traldf_iso    =  .true.   !  iso-neutral                          (require "key_ldfslp")
   ln_traldf_grif   =  .false.  !  griffies skew flux formulation       (require "key_ldfslp")  ! UNDER TEST, DO NOT USE
   ln_traldf_gdia   =  .false.  !  griffies operator strfn diagnostics  (require "key_ldfslp")  ! UNDER TEST, DO NOT USE
   !                       !  Coefficient
   rn_aht_0         =  1400.    !  horizontal eddy diffusivity for tracers [m2/s]
   rn_ahtb_0        =     0.    !  background eddy diffusivity for ldf_iso [m2/s]
   rn_aeiv_0        =  1400.    !  eddy induced velocity coefficient [m2/s]    (require "key_traldf_eiv")
/
!-----------------------------------------------------------------------
&namtra_dmp    !   tracer: T & S newtonian damping                      ('key_tradmp')
!-----------------------------------------------------------------------
   nn_hdmp     =   -1      !  horizontal shape =-1, damping in Med and Red Seas only
                           !                   =XX, damping poleward of XX degrees (XX>0)
                           !                      + F(distance-to-coast) + Red and Med Seas
   nn_zdmp     =    1      !  vertical   shape =0    damping throughout the water column
                           !                   =1 no damping in the mixing layer (kz  criteria)
                           !                   =2 no damping in the mixed  layer (rho crieria)
   rn_surf     =   50.     !  surface time scale of damping   [days]
   rn_bot      =  360.     !  bottom  time scale of damping   [days]
   rn_dep      =  800.     !  depth of transition between rn_surf and rn_bot [meters]
   nn_file     =    0      !  create a damping.coeff NetCDF file (=1) or not (=0)
/

!!======================================================================
!!                      ***  Dynamics namelists  ***
!!======================================================================
!!   namdyn_adv    formulation of the momentum advection
!!   namdyn_vor    advection scheme
!!   namdyn_hpg    hydrostatic pressure gradient
!!   namdyn_spg    surface pressure gradient                            (CPP key only)
!!   namdyn_ldf    lateral diffusion scheme
!!======================================================================
!
!-----------------------------------------------------------------------
&namdyn_adv    !   formulation of the momentum advection
!-----------------------------------------------------------------------
   ln_dynadv_vec = .true.  !  vector form (T) or flux form (F)
   ln_dynadv_cen2= .false. !  flux form - 2nd order centered scheme
   ln_dynadv_ubs = .false. !  flux form - 3rd order UBS      scheme
/
!-----------------------------------------------------------------------
&namdyn_vor    !   option of physics/algorithm (not control by CPP keys)
!-----------------------------------------------------------------------
   ln_dynvor_ene = .false. !  enstrophy conserving scheme
   ln_dynvor_ens = .false. !  energy conserving scheme
   ln_dynvor_mix = .false. !  mixed scheme
   ln_dynvor_een = .true.  !  energy & enstrophy scheme
/
!-----------------------------------------------------------------------
&namdyn_hpg    !   Hydrostatic pressure gradient option
!-----------------------------------------------------------------------
   ln_hpg_zco  = .false.   !  z-coordinate - full steps
   ln_hpg_zps  = .true.    !  z-coordinate - partial steps (interpolation)
   ln_hpg_sco  = .false.   !  s-coordinate (standard jacobian formulation)
   ln_hpg_hel  = .false.   !  s-coordinate (helsinki modification)
   ln_hpg_wdj  = .false.   !  s-coordinate (weighted density jacobian)
   ln_hpg_djc  = .false.   !  s-coordinate (Density Jacobian with Cubic polynomial)
   ln_hpg_rot  = .false.   !  s-coordinate (ROTated axes scheme)
   rn_gamma    = 0.e0      !  weighting coefficient (wdj scheme)
   ln_dynhpg_imp = .false. !  time stepping: semi-implicit time scheme  (T)
                                 !           centered      time scheme  (F)
/
!-----------------------------------------------------------------------
!namdyn_spg    !   surface pressure gradient   (CPP key only)
!-----------------------------------------------------------------------
!                          !  explicit free surface                     ("key_dynspg_exp")
!                          !  filtered free surface                     ("key_dynspg_flt")
!                          !  split-explicit free surface               ("key_dynspg_ts")

!-----------------------------------------------------------------------
&namdyn_ldf    !   lateral diffusion on momentum
!-----------------------------------------------------------------------
   !                       !  Type of the operator :
   ln_dynldf_lap    =  .true.  !  laplacian operator
   ln_dynldf_bilap  =  .false.   !  bilaplacian operator
   !                       !  Direction of action  :
   ln_dynldf_level  =  .false.  !  iso-level
   ln_dynldf_hor    =  .true.   !  horizontal (geopotential)            (require "key_ldfslp" in s-coord.)
   ln_dynldf_iso    =  .false.  !  iso-neutral                          (require "key_ldfslp")
   !                       !  Coefficient
   rn_ahm_0_lap     = 10000.    !  horizontal laplacian eddy viscosity   [m2/s]
   rn_ahmb_0        =     0.    !  background eddy viscosity for ldf_iso [m2/s]
   rn_ahm_0_blp     =     0.    !  horizontal bilaplacian eddy viscosity [m4/s]
/

!!======================================================================
!!             Tracers & Dynamics vertical physics namelists
!!======================================================================
!!    namzdf        vertical physics
!!    namzdf_ric    richardson number dependent vertical mixing         ("key_zdfric")
!!    namzdf_tke    TKE dependent vertical mixing                       ("key_zdftke")
!!    namzdf_kpp    KPP dependent vertical mixing                       ("key_zdfkpp")
!!    namzdf_ddm    double diffusive mixing parameterization            ("key_zdfddm")
!!    namzdf_tmx    tidal mixing parameterization                       ("key_zdftmx")
!!======================================================================
!
!-----------------------------------------------------------------------
&namzdf        !   vertical physics
!-----------------------------------------------------------------------
   rn_avm0     =   1.0e-4  !  vertical eddy viscosity   [m2/s]          (background Kz if not "key_zdfcst")
   rn_avt0     =   1.0e-5  !  vertical eddy diffusivity [m2/s]          (background Kz if not "key_zdfcst")
   nn_avb      =    0      !  profile for background avt & avm (=1) or not (=0)
   nn_havtb    =    0      !  horizontal shape for avtb (=1) or not (=0)
   ln_zdfevd   = .true.    !  enhanced vertical diffusion (evd) (T) or not (F)
   nn_evdm     =    0      !  evd apply on tracer (=0) or on tracer and momentum (=1)
   rn_avevd    =   50.     !  evd mixing coefficient [m2/s]
   ln_zdfnpc   = .false.   !  Non-Penetrative Convective algorithm (T) or not (F)
   nn_npc      =    1            !  frequency of application of npc
   nn_npcp     =  365            !  npc control print frequency
   ln_zdfexp   = .false.   !  time-stepping: split-explicit (T) or implicit (F) time stepping
   nn_zdfexp   =    3            !  number of sub-timestep for ln_zdfexp=T
/
!-----------------------------------------------------------------------
&namzdf_ric    !   richardson number dependent vertical diffusion       ("key_zdfric" )
!-----------------------------------------------------------------------
   rn_avmri    = 100.e-4   !  maximum value of the vertical viscosity
   rn_alp      =   5.      !  coefficient of the parameterization
   nn_ric      =   2       !  coefficient of the parameterization
/
!-----------------------------------------------------------------------
&namzdf_tke    !   turbulent eddy kinetic dependent vertical diffusion  ("key_zdftke")
!-----------------------------------------------------------------------
   rn_ediff    =   0.1     !  coef. for vertical eddy coef. (avt=rn_ediff*mxl*sqrt(e) )
   rn_ediss    =   0.7     !  coef. of the Kolmogoroff dissipation
   rn_ebb      =  67.83    !  coef. of the surface input of tke (=67.83 suggested when ln_mxl0=T)
   rn_emin     =   1.e-6   !  minimum value of tke [m2/s2]
   rn_emin0    =   1.e-4   !  surface minimum value of tke [m2/s2]
   nn_mxl      =   2       !  mixing length: = 0 bounded by the distance to surface and bottom
                           !                 = 1 bounded by the local vertical scale factor
                           !                 = 2 first vertical derivative of mixing length bounded by 1
                           !                 = 3 as =2 with distinct disspipative an mixing length scale
   nn_pdl      =   1       !  Prandtl number function of richarson number (=1, avt=pdl(Ri)*avm) or not (=0, avt=avm)
   ln_mxl0     = .true.    !  surface mixing length scale = F(wind stress) (T) or not (F)
   rn_mxl0     =   0.04    !  surface  buoyancy lenght scale minimum value
   ln_lc       = .true.    !  Langmuir cell parameterisation (Axell 2002)
   rn_lc       =   0.15    !  coef. associated to Langmuir cells
   nn_etau     =   1       !  penetration of tke below the mixed layer (ML) due to internal & intertial waves
                           !        = 0 no penetration
                           !        = 1 add a tke source below the ML
                           !        = 2 add a tke source just at the base of the ML
                           !        = 3 as = 1 applied on HF part of the stress    ("key_coupled")
   rn_efr      =   0.05    !  fraction of surface tke value which penetrates below the ML (nn_etau=1 or 2)
   nn_htau     =   1       !  type of exponential decrease of tke penetration below the ML
                           !        = 0  constant 10 m length scale
                           !        = 1  0.5m at the equator to 30m poleward of 40 degrees
/
!------------------------------------------------------------------------
&namzdf_kpp    !   K-Profile Parameterization dependent vertical mixing  ("key_zdfkpp", and optionally:
!------------------------------------------------------------------------ "key_kppcustom" or "key_kpplktb")
   ln_kpprimix = .true.    !  shear instability mixing
   rn_difmiw   =  1.0e-04  !  constant internal wave viscosity [m2/s]
   rn_difsiw   =  0.1e-04  !  constant internal wave diffusivity [m2/s]
   rn_riinfty  =  0.8      !  local Richardson Number limit for shear instability
   rn_difri    =  0.0050   !  maximum shear mixing at Rig = 0    [m2/s]
   rn_bvsqcon  = -0.01e-07 !  Brunt-Vaisala squared for maximum convection [1/s2]
   rn_difcon   =  1.       !  maximum mixing in interior convection [m2/s]
   nn_avb      =  0        !  horizontal averaged (=1) or not (=0) on avt and amv
   nn_ave      =  1        !  constant (=0) or profile (=1) background on avt
/
!-----------------------------------------------------------------------
&namzdf_gls                !   GLS vertical diffusion                   ("key_zdfgls")
!-----------------------------------------------------------------------
   rn_emin       = 1.e-6   !  minimum value of e   [m2/s2]
   rn_epsmin     = 1.e-12  !  minimum value of eps [m2/s3]
   ln_length_lim = .true.  !  limit on the dissipation rate under stable stratification (Galperin et al., 1988)
   rn_clim_galp  = 0.53    !  galperin limit
   ln_crban      = .true.  !  Use Craig & Banner (1994) surface wave mixing parametrisation
   ln_sigpsi     = .true.  !  Activate or not Burchard 2001 mods on psi schmidt number in the wb case
   rn_crban      = 100.    !  Craig and Banner 1994 constant for wb tke flux
   rn_charn      = 70000.  !  Charnock constant for wb induced roughness length
   nn_tkebc_surf =   1     !  surface tke condition (0/1/2=Dir/Neum/Dir Mellor-Blumberg)
   nn_tkebc_bot  =   1     !  bottom tke condition (0/1=Dir/Neum)
   nn_psibc_surf =   1     !  surface psi condition (0/1/2=Dir/Neum/Dir Mellor-Blumberg)
   nn_psibc_bot  =   1     !  bottom psi condition (0/1=Dir/Neum)
   nn_stab_func  =   2     !  stability function (0=Galp, 1= KC94, 2=CanutoA, 3=CanutoB)
   nn_clos       =   1     !  predefined closure type (0=MY82, 1=k-eps, 2=k-w, 3=Gen)
/
!-----------------------------------------------------------------------
&namzdf_ddm    !   double diffusive mixing parameterization             ("key_zdfddm")
!-----------------------------------------------------------------------
   rn_avts     = 1.e-4     !  maximum avs (vertical mixing on salinity)
   rn_hsbfr    = 1.6       !  heat/salt buoyancy flux ratio
/
!-----------------------------------------------------------------------
&namzdf_tmx    !   tidal mixing parameterization                        ("key_zdftmx")
!-----------------------------------------------------------------------
   rn_htmx     = 500.      !  vertical decay scale for turbulence (meters)
   rn_n2min    = 1.e-8     !  threshold of the Brunt-Vaisala frequency (s-1)
   rn_tfe      = 0.333     !  tidal dissipation efficiency
   rn_me       = 0.2       !  mixing efficiency
   ln_tmx_itf  = .false.   !  ITF specific parameterisation
   rn_tfe_itf  = 1.        !  ITF tidal dissipation efficiency
/

!!======================================================================
!!                  ***  Miscellaneous namelists  ***
!!======================================================================
!!   nammpp            Massively Parallel Processing                    ("key_mpp_mpi")
!!   namctl            Control prints & Benchmark
!!   namsol            elliptic solver / island / free surface
!!======================================================================
!
!-----------------------------------------------------------------------
&namsol        !   elliptic solver / island / free surface
!-----------------------------------------------------------------------
   nn_solv     =      1    !  elliptic solver: =1 preconditioned conjugate gradient (pcg)
                           !                   =2 successive-over-relaxation (sor)
   nn_sol_arp  =      0    !  absolute/relative (0/1) precision convergence test
   rn_eps      =  1.e-6    !  absolute precision of the solver
   nn_nmin     =    300    !  minimum of iterations for the SOR solver
   nn_nmax     =   1800    !  maximum of iterations for the SOR solver
   nn_nmod     =     10    !  frequency of test for the SOR solver
   rn_resmax   =  1.e-10   !  absolute precision for the SOR solver
   rn_sor      =  1.92     !  optimal coefficient for SOR solver (to be adjusted with the domain)
/
!-----------------------------------------------------------------------
&nammpp        !   Massively Parallel Processing                        ("key_mpp_mpi)
!-----------------------------------------------------------------------
   cn_mpi_send =  'B'      !  mpi send/recieve type   ='S', 'B', or 'I' for standard send,
                           !  buffer blocking send or immediate non-blocking sends, resp.
   nn_buffer   = 16000000  !  size in bytes of exported buffer ('B' case), 0 no exportation
   jpni        =   0       !  jpni   number of processors following i (set automatically if < 1)
   jpnj        =   0       !  jpnj   number of processors following j (set automatically if < 1)
   jpnij       =   0       !  jpnij  number of local domains (set automatically if < 1)
/
!-----------------------------------------------------------------------
&namctl        !   Control prints & Benchmark
!-----------------------------------------------------------------------
   ln_ctl      = .false.   !  trends control print (expensive!)
   nn_print    =    0      !  level of print (0 no extra print)
   nn_ictls    =    0      !  start i indice of control sum (use to compare mono versus
   nn_ictle    =    0      !  end   i indice of control sum        multi processor runs
   nn_jctls    =    0      !  start j indice of control               over a subdomain)
   nn_jctle    =    0      !  end   j indice of control
   nn_isplt    =    1      !  number of processors in i-direction
   nn_jsplt    =    1      !  number of processors in j-direction
   nn_bench    =    0      !  Bench mode (1/0): CAUTION use zero except for bench
                           !     (no physical validity of the results)
/

!!======================================================================
!!                  ***  Diagnostics namelists  ***
!!======================================================================
!!   namnc4       netcdf4 chunking and compression settings             ("key_netcdf4")
!!   namtrd       dynamics and/or tracer trends                         ("key_trddyn","key_trdtra","key_trdmld")
!!   namflo       float parameters                                      ("key_float")
!!   namptr       Poleward Transport Diagnostics
!!   namhsb       Heat and salt budgets
!!======================================================================
!
!-----------------------------------------------------------------------
&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=   31      !  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   = .false.   !  (T) use netcdf4 chunking and compression
                           !  (F) ignore chunking information and produce netcdf3-compatible files
/
!-----------------------------------------------------------------------
&namtrd        !   diagnostics on dynamics and/or tracer trends         ("key_trddyn" and/or "key_trdtra")
!              !       or mixed-layer trends or barotropic vorticity    ("key_trdmld" or     "key_trdvor")
!-----------------------------------------------------------------------
   nn_trd      = 365       !  time step frequency dynamics and tracers trends
   nn_ctls     =   0       !  control surface type in mixed-layer trends (0,1 or n<jpk)
   rn_ucf      =   1.      !  unit conversion factor (=1 -> /seconds ; =86400. -> /day)
   cn_trdrst_in      = "restart_mld"   ! suffix of ocean restart name (input)
   cn_trdrst_out     = "restart_mld"   ! suffix of ocean restart name (output)
   ln_trdmld_restart = .false.         !  restart for ML diagnostics
   ln_trdmld_instant = .false.         !  flag to diagnose trends of instantantaneous or mean ML T/S
/
!-----------------------------------------------------------------------
&namflo       !   float parameters                                      ("key_float")
!-----------------------------------------------------------------------
   ln_rstflo  = .false.    !  float restart (T) or not (F)
   nn_writefl =      75    !  frequency of writing in float output file
   nn_stockfl =    5475    !  frequency of creation of the float restart file
   ln_argo    = .false.    !  Argo type floats (stay at the surface each 10 days)
   ln_flork4  = .false.    !  trajectories computed with a 4th order Runge-Kutta (T)
                           !  or computed with Blanke' scheme (F)
/
!-----------------------------------------------------------------------
&namptr       !   Poleward Transport Diagnostic
!-----------------------------------------------------------------------
   ln_diaptr  = .false.    !  Poleward heat and salt transport (T) or not (F)
   ln_diaznl  = .false.    !  Add zonal means and meridional stream functions
   ln_subbas  = .false.    !  Atlantic/Pacific/Indian basins computation (T) or not
                           !  (orca configuration only, need input basins mask file named "subbasins.nc"
   ln_ptrcomp = .true.     !  Add decomposition : overturning
   nn_fptr    =  1         !  Frequency of ptr computation [time step]
   nn_fwri    =  15        !  Frequency of ptr outputs [time step]
/
!-----------------------------------------------------------------------
&namhsb       !  Heat and salt budgets
!-----------------------------------------------------------------------
   ln_diahsb  = .false.    !  check the heat and salt budgets (T) or not (F)
/

!!======================================================================
!!            ***  Observation & Assimilation namelists ***
!!======================================================================
!!   namobs       observation and model comparison                      ('key_diaobs')
!!   nam_asminc   assimilation increments                               ('key_asminc')
!!======================================================================
!
!-----------------------------------------------------------------------
&namobs       !  observation usage switch                               ('key_diaobs')
!-----------------------------------------------------------------------
   ln_t3d     = .false.    ! Logical switch for T profile observations
   ln_s3d     = .false.    ! Logical switch for S profile observations
   ln_ena     = .false.    ! Logical switch for ENACT insitu data set
   !                       !     ln_cor                  Logical switch for Coriolis insitu data set
   ln_profb   = .false.    ! Logical switch for feedback insitu data set
   ln_sla     = .false.    ! Logical switch for SLA observations

   ln_sladt   = .false.    ! Logical switch for AVISO SLA data

   ln_slafb   = .false.    ! Logical switch for feedback SLA data
                           !     ln_ssh                  Logical switch for SSH observations

   ln_sst     = .false.    ! Logical switch for SST observations
                           !     ln_reysst               Logical switch for Reynolds observations
                           !     ln_ghrsst               Logical switch for GHRSST observations

   ln_sstfb   = .false.    ! Logical switch for feedback SST data
                           !     ln_sss                  Logical switch for SSS observations
                           !     ln_seaice               Logical switch for Sea Ice observations
                           !     ln_vel3d                Logical switch for velocity observations
                           !     ln_velavcur             Logical switch for velocity daily av. cur.
                           !     ln_velhrcur             Logical switch for velocity high freq. cur.
                           !     ln_velavadcp            Logical switch for velocity daily av. ADCP
                           !     ln_velhradcp            Logical switch for velocity high freq. ADCP
                           !     ln_velfb                Logical switch for feedback velocity data
                           !     ln_grid_global          Global distribtion of observations
                           !     ln_grid_search_lookup   Logical switch for obs grid search w/lookup table
                           !     grid_search_file        Grid search lookup file header
                           !     enactfiles              ENACT input observation file names
                           !     coriofiles              Coriolis input observation file name
   !                       ! profbfiles: Profile feedback input observation file name
   profbfiles = 'profiles_01.nc'
                           !     ln_profb_enatim         Enact feedback input time setting switch
                           !     slafilesact             Active SLA input observation file name
                           !     slafilespas             Passive SLA input observation file name
   !                       ! slafbfiles: Feedback SLA input observation file name
   slafbfiles = 'sla_01.nc'
                           !     sstfiles                GHRSST input observation file name
   !                       ! sstfbfiles: Feedback SST input observation file name
   sstfbfiles = 'sst_01.nc' 'sst_02.nc' 'sst_03.nc' 'sst_04.nc' 'sst_05.nc'
                           !     seaicefiles             Sea Ice input observation file name
                           !     velavcurfiles           Vel. cur. daily av. input file name
                           !     velhvcurfiles           Vel. cur. high freq. input file name
                           !     velavadcpfiles          Vel. ADCP daily av. input file name
                           !     velhvadcpfiles          Vel. ADCP high freq. input file name
                           !     velfbfiles              Vel. feedback input observation file name
                           !     dobsini                 Initial date in window YYYYMMDD.HHMMSS
                           !     dobsend                 Final date in window YYYYMMDD.HHMMSS
                           !     n1dint                  Type of vertical interpolation method
                           !     n2dint                  Type of horizontal interpolation method
                           !     ln_nea                  Rejection of observations near land switch
   nmsshc     = 0          ! MSSH correction scheme
                           !     mdtcorr                 MDT  correction
                           !     mdtcutoff               MDT cutoff for computed correction
   ln_altbias = .false.    ! Logical switch for alt bias
   ln_ignmis  = .true.     ! Logical switch for ignoring missing files
                           !     endailyavtypes   ENACT daily average types
   ln_grid_global = .true.
   ln_grid_search_lookup = .false.
/
!-----------------------------------------------------------------------
&nam_asminc   !   assimilation increments                               ('key_asminc')
!-----------------------------------------------------------------------
    ln_bkgwri = .false.    !  Logical switch for writing out background state
    ln_trjwri = .false.    !  Logical switch for writing out state trajectory
    ln_trainc = .false.    !  Logical switch for applying tracer increments
    ln_dyninc = .false.    !  Logical switch for applying velocity increments
    ln_sshinc = .false.    !  Logical switch for applying SSH increments
    ln_asmdin = .false.    !  Logical switch for Direct Initialization (DI)
    ln_asmiau = .false.    !  Logical switch for Incremental Analysis Updating (IAU)
    nitbkg    = 0          !  Timestep of background in [0,nitend-nit000-1]
    nitdin    = 0          !  Timestep of background for DI in [0,nitend-nit000-1]
    nitiaustr = 1          !  Timestep of start of IAU interval in [0,nitend-nit000-1]
    nitiaufin = 15         !  Timestep of end of IAU interval in [0,nitend-nit000-1]
    niaufn    = 0          !  Type of IAU weighting function
    nittrjfrq = 0          !  Frequency of trajectory output for 4D-VAR
    ln_salfix = .false.    !  Logical switch for ensuring that the sa > salfixmin
    salfixmin = -9999      !  Minimum salinity after applying the increments
/
EOF
