!  Nutrient-Phytoplankton-Zooplankton-Detritus Biological Model Parameters.
!
!git $Id$
!svn $Id: npzd_iron.in 1151 2023-02-09 03:08:53Z arango $
!========================================================= Hernan G. Arango ===
!  Copyright (c) 2002-2023 The ROMS/TOMS Group                                !
!    Licensed under a MIT/X style license                                     !
!    See License_ROMS.md                                                      !
!==============================================================================
!                                                                             !
! Input parameters can be entered in ANY order, provided that the parameter   !
! KEYWORD (usually, upper case) is typed correctly followed by "="  or "=="   !
! symbols. Any comment lines are allowed and must begin with an exclamation   !
! mark (!) in column one.  Comments may  appear to the right of a parameter   !
! specification to improve documentation.  Comments will be ignored  during   !
! reading.  Blank lines are also allowed and ignored. Continuation lines in   !
! a parameter specification are allowed and must be preceded by a backslash   !
! (\).  In some instances, more than one value is required for a parameter.   !
! If fewer values are provided, the  last value  is assigned for the entire   !
! parameter array.  The multiplication symbol (*),  without blank spaces in   !
! between, is allowed for a parameter specification.  For example, in a two   !
! grids nested application:                                                   !
!                                                                             !
!    AKT_BAK == 2*1.0d-6  2*5.0d-6              ! m2/s                        !
!                                                                             !
! indicates that the first two entries of array AKT_BAK,  in fortran column-  !
! major order, will have the same value of "1.0d-6" for grid 1,  whereas the  !
! next two entries will have the same value of "5.0d-6" for grid 2.           !
!                                                                             !
! In multiple levels of nesting and/or multiple connected domains  step-ups,  !
! "Ngrids" entries are expected for some of these parameters.  In such case,  !
! the order of the entries for a parameter is extremely important.  It  must  !
! follow the same order (1:Ngrids) as in the state variable declaration. The  !
! USER may follow the above guidelines for specifying his/her values.  These  !
! parameters are marked by "==" plural symbol after the KEYWORD.              !
!                                                                             !
!==============================================================================
!
! NOTICE: Input parameter units are specified within brackets and default
! ******  values are specified within braces.
!
! Switch to control the computation of biology within nested and/or multiple
! connected grids.

    Lbiology == T

! Maximum number of iterations to achieve convergence of the nonlinear
! solution.

     BioIter == 1

! Initial concentration for analytical uniform initial conditions.
! [millimole/meter3].

BioIni(iNO3_) == 17.0d0                          ! nitrate
BioIni(iPhyt) == 1.0d0                           ! phytoplankton
BioIni(iZoop) == 1.0d0                           ! zooplankton
BioIni(iSDet) == 1.0d0                           ! detritus
BioIni(iFphy) == 0.0d0                           ! iron in phytoplankton
BioIni(iFdis) == 0.0d0                           ! dissolved iron

! Fraction of shortwave radiation that is photosynthetically active
! (nondimensional), {0.43d0}.

     PARfrac == 0.43d0

! Light attenuation due to seawater [1/m], {0.067d0}.

       AttSW == 0.067d0                          ! k_ext

! Light attenuation due to phytoplankton, self-shading coefficient,
! [m2/millimole_N], {0.0095d0}.

      AttPhy == 0.04d0                         ! k_extP

! Phytoplankton, initial slope of P-I curve [m2/W], {0.025d0}.

       PhyIS == 0.02d0                          ! alpha

! Nitrate uptake rate, [1/day], {1.5d0}.

       Vm_NO3 == 1.0d0                           ! Vm

! Phytoplankton mortality rate to Detritus pool [1/day], {0.1d0}.

      PhyMRD == 0.1d0                            ! sigmaD

! Phytoplankton mortality rate to Nitrogen pool [1/day], {0.0d0}.

      PhyMRN == 0.0d0                            ! sigmaN

! Inverse half-saturation for phytoplankton nitrate uptake
! [1/(millimole_N m-3)], {1.0d0}.

        K_NO3 == 1.0d0                           ! k_N

! Ivlev constant for zooplankton grazing parameterization
! [Nondimensional], {14*0.06=0.84d0}

        Ivlev == 0.84d0

! Zooplankton grazing rate, [1/day], {0.52}.

        ZooGR == 0.65d0                          ! R_m

! Zooplankton excretion efficiency to Detritus pool [nondimensional],
! {0.3d0}

       ZooEED == 0.0d0                           ! gammaD

! Zooplankton excretion efficiency to Nitrogen pool [nondimensional],
! {0.3d0}

       ZooEEN == 0.3d0                           ! gammaN

! Zooplankton mortality rate to Detritus pool, [1/day], {0.0d0}.

       ZooMRD == 0.145d0                         ! zetaD

! Zooplankton mortality rate to Nitrogen pool, [1/day], {0.145d0}.

       ZooMRN == 0.0d0                           ! zetaN

! Detritus remineralization rate, [1/day], {0.1d0}.

        DetRR == 1.0d0                           ! delta

! Phytoplankton sinking rate, [m/day], {0.0d0}.

         wPhy == 0.0d0                           ! wP

! Detrital sinking rate, [m/day], {8.0d0}.

         wDet == 8.0d0                           ! wD

! Iron uptake timescale, [day], {1.0d0}.

         T_Fe == 1.0d0                           ! T_Fe

! Empirical Fe:C power, [nondimensional], {0.6d0}.

         A_Fe == 0.6d0                           ! A_Fe

! Empirical Fe:C coefficient, [1/M-C], {64.0d0}.

         B_Fe == 64.0d0                          ! B_Fe

! Fe:C at F=0.5, [muM-Fe/M-C], {16.9d0}.

         K_FeC == 16.9d0                         ! K_FeC

! Fe remineralization rate, [1/day], {1.0d0}.

         FeRR == 0.5d0                           ! FeRR

! If applicable, dissolved Fe relaxation (nudging) parameters to simulate
! Fe source over the shelf (h <= FeHmin).

        FeHmin == 200.0d0                        ! minimum depth (m)
    FeNudgTime == 5.0d0                          ! nudging time (days)
         FeMax == 2.0d0                          ! Fe value (mmole/m3) to nudge

! Harmonic/biharmonic horizontal diffusion of biological tracer for
! nonlinear model and adjoint-based algorithms: [1:NBT,Ngrids].

         TNU2 == 6*5.0d0                         ! m2/s
         TNU4 == 6*0.0d0                         ! m4/s

      ad_TNU2 == 6*0.0d0                         ! m2/s
      ad_TNU4 == 6*0.0d0                         ! m4/s

! Logical switches (TRUE/FALSE) to increase/decrease horizontal diffusivity
! in specific areas of the application domain (like sponge areas) for the
! desired grid: [Ngrids]

LtracerSponge == 6*F

! Vertical mixing coefficients for biological tracers for nonlinear
! model and basic state scale factor in adjoint-based algorithms:
! [1:NBT,Ngrids].

      AKT_BAK == 6*1.0d-6                        ! m2/s

   ad_AKT_fac == 6*1.0d0                         ! nondimensional

! Nudging/relaxation time scales, inverse scales will be computed
! internally: [1:NBT,Ngrids].

        TNUDG == 6*0.0d0                         ! days

! Set horizontal and vertical advection schemes for biological tracers.
! A different advection scheme is allowed for each tracer. For example,
! a positive-definite (monotonic) algorithm can be activated for
! salinity and biological tracers, while a different one is set for
! temperature. [1:NAT+NPT,Ngrids] values are expected.
!
!   Keyword    Advection Algorithm
!
!   A4         4th-order Akima (horizontal/vertical)
!   C2         2nd-order centered differences (horizontal/vertical)
!   C4         4th-order centered differences (horizontal/vertical)
!   HSIMT      3th-order HSIMT-TVD (horizontal/vertical)
!   MPDATA     recursive flux corrected MPDATA (horizontal/vertical)
!   SPLINES    parabolic splines (only vertical)
!   SU3        split third-order upstream (horizontal/vertical)
!   U3         3rd-order upstream-biased (only horizontal)
!
! The user has the option of specifying the full Keyword or the first
! two letters, regardless if using uppercase or lowercase. If nested
! grids, specify values for each grid.

   Hadvection == HSIMT    \                     ! idbio(1), NO3
                 HSIMT    \                     ! idbio(2), phytoplankton
                 HSIMT    \                     ! idbio(3), zooplankton
                 HSIMT    \                     ! idbio(4), detritus
                 HSIMT    \                     ! idbio(5), phytoplanktonFe
                 HSIMT                          ! idbio(6), iron

   Vadvection == HSIMT    \                     ! idbio(1), NO3
                 HSIMT    \                     ! idbio(2), phytoplankton
                 HSIMT    \                     ! idbio(3), zooplankton
                 HSIMT    \                     ! idbio(4), detritus
                 HSIMT    \                     ! idbio(5), phytoplanktonFe
                 HSIMT                          ! idbio(6), iron

! Adjoint-based algorithms can have different horizontal and schemes
! for active and inert tracers.

ad_Hadvection == U3                             ! idbio(:), compact

ad_Vadvection == C4                             ! idbio(:), compact

! Set lateral boundary conditions keyword. Notice that a value is expected
! for each boundary segment per nested grid for each state variable.
!
! The biological tracer variables require [1:4,1:NBT,Ngrids] values. The
! boundary order is: 1=west, 2=south, 3=east, and 4=north. That is,
! anticlockwise starting at the western boundary.
!
! The keyword is case insensitive and usually has three characters. However,
! it is possible to have compound keywords, if applicable. For example, the
! keyword "RadNud" implies radiation boundary condition with nudging. This
! combination is usually used in active/passive radiation conditions.
!
! NOTICE: It is possible to specify the lateral boundary conditions for
! ======  all biological tracers in a compact form with a single entry.
! If so, all the biological tracers are assumed to have the same boundary
! condition as in the single entry.
!
!   Keyword    Lateral Boundary Condition Type
!
!   Cla        Clamped                                _____N_____     j=Mm
!   Clo        Closed                                |     4     |
!   Gra        Gradient                              |           |
!   Nes        Nested                              1 W           E 3
!   Nud        Nudging                               |           |
!   Per        Periodic                              |_____S_____|
!   Rad        Radiation                                   2          j=1
!                                                   i=1         i=Lm
!                   W       S       E       N
!                   e       o       a       o
!                   s       u       s       r
!                   t       t       t       t
!                           h               h
!
!                   1       2       3       4

   LBC(isTvar) ==   Per     Clo     Per     Clo \   ! idbio(1), NO3
                    Per     Clo     Per     Clo \   ! idbio(2), phytoplankton
                    Per     Clo     Per     Clo \   ! idbio(3), zooplankton
                    Per     Clo     Per     Clo \   ! idbio(4), detritus
                    Per     Clo     Per     Clo \   ! idbio(5), phytoplanktonFe
                    Per     Clo     Per     Clo     ! idbio(6), iron

! Adjoint-based algorithms can have different lateral boundary
! conditions keywords.

ad_LBC(isTvar) ==   Per     Clo     Per     Clo \   ! idbio(1), NO3
                    Per     Clo     Per     Clo \   ! idbio(2), phytoplankton
                    Per     Clo     Per     Clo \   ! idbio(3), zooplankton
                    Per     Clo     Per     Clo \   ! idbio(4), detritus
                    Per     Clo     Per     Clo \   ! idbio(5), phytoplanktonFe
                    Per     Clo     Per     Clo     ! idbio(6), iron

! Logical switches (TRUE/FALSE) to activate biological tracers point
! Sources/Sinks (like river runoff) and to specify which tracer variables
! to consider: [NBT,Ngrids] values are expected. See glossary below for
! details.

  LtracerSrc == 6*F

! Logical switches (TRUE/FALSE) to read and process biological tracer
! climatology fields: [NBT,Ngrids] values are expected. See glossary below
! for details.

  LtracerCLM == 6*F

! Logical switches (TRUE/FALSE) to nudge the desired biological tracer
! climatology field. If not analytical climatology fields, users need to
! turn on the logical switches above to process the fields from the
! climatology NetCDF file that are needed for nudging; [NBT,Ngrids]
! values are expected. See glossary below for details.

  LnudgeTCLM == 6*F

! Logical switches (TRUE/FALSE) to activate writing of biological fields
! into HISTORY output files: [1:NBT,Ngrids].

Hout(idTvar) == 6*T     ! ..., NO3, ...           biological tracer
Hout(idTsur) == 6*F     ! ..., NO3_sflux, ...     surface tracer flux

! Logical switches (TRUE/FALSE) to activate writing of biological fields
! into QUICKSAVE output files: [1:NBT,Ngrids].

Qout(idTvar) == 6*F     ! ..., NO3, ...           biological tracer
Qout(idsurT) == 6*F     ! ..., NO3_sur, ...       surface biological tracer
Qout(idTsur) == 6*F     ! ..., NO3_sflux, ...     surface tracer flux

! Logical switches (TRUE/FALSE) to activate writing of time-averaged fields
! into AVERAGE output file: [1:NBT,Ngrids].

Aout(idTvar) == 6*T     ! ..., NO3, ...           biological tracer

Aout(idTTav) == 6*F     ! ..., NO3_2, ...         quadratic <t*t> tracer terms
Aout(idUTav) == 6*F     ! ..., u_NO3, ...         quadratic <u*t> tracer terms
Aout(idVTav) == 6*F     ! ..., v_NO3, ...         quadratic <v*t> tracer terms
Aout(iHUTav) == 6*F     ! ..., Huon_NO3, ...      tracer volume flux, <Huon*t>
Aout(iHVTav) == 6*F     ! ..., Hvom_NO3, ...      tracer volume flux, <Hvom*t>

! Logical switches (TRUE/FALSE) to activate writing of time-averaged,
! biological tracer diagnostic terms into DIAGNOSTIC output file:
! [1:NBT,Ngrids].

Dout(iTrate) == 6*T     ! ..., NO3_rate, ...      time rate of change
Dout(iThadv) == 6*T     ! ..., NO3_hadv, ...      horizontal total advection
Dout(iTxadv) == 6*T     ! ..., NO3_xadv, ...      horizontal XI-advection
Dout(iTyadv) == 6*T     ! ..., NO3_yadv, ...      horizontal ETA-advection
Dout(iTvadv) == 6*T     ! ..., NO3_vadv, ...      vertical advection
Dout(iThdif) == 6*T     ! ..., NO3_hdiff, ...     horizontal total diffusion
Dout(iTxdif) == 6*T     ! ..., NO3_xdiff, ...     horizontal XI-diffusion
Dout(iTydif) == 6*T     ! ..., NO3_ydiff, ...     horizontal ETA-diffusion
Dout(iTsdif) == 6*T     ! ..., NO3_sdiff, ...     horizontal S-diffusion
Dout(iTvdif) == 6*T     ! ..., NO3_vdiff, ...     vertical diffusion

!
!  GLOSSARY:
!  =========
!
!------------------------------------------------------------------------------
! NPZD-Iron (Fiechter et al, 2009) Biological Model Parameters. Currently, it
! is configured with 6 biological tracers:
!
! idbio(1)      NO3               Nitrate concentration
! idbio(2)      phytoplankton     Phytoplankton biomass
! idbio(3)      zooplankton       Zooplankton biomass
! idbio(4)      detritus          Detritus concentration
! idbio(5)      phytoplanktonFe   Iron concentration in phytoplankton  if IRON
! idbio(6)      iron              Dissolved iron concentration         if IRON
!
!------------------------------------------------------------------------------
!
!  Lbiology       Switch to control the computation of a particular module
!                   within nested and/or multiple connected grids. By default
!                   this switch is set to TRUE in "mod_scalars" for all grids.
!                   Ngrids values are expected. The USER has the option, for
!                   example, to compute the biology in just one of the nested
!                   grids. If so, this switch needs to be consistent with the
!                   dimension parameter NBT in "mod_param".  In order to make
!                   the model more efficient in memory usage, NBT(:) should
!                   be zero in such grids.
!
!  BioIter        Maximum number of iterations to achieve convergence of
!                   the nonlinear implicit solution.
!
!  BioIni         Initial concentration for analytical uniform initial
!                   conditions, [millimole/meter3]. It is only used when
!                   ANA_BIOLOGY is activated.
!
!                     BioIni(iNO3_)          Nitrate concentration
!                     BioIni(iPhyt)          Phytoplankton biomass
!                     BioIni(iZoop)          Zooplankton biomass
!                     BioIni(iSDet)          Detritus concentration
!                     BioIni(iFphy)          Phytoplankton Iron concentration
!                     BioIni(iFdis)          Dissolved iron concentration
!
!  PARfrac        Fraction of shortwave radiation that is photosynthetically
!                   active (nondimensional).
!
!  AttSW          Light attenuation due to seawater [1/m].
!
!  AttPhy         Light attenuation by phytoplankton, self-shading
!                   coefficient, [m2/millimole_N].
!
!  PhyIS          Phytoplankton, initial slope of P-I curve [m2/W].
!
!  Vm_NO3         Nitrate uptake rate, [1/day].
!
!  PhyMRD         Phytoplankton mortality rate to Detritus, [1/day].
!
!  PhyMRN         Phytoplankton mortality rate to Nitrogen, [1/day].
!
!  K_NO3          Inverse half-saturation for phytoplankton nitrate uptake
!                   [1/(millimole_N m-3)].
!
!  Ivlev          Ivlev constant for zooplankton grazing parameterization,
!                   [nondimensional].
!
!  ZooGR          Zooplankton grazing rate, [1/day].
!
!  ZooEED         Zooplankton excretion efficiency to Detritus pool,
!                   [nondimensional].
!
!  ZooEEN         Zooplankton excretion efficiency to Nitrogen pool,
!                   [nondimensional].
!
!  ZooMRD         Zooplankton mortality rate to Detritus pool, [1/day].
!
!  ZooMRN         Zooplankton mortality rate to Nitrogen pool, [1/day].
!
!  DetRR          Detritus remineralization rate, [1/day].
!
!  wPhy           Phytoplankton sinking rate, [m/day].
!
!  wDet           Detrital sinking rate, [m/day].
!
!  T_Fe           Iron uptake timescale, [day].
!
!  A_Fe           Empirical Fe:C power, [nondimensional]
!
!  B_Fe           Empirical Fe:C coefficient, [1/M-C].
!
!  K_FeC          Fe:C at F=0.5, [muM-Fe/M-C].
!
!  FeRR           Fe remineralization rate, [1/day].
!
!  FeHmin         Minimum bathymetry value (meter; positive) considered to
!                   nudge dissolved iron over the shelf (h <= FeHmin).
!
!  FeNudgTime     Dissolved iron nudging time scale (days) over the shelf.
!                  Inverse scale will be computed internally.
!
!  FeMax          Dissolved iron value (mmole/m3) to nudge over the shelf to
!                   simulate Fe coastal source.  It is only considered when
!                   the IRON_RELAX c-preprocessing option is activated.
!
!------------------------------------------------------------------------------
! Physical Parameters, [1:NBT,1:Ngrids] values are expected.
!------------------------------------------------------------------------------
!
!  TNU2           Nonlinear model lateral, harmonic, constant, mixing
!                   coefficient (m2/s) for biological tracer variables;
!                   [1:NBT,1:Ngrids] values are expected. If variable
!                   horizontal diffusion is activated, TNU2 is the mixing
!                   coefficient for the largest grid-cell in the domain.
!
!  TNU4           Nonlinear model lateral, biharmonic, constant, mixing
!                   coefficient (m4/s) for biological tracer variables;
!                   [1:NBT,1:Ngrids] values are expected. If variable
!                   horizontal diffusion is activated, TNU4 is the mixing
!                   coefficient for the largest grid-cell in the domain.
!
!  ad_TNU2        Adjoint-based algorithms lateral, harmonic, constant,
!                   mixing coefficient (m2/s) for biological tracer variables;
!                   [1:NBT,1:Ngrids] values are expected. If variable
!                   horizontal diffusion is activated, ad_TNU2 is the mixing
!                   coefficient for the largest grid-cell in the domain.
!
!  ad_TNU4        Adjoint-based algorithms lateral, biharmonic, constant,
!                   mixing coefficient (m4/s) for biological tracer variables;
!                   [1:NBT,1:Ngrids] values are expected. If variable
!                   horizontal diffusion is activated, ad_TNU4 is the mixing
!                   coefficient for the largest grid-cell in the domain.
!
!  LtracerSponge  Logical switches (TRUE/FALSE) to increase/decrease horizontal
!                   diffusivity of biological tracers in specific areas of the
!                   domain. It can be used to specify sponge areas with larger
!                   horizontal mixing coefficients for damping of high
!                   frequency noise due to open boundary conditions or nesting.
!                   The CPP option SPONGE is now deprecated and replaced with
!                   this switch to facilitate or not sponge areas over a
!                   particular nested grid; [1:NBT,1:Ngrids] values are
!                   expected.
!
!                   The horizontal mixing distribution is specified in
!                   "ini_hmixcoef.F" as:
!
!                     diff2(i,j,itrc) = diff_factor(i,j) * diff2(i,j,itrc)
!                     diff4(i,j,itrc) = diff_factor(i,j) * diff4(i,j,itrc)
!
!                   The variable "diff_factor" can be read from the grid
!                   NetCDF file. Alternately, the horizontal diffusion in the
!                   sponge area can be set-up with analytical functions in
!                   "ana_sponge.h" using CPP ANA_SPONGE when these switches
!                   are turned ON for a particular grid.
!
!  AKT_BAK        Background vertical mixing coefficient (m2/s) for biological
!                   tracer variables, [1:NBT,1:Ngrids] values are expected.
!
!
!  ad_AKT_fac     Adjoint-based algorithms vertical mixing, basic state,
!                   scale factor (nondimensional) for biological tracer
!                   variables; [1:NBT,1:Ngrids] values are expected. In
!                   some applications, a smaller/larger values of vertical
!                   mixing are necessary for stability. It is only used
!                   when FORWARD_MIXING is activated.
!
!  TNUDG          Nudging time scale (days), [1:NBT,1:Ngrids]. Inverse scale
!                   will be computed internally.
!
!------------------------------------------------------------------------------
! Tracer advection scheme.
!------------------------------------------------------------------------------
!
! It is more advantageous to set the horizontal and vertical advection schemes
! for each tracer with switches instead of a single CPP flag for all of them.
! Positive-definite and monotonic algorithms (i.e., MPDATA and HSIMT) are
! appropriate and useful for positive fields like salinity, inert, biological,
! and sediment tracers.  However, since the temperature has a dynamic range
! with negative and positive values in the ocean, other advection schemes are
! more appropriate.
!
! Currently, the following tracer advection schemes are available and are
! activated using the associated Keyword:
!
!   Keyword    Advection Algorithm
!
!   A4         4th-order Akima (horizontal/vertical)
!   C2         2nd-order centered differences (horizontal/vertical)
!   C4         4th-order centered differences (horizontal/vertical)
!   HSIMT      3th-order HSIMT with TVD limiter (horizontal/vertical)
!   MPDATA     recursive flux corrected MPDATA (horizontal/vertical)
!   SPLINES    parabolic splines reconstruction (only vertical)
!   SU3        split third-order upstream (horizontal/vertical)
!   U3         3rd-order upstresm-bias (only horizontal)
!
! The user has the option of specifying the full Keyword or the first
! two letters, regardless if using uppercase or lowercase.
!
! If using either HSIMT (Wu and Zhu, 2010) or MPDATA (Margolin and
! Smolarkiewicz, 1998) options, the user needs to set the same scheme
! for both horizontal and vertical advection to preserve monotonicity.
!
! Hadvection     Horizontal advection for each active (temperature and
!                  salinity) and inert tracers, [1:NAT+NPT,Ngrids]
!                  values are expected.
!
! Vadvection     Vertical advection for each active (temperature and
!                  salinity) and inert tracers, [1:NAT+NPT,Ngrids]
!                  values are expected.
!
! ad_Hadvection  Horizontal advection for each active (temperature and
!                  salinity) and inert tracers in the adjoint-based
!                  algorithms, [1:NAT+NPT,Ngrids] values are expected.
!
! ad_Vadvection  Vertical advection for each active (temperature and
!                  salinity) and inert tracers in the adjoint-based
!                  algorithms, [1:NAT+NPT,Ngrids] values are expected.
!
! Examples:
!
!  Hadvection == A4       \                     ! temperature
!                MPDATA   \                     ! salinity
!                HSIMT    \                     ! dye_01, inert(1)
!                HSIMT                          ! dy2_02, inert(2)
!
!  Vadvection == A4       \                     ! temperature
!                MPDATA   \                     ! salinity
!                HSIMT    \                     ! dye_01, inert(1)
!                HSIMT                          ! dye_02, inert(2)
!
! or in nested applications
!
!  Hadvection == U3       \                     ! temperature, Grid 1
!                HSIMT    \                     ! salinity,    Grid 1
!                U3       \                     ! temperature, Grid 2
!                HSIMT    \                     ! salinity,    Grid 2
!                U3       \                     ! temperature, Grid 3
!                HSIMT                          ! salinity,    Grid 3
!
!  Vadvection == C4       \                     ! temperature, Grid 1
!                HSIMT    \                     ! salinity,    Grid 1
!                C4       \                     ! temperature, Grid 2
!                HSIMT    \                     ! salinity,    Grid 2
!                C4       \                     ! temperature, Grid 3
!                HSIMT                          ! salinity,    Grid 3
!
! It is convinient to use the compact specification format for biological and
! sediment passive tracers as:
!
!  Hadvection == HSIMT                          ! idbio(:), compact
!
!  Vadvection == HSIMT                          ! idbio(:), compact
!
! when all the passive tracers have the same horizontal and vertical tracer
! advection scheme.
!
!------------------------------------------------------------------------------
! Lateral boundary conditions parameters.
!------------------------------------------------------------------------------
!
! The lateral boundary conditions are now specified with logical switches
! instead of CPP flags to allow nested grid configurations. Their values are
! load into structured array:
!
!    LBC(1:4, nLBCvar, Ngrids)
!
! where 1:4 are the number of boundary edges, nLBCvar are the number LBC state
! variables, and Ngrids is the number of nested grids. For Example, to apply
! gradient boundary conditions to any tracer we use:
!
!    LBC(iwest,  isTvar(itrc), ng) % gradient
!    LBC(ieast,  isTvar(itrc), ng) % gradient
!    LBC(isouth, isTvar(itrc), ng) % gradient
!    LBC(inorth, isTvar(itrc), ng) % gradient
!
! The lateral boundary conditions for biological tracers are entered with
! a keyword. This keyword is case insensitive and usually has three characters.
! However, it is possible to have compound keywords, if applicable. For example,
! the keyword "RadNud" implies radiation boundary condition with nudging. This
! combination is usually used in active/passive radiation conditions.
!
! It is possible to specify the lateral boundary conditions for all biological
! tracers in a compact form with a single entry.  for example, in a East-West
! periodic application we can just have:
!
!                   W       S       E       N
!                   e       o       a       o
!                   s       u       s       r
!                   t       t       t       t
!                           h               h
!
!                   1       2       3       4
!
!  LBC(isTvar) ==   Per     Clo     Per     Clo
!
! Then, the standard input processing routine will assume that all the
! biological tracers have the same lateral boundary condition specified by
! the single entry.
!
!   Keyword    Lateral Boundary Condition Type
!
!   Cla        Clamped                                _____N_____     j=Mm
!   Clo        Closed                                |     4     |
!   Gra        Gradient                              |           |
!   Nes        Nested                              1 W           E 3
!   Nud        Nudging                               |           |
!   Per        Periodic                              |_____S_____|
!   Rad        Radiation                                   2          j=1
!                                                   i=1         i=Lm
!
!  LBC(isTvar)    Biological Tracers, [1:4, 1:NBT, Ngrids] values are expected.
!
! Similarly, the adjoint-based algorithms (ADM, TLM, RPM) can have different
! lateral boundary conditions keywords:
!
!  ad_LBC(isTvar) Biological Tracers, [1:4, 1:NBT, Ngrids] values are expected.
!
!------------------------------------------------------------------------------
!  Tracer point Sources/Sink sources switches: [1:NBT,1:Ngrids].
!------------------------------------------------------------------------------
!
!  LtracerSrc     Logical switches (T/F) to activate biological tracer
!                   variables point Sources/Sinks.
!
!                     LtracerSrc(idbio(1),ng)     Nitrate concetration
!                     LtracerSrc(idbio(2),ng)     Phytoplankton biomass
!                     LtracerSrc(idbio(3),ng)     Zooplankton biomass
!                     LtracerSrc(idbio(4),ng)     Detritus concentration
!                     LtracerSrc(idbio(5),ng)     Dissolved iron concentration
!                     LtracerSrc(idbio(6),ng)     Iron concentration
!
!                   Recall that these switches are usually activated to add
!                   river runoff as a point source. At minimum, it is necessary
!                   to specify both temperature and salinity for all rivers.
!                   The other tracers are optional. The user needs to know the
!                   correspondence between biological variables and indices
!                   idbio(1:NBT) when activating one or more of these switches.
!
!                   These logical switches REPLACES and ELIMINATES the need to
!                   have or read the variable "river_flag(river)" in the input
!                   rivers forcing NetCDF file:
!
!                     double river_flag(river)
!                        river_flag:long_name = "river runoff tracer flag"
!                        river_flag:option_0 = "all tracers are off"
!                        river_flag:option_1 = "only temperature"
!                        river_flag:option_2 = "only salinity"
!                        river_flag:option_3 = "both temperature and salinity"
!                        river_flag:units = "nondimensional"
!
!                   This logic was too cumbersome and complicated when
!                   additional tracers are considered. However, this change
!                   is backward compatible.
!
!                   The LtracerSrc switch will be used to activate the reading
!                   of respective tracer variable from input river forcing
!                   NetCDF file. If you want to add other tracer variables
!                   (other than temperature and salinity) as a source for a
!                   particular river(s), you just need to specify such values
!                   on those river(s). Then, set the values to ZERO on the
!                   other river(s) that do NOT require such river forcing for
!                   that tracer. Recall that you need to specify the tracer
!                   values for all rivers, even if their values are zero.
!
!------------------------------------------------------------------------------
!  Tracer climatology processing switches: [1:NBT,1:Ngrids].
!------------------------------------------------------------------------------
!
!  LtracerCLM     Logical switches (T/F) to process biological tracer variables
!                   climatology.  The CPP option TCLIMATOLOGY is now obsolete
!                   and replaced with these switches to facilitate nesting
!                   applications. Currently, the CLIMA(ng)%tclm is used for
!                   horizontal mixing, sponges, and nudging.
!
!                     LtracerCLM(idbio(1),ng)     Nitrate concetration
!                     LtracerCLM(idbio(2),ng)     Phytoplankton biomass
!                     LtracerCLM(idbio(3),ng)     Zooplankton biomass
!                     LtracerCLM(idbio(4),ng)     Detritus concentration
!                     LtracerCLM(idbio(5),ng)     Dissolved iron concentration
!                     LtracerCLM(idbio(6),ng)     Iron concentration
!
!                   These switches also controls which climatology tracer
!                   fields needs to be processed.  So we may reduce the
!                   memory allocation for the CLIMA(ng)%tclm array.
!
!------------------------------------------------------------------------------
!  Logical switches for nudging to climatology: [1:NBT,1:Ngrids].
!------------------------------------------------------------------------------
!
!  LnudgeTCLM     Logical switches (T/F) to activate the nugding of biological
!                   tracer variables climatology. These switches also control
!                   which biological tracer variables to nudge. The CPP option
!                   TCLM_NUDGING is now obsolete and replaced with these
!                   switches to facilitate nesting.
!
!                     LnudgeTCLM(idbio(1),ng)     Nitrate concetration
!                     LnudgeTCLM(idbio(2),ng)     Phytoplankton biomass
!                     LnudgeTCLM(idbio(3),ng)     Zooplankton biomass
!                     LnudgeTCLM(idbio(4),ng)     Detritus concentration
!                     LnudgeTCLM(idbio(5),ng)     Dissolved iron concentration
!                     LnudgeTCLM(idbio(6),ng)     Iron concentration
!
!                   User also needs to TURN ON the respective logical switches
!                   "LtracerCLM", described above, to process the required 3D
!                   biological tracer climatology data. This data can be set
!                   with analytical functions (ANA_TCLIMA) or read from input
!                   climatology NetCDF file(s).
!
!                   The nudging coefficients CLIMA(ng)%Tnudgcof can be set
!                   with analytical functions in "ana_nudgcoef.h"  using CPP
!                   option ANA_NUDGCOEF.  Otherwise, it will be read from
!                   NetCDF file NUDNAME.
!
!------------------------------------------------------------------------------
! Logical switches (T/F) to activate writing of fields into HISTORY files.
!------------------------------------------------------------------------------
!
!  Hout           Logical switches to write out biological fields into
!                   output HISTORY NetCDF file, [1:NBT,1:Ngrids] values
!                   are expected:
!
!                   Hout(idTvar)              biological tracers
!                   Hout(idTsur)              biological tracers surface flux
!
!                   idTvar(idbio(1))=iNO3_    Nitrate concentration
!                   idTvar(idbio(2))=iPhyt    Phytoplankton biomass
!                   idTvar(idbio(3))=iZoop    Zooplankton biomass
!                   idTvar(idbio(4))=iSdet    Detritus concentration
!                   idTvar(idbio(5))=iFphy    Phytoplankton Iron concentration
!                   idTvar(idbio(6))=iFdis    Dissolved iron concentration
!
!------------------------------------------------------------------------------
! Logical switches (T/F) to activate writing of fields into QUICKSAVE file.
!------------------------------------------------------------------------------
!
!  Qout             Logical switches to write out biological fields into
!                     output QUICKSAVE NetCDF file, [1:NBT,1:Ngrids] values
!                     are expected:
!
!                     Qout(idTvar)      biological tracers
!                     Qout(idsurT)      surface biological tracers
!                     Qout(idTsur)      biological tracers surface flux
!
!                     The idTvar(idbio(:)), idsurR(idbio(:)), and
!                     idTsur(idbio(:)) indices are provided above.
!
!------------------------------------------------------------------------------
! Logical switches (T/F) to activate writing of fields into AVERAGE file.
!------------------------------------------------------------------------------
!
!  Aout           Logical switches to write out biological fields into
!                   output AVERAGE NetCDF file, [1:NBT,1:Ngrids] values
!                   are expected:
!
!                   Aout(idTvar)              biological tracers
!
!                   Aout(idTTav)              quadratic <t*t> tracers terms
!                   Aout(idUTav)              quadratic <u*t> tracers terms
!                   Aout(idVTav)              quadratic <v*t> tracers terms
!                   Aout(iHUTav)              tracer u-volume flux, <Huon*t>
!                   Aout(iHVTav)              tracer v-volume flux, <Hvom*t>
!
!                   The idTvar(idbio(:)) are the same to those in the HISTORY
!                   file.
!
!------------------------------------------------------------------------------
! Logical switches (T/F) to activate writing of time-averaged fields into
! DIAGNOSTIC file.
!------------------------------------------------------------------------------
!
!  Time-averaged, biological tracers  diagnostic terms, [1:NBT,Ngrids] values
!  expected: (if DIAGNOSTICS_TS)
!
!                 Dout(idDtrc(idbio(1:NBT),iT....),1:Ngrids)
!
!  Dout(iTrate)   Write out time rate of change.
!  Dout(iThadv)   Write out horizontal total advection.
!  Dout(iTxadv)   Write out horizontal  XI-advection.
!  Dout(iTyadv)   Write out horizontal ETA-advection.
!  Dout(iTvadv)   Write out vertical advection.
!  Dout(iThdif)   Write out horizontal total diffusion, if TS_DIF2 or TS_DIF4.
!  Dout(iTxdif)   Write out horizonta1  XI-diffusion, if TS_DIF2 or TS_DIF4.
!  Dout(iTydif)   Write out horizontal ETA-diffusion, if TS_DIF2 or TS_DIF4.
!  Dout(iTsdif)   Write out horizontal   S-diffusion, if TS_DIF2 or TS_DIF4 and
!                   rotated tensor (MIX_GEO_TS or MIX_ISO_TS).
!  Dout(iTvdif)   Write out vertical diffusion.
!