!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
!! NEMO/OPA  : 1D configuration based on Kato-Philipps () exp.
!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

!!======================================================================
!!              ***  Domain & Run management namelists  ***           !!
!!                                                                    !!
!!   namrun       parameters of the run
!!   namdom       space and time domain
!!   namcfg       parameters of the configuration                       (default: user defined GYRE)
!!   namwad       Wetting and drying                                    (default NO)
!!   namtsd       data: temperature & salinity                          (default NO)
!!   namcrs       coarsened grid (for outputs and/or TOP)               (ln_crs =T)
!!   namc1d       1D configuration options                              ("key_c1d")
!!   namc1d_dyndmp 1D newtonian damping applied on currents             ("key_c1d")
!!   namc1d_uvd   1D data (currents)                                    ("key_c1d")
!!======================================================================
!
!-----------------------------------------------------------------------
&namrun        !   parameters of the run
!-----------------------------------------------------------------------
   cn_exp      =  "PAPA"   !  experience name
   nn_it000    =       1   !  first time step
   nn_itend    =   87600   !  last  time step
   nn_date0    =  20100615 !  date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1)
   nn_leapy    =       1   !  Leap year calendar (1) or not (0)
   nn_stock    =   87600   !  frequency of creation of a restart file (modulo referenced to 1)
   nn_write    =     240   !  frequency of write in the output file   (modulo referenced to nn_it000)
/
!-----------------------------------------------------------------------
&namdom        !   space and time domain (bathymetry, mesh, timestep)
!-----------------------------------------------------------------------
   nn_bathy    =    0      !  compute (=0) or read (=1) the bathymetry file
   rn_bathy    = 4198.     !  value of the bathymetry. if (=0) bottom flat at jpkm1
   !
   rn_rdt      =  360.     !  time step for the dynamics 
   ppglam0     =    -150.0               !  longitude of first raw and column T-point (jphgr_msh = 1)
   ppgphi0     =      50.0               ! latitude  of first raw and column T-point (jphgr_msh = 1)
   ppe1_deg    =       0.1               !  zonal      grid-spacing (degrees)
   ppe2_deg    =       0.1               !  meridional grid-spacing (degrees)
   ppe1_m      =  999999.0               !  zonal      grid-spacing (degrees)
   ppe2_m      =  999999.0               !  meridional grid-spacing (degrees)
   ppsur       =   -3958.951371276829    !  ORCA r4, r2 and r05 coefficients
   ppa0        =    103.9530096000000    ! (default coefficients)
   ppa1        =     2.415951269000000   !
   ppkth       =      15.35101370000000  !
   ppacr       =       7.0               !
   ppdzmin     =  999999.0               !  Minimum vertical spacing
   pphmax      =  999999.0               !  Maximum depth
   ldbletanh   =  .TRUE.                 !  Use/do not use double tanf function for vertical coordinates
   ppa2        =  100.7609285000000      !  Double tanh function parameters
   ppkth2      =  48.02989372000000      !
   ppacr2      =   13.00000000000        !
/
!-----------------------------------------------------------------------
&namcfg     !   parameters of the configuration   
!-----------------------------------------------------------------------
   cp_cfg      =  "papa"                 !  name of the configuration
   jp_cfg      =       1                 !  resolution of the configuration
!   jpidta      =       3                 !  1st lateral dimension ( >= jpi ) = 30*jp_cfg+2
!   jpjdta      =       3                 !  2nd    "         "    ( >= jpj ) = 20*jp_cfg+2 
!   jpkdta      =      75                 !  number of levels      ( >= jpk )
!   jpiglo      =       3                 !  1st dimension of global domain --> i  = jpidta
!   jpjglo      =       3                 !  2nd    -                  -    --> j  = jpjdta
   jperio      =       0                 !  lateral cond. type (between 0 and 6)
/
!-----------------------------------------------------------------------
&namzgr        !   vertical coordinate
!-----------------------------------------------------------------------
   ln_zps      = .true.    !  z-coordinate - partial steps
/
!-----------------------------------------------------------------------
&namzgr_sco    !   s-coordinate or hybrid z-s-coordinate
!-----------------------------------------------------------------------
/
!-----------------------------------------------------------------------
&namc1d        !   1D configuration options                             ("key_c1d" default: PAPA station)
!-----------------------------------------------------------------------
   rn_lat1d    =      50.  !  Column latitude (default at PAPA station)
   rn_lon1d    =    -145.  !  Column longitude (default at PAPA station)
   ln_c1d_locpt=  .true.   ! Localization of 1D config in a grid (T) or independant point (F)
/
!-----------------------------------------------------------------------
&namc1d_uvd    !   data: U & V currents                                 ("key_c1d" default: NO)
!-----------------------------------------------------------------------
/
!-----------------------------------------------------------------------
&namc1d_dyndmp !   U & V newtonian damping                              ("key_c1d" default: NO)
!-----------------------------------------------------------------------
/
!-----------------------------------------------------------------------
&namtsd        !    Temperature & Salinity Data                         (default: NO)
!-----------------------------------------------------------------------
   !           !  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_tem      = 'init_PAPASTATION'         ,         24        ,'votemper',  .false.     , .true.,  'daily'  , ''       , ' '      , ''
   sn_sal      = 'init_PAPASTATION'         ,         24        ,'vosaline',  .false.     , .true.,  'daily'  , ''       , ' '      , ''
   !
   ln_tsd_init = .true.   !  Initialisation of ocean T & S with T &S input data (T) or not (F)
   ln_tsd_dmp  = .false.  !  damping of ocean T & S toward T &S input data (T) or not (F)
      cn_dir   = './'        !  root directory for the location of the runoff files
/

!!======================================================================
!!            ***  Surface Boundary Condition namelists  ***          !!
!!======================================================================
!
!-----------------------------------------------------------------------
&namsbc        !   Surface Boundary Condition manager
!-----------------------------------------------------------------------
   nn_fsbc     = 1   !  frequency of the calling of SBC module
                     ! Type of air-sea fluxes 
   ln_blk      = .false.   !  Bulk formulation                          (T => fill namsbc_blk )
                     ! Misc. options of sbc : 
   ln_traqsr   = .false.   !  Light penetration in the ocean            (T => fill namtra_qsr)
/
!-----------------------------------------------------------------------
&namsbc_flx    !   surface boundary condition : flux formulation
!-----------------------------------------------------------------------
/
!-----------------------------------------------------------------------
&namsbc_blk   !   namsbc_blk  generic Bulk formula                      (ln_blk = T)
!-----------------------------------------------------------------------
!              !  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_wndi     = 'forcing_PAPASTATION_1h' ,         1         , 'wndwe'   ,   .true.     , .false. , 'yearly' , '' , '', ''
   sn_wndj     = 'forcing_PAPASTATION_1h' ,         1         , 'wndsn'   ,   .true.     , .false. , 'yearly' , '' , '', ''
   sn_qsr      = 'forcing_PAPASTATION_1h' ,         1         , 'qsr'     ,   .false.    , .false. , 'yearly' , '' , '', ''
   sn_qlw      = 'forcing_PAPASTATION_1h' ,         1         , 'qlw'     ,   .false.    , .false. , 'yearly' , '' , '', ''
   sn_tair     = 'forcing_PAPASTATION_1h' ,         1         , 'tair'    ,   .true.     , .false. , 'yearly' , '' , '', ''
   sn_humi     = 'forcing_PAPASTATION_1h' ,         1         , 'humi'    ,   .true.     , .false. , 'yearly' , '' , '', ''
   sn_prec     = 'forcing_PAPASTATION_1h' ,         1         , 'prec'    ,   .false.    , .false. , 'yearly' , '' , '', ''
   sn_snow     = 'forcing_PAPASTATION_1h' ,         1         , 'snow'    ,   .false.    , .false. , 'yearly' , '' , '', ''
   sn_slp      = 'slp.15JUNE2009_fill'        ,         6         , 'SLP',        .false.    , .true. , 'yearly'  , 'weights_core_orca2_bilinear_noc.nc'  , ''       , ''

   !                    !  bulk algorithm :
   ln_NCAR     = .true.    ! "NCAR"      algorithm   (Large and Yeager 2008)
   ln_COARE_3p0= .false.   ! "COARE 3.0" algorithm   (Fairall et al. 2003)
   ln_COARE_3p5= .false.   ! "COARE 3.5" algorithm   (Edson et al. 2013)
   ln_ECMWF    = .false.   ! "ECMWF"     algorithm   (IFS cycle 31)

   rn_zqt      =  2.       !  Air temperature & humidity reference height (m)
/
!-----------------------------------------------------------------------
&namtra_qsr    !   penetrative solar radiation                          (ln_traqsr =T)
!-----------------------------------------------------------------------
!              !  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_chl      ='chlorophyll_PAPASTATION', -1    , 'CHLA'    ,   .true.     , .true. , 'yearly'  , ''       , ''       , ''

   ln_qsr_rgb  = .true.    !  RGB (Red-Green-Blue) light penetration

   nn_chldta   =      1    !  RGB : Chl data (=1) or cst value (=0)
      cn_dir   = './'         !  root directory for the location of the runoff files
/
!-----------------------------------------------------------------------
&namdrg            !   top/bottom drag coefficient                      (default: NO selection)
!-----------------------------------------------------------------------
   ln_non_lin = .true.     !  non-linear  drag: Cd = Cd0 |U|
/

!!======================================================================
!!                        Tracer (T & S) namelists
!!======================================================================
!
!-----------------------------------------------------------------------
&nameos        !   ocean physical parameters                            (default: NO selection)
!-----------------------------------------------------------------------
   ln_eos80    = .true.         !  = Use EOS80 equation of state
/
!-----------------------------------------------------------------------
&namtra_adv    !   advection scheme for tracer                          (default: NO selection)
!-----------------------------------------------------------------------
   ln_traadv_NONE= .true.  !  No tracer advection
/
!-----------------------------------------------------------------------
&namtra_ldf    !   lateral diffusion scheme for tracers
!-----------------------------------------------------------------------
   ln_traldf_NONE= .true.  ! No operator (no explicit diffusion)
/

!!======================================================================
!!                      ***  Dynamics namelists  ***                  !!
!!======================================================================
!
!-----------------------------------------------------------------------
&nam_vvl       !   vertical coordinate options                          (default: z-star)
!-----------------------------------------------------------------------
/
!-----------------------------------------------------------------------
&namdyn_adv    !   formulation of the momentum advection                (default: selection)
!-----------------------------------------------------------------------
   ln_dynadv_NONE= .true.  !  linear dynamics (no momentum advection)
/
!-----------------------------------------------------------------------
&namdyn_vor    !   Vorticity / Coriolis scheme                          (default: NO selection)
!-----------------------------------------------------------------------
   ln_dynvor_ene = .true.  !  energy    conserving scheme
/
!-----------------------------------------------------------------------
&namdyn_hpg    !   Hydrostatic pressure gradient option
!-----------------------------------------------------------------------
/
!-----------------------------------------------------------------------
&namdyn_spg    !   surface pressure gradient                            (default: NO)
!-----------------------------------------------------------------------
/
!-----------------------------------------------------------------------
&namdyn_ldf    !   lateral diffusion on momentum
!-----------------------------------------------------------------------
   ln_dynldf_NONE= .true.     ! No operator (no explicit diffusion)
/

!!======================================================================
!!                     vertical physics namelists                     !!
!!======================================================================
!
!-----------------------------------------------------------------------
&namzdf        !   vertical physics                                     (default: NO selection)
!-----------------------------------------------------------------------
   !                       ! type of vertical closure
   ln_zdfcst   = .false.      !  constant mixing
   ln_zdfric   = .false.      !  local Richardson dependent formulation (T =>   fill namzdf_ric)
   ln_zdftke   = .false.      !  Turbulent Kinetic Energy closure       (T =>   fill namzdf_tke)
   ln_zdfgls   = .true.       !  Generic Length Scale closure           (T =>   fill namzdf_gls)
   ln_zdfosm   = .false.      !  OSMOSIS BL closure                     (T =>   fill namzdf_osm)
   !
   !                       ! convection
   ln_zdfevd   = .false.      !  enhanced vertical diffusion
      nn_evdm     =    0         ! apply on tracer (=0) or on tracer and momentum (=1)
      rn_evd      =  100.        ! mixing coefficient [m2/s]
   ln_zdfnpc   = .false.      !  Non-Penetrative Convective algorithm
      nn_npc      =    1         ! frequency of application of npc
      nn_npcp     =  365         ! npc control print frequency
   !
   ln_zdfddm   = .false.   ! double diffusive mixing
      rn_avts  =    1.e-4     !  maximum avs (vertical mixing on salinity)
      rn_hsbfr =    1.6       !  heat/salt buoyancy flux ratio
   !
   !                       ! gravity wave-driven vertical mixing
   ln_zdfiwm   = .false.      ! internal wave-induced mixing            (T =>   fill namzdf_iwm)
   ln_zdfswm   = .false.      ! surface  wave-induced mixing            (T => ln_wave=ln_sdw=T )
   !
   !                       ! coefficients
   rn_avm0     =   1.2e-4     !  vertical eddy viscosity   [m2/s]       (background Kz if ln_zdfcst=F)
   rn_avt0     =   1.2e-5     !  vertical eddy diffusivity [m2/s]       (background Kz if ln_zdfcst=F)
   nn_avb      =    0         !  profile for background avt & avm (=1) or not (=0)
   nn_havtb    =    0         !  horizontal shape for avtb (=1) or not (=0)
/
!-----------------------------------------------------------------------
&namzdf_ric    !   richardson number dependent vertical diffusion       (ln_zdfric =T)
!-----------------------------------------------------------------------
/
!-----------------------------------------------------------------------
&namzdf_tke    !   turbulent eddy kinetic dependent vertical diffusion  (ln_zdftke =T)
!-----------------------------------------------------------------------
/
!-----------------------------------------------------------------------
&namzdf_gls                !   GLS vertical diffusion                   (ln_zdfgls =T)
!-----------------------------------------------------------------------
/
!-----------------------------------------------------------------------
&namzdf_osm                !   OSM vertical diffusion                   (ln_zdfosm =T)
!-----------------------------------------------------------------------
/
!-----------------------------------------------------------------------
&namzdf_iwm    !    internal wave-driven mixing parameterization        (ln_zdfiwm =T)
!-----------------------------------------------------------------------
/