!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
!! SI3 Reference namelist:
!!              1 - Generic parameters                 (nampar)
!!              2 - Ice thickness discretization       (namitd)
!!              3 - Ice dynamics                       (namdyn)
!!              4 - Ice ridging/rafting                (namdyn_rdgrft)
!!              5 - Ice rheology                       (namdyn_rhg)
!!              6 - Ice advection                      (namdyn_adv)
!!              7 - Ice surface boundary conditions    (namsbc)
!!              8 - Ice thermodynamics                 (namthd)
!!              9 - Ice heat diffusion                 (namthd_zdf)
!!             10 - Ice lateral melting                (namthd_da)
!!             11 - Ice growth in open water           (namthd_do)
!!             12 - Ice salinity                       (namthd_sal)
!!             13 - Ice melt ponds                     (namthd_pnd)
!!             14 - Ice initialization                 (namini)
!!             15 - Ice/snow albedos                   (namalb)
!!             16 - Ice diagnostics                    (namdia)
!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
!
!------------------------------------------------------------------------------
&nampar         !   Generic parameters
!------------------------------------------------------------------------------
   jpl              =   5             !  number of ice  categories
   nlay_i           =   2             !  number of ice  layers
   nlay_s           =   2             !  number of snow layers
   ln_virtual_itd   =   .false.       !  virtual ITD mono-category parameterization (jpl=1 only)
                                      !     i.e. enhanced thermal conductivity & virtual thin ice melting
   ln_icedyn        = .true.          !  ice dynamics (T) or not (F)
   ln_icethd        = .true.          !  ice thermo   (T) or not (F)
   rn_amax_n        =   0.997         !  maximum tolerated ice concentration NH
   rn_amax_s        =   0.98          !  maximum tolerated ice concentration SH
   cn_icerst_in     = "restart_ice"   !  suffix of ice restart name (input)
   cn_icerst_out    = "restart_ice"   !  suffix of ice restart name (output)
   cn_icerst_indir  = "."             !  directory to read   input ice restarts
   cn_icerst_outdir = "."             !  directory to write output ice restarts
/
!------------------------------------------------------------------------------
&namitd         !   Ice discretization
!------------------------------------------------------------------------------
   ln_cat_hfn       = .true.          !  ice categories are defined by a function following rn_himean**(-0.05)
      rn_himean     =   2.0           !  expected domain-average ice thickness (m)
   ln_cat_usr       = .false.         !  ice categories are defined by rn_catbnd below (m)
      rn_catbnd     =   0.,0.45,1.1,2.1,3.7,6.0  
   rn_himin         =   0.1           !  minimum ice thickness (m) allowed
   rn_himax         =  99.0           !  maximum ice thickness (m) allowed
/
!------------------------------------------------------------------------------
&namdyn         !   Ice dynamics
!------------------------------------------------------------------------------
   ln_dynALL        = .true.          !  dyn.: full ice dynamics                  (rheology + advection + ridging/rafting + correction)
   ln_dynRHGADV     = .false.         !  dyn.: no ridge/raft & no corrections     (rheology + advection)
   ln_dynADV1D      = .false.         !  dyn.: only advection 1D                  (Schar & Smolarkiewicz 1996 test case)
   ln_dynADV2D      = .false.         !  dyn.: only advection 2D w prescribed vel.(rn_uvice + advection)
      rn_uice       =   0.5           !        prescribed ice u-velocity
      rn_vice       =   0.5           !        prescribed ice v-velocity
   rn_ishlat        =   2.            !  lbc : free slip (0) ; partial slip (0-2) ; no slip (2) ; strong slip (>2)
   ln_landfast_L16  = .false.         !  landfast: parameterization from Lemieux 2016
      rn_lf_depfra  =   0.125         !        fraction of ocean depth that ice must reach to initiate landfast
                                      !          recommended range: [0.1 ; 0.25]
      rn_lf_bfr     =  15.            !        maximum bottom stress per unit volume [N/m3]
      rn_lf_relax   =   1.e-5         !        relaxation time scale to reach static friction [s-1]
      rn_lf_tensile =   0.05          !        isotropic tensile strength [0-0.5??]

   cn_dir           = './'      !  root directory for the grounded icebergs mask data location
   !___________!________________!___________________!___________!_____________!________!___________!__________!__________!_______________!
   !           !  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_icbmsk       = 'NOT USED' ,       -12.        , 'icb_mask',   .false.   , .true. , 'yearly'  , ''       , ''       , ''
/
!------------------------------------------------------------------------------
&namdyn_rdgrft  !   Ice ridging/rafting
!------------------------------------------------------------------------------
          ! -- ice_rdgrft_strength -- !
   ln_str_H79       = .true.          !  ice strength param.: Hibler_79   => P = pstar*<h>*exp(-c_rhg*A)
      rn_pstar      =   2.0e+04       !     ice strength thickness parameter [N/m2]
      rn_crhg       =  20.0           !     ice strength conc. parameter (-)
   ln_str_R75       = .false.         !  ice strength param.: Rothrock_75 => P = fn of potential energy
      rn_pe_rdg     =  17.0           !     coef accouting for frictional dissipation
   ln_str_CST       = .false.         !  ice strength param.: Constant
      rn_str        =   0.0           !     ice strength value
   ln_str_smooth    = .true.          !  spatial smoothing of the ice strength
                   ! -- ice_rdgrft -- !
   ln_distf_lin     = .true.          !  redistribution function of ridged ice: linear (Hibler 1980)
   ln_distf_exp     = .false.         !  redistribution function of ridged ice: exponential => not coded yet
      rn_murdg      =   3.0           !     e-folding scale of ridged ice (m**.5)
   rn_csrdg         =   0.5           !  fraction of shearing energy contributing to ridging
              ! -- ice_rdgrft_prep -- !
   ln_partf_lin     = .false.         !  Linear ridging participation function (Thorndike et al, 1975)
      rn_gstar      =   0.15          !     fractional area of thin ice being ridged 
   ln_partf_exp     = .true.          !  Exponential ridging participation function (Lipscomb, 2007)
      rn_astar      =   0.03          !     exponential measure of ridging ice fraction [set to 0.05 if hstar=100]
   ln_ridging       = .true.          !  ridging activated (T) or not (F)
      rn_hstar      =  25.0           !     determines the maximum thickness of ridged ice [m] (Hibler, 1980)
      rn_porordg    =   0.3           !     porosity of newly ridged ice (Lepparanta et al., 1995)
      rn_fsnwrdg    =   0.5           !     snow volume fraction that survives in ridging
      rn_fpndrdg    =   1.0           !     pond fraction that survives in ridging (small a priori)
   ln_rafting       = .true.          !  rafting activated (T) or not (F)
      rn_hraft      =   0.75          !     threshold thickness for rafting [m]
      rn_craft      =   5.0           !     squeezing coefficient used in the rafting function
      rn_fsnwrft    =   0.5           !     snow volume fraction that survives in rafting
      rn_fpndrft    =   1.0           !     pond fraction that survives in rafting (0.5 a priori)
/
!------------------------------------------------------------------------------
&namdyn_rhg     !   Ice rheology
!------------------------------------------------------------------------------
   ln_rhg_EVP       = .true.          !  EVP rheology
   ln_rhg_EAP       = .false.         !  EAP rheology
      ln_aEVP       = .true.          !     adaptive rheology (Kimmritz et al. 2016 & 2017)
      rn_creepl     =   2.0e-9        !     creep limit [1/s]
      rn_ecc        =   2.0           !     eccentricity of the elliptical yield curve          
      nn_nevp       = 100             !     number of EVP subcycles                             
      rn_relast     =   0.333         !     ratio of elastic timescale to ice time step: Telast = dt_ice * rn_relast 
                                      !        advised value: 1/3 (nn_nevp=100) or 1/9 (nn_nevp=300)
      nn_rhg_chkcvg =   0             !     check convergence of rheology
                                      !     = 0  no check
                                      !     = 1  check at the main time step (output xml: uice_cvg)
                                      !     = 2  check at both main and rheology time steps (additional output: ice_cvg.nc)
                                      !          this option 2 asks a lot of communications between cpu
   ln_rhg_VP        = .false.         !  VP rheology
      nn_vp_nout    = 10              !     number of outer iterations
      nn_vp_ninn    = 1500            !     number of inner iterations
      nn_vp_chkcvg  = 5               !     iteration step for convergence check
/
!------------------------------------------------------------------------------
&namdyn_adv     !   Ice advection
!------------------------------------------------------------------------------
   ln_adv_Pra       = .true.          !  Advection scheme (Prather)
   ln_adv_UMx       = .false.         !  Advection scheme (Ultimate-Macho)
      nn_UMx        =   5             !     order of the scheme for UMx (1-5 ; 20=centered 2nd order)
/
!------------------------------------------------------------------------------
&namsbc         !   Ice surface boundary conditions
!------------------------------------------------------------------------------
   rn_cio           =   5.0e-03       !  ice-ocean drag coefficient (-)
   nn_snwfra        =   2             !  calculate the fraction of ice covered by snow (for zdf and albedo)
                                      !     = 0  fraction = 1 (if snow) or 0 (if no snow)
                                      !     = 1  fraction = 1-exp(-0.2*rhos*hsnw) [MetO formulation]
                                      !     = 2  fraction = hsnw / (hsnw+0.02)    [CICE formulation]
   rn_snwblow       =   0.66          !  mesure of snow blowing into the leads
                                      !     = 1 => no snow blowing, < 1 => some snow blowing
   nn_flxdist       =  -1             !  Redistribute heat flux over ice categories
                                      !     =-1  Do nothing (needs N(cat) fluxes)
                                      !     = 0  Average N(cat) fluxes then apply the average over the N(cat) ice
                                      !     = 1  Average N(cat) fluxes then redistribute over the N(cat) ice using T-ice and albedo sensitivity
                                      !     = 2  Redistribute a single flux over categories
   ln_cndflx        = .false.         !  Use conduction flux as surface boundary conditions (i.e. for Jules coupling)
      ln_cndemulate = .false.         !     emulate conduction flux (if not provided in the inputs)
   nn_qtrice        =   1             !  Solar flux transmitted thru the surface scattering layer:
                                      !     = 0  Grenfell and Maykut 1977 (depends on cloudiness and is 0 when there is snow) 
                                      !     = 1  Lebrun 2019 (equals 0.3 anytime with different melting/dry snw conductivities)
/
!------------------------------------------------------------------------------
&namthd         !   Ice thermodynamics
!------------------------------------------------------------------------------
   ln_icedH         = .true.          !  activate ice thickness change from growing/melting (T) or not (F)
   ln_icedA         = .true.          !  activate lateral melting param. (T) or not (F)
   ln_icedO         = .true.          !  activate ice growth in open-water (T) or not (F)
   ln_icedS         = .true.          !  activate brine drainage (T) or not (F)
   !
   ln_leadhfx       = .true.          !  heat in the leads is used to melt sea-ice before warming the ocean
/
!------------------------------------------------------------------------------
&namthd_zdf     !   Ice heat diffusion
!------------------------------------------------------------------------------
   ln_zdf_BL99      = .true.          !  Heat diffusion follows Bitz and Lipscomb 1999
   ln_cndi_U64      = .false.         !  sea ice thermal conductivity: k = k0 + beta.S/T            (Untersteiner, 1964)
   ln_cndi_P07      = .true.          !  sea ice thermal conductivity: k = k0 + beta1.S/T - beta2.T (Pringle et al., 2007)
   rn_cnd_s         =   0.50          !  thermal conductivity of the snow (0.31 W/m/K, Maykut and Untersteiner, 1971)
                                      !     Obs: 0.1-0.5 (Lecomte et al, JAMES 2013)
   rn_kappa_i       =   1.0           !  radiation attenuation coefficient in sea ice                     [1/m]
   rn_kappa_s       =  10.0           !  nn_qtrice = 0: radiation attenuation coefficient in snow         [1/m]
   rn_kappa_smlt    =   7.0           !  nn_qtrice = 1: radiation attenuation coefficient in melting snow [1/m]
   rn_kappa_sdry    =  10.0           !                 radiation attenuation coefficient in dry snow     [1/m]
   ln_zdf_chkcvg    = .false.         !  check convergence of heat diffusion scheme (outputs: tice_cvgerr, tice_cvgstp)
/
!------------------------------------------------------------------------------
&namthd_da      !   Ice lateral melting
!------------------------------------------------------------------------------
   rn_beta          =   1.0           !  coef. beta for lateral melting param. Recommended range=[0.8-1.2]
                                      !   => decrease = more melt and melt peaks toward higher concentration (A~0.5 for beta=1 ; A~0.8 for beta=0.2)
                                      !      0.3 = best fit for western Fram Strait and Antarctica
                                      !      1.4 = best fit for eastern Fram Strait      
   rn_dmin          =   8.            !  minimum floe diameter for lateral melting param. Recommended range=[6-10]
                                      !   => 6  vs 8m = +40% melting at the peak (A~0.5)
                                      !      10 vs 8m = -20% melting
/
!------------------------------------------------------------------------------
&namthd_do      !   Ice growth in open water
!------------------------------------------------------------------------------
   rn_hinew         =   0.1           !  thickness for new ice formation in open water (m), must be larger than rn_himin
   ln_frazil        = .false.         !  Frazil ice parameterization (ice collection as a function of wind)
      rn_maxfraz    =   1.0           !     maximum fraction of frazil ice collecting at the ice base
      rn_vfraz      =   0.417         !     thresold drift speed for frazil ice collecting at the ice bottom (m/s)
      rn_Cfraz      =   5.0           !     squeezing coefficient for frazil ice collecting at the ice bottom
/
!------------------------------------------------------------------------------
&namthd_sal     !   Ice salinity
!------------------------------------------------------------------------------
   nn_icesal        =   2             !  ice salinity option
                                      !     1: constant ice salinity (S=rn_icesal)
                                      !     2: varying salinity parameterization S(z,t)
                                      !     3: prescribed salinity profile S(z) (Schwarzacher 1959)
   rn_icesal        =   4.            !      (nn_icesal=1) ice salinity (g/kg)
   rn_sal_gd        =   5.            !      (nn_icesal=2) restoring ice salinity, gravity drainage (g/kg)
   rn_time_gd       =   1.73e+6       !      (nn_icesal=2) restoring time scale,   gravity drainage  (s)
   rn_sal_fl        =   2.            !      (nn_icesal=2) restoring ice salinity, flushing (g/kg)
   rn_time_fl       =   8.64e+5       !      (nn_icesal=2) restoring time scale,   flushing (s)
   rn_simax         =  20.            !  maximum tolerated ice salinity (g/kg)
   rn_simin         =   0.1           !  minimum tolerated ice salinity (g/kg)
/
!------------------------------------------------------------------------------
&namthd_pnd     !   Melt ponds
!------------------------------------------------------------------------------
   ln_pnd            = .true.         !  activate melt ponds or not
      ln_pnd_TOPO    = .false.        !  topographic melt ponds
      ln_pnd_LEV     = .true.         !  level ice melt ponds
         rn_apnd_min =   0.15         !     minimum meltwater fraction contributing to pond growth (TOPO and LEV)
         rn_apnd_max =   0.85         !     maximum meltwater fraction contributing to pond growth (TOPO and LEV)
         rn_pnd_flush=   0.1          !     pond flushing efficiency (tuning parameter) (LEV)
      ln_pnd_CST     = .false.        !  constant  melt ponds
         rn_apnd     =   0.2          !     prescribed pond fraction, at Tsu=0 degC
         rn_hpnd     =   0.05         !     prescribed pond depth,    at Tsu=0 degC
      ln_pnd_lids    = .true.         !  frozen lids on top of the ponds (only for ln_pnd_LEV)
      ln_pnd_alb     = .true.         !  effect of melt ponds on ice albedo
/
!------------------------------------------------------------------------------
&namini         !   Ice initialization
!------------------------------------------------------------------------------
   ln_iceini        = .true.          !  activate ice initialization (T) or not (F)
   nn_iceini_file   =   0             !     0 = Initialise sea ice based on SSTs
                                      !     1 = Initialise sea ice from single category netcdf file
                                      !     2 = Initialise sea ice from multi category restart file
   rn_thres_sst     =   1.0           !  max temp. above Tfreeze with initial ice = (sst - tfreeze)
   rn_hti_ini_n     =   3.0           !  initial ice thickness       (m), North
   rn_hti_ini_s     =   1.0           !        "            "             South
   rn_hts_ini_n     =   0.3           !  initial snow thickness      (m), North
   rn_hts_ini_s     =   0.3           !        "            "             South
   rn_ati_ini_n     =   0.9           !  initial ice concentration   (-), North
   rn_ati_ini_s     =   0.9           !        "            "             South
   rn_smi_ini_n     =   6.3           !  initial ice salinity     (g/kg), North
   rn_smi_ini_s     =   6.3           !        "            "             South
   rn_tmi_ini_n     = 270.            !  initial ice temperature     (K), North
   rn_tmi_ini_s     = 270.            !        "            "             South
   rn_tsu_ini_n     = 270.            !  initial surface temperature (K), North
   rn_tsu_ini_s     = 270.            !        "            "             South
   rn_tms_ini_n     = 270.            !  initial snw temperature     (K), North
   rn_tms_ini_s     = 270.            !        "            "             South
   rn_apd_ini_n     =   0.2           !  initial pond fraction       (-), North
   rn_apd_ini_s     =   0.2           !        "            "             South
   rn_hpd_ini_n     =   0.05          !  initial pond depth          (m), North
   rn_hpd_ini_s     =   0.05          !        "            "             South
   rn_hld_ini_n     =   0.0           !  initial pond lid depth      (m), North
   rn_hld_ini_s     =   0.0           !        "            "             South
   ! -- for nn_iceini_file = 1
   sn_hti = 'Ice_initialization'    , -12. ,'hti'   ,  .false.  , .true., 'yearly'  , '' , '', ''
   sn_hts = 'Ice_initialization'    , -12. ,'hts'   ,  .false.  , .true., 'yearly'  , '' , '', ''
   sn_ati = 'Ice_initialization'    , -12. ,'ati'   ,  .false.  , .true., 'yearly'  , '' , '', ''
   sn_smi = 'Ice_initialization'    , -12. ,'smi'   ,  .false.  , .true., 'yearly'  , '' , '', ''
   sn_tmi = 'Ice_initialization'    , -12. ,'tmi'   ,  .false.  , .true., 'yearly'  , '' , '', ''
   sn_tsu = 'Ice_initialization'    , -12. ,'tsu'   ,  .false.  , .true., 'yearly'  , '' , '', ''
   sn_tms = 'NOT USED'              , -12. ,'tms'   ,  .false.  , .true., 'yearly'  , '' , '', ''
   !      melt ponds (be careful, sn_apd is the pond concentration (not fraction), so it differs from rn_apd)
   sn_apd = 'NOT USED'              , -12. ,'apd'   ,  .false.  , .true., 'yearly'  , '' , '', ''
   sn_hpd = 'NOT USED'              , -12. ,'hpd'   ,  .false.  , .true., 'yearly'  , '' , '', ''
   sn_hld = 'NOT USED'              , -12. ,'hld'   ,  .false.  , .true., 'yearly'  , '' , '', ''
   cn_dir='./'
/
!------------------------------------------------------------------------------
&namalb         !   albedo parameters
!------------------------------------------------------------------------------
   !                                  !                          !  obs range (cloud-sky)
   rn_alb_sdry      =   0.85          !  dry snow albedo         :  0.85 -- 0.87
   rn_alb_smlt      =   0.75          !  melting snow albedo     :  0.72 -- 0.82
   rn_alb_idry      =   0.60          !  dry ice albedo          :  0.54 -- 0.65
   rn_alb_imlt      =   0.50          !  bare puddled ice albedo :  0.49 -- 0.58
   rn_alb_dpnd      =   0.27          !  ponded ice albedo       :  0.10 -- 0.30 
   rn_alb_hpiv      =   1.00          !  pivotal ice thickness in m (above which albedo is constant)
/
!------------------------------------------------------------------------------
&namdia         !   Diagnostics
!------------------------------------------------------------------------------
   ln_icediachk     = .false.         !  check online heat, mass & salt budgets
      !                               !   rate of ice spuriously gained/lost at each time step => rn_icechk=1 <=> 1.e-6 m/hour
      rn_icechk_cel =  1.             !     check at each gridcell          (1.e-06m/h)=> stops the code if violated (and writes a file)
      rn_icechk_glo =  1.e-04         !     check over the entire ice cover (1.e-10m/h)=> only prints warnings
   ln_icediahsb     = .true.          !  output the heat, mass & salt budgets (T) or not (F)
   ln_icectl        = .false.         !  ice points output for debug (T or F)
      iiceprt       =  10             !     i-index for debug
      jiceprt       =  10             !     j-index for debug
/
