:=============================================================================
:         MODULE SUBSTANCE NAMELIST with  CPP key : SUBSTANCE 
:=============================================================================
:
:-----------------------------------------------------------------------------
: nmlnbvar : number of each type of substance to be defined (other than T & S)
:-----------------------------------------------------------------------------
:    nv_dis : number of dissolved substances
:    nv_ncp : number of  Non Constitutive Particulate substances
:    nv_fix : number of  fixed substances (not advected)
:    nv_bent : number of benthic substances
:    nv_grav : number of substances type GRAVELS (only if cppkey MUSTANG)
:    nv_sand : number of substances type SAND (only if cppkey MUSTANG)
:    nv_mud : number of substances type MUD (only if cppkey MUSTANG)
:    nv_sorb : number of particulate substances sorbed on an other particule
:
 &nmlnbvar
    nv_dis=0
    nv_ncp=0
    nv_fix=0
    nv_bent=0 
    nv_grav=0
    nv_sand=2
    nv_mud=1
    nv_sorb=0 /

:-----------------------------------------------------------------------------
: Namelists for each type of substance 
:-----------------------------------------------------------------------------
:-----------------------------------------------------------------------------
: nmlgravels : Characterization of GRAVEL substances (used only if defined 
:              MUSTANG)
:              If nv_grav = 0 this namelist is not read
:-----------------------------------------------------------------------------
:    name_var_n() : string, name of variable
:    long_name_var_n() : string, long name of variable
:    standard_name_var_n() : string, standard name of variable
:    unit_var_n() : string, unit of concentration of variable
:    flx_atm_n() : real, uniform atmospherical deposition (unit/m2/s) 
:    cv_rain_n() : real, concentration in rainwater (unit/m3 of water)
:    cini_wat_n() : real, initial concentration in water column (unit/m3)
:    cini_air_n() : real, initial concentration in air
:    l_out_subs_n() : boolean, saving in output file if TRUE
:    init_cv_name_n() : string, name of substance read from initial condition 
:                       file
:    obc_cv_name_n() : string, name of substance read from obc file
:    cini_sed_n() : real, initial concentration in sediment (quantity/kg of 
:                   dry sediment)  (only if cppkey MUSTANG)
:    tocd_n() : real, critical stress of deposition (N/m2)
:    ros_n()  : real, density of particle (kg/m3)
:    l_bedload_n() : boolean, allow bedload transport (used only if 
:                    key_MUSTANG_V2 and key_MUSTANG_bedload)
:    diam_n() : real, diameter of particles (m)
:   
 &nmlgravels
    name_var_n(1)=''
      long_name_var_n(1)=''
      standard_name_var_n(1)=''
      unit_var_n(1)=''
      flx_atm_n(1)=0.0
      cv_rain_n(1)=0.0
      cini_wat_n(1)=0.0
      cini_sed_n(1)=0.0
      cini_air_n(1)=0.0
      l_out_subs_n(1)=.TRUE.
      l_bedload_n(1)=.TRUE.
      init_cv_name_n(1)='none'
      obc_cv_name_n(1)='none'
      tocd_n(1)=0.0
      ros_n(1)=0.0
      diam_n(1)=0.0 /
:-----------------------------------------------------------------------------
: nmlsands : Characterization of SAND substances (used only if defined 
:            MUSTANG)
:            If nv_sand = 0 this namelist is not read
:-----------------------------------------------------------------------------
:    name_var_n() : string, name of variable
:    long_name_var_n() : string, long name of variable
:    standard_name_var_n() : string, standard name of variable
:    unit_var_n() : string, unit of concentration of variable
:    flx_atm_n() : real, uniform atmospherical deposition (unit/m2/s) 
:    cv_rain_n() : real, concentration in rainwater (unit/m3 of water)
:    cini_wat_n() : real, initial concentration in water column (unit/m3)
:    cini_air_n() : real, initial concentration in air
:    l_out_subs_n() : boolean, saving in output file if TRUE
:    init_cv_name_n() : string, name of substance read from initial condition 
:                       file
:    obc_cv_name_n() : string, name of substance read from obc file
:    cini_sed_n() : real, initial concentration in sediment (quantity/kg of 
:                   dry sediment)  (only if cppkey MUSTANG)
:    tocd_n() : real, critical stress of deposition (N/m2) 
:    ros_n()  : real, density of particle (kg/m3)
:    l_bedload_n() : boolean, allow bedload transport (used only if 
:                    key_MUSTANG_V2 and key_MUSTANG_bedload)
:    diam_n() : diameter of particles
:    l_sand2D() : boolean, to treat sand variable as 2D variable (used only if 
:                 key_sand2D)
:    l_outsandrouse()  : boolean, to use a reconstitution of a ROUSE profil 
:                        for output in water column (used only if key_sand2D 
:                        and l_sand2D is TRUE for this variable)
:
:  WARNING if several sands: start with the coarser sands and continue more 
:  and more finely
:
 &nmlsands
    name_var_n(1)='GRAV'
      long_name_var_n(1)='GRAV'
      standard_name_var_n(1)='GRAV'
      unit_var_n(1)='kg.m-3'
      flx_atm_n(1)=0.0
      cv_rain_n(1)=0.0
      cini_wat_n(1)=0.0
      cini_sed_n(1)=0.4
      cini_air_n(1)=0.0
      l_out_subs_n(1)=.TRUE.
      l_bedload_n(1)=.FALSE.
      init_cv_name_n(1)='GRAV'
      obc_cv_name_n(1)='GRAV'
      tocd_n(1)=0.5
      ros_n(1)=2600.0
      diam_n(1)=0.0002
      l_sand2D_n(1)=.FALSE.
      l_outsandrouse_n(1)=.FALSE. 
    name_var_n(2)='SAND'
      long_name_var_n(2)='SAND'
      standard_name_var_n(2)='SAND'
      unit_var_n(2)='kg.m-3'
      flx_atm_n(2)=0.0
      cv_rain_n(2)=0.0
      cini_wat_n(2)=0.0
      cini_sed_n(2)=0.4
      cini_air_n(2)=0.0
      l_out_subs_n(2)=.TRUE.
      l_bedload_n(2)=.FALSE.
      init_cv_name_n(2)='SAND'
      obc_cv_name_n(2)='SAND'
      tocd_n(2)=1.0
      ros_n(2)=2600.0
      diam_n(2)=0.0001
      l_sand2D_n(2)=.FALSE.
      l_outsandrouse_n(2)=.FALSE.  /
:-----------------------------------------------------------------------------    
: nmlmuds : Characterization of MUD substances (used only if defined MUSTANG)
:           If nv_mud = 0 this namelist is not read
:-----------------------------------------------------------------------------
:    name_var_n() : string, name of variable
:    long_name_var_n() : string, long name of variable
:    standard_name_var_n() : string, standard name of variable
:    unit_var_n() : string, unit of concentration of variable
:    flx_atm_n() : real, uniform atmospherical deposition (unit/m2/s) 
:    cv_rain_n() : real, concentration in rainwater (unit/m3 of water)
:    cini_wat_n() : real, initial concentration in water column (unit/m3)
:    cini_air_n() : real, initial concentration in air
:    l_out_subs_n() : boolean, saving in output file if TRUE
:    init_cv_name_n() : string, name of substance read from initial condition 
:                       file
:    obc_cv_name_n() : string, name of substance read from obc file
:    cini_sed_n() : real, initial concentration in sediment (quantity/kg of 
:                   dry sediment)  (only if cppkey MUSTANG)
:    cobc_wat_n() : real, boundaries uniform and constant concentration 
:                   (kg/m3)
:    tocd_n() : real, critical stress of deposition (N/m2) 
:    diam_n() : real, diameter (m), used only if key_MUSTANG_flocmod
:    ros_n()  : real, density of particle (kg/m3)
:    ws_free_opt_n() : integer, choice of free settling formulation : 
:                      0 constant, 1 Van Leussen, 2 Winterwerp, 3 Wolanski
:    ws_free_min_n() : real, minimum setling velocity (m/s)
:    ws_free_max_n() : real, maximum setling velocity (m/s)
:    ws_free_para_n(1:4,num substance) : 4 additional parameters
:    ws_hind_opt_n() : choice of hindered settling formulation : 
:                      0 no hindered settling, 1 Scott, 2 Winterwerp, 
:                      3 Wolanski
:    ws_hind_para_n(1:2,num substance) : 2 additional parameters 
:
 &nmlmuds
    name_var_n(1)='MUD'
      long_name_var_n(1)='MUD'
      standard_name_var_n(1)='MUD'
      unit_var_n(1)='kg.m-3'
      flx_atm_n(1)=0.0
      cv_rain_n(1)=0.0
      cini_wat_n(1)=0.02
      cobc_wat_n(1)=0.02
      cini_sed_n(1)=0.2
      cini_air_n(1)=0.0
      l_out_subs_n(1)=.TRUE.
      init_cv_name_n(1)='MUD'
      obc_cv_name_n(1)='MUD'
      tocd_n(1)=1.
      diam_n(1)=0.00003
      ros_n(1)=2600.0
      ws_free_opt_n(1)=0
      ws_free_min_n(1)=0.0005
      ws_free_max_n(1)=0.0005
      ws_free_para_n(1,1)=0.0, 
      ws_free_para_n(2,1)=0.0, 
      ws_free_para_n(3,1)=0.0, 
      ws_free_para_n(4,1)=0.0
      ws_hind_opt_n(1)=0
      ws_hind_para_n(1,1)=0.0 ,  
      ws_hind_para_n(2,1)=0.0 /


:-----------------------------------------------------------------------------
: nmlpartnc : NON constitutive substances
:             If nv_ncp = 0 this namelist is not read
:-----------------------------------------------------------------------------
:    name_var_n() : string, name of variable
:    long_name_var_n() : string, long name of variable
:    standard_name_var_n() : string, standard name of variable
:    unit_var_n() : string, unit of concentration of variable
:    flx_atm_n() : real, uniform atmospherical deposition (unit/m2/s) 
:    cv_rain_n() : real, concentration in rainwater (unit/m3 of water)
:    cini_wat_n() : real, initial concentration in water column (unit/m3)
:    cini_air_n() : real, initial concentration in air
:    l_out_subs_n() : boolean, saving in output file if TRUE
:    init_cv_name_n() : string, name of substance read from initial condition 
:                       file
:    obc_cv_name_n() : string, name of substance read from obc file
:    cobc_wat_n() : real, boundaries uniform and constant concentration 
:                   (kg/m3)
:    ws_free_min_n() : real, minimum setling velocity (m/s)
:    ws_free_max_n() : real, maximum setling velocity (m/s)
:    cini_sed_n() : real, initial concentration in sediment (quantity/kg of 
:                   dry sediment)  (only if cppkey MUSTANG)
:    tocd_n() : real, critical stress of deposition (N/m2) (only if cppkey 
:               MUSTANG)
:    ros_n()  : real, density of particle (kg/m3)(only if cppkey MUSTANG)
:    ws_free_opt_n() : choice of free settling formulation : 
:                      0 constant, 1 Van Leussen, 2 Winterwerp, 3 Wolanski  
:                      (only if cppkey MUSTANG)
:    ws_free_para_n(1:4,num substance) : 4 additional parameters 
:                                        (only if cppkey MUSTANG)
:    ws_hind_opt_n() : choice of hindered settling formulation : 
:                      0 no hindered settling, 1 Scott, 2 Winterwerp, 
:                      3 Wolanski  (only if cppkey MUSTANG)
:    ws_hind_para_n(1:2,num substance) : 2 additional parameters  
:                                        (only if cppkey MUSTANG)
:
 &nmlpartnc
    name_var_n(1)='MES'
      long_name_var_n(1)='MES'
      standard_name_var_n(1)='MES'
      unit_var_n(1)='g.l-1'
      flx_atm_n(1)=0.0
      cv_rain_n(1)=0.0
      cini_wat_n(1)=1.0
      cobc_wat_n(1)=1.
      cini_sed_n(1)=0.4
      cini_air_n(1)=0.0
      l_out_subs_n(1)=.TRUE.
      init_cv_name_n(1)='MES'
      obc_cv_name_n(1)='MES'
      tocd_n(1)=1000.0
      ros_n(1)=2600.0
      ws_free_opt_n(1)=0
      ws_free_min_n(1)=0.0001
      ws_free_max_n(1)=0.0015
      ws_free_para_n(1,1)=0.003,  
      ws_free_para_n(2,1)=0.79,  
      ws_free_para_n(3,1)=0.3,  
      ws_free_para_n(4,1)=0.18
      ws_hind_opt_n(1)=0
      ws_hind_para_n(1,1)=0.0 , 
      ws_hind_para_n(2,1)=0.0 /

:-----------------------------------------------------------------------------
: nmlpartsorb : SORBED SUBSTANCES
:               If nv_sorb = 0 this namelist is not read
:-----------------------------------------------------------------------------
:    name_var_n() : string, name of variable
:    long_name_var_n() : string, long name of variable
:    standard_name_var_n() : string, standard name of variable
:    unit_var_n() : string, unit of concentration of variable
:    flx_atm_n() : real, uniform atmospherical deposition (unit/m2/s) 
:    cv_rain_n() : real, concentration in rainwater (unit/m3 of water)
:    cini_wat_n() : real, initial concentration in water column (unit/m3)
:    cini_air_n() : real, initial concentration in air
:    l_out_subs_n() : boolean, saving in output file if TRUE
:    init_cv_name_n() : string, name of substance read from initial condition 
:                       file
:    obc_cv_name_n() : string, name of substance read from obc file
:    cini_sed_n() : real, initial concentration in sediment (quantity/kg of 
:                   dry sediment)  (only if cppkey MUSTANG)
:    cobc_wat_n() : real, boundaries uniform and constant concentration 
:                   (kg/m3)
:    name_varpc_assoc_n() : string, name of associated particulate substance  
:                            on which this substance is sorbed
:
 &nmlpartsorb
    name_var_n(1)='testpartnc'
      long_name_var_n(1)='testpartnc'
      standard_name_var_n(1)='testpartnc'
      unit_var_n(1)='ng.l-1'
      flx_atm_n(1)=0.0
      cv_rain_n(1)=0.0
      cini_wat_n(1)=1.0
      cini_sed_n(1)=10.
      cini_air_n(1)=0.0
      l_out_subs_n(1)=.TRUE.
      init_cv_name_n(1)='none'
      obc_cv_name_n(1)='none' 
      cobc_wat_n(1)=1.
      name_varpc_assoc_n(1)='MES_mud'/

:-----------------------------------------------------------------------------
: nmlvardiss : DISSOLVED SUBSTANCES
:              If nv_dis = 0 this namelist is not read
:-----------------------------------------------------------------------------
:    name_var_n() : string, name of variable
:    long_name_var_n() : string, long name of variable
:    standard_name_var_n() : string, standard name of variable
:    unit_var_n() : string, unit of concentration of variable
:    flx_atm_n() : real, uniform atmospherical deposition (unit/m2/s) 
:    cv_rain_n() : real, concentration in rainwater (unit/m3 of water)
:    cini_wat_n() : real, initial concentration in water column (unit/m3)
:    cini_air_n() : real, initial concentration in air
:    l_out_subs_n() : boolean, saving in output file if TRUE
:    init_cv_name_n() : string, name of substance read from initial condition 
:                       file
:    obc_cv_name_n() : string, name of substance read from obc file
:    cini_sed_n() : real, initial concentration in sediment (quantity/kg of 
:                   dry sediment)  (only if cppkey MUSTANG)
:    cobc_wat_n() : real, boundaries uniform and constant concentration 
:                   (kg/m3)
:
 &nmlvardiss
    name_var_n(1)='DISS'
      long_name_var_n(1)='testdiss'
      standard_name_var_n(1)='testdiss'
      unit_var_n(1)='ng.l-1'
      flx_atm_n(1)=0.0
      cv_rain_n(1)=0.0
      cini_wat_n(1)=100.0
      cobc_wat_n(1)=100.
      cini_sed_n(1)=0.
      cini_air_n(1)=0.0
      l_out_subs_n(1)=.TRUE.
      init_cv_name_n(1)='testdiss'
      obc_cv_name_n(1)='testdiss' /

:-----------------------------------------------------------------------------
: nmlvarfix : FIXED SUBSTANCES (not advected)
:             If nv_fix = 0 this namelist is not read
:-----------------------------------------------------------------------------
:    name_var_fix() : string, name of variable
:    long_name_var_fix() : string, long name of variable
:    standard_name_var_fix() : string, standard name of variable
:    unit_var_fix() : string, unit of concentration of variable
:    cini_wat_fix) : real, initial concentration in water column (unit/m3)
:    l_out_subs_fix() : boolean, saving in output file if TRUE
:    init_cv_name_fix() : string, name of substance read from initial  
:                         condition file
:    
 &nmlvarfix
    name_var_fix(1)=''
       long_name_var_fix(1)=''
       standard_name_var_fix(1)=''
       unit_var_fix(1)=''
       cini_wat_fix(1)=0.0
       l_out_subs_fix(1)=.TRUE.
       init_cv_name_fix(1)='none'  /

:-----------------------------------------------------------------------------
: nmlbent : used only if defined key_benthic 
:           If nv_bent = 0 this namelist is not read
:-----------------------------------------------------------------------------
:    name_var_bent() : string, name of variable
:    long_name_var_bent() : string, long name of variable
:    standard_name_var_bent() : string, standard name of variable
:    unit_var_bent() : string, unit of concentration of variable
:    l_out_subs_bent() : boolean, saving in output file if TRUE
:    cini_bent() : real, initial concentration 
:
 &nmlvarbent
    name_var_bent(1)=''
       long_name_var_bent(1)=''
       standard_name_var_bent(1)=''
       unit_var_bent(1)=''
       cini_bent(1)=0.0
       l_out_subs_bent(1)=.TRUE. /

:-----------------------------------------------------------------------------
: nmlsubmassbalance : used only if defined SUBSTANCE_SUBMASSBALANCE 
:           else this namelist is not read
:-----------------------------------------------------------------------------
:    submassbalance_l : boolean, activate submassbalance computation
:    submassbalance_nb_border  : integer, nomber of polygons and lines
:    submassbalance_input_file : string, path of the input file (if '' or 'all_domain', 
:                  only one budget zone is taking into account 
:                  (all the domain) and any fluxes threw open borders
:    submassbalance_dtout : real, output frequency in hours (h)
:    submassbalance_date_start : string, starting date for budget/fluxes computing
:
&nmlsubmassbalance
    submassbalance_l = .TRUE.
    submassbalance_nb_border = 1
    submassbalance_input_file = ''
    submassbalance_output_file = 'outsubmassbalance.nc'
    submassbalance_dtout = 1.
    submassbalance_date_start ='1999/01/01 00:00:00' /



