Commit a59bbb7e67e24122622f5feea059ab7af1f246a4

Authored by Dany Dumont
1 parent cd036332
Exists in master and in 1 other branch snow

Ajout d'un modele bio appele nocera copie de fasham. A modifer par Ariadna.

Showing 2 changed files with 729 additions and 0 deletions   Show diff stats
nml/bio_nocera.nml 0 → 100644
... ... @@ -0,0 +1,87 @@
  1 +#$Id$
  2 +!-------------------------------------------------------------------------------
  3 +! Fasham et al. biological model with modifications by Kuehn and Radach
  4 +!
  5 +! numc= number of compartments for geobiochemical model
  6 +!
  7 +! p_initial= initial phytoplankton concentration [mmol n/m3]
  8 +! z_initial= initial zooplakton concentration [mmol n/m3]
  9 +! b_initial= initial bacteria concentration [mmol n/m3]
  10 +! d_initial= initial detritus concentration [mmol n/m3]
  11 +! n_initial= *** see obs.nml *** [mmol n/m3]
  12 +! a_initial= *** see obs.nml *** [mmol n/m3]
  13 +! l_initial= initial LDON concentration [mmol n/m3]
  14 +! p0 = minimum phytoplankton concentration [mmol n/m3]
  15 +! z0 = minimum zooplakton concentration [mmol n/m3]
  16 +! b0 = minimum bacteria concentration [mmol n/m3]
  17 +! vp = maximum phytoplankton uptake rate [1/day]
  18 +! alpha = slope of the PI-curvea [m2/(W day)]
  19 +! k1 = half saturation constant nitrate uptake [mmol n/m3]
  20 +! k2 = half saturation constant ammonium uptake [mmol n/m3]
  21 +! mu1 = phytoplankton mortality rate [1/day]
  22 +! k5 = half saturation constant phytoplankton mortality [mmol n/m3]
  23 +! gamma = exudation fraction [-]
  24 +! w_p = phytoplankton settling velocity [m/day]
  25 +! gmax = maximum ingestion rate [1/day]
  26 +! k3 = half saturation constant ingestion [mmol n/m3]
  27 +! beta = grazing efficiency [-]
  28 +! mu2 = maximum zooplankton loss rate [1/day]
  29 +! k6 = half saturation zooplankton loss [mmol n/m3]
  30 +! delta = fractional zooplankton loss to LDON [-]
  31 +! epsi = fractional zooplankton loss to ammonium [-]
  32 +! r1 = grazing preference phytoplankton [-]
  33 +! r2 = grazing preference bacteria [-]
  34 +! r3 = grazing preference detritus [-]
  35 +! vb = maximum bacterial uptake rate [1/day]
  36 +! k4 = half saturation bacterial uptake [mmol n/m3]
  37 +! mu3 = bacteria excretion rate [1/day]
  38 +! eta = uptake ratio ammonium:LDON [-]
  39 +! mu4 = detritus breakdown rate [1/day]
  40 +! w_d = detritus settling velocity [m/day]
  41 +! kc = attenuation constant for the self shading effect [m**2/mmol N]
  42 +! I_min = minimum photosynthetically active radiation (PAR) [W/m**2]
  43 +! I_opt = optimal photosynthetically active radiation (PAR) [W/m**2] !CHG1
  44 +! inib = inhibition slope of the PI-curve (positive) [m2/(W day)] !CHG1
  45 +! theta = phytoplancton buoyancy parameter [m3 day/(mmol N)] !CHG2
  46 +!-------------------------------------------------------------------------------
  47 + &bio_fasham_nml
  48 + numc= 7
  49 + p_initial= 0.012
  50 + z_initial= 0.012
  51 + b_initial= 0.001
  52 + d_initial= 0.01
  53 + l_initial= 0.1
  54 + p0= 0.0001
  55 + z0= 0.0001
  56 + b0= 0.0001
  57 + vp= 0.3
  58 + alpha= 0.04
  59 + inib= 0.06
  60 + I_opt= 20.0
  61 + k1= 1.0
  62 + k2= 0.8
  63 + mu1= 0.05
  64 + k5= 0.2
  65 + gamma= 0.05
  66 + w_p= -0.38
  67 + theta= 0.0
  68 + w_pmin= -0.06
  69 + w_pmax= -0.38
  70 + gmax= 1.0
  71 + k3= 1.0
  72 + beta= 0.625
  73 + mu2= 0.3
  74 + k6= 0.2
  75 + delta= 0.1
  76 + epsi= 0.70
  77 + r1= 0.55
  78 + r2= 0.4
  79 + r3= 0.05
  80 + vb= 0.24
  81 + k4= 0.5
  82 + mu3= 0.03
  83 + eta= 0.0
  84 + mu4= 0.02
  85 + w_d= -5.0
  86 + kc= 0.03
  87 + /
... ...
src/extras/bio/bio_nocera.F90 0 → 100644
... ... @@ -0,0 +1,642 @@
  1 +!$id: bio_nocera.F90,v 1.11 2016-05-05 11:49:15 dd Exp $
  2 +#include"cppdefs.h"
  3 +!-----------------------------------------------------------------------
  4 +!BOP
  5 +!
  6 +! !MODULE: bio_fasham --- Fasham et al. biological model \label{sec:bio-fasham}
  7 +!
  8 +! !INTERFACE:
  9 + module bio_nocera
  10 +!
  11 +! !DESCRIPTION:
  12 +! The model developed by \cite{Fashametal1990}
  13 +! uses nitrogen as 'currency' according to the evidence that in
  14 +! most cases nitrogen is the limiting macronutrient. It consists of
  15 +! seven state variables: phytoplankton, zooplankton, bacteria,
  16 +! particulate organic matter (detritus), dissolved organic matter
  17 +! and the nutrients nitrate and ammonium.
  18 +! The structure of the \cite{Fashametal1990} biogeochemical model
  19 +! is given in figure \ref{fig_fasham}.
  20 +! \begin{figure}
  21 +! \begin{center}
  22 +! \scalebox{0.5}{\includegraphics{figures/fasham_structure.eps}}
  23 +! \caption{Structure of the \cite{Fashametal1990} model with bacteria (bac),
  24 +! phytoplankton (phy), detritus (det), zooplankton (zoo), labile dissolved
  25 +! organic nitrogen (don), ammonium (amm) and nitrate (nit) as the seven
  26 +! state variables.
  27 +! The concentrations are in mmol N\,m$^{-3}$,
  28 +! all fluxes (green arrows) are conservative.
  29 +! }\label{fig_fasham}
  30 +! \end{center}
  31 +! \end{figure}
  32 +! A detailed mathematical description of all
  33 +! processes is given in section \ref{sec:bio-fasham-rhs}.
  34 +! The version of the \cite{Fashametal1990} model which is implemented includes
  35 +! slight modifications by \cite{KuehnRadach1997} and has been
  36 +! included into GOTM by \cite{Burchardetal05}.
  37 +
  38 +! !USES:
  39 +! default: all is private.
  40 + use bio_var
  41 + use output
  42 + use observations, only : aa,g2
  43 + private
  44 +!
  45 +! !PUBLIC MEMBER FUNCTIONS:
  46 + public init_bio_nocera, init_var_nocera, var_info_nocera, &
  47 + light_nocera, do_bio_nocera, end_bio_nocera
  48 +!
  49 +! !PRIVATE DATA MEMBERS:
  50 +!
  51 +! !REVISION HISTORY:!
  52 +! Original author(s): Hans Burchard & Karsten Bolding
  53 +!
  54 +! $Log: bio_fasham.F90,v $
  55 +! Revision 1.11 2007-01-06 11:49:15 kbk
  56 +! namelist file extension changed .inp --> .nml
  57 +!
  58 +! Revision 1.10 2006-10-26 13:12:46 kbk
  59 +! updated bio models to new ode_solver
  60 +!
  61 +! Revision 1.9 2005-12-02 20:57:27 hb
  62 +! Documentation updated and some bugs fixed
  63 +!
  64 +! Revision 1.8 2005-11-17 09:58:18 hb
  65 +! explicit argument for positive definite variables in diff_center()
  66 +!
  67 +! Revision 1.7 2005/09/12 14:48:33 kbk
  68 +! merged generic biological module support
  69 +!
  70 +! Revision 1.6.2.1 2005/07/05 20:25:35 hb
  71 +! added control over par calculation
  72 +!
  73 +! Revision 1.6 2004/08/09 11:53:39 hb
  74 +! bioshading now without detritus
  75 +!
  76 +! Revision 1.5 2004/08/02 08:34:36 hb
  77 +! updated init routines to reflect new internal bio interface
  78 +!
  79 +! Revision 1.4 2004/08/01 15:52:57 hb
  80 +! alpha now devided by seconds per day
  81 +!
  82 +! Revision 1.3 2004/07/30 09:22:20 hb
  83 +! use bio_var in specific bio models - simpliefied internal interface
  84 +!
  85 +! Revision 1.2 2004/07/28 11:34:29 hb
  86 +! Bioshade feedback may now be switched on or off, depending on bioshade_feedback set to .true. or .false. in bio.nml
  87 +!
  88 +! Revision 1.1 2004/06/29 08:03:16 hb
  89 +! Fasham et al. 1990 model implemented
  90 +!
  91 +! Revision 1.2 2003/10/16 15:42:16 kbk
  92 +! simple mussesl model implemented - filter only
  93 +!
  94 +! Revision 1.1 2003/07/23 12:27:31 hb
  95 +! more generic support for different bio models
  96 +!
  97 +! Revision 1.3 2003/04/05 07:01:41 kbk
  98 +! moved bioshade variable to meanflow - to compile properly
  99 +!
  100 +! Revision 1.2 2003/04/04 14:25:52 hb
  101 +! First iteration of four-compartment geobiochemical model implemented
  102 +!
  103 +! Revision 1.1 2003/04/01 17:01:00 hb
  104 +! Added infrastructure for geobiochemical model
  105 +!
  106 +! !LOCAL VARIABLES:
  107 +! from a namelist
  108 + REALTYPE :: p_initial= 0.056666666
  109 + REALTYPE :: z_initial= 0.05
  110 + REALTYPE :: b_initial= 0.001
  111 + REALTYPE :: d_initial= 0.416666666
  112 +! Nitrate and ammonium are initialized within the GOTM observation module
  113 +! REALTYPE :: n_initial= 8.3
  114 +! REALTYPE :: a_initial= 0.22
  115 + REALTYPE :: l_initial= 0.14
  116 + REALTYPE :: p0 = 0.0
  117 + REALTYPE :: z0 = 0.0
  118 + REALTYPE :: b0 = 0.0
  119 + REALTYPE :: vp = 1.5
  120 + REALTYPE :: alpha = 0.065
  121 + REALTYPE :: I_opt = 10.0
  122 + REALTYPE :: inib = 0.05
  123 + REALTYPE :: theta = 0.0
  124 + REALTYPE :: w_pmin = -0.06
  125 + REALTYPE :: w_pmax = -0.38
  126 + REALTYPE :: k1 = 0.2
  127 + REALTYPE :: k2 = 0.8
  128 + REALTYPE :: mu1 = 0.05
  129 + REALTYPE :: k5 = 0.2
  130 + REALTYPE :: gamma = 0.05
  131 + REALTYPE :: w_p = -0.5
  132 + REALTYPE :: gmax = 1.0
  133 + REALTYPE :: k3 = 1.0
  134 + REALTYPE :: beta = 0.625
  135 + REALTYPE :: mu2 = 0.3
  136 + REALTYPE :: k6 = 0.2
  137 + REALTYPE :: delta = 0.1
  138 + REALTYPE :: epsi = 0.70
  139 + REALTYPE :: r1 = 0.55
  140 + REALTYPE :: r2 = 0.4
  141 + REALTYPE :: r3 = 0.05
  142 + REALTYPE :: vb = 1.2
  143 + REALTYPE :: k4 = 0.5
  144 + REALTYPE :: mu3 = 0.15
  145 + REALTYPE :: eta = 0.0
  146 + REALTYPE :: mu4 = 0.02
  147 + REALTYPE :: w_d = -2.0
  148 + REALTYPE, public :: kc = 0.03
  149 + integer :: out_unit
  150 + integer, parameter :: p=1,z=2,b=3,d=4,n=5,a=6,l=7
  151 +!EOP
  152 +!-----------------------------------------------------------------------
  153 +
  154 + contains
  155 +
  156 +!-----------------------------------------------------------------------
  157 +!BOP
  158 +!
  159 +! !IROUTINE: Initialise the bio module
  160 +!
  161 +! !INTERFACE:
  162 + subroutine init_bio_nocera(namlst,fname,unit)
  163 +!
  164 +! !DESCRIPTION:
  165 +! Here, the bio namelist {\tt bio\_fasham.nml} is read and
  166 +! various variables (rates and settling velocities)
  167 +! are transformed into SI units.
  168 +!
  169 +! !USES:
  170 + IMPLICIT NONE
  171 +!
  172 +! !INPUT PARAMETERS:
  173 + integer, intent(in) :: namlst
  174 + character(len=*), intent(in) :: fname
  175 + character(len=20) :: pfile
  176 + integer, intent(in) :: unit
  177 +!
  178 +! !REVISION HISTORY:
  179 +! Original author(s): Hans Burchard & Karsten Bolding
  180 +!
  181 +! !LOCAL VARIABLES:
  182 + namelist /bio_nocera_nml/ numc, &
  183 + p_initial,z_initial,b_initial,d_initial, &
  184 + l_initial,p0,z0,b0,vp,alpha,k1,k2,mu1,k5, &
  185 + gamma,w_p,gmax,k3,beta,mu2,k6,delta,epsi,r1,r2,r3, &
  186 + vb,k4,mu3,eta,mu4,w_d,kc, &
  187 + I_opt,inib, & !CHG1
  188 + theta,w_pmax,w_pmin !CHG2
  189 +!EOP
  190 +!-----------------------------------------------------------------------
  191 +!BOC
  192 + LEVEL2 'init_bio_nocera'
  193 +
  194 + open(namlst,file=fname,action='read',status='old',err=98)
  195 + read(namlst,nml=bio_nocera_nml,err=99)
  196 + close(namlst)
  197 +
  198 + numcc=numc
  199 +
  200 +! Print some parameter values in standard output
  201 +! and save them in a separate file [out_fn]_fasham.par
  202 + pfile = trim(out_fn) // '_nocera.par'
  203 + open(10,status='unknown',action='write',file=pfile)
  204 + LEVEL3 'Biogeochemical parameters saved in ', pfile
  205 + write(*,900) ' vp = ',vp
  206 + write(10,901) vp
  207 + write(*,900) ' alpha = ',alpha
  208 + write(10,901) alpha
  209 + write(*,900) ' inib = ',inib
  210 + write(10,901) inib
  211 + write(*,900) ' k1 = ',k1
  212 + write(10,901) k1
  213 + write(*,900) ' k2 = ',k2
  214 + write(10,901) k2
  215 + write(*,900) ' w_p = ',w_p
  216 + write(10,901) w_p
  217 + write(*,900) ' gmax = ',gmax
  218 + write(10,901) gmax
  219 +
  220 +900 format (a,f8.5)
  221 +901 format (f8.5)
  222 +
  223 +! Conversion from day to second
  224 + vp = vp /secs_pr_day
  225 + vb = vb /secs_pr_day
  226 + mu1 = mu1 /secs_pr_day
  227 + mu2 = mu2 /secs_pr_day
  228 + mu3 = mu3 /secs_pr_day
  229 + mu4 = mu4 /secs_pr_day
  230 + gmax = gmax /secs_pr_day
  231 + w_p = w_p /secs_pr_day
  232 + w_pmin = w_pmin /secs_pr_day !DD
  233 + w_pmax = w_pmax /secs_pr_day !DD
  234 + theta = theta /secs_pr_day !DD
  235 + w_d = w_d /secs_pr_day
  236 + alpha= alpha/secs_pr_day
  237 + inib = inib /secs_pr_day !CHG1
  238 +
  239 + out_unit=unit
  240 +
  241 + LEVEL3 'NOCERA bio module initialised ...'
  242 +
  243 + return
  244 +
  245 +98 LEVEL2 'I could not open bio_nocera.nml'
  246 + LEVEL2 'If thats not what you want you have to supply bio_nocera.nml'
  247 + LEVEL2 'See the bio example on www.gotm.net for a working bio_nocera.nml'
  248 + return
  249 +99 FATAL 'I could not read bio_nocera.nml'
  250 + stop 'init_bio_nocera'
  251 + end subroutine init_bio_nocera
  252 +!EOC
  253 +
  254 +!-----------------------------------------------------------------------
  255 +!BOP
  256 +!
  257 +! !IROUTINE: Initialise the concentration variables
  258 +!
  259 +! !INTERFACE:
  260 + subroutine init_var_nocera(nlev)
  261 +!
  262 +! !DESCRIPTION:
  263 +! Here, the the initial conditions are set and the settling velocities are
  264 +! transferred to all vertical levels. All concentrations are declared
  265 +! as non-negative variables, and it is defined which variables would be
  266 +! taken up by benthic filter feeders.
  267 +!
  268 +! !USES:
  269 + use observations, only: nprof,aprof !CHG3-5
  270 + use meanflow, only: nit,amm,T,S !CHG3-5
  271 +
  272 + IMPLICIT NONE
  273 +
  274 +!
  275 +! !INPUT PARAMETERS:
  276 + integer, intent(in) :: nlev
  277 +!
  278 +! !REVISION HISTORY:
  279 +! Original author(s): Hans Burchard & Karsten Bolding
  280 +
  281 +! !LOCAL VARIABLES:
  282 + integer :: i
  283 +!EOP
  284 +!-----------------------------------------------------------------------
  285 +!BOC
  286 + do i=1,nlev
  287 + cc(p,i)=p_initial
  288 + cc(z,i)=z_initial
  289 + cc(b,i)=b_initial
  290 + cc(d,i)=d_initial
  291 + cc(n,i)=nprof(i) !CHG3
  292 + cc(a,i)=aprof(i) !CHG5
  293 + cc(l,i)=l_initial
  294 + end do
  295 +
  296 + do i=0,nlev
  297 + ws(z,i) = _ZERO_
  298 + ws(b,i) = _ZERO_
  299 + ws(n,i) = _ZERO_
  300 + ws(a,i) = _ZERO_
  301 + ws(l,i) = _ZERO_
  302 + ws(p,i) = w_p
  303 + ws(d,i) = w_d
  304 + end do
  305 +
  306 + posconc(p) = 1
  307 + posconc(z) = 1
  308 + posconc(b) = 1
  309 + posconc(d) = 1
  310 + posconc(n) = 1
  311 + posconc(a) = 1
  312 + posconc(l) = 1
  313 +
  314 +#if 0
  315 + mussels_inhale(p) = .true.
  316 + mussels_inhale(z) = .true.
  317 + mussels_inhale(b) = .false.
  318 + mussels_inhale(d) = .true.
  319 + mussels_inhale(n) = .false.
  320 + mussels_inhale(a) = .false.
  321 + mussels_inhale(l) = .true.
  322 +#endif
  323 +
  324 + LEVEL3 'NOCERA variables initialised ...'
  325 +
  326 + return
  327 +
  328 + end subroutine init_var_nocera
  329 +!EOC
  330 +
  331 +!-----------------------------------------------------------------------
  332 +!BOP
  333 +!
  334 +! !IROUTINE: Providing info on variables
  335 +!
  336 +! !INTERFACE:
  337 + subroutine var_info_nocera()
  338 +!
  339 +! !DESCRIPTION:
  340 +! This subroutine provides information about the variable names as they
  341 +! will be used when storing data in NetCDF files.
  342 +!
  343 +! !USES:
  344 + IMPLICIT NONE
  345 +!
  346 +! !REVISION HISTORY:
  347 +! Original author(s): Hans Burchard & Karsten Bolding
  348 +!
  349 +! !LOCAL VARIABLES:
  350 +!EOP
  351 +!-----------------------------------------------------------------------
  352 +!BOC
  353 + var_names(1) = 'phy'
  354 + var_units(1) = 'mmol/m**3'
  355 + var_long(1) = 'phytoplankton'
  356 +
  357 + var_names(2) = 'zoo'
  358 + var_units(2) = 'mmol/m**3'
  359 + var_long(2) = 'zooplankton'
  360 +
  361 + var_names(3) = 'bac'
  362 + var_units(3) = 'mmol/m**3'
  363 + var_long(3) = 'bacteria'
  364 +
  365 + var_names(4) = 'det'
  366 + var_units(4) = 'mmol/m**3'
  367 + var_long(4) = 'detritus'
  368 +
  369 + var_names(5) = 'nit'
  370 + var_units(5) = 'mmol/m**3'
  371 + var_long(5) = 'nitrate'
  372 +
  373 + var_names(6) = 'amm'
  374 + var_units(6) = 'mmol/m**3'
  375 + var_long(6) = 'ammonium'
  376 +
  377 + var_names(7) = 'ldn'
  378 + var_units(7) = 'mmol/m**3'
  379 + var_long(7) = 'labile_dissolved_organic_nitrogen'
  380 +
  381 + return
  382 + end subroutine var_info_nocera
  383 +!EOC
  384 +
  385 +!-----------------------------------------------------------------------
  386 +!BOP
  387 +!
  388 +! !IROUTINE: Light properties for the Fasham model
  389 +!
  390 +! !INTERFACE:
  391 + subroutine light_nocera(nlev,bioshade_feedback)
  392 +!
  393 +! !DESCRIPTION:
  394 +! Here, the photosynthetically available radiation is calculated
  395 +! by simply assuming that the short wave part of the total
  396 +! radiation is available for photosynthesis.
  397 +! The photosynthetically
  398 +! available radiation, $I_{PAR}$, follows from (\ref{light}).
  399 +! The user should make
  400 +! sure that this is consistent with the light class given in the
  401 +! {\tt extinct} namelist of the {\tt obs.nml} file.
  402 +! The self-shading effect is also calculated in this subroutine,
  403 +! which may be used to consider the effect of bio-turbidity also
  404 +! in the temperature equation (if {\tt bioshade\_feedback} is set
  405 +! to true in {\tt bio.nml}).
  406 +! For details, see section \ref{sec:do-bio}.
  407 +!
  408 +! !USES:
  409 + IMPLICIT NONE
  410 +!
  411 +! !INPUT PARAMETERS:
  412 + integer, intent(in) :: nlev
  413 + logical, intent(in) :: bioshade_feedback
  414 +!
  415 +! !REVISION HISTORY:
  416 +! Original author(s): Hans Burchard, Karsten Bolding
  417 +!
  418 +! !LOCAL VARIABLES:
  419 + integer :: i
  420 + REALTYPE :: zz,add
  421 +!EOP
  422 +!-----------------------------------------------------------------------
  423 +!BOC
  424 + zz = _ZERO_
  425 + add = _ZERO_
  426 + do i=nlev,1,-1
  427 + add=add+0.5*h(i)*(cc(p,i)+p0)
  428 + zz=zz+0.5*h(i)
  429 + par(i)=rad(nlev)*(1.-aa)*exp(-zz/g2)*exp(-kc*add)
  430 + add=add+0.5*h(i)*(cc(p,i)+p0)
  431 + zz=zz+0.5*h(i)
  432 + if (bioshade_feedback) bioshade_(i)=exp(-kc*add)
  433 + end do
  434 +
  435 +
  436 + return
  437 + end subroutine light_nocera
  438 +!EOC
  439 +
  440 +!-----------------------------------------------------------------------
  441 +!BOP
  442 +!
  443 +! !IROUTINE: Right hand sides of geobiochemical model \label{sec:bio-fasham-rhs}
  444 +!
  445 +! !INTERFACE:
  446 + subroutine do_bio_nocera(first,numc,nlev,cc,pp,dd)
  447 +!
  448 +! !DESCRIPTION:
  449 +!
  450 +! The \cite{Fashametal1990} model consisting of the $I=7$
  451 +! state variables phytoplankton, bacteria, detritus, zooplankton,
  452 +! nitrate, ammonium and dissolved organic nitrogen is described here
  453 +! in detail.
  454 +!
  455 +! Phytoplankton mortality and zooplankton grazing loss of phytoplankton:
  456 +! \begin{equation}\label{d13}
  457 +! d_{1,3} = \mu_1 \frac{c_1+c_{1}^{\min}}{K_5+c_1+c_{1}^{\min}}c_1+
  458 +! (1-\beta)\frac{g\rho_1 c_1^2}{K_3 \sum_{j=1}^3 \rho_jc_j
  459 +! + \sum_{j=1}^3 \rho_jc_j^2} (c_4+c_{4}^{\min}).
  460 +! \end{equation}
  461 +! Phytoplankton loss to LDON (labile dissolved organic nitrogen):
  462 +! \begin{equation}\label{d17}
  463 +! d_{1,7} = \gamma
  464 +! F(I_{PAR})\frac{\frac{c_5}{K_1}
  465 +! +\frac{c_6}{K_2}}{1+\frac{c_5}{K_1}+\frac{c_6}{K_2}}c_1,
  466 +! \end{equation}
  467 +! with
  468 +! \begin{equation}\label{FI}
  469 +! F(I_{PAR}) = \frac{V_p\alpha I_{PAR}(z)}{\left(V_p^2+\alpha^2(I_{PAR}(z))^2
  470 +! \right)^{1/2}}.
  471 +! \end{equation}
  472 +! With $I_{PAR}$ from (\ref{light}).
  473 +!
  474 +! Zooplankton grazing loss:
  475 +! \begin{equation}\label{di3}
  476 +! d_{2,3} = (1-\beta)\frac{g\rho_2 c_2^2}{K_3 \sum_{j=1}^3 \rho_jc_j
  477 +! + \sum_{j=1}^3 \rho_jc_j^2} (c_4+c_{4}^{\min}).
  478 +! \end{equation}
  479 +! Zooplankton grazing:
  480 +! \begin{equation}\label{di4}
  481 +! d_{i,4} = \beta\frac{g\rho_i c_i^2}{K_3 \sum_{j=1}^3 \rho_jc_j
  482 +! + \sum_{j=1}^3 \rho_jc_j^2} (c_4+c_{4}^{\min}), \quad i=1,\dots,3.
  483 +! \end{equation}
  484 +! Bacteria excretion rate:
  485 +! \begin{equation}\label{d26}
  486 +! d_{2,6} = \mu_3 c_2.
  487 +! \end{equation}
  488 +! Detritus breakdown rate:
  489 +! \begin{equation}\label{d37}
  490 +! d_{3,7} = \mu_4 c_3.
  491 +! \end{equation}
  492 +! Zooplankton losses to detritus, ammonium and LDON:
  493 +! \begin{equation}\label{d43}
  494 +! d_{4,3} = (1-\epsilon-\delta)\mu_2
  495 +! \frac{c_4+c_{4}^{\min}}{K_6+c_4+c_{4}^{\min}}c_4.
  496 +! \end{equation}
  497 +! \begin{equation}\label{d46}
  498 +! d_{4,6} = \epsilon\mu_2 \frac{c_4+c_{4}^{\min}}{K_6+c_4+c_{4}^{\min}}c_4.
  499 +! \end{equation}
  500 +! \begin{equation}\label{d47}
  501 +! d_{4,7} = \delta\mu_2 \frac{c_4+c_{4}^{\min}}{K_6+c_4+c_{4}^{\min}}c_4.
  502 +! \end{equation}
  503 +! Nitrate uptake by phytoplankton:
  504 +! \begin{equation}\label{d51}
  505 +! d_{5,1} = F(I_{PAR})\frac{\frac{c_5}{K_1}}{1+\frac{c_5}{K_1}
  506 +! +\frac{c_6}{K_2}}(c_1+c_{1}^{\min}).
  507 +! \end{equation}
  508 +! Ammonium uptake by phytoplankton:
  509 +! \begin{equation}\label{d61}
  510 +! d_{6,1} = F(I_{PAR})\frac{\frac{c_6}{K_2}}{1+\frac{c_5}{K_1}
  511 +! +\frac{c_6}{K_2}}(c_1+c_{1}^{\min}).
  512 +! \end{equation}
  513 +! Ammonium uptake by bacteria:
  514 +! \begin{equation}\label{d62}
  515 +! d_{6,2} = V_b \frac{\min(c_6,\eta c_7)}{K_4+\min(c_6,\eta c_7)+c_7}
  516 +! (c_2+c_{2}^{\min}).
  517 +! \end{equation}
  518 +! LDON uptake by bacteria:
  519 +! \begin{equation}\label{d72}
  520 +! d_{7,2} = V_b \frac{c_7}{K_4+\min(c_6,\eta c_7)+c_7} (c_2+c_{2}^{\min}).
  521 +! \end{equation}
  522 +!
  523 +! !USES:
  524 + IMPLICIT NONE
  525 +!
  526 +! !INPUT PARAMETERS:
  527 + logical, intent(in) :: first
  528 + integer, intent(in) :: numc,nlev
  529 + REALTYPE, intent(in) :: cc(1:numc,0:nlev)
  530 +!
  531 +! !OUTPUT PARAMETERS:
  532 + REALTYPE, intent(out) :: pp(1:numc,1:numc,0:nlev)
  533 + REALTYPE, intent(out) :: dd(1:numc,1:numc,0:nlev)
  534 +!
  535 +! !REVISION HISTORY:
  536 +! Original author(s): Hans Burchard, Karsten Bolding
  537 +!
  538 +! !LOCAL VARIABLES:
  539 + REALTYPE :: ff,fac,min67,q1,q2
  540 + REALTYPE :: Ps !CHG1
  541 + integer :: i,j,ci
  542 +!EOP
  543 +!-----------------------------------------------------------------------
  544 +!BOC
  545 +!KBK - is it necessary to initialise every time - expensive in a 3D model
  546 + pp = _ZERO_
  547 + dd = _ZERO_
  548 +
  549 + do ci=1,nlev
  550 +
  551 +!CHG1
  552 +! Smith (1936) - saturation (default)
  553 +! ff= vp*alpha*par(ci)/sqrt(vp**2+alpha**2*par(ci)**2)
  554 +! Blackman (1919)
  555 +! if (par(ci) .lt. vp/alpha) then
  556 +! ff=alpha*par(ci)
  557 +! else
  558 +! ff=vp
  559 +! endif
  560 +! Steele (1962) - inhibition
  561 +! ff= vp*((par(ci)/I_opt)*exp(1-(par(ci)/I_opt)))
  562 +! Parker (1974) - inhibition
  563 +! ff= vp*((par(ci)/I_opt)*exp(1-(par(ci)/I_opt)))**2
  564 +! Platt et al. (1980) - inhibition
  565 + Ps= vp/((alpha/(alpha+inib))*(alpha/(alpha+inib))**(inib/alpha))
  566 + ff= Ps*(1.-exp(-1.*alpha*par(ci)/Ps))*exp(-1.*inib*par(ci)/Ps)
  567 +! --------------------------------------------------------------------
  568 +
  569 +
  570 + q1=(cc(n,ci)/k1)/(1.+cc(n,ci)/k1+cc(a,ci)/k2)
  571 + q2=(cc(a,ci)/k2)/(1.+cc(n,ci)/k1+cc(a,ci)/k2)
  572 + fac=(cc(z,ci)+z0)/(k3*(r1*cc(p,ci)+r2*cc(b,ci)+r3*cc(d,ci))+ &
  573 + r1*cc(p,ci)**2+r2*cc(b,ci)**2+r3*cc(d,ci)**2)
  574 + min67=min(cc(a,ci),eta*cc(l,ci))
  575 +
  576 + ! Light and nutrient limitation factors
  577 + lumlim1(ci)=ff
  578 + nitlim1(ci)=q1
  579 + ammlim1(ci)=q2
  580 +
  581 + dd(p,d,ci)=mu1*(cc(p,ci)+p0)/(k5+cc(p,ci)+p0)*cc(p,ci) &
  582 + +(1.-beta)*gmax*r1*cc(p,ci)**2*fac
  583 + dd(p,l,ci)=gamma*ff*(q1+q2)*cc(p,ci)
  584 + dd(b,d,ci)=(1.-beta)*gmax*r2*cc(b,ci)**2*fac
  585 + dd(p,z,ci)=beta*gmax*r1*cc(p,ci)**2*fac
  586 + dd(b,z,ci)=beta*gmax*r2*cc(b,ci)**2*fac
  587 + dd(d,z,ci)=beta*gmax*r3*cc(d,ci)**2*fac
  588 + dd(b,a,ci)=mu3*cc(b,ci)
  589 + dd(d,l,ci)=mu4*cc(d,ci)
  590 + dd(z,d,ci)=(1.-epsi-delta)*mu2*(cc(z,ci)+z0)/(k6+cc(z,ci)+z0)*cc(z,ci)
  591 + dd(z,a,ci)=epsi*mu2*(cc(z,ci)+z0)/(k6+cc(z,ci)+z0)*cc(z,ci)
  592 + dd(z,l,ci)=delta*mu2*(cc(z,ci)+z0)/(k6+cc(z,ci)+z0)*cc(z,ci)
  593 + dd(n,p,ci)=ff*q1*(cc(p,ci)+p0)
  594 + dd(a,p,ci)=ff*q2*(cc(p,ci)+p0)
  595 + dd(a,b,ci)=vb*min67/(k4+min67+cc(l,ci))*(cc(b,ci)+b0)
  596 + dd(l,b,ci)=vb*cc(l,ci)/(k4+min67+cc(l,ci))*(cc(b,ci)+b0)
  597 +
  598 + ppnet(ci) =(dd(a,p,ci)+dd(n,p,ci)-dd(p,d,ci)-dd(p,z,ci)-dd(p,l,ci))*secs_pr_day
  599 +
  600 + do i=1,numc
  601 + do j=1,numc
  602 + pp(i,j,ci)=dd(j,i,ci)
  603 + end do
  604 + end do
  605 + end do
  606 +
  607 + return
  608 + end subroutine do_bio_nocera
  609 +!EOC
  610 +
  611 +!-----------------------------------------------------------------------
  612 +!BOP
  613 +!
  614 +! !IROUTINE: Finish the bio calculations
  615 +!
  616 +! !INTERFACE:
  617 + subroutine end_bio_nocera
  618 +!
  619 +! !DESCRIPTION:
  620 +! Nothing done yet --- supplied for completeness.
  621 +!
  622 +! !USES:
  623 + IMPLICIT NONE
  624 +!
  625 +! !REVISION HISTORY:
  626 +! Original author(s): Hans Burchard & Karsten Bolding
  627 +!
  628 +!EOP
  629 +!-----------------------------------------------------------------------
  630 +!BOC
  631 +
  632 + return
  633 + end subroutine end_bio_nocera
  634 +!EOC
  635 +
  636 +!-----------------------------------------------------------------------
  637 +
  638 + end module bio_nocera
  639 +
  640 +!-----------------------------------------------------------------------
  641 +! Copyright by the GOTM-team under the GNU Public License - www.gnu.org
  642 +!-----------------------------------------------------------------------
... ...