! BioCGT processes file
! *********************
! properties of processes:
! name=           fortran variable name for the rate
! description=    e.g. "grazing of zooplankton"
! turnover=       fortran formula for calculating the process turnover [mol/kg or mol/m2]
! equation=       equation which, like a chemical equation, lists reaction agents and products of this process.
!                   example: t_no3 + 1/16*t_po4 -> t_lpp
!                   tracers to the left of the "->" are consumed, tracers to the right of the "->" are produced by this process.
! isActive=       1=active (default); 0=process is switched off
! isOutput=       1=occurs as output in model results; 0=internal use only (default)
! limitation=     TYPE tracer > value else otherProcess
! limitation=     TYPE tracer < value else otherProcess
!                   TYPE = HARD (theta function), MM (Michaelis-Menten), MMQ (quadratic Michaelis-Menten), IV (Ivlev), IVQ (quadratic Ivlev), LIN (linear), TANH (tangens hyperbolicus)
!                   tracer = name of tracer that needs to be present
!                   value = value that needs to be exceeded, may also be a constant or auxiliary
!                   otherProcess = process that takes place instead if this process gets hampered by the availability of "tracer"
!                 several of these lines may exist, the order of them may be relevant for the rate of "otherProcess".
! processType=    type of process, e.g. "propagation", default="standard"
! repaint=        number n of repainting actions to be done by the process, default=0
!                 This line is followed by n lines of this kind:
!   <oldColor> <element> = <newColor>    e.g.: "all  N   = blue "
!                                              "blue P   = none "
!                                              "red  all = green"
! vertLoc=        WAT=z-dependent (default), SED=in the sediment only, SUR=in the surface only, FIS=fish-type behaviour
! feedingEfficiency= name of an auxiliary variable (values 0..1) which tells how much of the food in a certain depth is accessible for the predator with vertLoc=FIS. Relevant for vertLoc=FIS only. Default="1.0"
! comment=        comment, default=""
!
! Process rates are calculated in the given order.
! *************************************************************************************
name        = p_co2_stf_down
isOutput    = 0
***********************
name        = p_co2_stf_up
isOutput    = 0
***********************
name        = p_no3_assim_lpp
turnover    = lpp_plus_lpp0*lr_assim_lpp*t_no3/ntemp_eps
***********************
name        = p_nh4_assim_lpp
turnover    = lpp_plus_lpp0*lr_assim_lpp*t_nh4/ntemp_eps
***********************
name        = p_no3_assim_spp
turnover    = spp_plus_spp0*lr_assim_spp*t_no3/ntemp_eps
***********************
name        = p_nh4_assim_spp
turnover    = spp_plus_spp0*lr_assim_spp*t_nh4/ntemp_eps
equation    = 7.4375*h2o + rfr_c*t_dic + rfr_p*t_po4 + t_nh4 -> 0.8125*h3oplus + 6.625*t_o2 + t_spp
***********************
name        = p_lpp_resp_nh4
limitation  = HARD t_o2 > 2.0e-6
***********************
name        = p_spp_resp_nh4
limitation  = HARD t_o2 > 2.0e-6
***********************
name        = p_cya_resp_nh4
limitation  = HARD t_o2 > 2.0e-6
***********************
name        = p_dia_graz_cop
description = grazing of copepods eating diatoms
turnover    = (t_cop+zoo0)*gg_cop*t_lpp*fp_cop_eating_dia/total_pon
comment     = gg_cop represents anything that is taken up by the copepods. dia/total_pon gives the ratio \\in which diatoms are in this PON the copepod ingests. fp_cop_eating_dia says how many \\percent of the ingested diatoms the copepod is able to assimilate.
equation    = t_lpp -> t_cop
isOutput    = 1
limitation  = MMQ t_o2 > o2_min_cop
***********************
name        = p_fla_graz_cop
description = grazing of copepods eating flagellates
turnover    = (t_cop+zoo0)*gg_cop*t_spp*fp_cop_eating_fla/total_pon
equation    = t_spp -> t_cop
isOutput    = 1
limitation  = MMQ t_o2 > o2_min_cop
***********************
name        = p_cya_graz_cop
description = grazing of copepods eating cyanobacteria
turnover    = (t_cop+zoo0)*gg_cop*t_cya*fp_cop_eating_cya/total_pon
equation    = t_cya -> t_cop
isOutput    = 1
limitation  = MMQ t_o2 > o2_min_cop
***********************
name        = p_det_graz_cop
description = grazing of copepods eating detritus
turnover    = (t_cop+zoo0)*gg_cop*t_det*fp_cop_eating_det/total_pon
equation    = t_det -> t_cop
isOutput    = 1
limitation  = MMQ t_o2 > o2_min_cop
***********************
name        = p_dia_graz_kr1
description = grazing of small krill eating diatoms
turnover    = (t_kr1+zoo0)*gg_kr1*t_lpp*fp_kr1_eating_dia/total_pon
equation    = t_lpp -> t_kr1
isOutput    = 1
limitation  = MMQ t_o2 > o2_min_kr1
***********************
name        = p_fla_graz_kr1
description = grazing of small krill eating flagellates
turnover    = (t_kr1+zoo0)*gg_kr1*t_spp*fp_kr1_eating_fla/total_pon
equation    = t_spp -> t_kr1
isOutput    = 1
limitation  = MMQ t_o2 > o2_min_kr1
***********************
name        = p_cya_graz_kr1
description = grazing of small krill eating cyanobacteria
turnover    = (t_kr1+zoo0)*gg_kr1*t_cya*fp_kr1_eating_cya/total_pon
equation    = t_cya -> t_kr1
isOutput    = 1
limitation  = MMQ t_o2 > o2_min_kr1
***********************
name        = p_cop_graz_kr1
description = grazing of small krill eating copepods
turnover    = (t_kr1+zoo0)*gg_kr1*t_cop*fp_kr1_eating_cop/total_pon
equation    = t_cop -> t_kr1
isOutput    = 1
limitation  = MMQ t_o2 > o2_min_kr1
***********************
name        = p_det_graz_kr1
description = grazing of small krill eating detritus
turnover    = (t_kr1+zoo0)*gg_kr1*t_det*fp_kr1_eating_det/total_pon
equation    = t_det -> t_kr1
isOutput    = 1
limitation  = MMQ t_o2 > o2_min_kr1
***********************
name        = p_cop_graz_kr2
description = grazing of large krill eating copepods
turnover    = (t_kr2+zoo0)*gg_kr2*t_cop*fp_kr2_eating_cop/total_pon
equation    = t_cop -> t_kr2
limitation  = MMQ t_o2 > o2_min_kr2
***********************
name        = p_kr1_graz_kr2
description = grazing of large krill eating small krill
turnover    = (t_kr2+zoo0)*gg_kr2*t_kr1*fp_kr2_eating_kr1/total_pon
equation    = t_kr1 -> t_kr2
limitation  = MMQ t_o2 > o2_min_kr2
***********************
name        = p_kr2_graz_kr2
description = grazing of large krill eating itself (cannibalism)
turnover    = (t_kr2+zoo0)*gg_kr2*t_kr2*fp_kr2_eating_kr2/total_pon
equation    = t_kr2 -> t_kr2
limitation  = MMQ t_o2 > o2_min_kr2
***********************
name        = p_det_graz_kr2
description = grazing of large krill eating detritus
turnover    = (t_kr2+zoo0)*gg_kr2*t_det*fp_kr2_eating_det/total_pon
equation    = t_det -> t_kr2
limitation  = MMQ t_o2 > o2_min_kr2
***********************
name        = p_cop_resp_nh4
description = respiration of copepods
turnover    = cop_eff*(r_cop_resp+gg_cop*frac_zoo_food_to_nh4)*(frac_resp_red_cop+(1.0-frac_resp_red_cop)*t_o2*t_o2/(o2_max_suboxic*o2_max_suboxic+t_o2*t_o2))
comment     = Respiration includes a food-dependent term. It is reduced under suboxic conditions and \\switched off under anoxic conditions.
equation    = 6.625*t_o2 + 0.8125*h3oplus + t_cop -> t_nh4 + rfr_p*t_po4 + rfr_c*t_dic + 7.4375*h2o
isOutput    = 1
limitation  = MMQ t_o2 > o2_min_cop
***********************
name        = p_kr1_resp_nh4
description = respiration of small krill
turnover    = kr1_eff*(r_kr1_resp+gg_kr1*frac_zoo_food_to_nh4)*(frac_resp_red_kr1+(1.0-frac_resp_red_kr1)*t_o2*t_o2/(o2_max_suboxic*o2_max_suboxic+t_o2*t_o2))
equation    = t_kr1 + 6.625*t_o2 + 0.8125*h3oplus -> t_nh4 + rfr_p*t_po4 + rfr_c*t_dic + 7.4375*h2o
isOutput    = 1
limitation  = MMQ t_o2 > o2_min_kr1
***********************
name        = p_kr2_resp_nh4
description = respiration of large krill
turnover    = kr2_eff*(r_kr2_resp+gg_kr2*frac_zoo_food_to_nh4)*(frac_resp_red_kr2+(1.0-frac_resp_red_kr2)*t_o2*t_o2/(o2_max_suboxic*o2_max_suboxic+t_o2*t_o2))
equation    = 0.8125*h3oplus + 6.625*t_o2 + t_kr2 -> 7.4375*h2o + rfr_c*t_dic + rfr_p*t_po4 + t_nh4
limitation  = MMQ t_o2 > o2_min_kr2
***********************
name        = p_cop_mort_det
description = mortality of copepods
turnover    = cop_eff*(r_cop_mort+gg_cop*frac_zoo_food_to_det)*(1+9*(o2_min_cop*o2_min_cop/(o2_min_cop*o2_min_cop+t_o2*t_o2)))
comment     = This includes both mortality and sloppy feeding. Both are enhanced under anoxic conditions.
equation    = t_cop -> t_det
isOutput    = 1
***********************
name        = p_kr1_mort_det
description = mortality of small krill
turnover    = kr1_eff*(r_kr1_mort+gg_kr1*frac_zoo_food_to_det)*(1+9*(o2_min_kr1*o2_min_kr1/(o2_min_kr1*o2_min_kr1+t_o2*t_o2)))
equation    = t_kr1 -> t_det
isOutput    = 1
***********************
name        = p_kr2_mort_det
description = mortality of large krill
turnover    = kr2_eff*(r_kr2_mort+gg_kr2*frac_zoo_food_to_det)*(1+9*(o2_min_kr2*o2_min_kr2/(o2_min_kr2*o2_min_kr2+t_o2*t_o2)))
equation    = t_kr2 -> t_det
***********************
name        = p_det_resp_nh4
limitation  = TANH t_o2 > 2.0e-6
***********************
name        = p_det_denit_nh4
comment     = as long as there is enough nitrate, no H2S("negative oxygen") is generated (2 NO3- + \\2 H3O+ \\-> N2 + 3 H2O + 5/2 O2)
limitation  = TANH t_o2 < 2.0e-6
limitation  = TANH t_no3 > 4.5454e-7
limitation  = TANH t_h2s > 2.0e-4
***********************
name        = p_det_sulf_nh4
limitation  = TANH t_o2 < 2.0e-6
limitation  = TANH t_no3 < 4.5454e-7
***********************
name        = p_det_anam_n2
description = anammox recycling
turnover    = r_det_anam*t_det/(1. + exp((cgt_temp - 30.)*0.5))/(1. + exp((7. - cgt_temp)*0.5))
equation    = t_det + 13.25*t_no3 + 12.25*t_nh4 + 0.8125*h3oplus -> 13.25*t_n2 + rfr_p*t_po4 + rfr_c*t_dic + 33.9375*h2o
limitation  = TANH t_o2 < 2.0e-6
limitation  = TANH t_no3 > 4.5454e-7
limitation  = TANH t_h2s < 2.0e-4
limitation  = TANH t_nh4 > 4.5454e-7
***********************
name        = p_det_denit_nh4_2
description = recycling of detritus using nitrate, because no ammonium exists for anammox
turnover    = t_det*r_det_rec*exp(q10_det_rec*cgt_temp)
comment     = as long as there is enough nitrate, no H2S("negative oxygen") is generated (2 NO3- + \\2 H3O+ -> N2 + 3 H2O + 5/2 O2)
equation    = t_det + 5.3*t_no3 + 6.1125*h3oplus -> 2.65*t_n2 + 15.3875*h2o + t_nh4 + rfr_p*t_po4 + rfr_c*t_dic
limitation  = TANH t_o2 < 2.0e-6
limitation  = TANH t_no3 > 4.5454e-7
limitation  = TANH t_h2s < 2.0e-4
limitation  = TANH t_nh4 < 4.5454e-7
***********************
name        = p_h2s_oxo2_sul
limitation  = HARD t_o2 > 0.0
limitation  = HARD t_h2s > 0.0
***********************
name        = p_h2s_oxno3_sul
limitation  = HARD t_no3 > 0.0
limitation  = HARD t_h2s > 0.0
***********************
name        = p_sul_oxo2_so4
limitation  = HARD t_o2 > 0.0
limitation  = HARD t_sul > 0.0
***********************
name        = p_sul_oxno3_so4
limitation  = HARD t_no3 > 0.0
limitation  = HARD t_sul > 0.0
***********************
name        = p_sed_ero_det
isOutput    = 1
***********************
name        = p_det_sedi_sed
turnover    = w_det_sedi*t_det*cgt_density
isOutput    = 1
***********************
name        = p_ips_ero_ipw
isOutput    = 1
***********************
name        = p_ipw_sedi_ips
turnover    = w_ipw_sedi*t_ipw*cgt_density
isOutput    = 1
***********************
name        = p_sed_resp_nh4
turnover    = lr_sed_rec*sed_active*(frac_sed_sulf+(1.0-frac_sed_sulf)*theta(sed_min_thiobact-t_sed)*theta(t_o2-2*t_h2s))
limitation  = HARD t_o2 > 0.0
***********************
name        = p_nh4_nitdenit_n2
turnover    = frac_denit_sed*lr_sed_rec*sed_active*theta(t_o2-2*t_h2s)*theta(sed_min_thiobact-t_sed)
comment     = 
equation    = (10./53.)*t_sed + (43./53.)*t_nh4 + 2.0*t_o2 -> 1.25*t_dic + 1.90330188679245*h2o + 0.846698113207547*h3oplus + (10./(16.*53.))*t_po4 + 0.5*t_n2
***********************
name        = p_sed_denit_nh4
turnover    = lr_sed_rec*sed_active*theta(sed_min_thiobact-t_sed)*(frac_sed_sulf+(1.0-frac_sed_sulf)*theta(t_o2-2*t_h2s))
comment     = as long as there is enough nitrate, no "negative oxygen" is generated (2 NO3- + 2 \\H3O+ -> N2 \\+ 3 H2O + 5/2 O2)
limitation  = HARD t_o2 < 0.0
limitation  = HARD t_no3 > 0.0
***********************
name        = p_sed_sulf_nh4
turnover    = lr_sed_rec*sed_active*frac_sed_sulf
limitation  = HARD t_o2 < 0.0
limitation  = HARD t_no3 < 0.0
***********************
name        = p_sed_burial
equation    = t_sed -> t_sed2
***********************
name        = p_ips_biores_ipw
turnover    = biores*t_ips
limitation = none
***********************
name        = p_sed_biores_det
turnover    = biores*sed_active
limitation = none
***********************
name        = p_sed_dnra_nh4
description = recycling of sediment detritus to ammonium using nitrate (DNRA process)
turnover    = lr_sed_rec*sed_active*theta(t_sed-sed_min_thiobact)*frac_sed_sulf
equation    = 3.3125*t_no3 + 7.4375*h3oplus + t_sed -> 10.75*h2o + 4.3125*t_nh4 + rfr_p*t_po4 + rfr_c*t_dic
vertLoc     = SED
limitation  = HARD t_o2 < 0.0
limitation  = HARD t_no3 > 0.0
***********************
name=delete_in_add_on_p_lpp_graz_zoo
***********************
name=delete_in_add_on_p_spp_graz_zoo
***********************
name=delete_in_add_on_p_cya_graz_zoo
***********************
name=delete_in_add_on_p_zoo_resp_nh4
***********************
name=delete_in_add_on_p_zoo_mort_det
***********************
