! BioCGT auxiliaries file
! ***********************
! properties of auxiliaries:  (auxiliary values that are calculated)
! name=               variable name in the code
! description=        e.g. "absolute temperature [K]" default=""
! temp1= ... temp9=   for calculating a temporary value which appears in the formula. e.g. temp1=no3*no3 temp2=no3limit*no3limit formula=temp1/(temp1+temp2), default=""
! formula=            formula as it appears in the code
! calcAfterProcesses= 1=calculate this auxiliary after all process rates are known, default=0
! iterations=         how often this auxiliary variable is calculated in an iterative loop, default=0
! iterInit=           the initial value in the iterative loop, default="0.0"
! isOutput=           1=occurs as output in model results; 0=internal use only (default)
! isUsedElsewhere=    1=make the value of this auxiliary accessible from outside the biological model (e.g. use a "diagnostic tracer" in MOM4); 0=internal use only (default)
! isZGradient=        1=is a vertical gradient of a tracer, 0=is not (default). If 1, "formula" must be the name of the tracer, which must have vertLoc=WAT. isZGradient=1 requires vertLoc=WAT.
! isZIntegral=        1=is a vertical integral (of value times density) of a tracer or an auxiliary variable, 0=is not (default). If 1 "formula" must be the name of the tracer, which must have vertLoc=WAT. isZIntegral=1 requires vertLoc=SED.
! vertLoc=            WAT=z-dependent (default), SED=in the bottom cell only, SUR=in the surface cell only
! comment=            e.g. a literature reference, default=""
!
! All entries with the same value of calcAfterProcesses are calculated in given order.
! *************************************************************************************
name               = light
formula            = cgt_light
description        = 
isOutput           = 1
***********************
name               = k0_co2
isOutput           = 0
***********************
name               = k1_co2
isOutput           = 0
***********************
name               = k2_co2
isOutput           = 0
***********************
name               = alk_boron
isOutput           = 0
***********************
name               = alk_h2s
isOutput           = 0
***********************
name               = alk_water
isOutput           = 0
***********************
name               = alk_po4
isOutput           = 0
***********************
name               = alk_co2
isOutput           = 0
***********************
name               = alk_residual
isOutput           = 0
***********************
name               = dalkp_dh3o
isOutput           = 0
***********************
name               = dalkc_dh3o
isOutput           = 0
***********************
name               = dalkresidual_dpH
isOutput           = 0
***********************
name               = ph
isOutput           = 0
***********************
name               = schmidtnumber_co2
comment            = Source unclear\\old GENUS code states the numbers are derived from:\\Wanninkhof, R., 1992. Relationship between wind speed and gas exchange over the ocean. \\Journal of Geophysical Research: Oceans (1978-2012) 97, 7373-7382.
***********************
name               = frac_denit_sed
formula            = 0.5
***********************
name               = o2_sat
comment            = derived from www.helcom.fi/Monas/CombineManual2/PartB/AnnexB-8Appendix3.pdf\\now found under \\http://www.helcom.fi/groups/monas/CombineManual/AnnexesB/en_GB/annex8app3/\\1[ml/l] = 44.66e-6 [mmol/m], max error < +/- 0.15 for t=0-36C, s=0-36psu; 1e-6 \\converts \\[mmol/m3] to [mol/kg]
vertLoc            = SUR
***********************
name               = o2_sat_garcia
temp1              = log((298.15-cgt_temp)/(273.15+cgt_temp))
temp2              = temp1 * temp1
temp3              = temp2 * temp1
temp4              = temp3 * temp1
temp5              = temp4 * temp1
formula            = exp( 2.00907 + 3.22014*temp1 + 4.05010*temp2 + 4.94457*temp3 + (-2.56847e-01)*temp4 + 3.88767*temp5 + ((-6.24523e-03) + (-7.37614e-03)*temp1 + (-1.03410e-02)*temp2 + (-8.17083e-03)*temp3 + (-4.88682e-07)*cgt_sali)*cgt_sali) /(22.3916*cgt_density)
description        = oxygen saturation concentration [mol/kg]
comment            = Formula is taken from:\\Oxygen solubility in seawater: Better fitting equations\\Garcia and Gordon, Limnol. Oceanogr., 37(6), 1992, 1307-1312\\Formula 8 on page 1310 gives [cm3/dm3], \\so we use molar volume 22.3916 [l/mol] and density [kg/m3] to convert:\\[cm3/dm3]/([l/mol]*[kg/m3]) = [cm3*mol*m3]/[dm3*l*kg] = [mol/kg]
vertLoc            = SUR
***********************
name               = solubility_o2
formula            = o2_sat_garcia*4.71265e-5
comment            = oxysat gives concentration at pressure of 1 atm = 101325 Pa\\We assume an atmospheric oxygen content of 0.20942\\=> partial pressure of O2 was 21219.4815 Pa\\its inverse is 4.71265e-5 Pa-1
***********************
name               = schmidtnumber_o2
comment            = Origin unclear.\\Old GENUS code states these values should have been taken from:\\Seasonal variations in the atmospheric O2/N2 ratio in relation to the kinetics of \\air-sea \\gas exchange\\Keeling et al. \\GLOBAL BIOGEOCHEMICAL CYCLES, VOL. 12, NO. 1, PAGES 141-163, MARCH 1998
***********************
name               = n2_sat
comment            = Hamme, R.C., Emerson, S.R., 2004. The solubility of neon, nitrogen and argon in \\distilled \\water and seawater. Deep Sea Res I Oceanogr Res Pap. 51 (11), 15171528.
vertLoc            = SUR
***********************
name               = cop_eff
formula            = t_cop*t_cop/zoo_cl
description        = renormalized squared copepods [mol/kg]
***********************
name               = kr1_eff
formula            = t_kr1*t_kr1/zoo_cl
description        = renormalized squared small krill [mol/kg]
***********************
name               = kr2_eff
formula            = t_kr2*t_kr2/zoo_cl
description        = renormalized squared large krill [mol/kg]
***********************
name               = ntemp_eps
formula            = max(t_no3+t_nh4,epsilon)
description        = total nitrogen (ammonium+nitrate) + epsilon [mol/kg]
***********************
name               = lr_assim_lpp
formula            = r_lpp_assim*theta(t_o2)*min(din_sq/(din_sq+din_min_lpp*din_min_lpp),po4_sq/(po4_sq+din_min_lpp*din_min_lpp*rfr_p*rfr_p),lim_light_lpp) / (1. + exp(temp_min_lpp - cgt_temp))  / (1. + exp(cgt_sali-sali_max_lpp)) / (1. + exp(sali_min_lpp-cgt_sali))
description        = growth rate of large-cell phytoplankton [1/d]
***********************
name               = lr_assim_spp
formula            = r_spp_assim*theta(t_o2)*min(din_sq/(din_sq+din_min_spp*din_min_spp),po4_sq/(po4_sq+din_min_spp*din_min_spp*rfr_p*rfr_p),lim_light_spp)/ (1. + exp(temp_min_spp - cgt_temp))  / (1. + exp(cgt_sali-sali_max_spp)) / (1. + exp(sali_min_spp-cgt_sali))
description        = growth rate of small-cell phytoplankton [1/d]
***********************
name               = lr_assim_cya
formula            = r_cya_assim*theta(t_o2)*min(po4_sq/(po4_sq+dip_min_cya*dip_min_cya),lim_light_spp)/ (1. + exp(temp_min_cya-cgt_temp)) / (1. + exp(cgt_sali-sali_max_cya)) / (1. + exp(sali_min_cya-cgt_sali))
description        = growth rate of diazotroph cyanobacteria [1/d]
***********************
name               = lr_sed_rec
formula            = r_sed_rec*exp(q10_sed_rec*cgt_temp)
***********************
name               = biores
formula            = r_biores * max(t_o2,0.0)*max(t_o2,0.0)/(max(t_o2,0.0)*max(t_o2,0.0)+o2_min_sed_resp*o2_min_sed_resp)
description        = resuspension rate by benthos (digging animals) [1/day]
vertLoc            = SED
***********************
name               = blanchard_ratio_cop
formula            = max(0.0,(temp_max_cop-cgt_temp)/(temp_max_cop-temp_opt_cop))
description        = Temperature difference ratio used for Blanchard temperature dependence of cop [1]
comment            = Blanchard 1996
***********************
name               = blanchard_ratio_kr1
formula            = max(0.0,(temp_max_kr1-cgt_temp)/(temp_max_kr1-temp_opt_kr1))
description        = Temperature difference ratio used for Blanchard temperature dependence of kr1 [1]
comment            = Blanchard 1996
***********************
name               = blanchard_ratio_kr2
formula            = max(0.0,(temp_max_kr2-cgt_temp)/(temp_max_kr2-temp_opt_kr2))
description        = Temperature difference ratio used for Blanchard temperature dependence of kr2 [1]
comment            = Blanchard 1996
***********************
name               = blanchard_cop
formula            = power(blanchard_ratio_cop,blanchard_beta) * exp(-blanchard_beta*(blanchard_ratio_cop-1.0))
description        = temperature dependence factor of copepod grazing [1]
comment            = Blanchard 1996
***********************
name               = blanchard_kr1
formula            = power(blanchard_ratio_kr1,blanchard_beta) * exp(-blanchard_beta*(blanchard_ratio_kr1-1.0))
description        = temperature dependence factor of small krill grazing [1]
comment            = Blanchard 1996
***********************
name               = blanchard_kr2
formula            = power(blanchard_ratio_kr2,blanchard_beta) * exp(-blanchard_beta*(blanchard_ratio_kr2-1.0))
description        = temperature dependence factor of large krill grazing [1]
comment            = Blanchard 1996
***********************
name               = total_pon
formula            = max(t_lpp+t_spp+t_cya+t_cop+t_kr1+t_kr2+t_det,epsilon)
description        = 
***********************
name               = ieval_cop
temp1              = light_max_cop*light_max_cop*light_max_cop*light_max_cop
temp2              = light*2.0*microeinstein_per_watt
temp3              = temp2*temp2*temp2*temp2
formula            = temp1/(temp1+temp3)
description        = limitation of copepod upward motion by too intense light [1]
comment            = The light is first multiplied by 2 (to consider all light, not only photosynthetically active radiation).\\Then, we convert it to microEinstein.\\If the light becomes too intense, ieval_cop becomes small.
***********************
name               = ieval_kr1
temp1              = light_max_kr1*light_max_kr1*light_max_kr1*light_max_kr1
temp2              = light*2.0*microeinstein_per_watt
temp3              = temp2*temp2*temp2*temp2
formula            = temp1/(temp1+temp3)
description        = limitation of small krill upward motion by too intense light [1]
***********************
name               = ieval_kr2
temp1              = light_max_kr2*light_max_kr2*light_max_kr2*light_max_kr2
temp2              = light*2.0*microeinstein_per_watt
temp3              = temp2*temp2*temp2*temp2
formula            = temp1/(temp1+temp3)
description        = limitation of large krill upward motion my too intense light [1]
***********************
name               = gg_cop
formula            = r_cop_graz*(1-exp(-total_pon*total_pon/(food_min_zoo*food_min_zoo)))*blanchard_cop
description        = total PON uptake rate of zooplankton [1/day]
comment            = Total grazing (PON uptake) takes place as long as any PON is there. But it only leads to \\growth if the concentration of edible things is large enough. Non-edible things are not \\touched.
isOutput           = 1
***********************
name               = gg_kr1
formula            = r_kr1_graz*ieval_kr1*(1-exp(-total_pon*total_pon/(food_min_zoo*food_min_zoo)))*blanchard_kr1
description        = total PON uptake rate of small krill [1/day]
isOutput           = 1
***********************
name               = gg_kr2
formula            = r_kr2_graz*ieval_kr2*(1-exp(-total_pon*total_pon/(food_min_zoo*food_min_zoo)))*blanchard_kr2
description        = total PON uptake rate of large krill [1/day]
***********************
name               = grad_dia
formula            = t_lpp
description        = vertical gradient of diatoms [mol/kg/m]
isZGradient        = 1
***********************
name               = grad_fla
formula            = t_spp
description        = vertical gradient of flagellates [mol/kg/m]
isZGradient        = 1
***********************
name               = grad_cya
formula            = t_cya
description        = vertical gradient of cyanobacteria [mol/kg/m]
isZGradient        = 1
***********************
name               = grad_cop
formula            = t_cop
description        = vertical gradient of copepods [mol/kg/m]
isZGradient        = 1
***********************
name               = grad_kr1
formula            = t_kr1
description        = vertical gradient of small krill [mol/kg/m]
isZGradient        = 1
***********************
name               = grad_kr2
formula            = t_kr2
description        = vertical gradient of large krill [mol/kg/m]
isZGradient        = 1
***********************
name               = grad_det
formula            = t_det
description        = vertical gradient of detritus [mol/kg/m]
isZGradient        = 1
***********************
name               = food_cop
formula            = max(fp_cop_eating_dia*t_lpp + fp_cop_eating_fla*t_spp + fp_cop_eating_cya*t_cya + fp_cop_eating_det*t_det,epsilon)
description        = available food for copepods [mol/kg]
isOutput           = 1
***********************
name               = food_kr1
formula            = max(fp_kr1_eating_dia*t_lpp + fp_kr1_eating_fla*t_spp + fp_kr1_eating_cya*t_cya + fp_kr1_eating_cop*t_cop + fp_kr1_eating_det*t_det,epsilon)
description        = available food for small krill [mol/kg]
isOutput           = 1
***********************
name               = food_kr2
formula            = max(fp_kr2_eating_cop*t_cop + fp_kr2_eating_kr1*t_kr1 + fp_kr2_eating_kr2*t_kr2 + fp_kr2_eating_det*t_det,epsilon)
description        = available food for large krill [mol/kg]
***********************
name               = food_grad_cop
formula            = fp_cop_eating_dia*grad_dia + fp_cop_eating_fla*grad_fla + fp_cop_eating_cya*grad_cya + fp_cop_eating_det*grad_det
description        = vertical gradient of available food for copepods [mol/kg/m]
isOutput           = 1
***********************
name               = food_grad_kr1
formula            = fp_kr1_eating_dia*grad_dia + fp_kr1_eating_fla*grad_fla + fp_kr1_eating_cya*grad_cya + fp_kr1_eating_cop*grad_cop + fp_kr1_eating_det*grad_det
description        = vertical gradient of available food for small krill [mol/kg/m]
isOutput           = 1
***********************
name               = food_grad_kr2
formula            = fp_kr2_eating_cop*grad_cop + fp_kr2_eating_kr1*grad_kr1 + fp_kr2_eating_kr2*grad_kr2 + fp_kr2_eating_det*grad_det
description        = vertical gradient of available food for large krill [mol/kg/m]
***********************
name               = feval_cop
temp1              = food_cop/food_min_zoo
formula            = motion_weight_food*exp(-(temp1*temp1))*food_grad_cop/food_min_zoo
description        = modification of copepod upward motion depending on the local food gradient [1]
comment            = the dimension of food_grad_cop is mol/kg/m\\the dimension of food_grad_cop/iv is 1/m.\\the dimension of motion_weight_food_cop is m.
isOutput           = 1
***********************
name               = feval_kr1
temp1              = food_kr1/food_min_zoo
formula            = motion_weight_food*exp(-(temp1*temp1))*food_grad_kr1/food_min_zoo
description        = modification of small krill upward motion depending on the local food gradient [1]
isOutput           = 1
***********************
name               = feval_kr2
temp1              = food_kr2/food_min_zoo
formula            = motion_weight_food*exp(-(temp1*temp1))*food_grad_kr2/food_min_zoo
description        = modification of large krill upward motion depending on the local food gradient [1]
***********************
name               = oeval_cop
temp1              = o2_min_cop*o2_min_cop
temp2              = t_o2*t_o2
formula            = motion_weight_oxy*temp1/(temp1+temp2)
description        = restriction of copepod upward motion by oxygen [1]
comment            = This term gets small if oxygen values are large. If light values are large as well, ieval_cop gets small as well. \\So, if ieval_cop+oeval_cop is small, this means good conditions for predators (fish).
isOutput           = 1
***********************
name               = oeval_kr1
temp1              = o2_min_kr1_move*o2_min_kr1_move
temp2              = t_o2*t_o2
formula            = motion_weight_oxy*temp1/(temp1+temp2)
description        = restriction of small krill upward motion by oxygen [1]
isOutput           = 1
***********************
name               = oeval_kr2
temp1              = o2_min_kr2_move*o2_min_kr2_move
temp2              = t_o2*t_o2
formula            = motion_weight_oxy*temp1/(temp1+temp2)
description        = restriction of large krill upward motion by oxygen [1]
***********************
name               = teval_cop
temp1              = max(0.0,temp_max_cop-temp_opt_cop)
temp2              = temp1*temp1
temp3              = temp_max_cop-temp_opt_cop
temp4              = temp3*temp3
formula            = temp2/(temp2+temp4)
description        = restriction of copepod upward motion by too high temperature [1]
isOutput           = 1
***********************
name               = teval_kr1
temp1              = max(0.0,cgt_temp-temp_opt_kr1)
temp2              = temp1*temp1
temp3              = temp_max_kr1-temp_opt_kr1
temp4              = temp3*temp3
formula            = temp4/(temp2+temp4)
description        = restriction of small krill upward motion by too high temperature [1]
isOutput           = 1
***********************
name               = teval_kr2
temp1              = max(0.0,cgt_temp-temp_opt_kr2)
temp2              = temp1*temp1
temp3              = temp_max_kr2-temp_opt_kr2
temp4              = temp3*temp3
formula            = temp4/(temp2+temp4)
description        = restriction of large krill upward motion by too high temperature [1]
***********************
name               = w_kr1
formula            = w_rise0_kr1*(1.0+feval_kr1)*min(ieval_kr1+oeval_kr1,min(teval_kr1,1.0)) + w_sink0_kr1
description        = vertical speed of small krill [m/day]
***********************
name               = w_kr2
formula            = w_rise0_kr2*(1.0+feval_kr2)*min(ieval_kr2+oeval_kr2,min(teval_kr2,1.0)) + w_sink0_kr2
description        = vertical speed of large krill [m/day]
***********************
name               = bottomstress
formula            = cgt_current_wave_stress
description        = 
vertLoc            = SED
isOutput           = 1
***********************
name               = btf_n2
formula            = 0.5*p_nh4_nitdenit_n2 + 2.65*p_sed_denit_nh4
calcAfterProcesses = 1
description        = bottom tracer flux of molecular nitrogen (positive upward) [mol/m2/day]
vertLoc            = SED
isOutput           = 1
***********************
name               = btf_o2
formula            = 0.0-6.625*p_sed_resp_nh4 - 0.75*p_nh4_nitdenit_n2
calcAfterProcesses = 1
description        = bottom tracer flux of oxygen (positive upward) [mol/m2/day]
vertLoc            = SED
isOutput           = 1
***********************
name               = btf_dic
formula            = rfr_c*p_sed_resp_nh4 + rfr_c*p_sed_denit_nh4 + rfr_c*p_sed_sulf_nh4  + rfr_c*p_sed_dnra_nh4
calcAfterProcesses = 1
description        = bottom tracer flux of dic (positive upward) [mol/m2/day]
vertLoc            = SED
isOutput           = 1
***********************
name               = btf_nh4
formula            = p_sed_resp_nh4 + p_sed_denit_nh4 + p_sed_sulf_nh4 + 4.3125*p_sed_dnra_nh4 - p_nh4_nitdenit_n2
calcAfterProcesses = 1
description        = bottom tracer flux of ammonium (positive upward) [mol/m2/day]
vertLoc            = SED
isOutput           = 1
***********************
name               = btf_no3
formula            = 0.0- 5.3*p_sed_denit_nh4 - 3.3125*p_sed_dnra_nh4
calcAfterProcesses = 1
description        = bottom tracer flux of nitrate (positive upward) [mol/m2/day]
vertLoc            = SED
isOutput           = 1
***********************
name               = btf_po4
formula            = rfr_p*p_sed_resp_nh4 + rfr_p*p_sed_denit_nh4 + rfr_p*p_sed_sulf_nh4 + rfr_p*p_sed_dnra_nh4 + p_ips_liber_po4 - p_po4_retent_ips
calcAfterProcesses = 1
description        = bottom tracer flux of phosphate (positive upward) [mol/m2/day]
vertLoc            = SED
isOutput           = 1
***********************
name               = btf_h2s
formula            = 3.3125*p_sed_sulf_nh4
calcAfterProcesses = 1
description        = bottom tracer flux of hydrogen sulfide (positive upward) [mol/m2/day]
vertLoc            = SED
isOutput           = 1
***********************
name               = btf_det
formula            = p_sed_ero_det + p_sed_biores_det - p_det_sedi_sed
calcAfterProcesses = 1
description        = bottom tracer flux of detritus (positive upward) [mol/m2/day]
vertLoc            = SED
isOutput           = 1
***********************
name               = btf_ipw
formula            = p_ips_ero_ipw + p_ips_biores_ipw - p_ipw_sedi_ips
calcAfterProcesses = 1
description        = bottom tracer flux of iron phosphate (positive upward) [mol/m2/day]
vertLoc            = SED
isOutput           = 1
***********************
name=delete_in_add_on_zoo_eff
***********************
name=delete_in_add_on_food_zoo
***********************
name=delete_in_add_on_lr_graz_zoo
***********************
name=delete_in_add_on_frac_po4retent
***********************
