Replies: 2 comments 1 reply
-
|
This may be a question more suited for OceanBIOME.jl since you would need to interact with the source code of that package rather than Oceananigans. What you can do in your script is change how the LOBSTER type acts. From what I see, the nitrification rate is used in these three functions:
If you import LOBSTER in your script, for example, with import OceanBIOME.Models.AdvectedPopulations.LOBSTERModel: LOBSTERyou can redefine what these functions do locally @inline function (bgc::LOBSTER)(::Val{:NO₃}, x, y, z, t, NO₃, NH₄, P, Z, sPOM, bPOM, DOM, PAR)
μₚ = bgc.maximum_phytoplankton_growthrate
kₚₐᵣ = bgc.light_half_saturation
ψ = bgc.nitrate_ammonia_inhibition
kₙₒ₃ = bgc.nitrate_half_saturation
μₙ = # Here I do what I want with nitrate....
return μₙ*NH₄ - μₚ*Lₚₐᵣ(PAR, kₚₐᵣ)*Lₙₒ₃(NO₃, NH₄, ψ, kₙₒ₃)*P
endHowever, here the question is how you would access PH to compute your nitrate rate, which does not seem to be a parameter passed to this function. How I would go about it is to open an issue in OceanBIOME and eventually a PR that leads to (1) the possibility of passing differently typed inputs in LOBSTER (so you can pass a simple function as your Maybe @jagoosw can chime in here. |
Beta Was this translation helpful? Give feedback.
-
|
Hi @kgrabb, Thanks for reaching out its great to hear you're using OceanBioME! We actually have a PR about to be merged that changes LOBSTER so its much easier to make changes like this OceanBioME/OceanBioME.jl#276 Simone's solution seems like a good interim, or if you wanted to use the branch (you can write I'm happy to help with this and will try to merge that PR asap to make things easier. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi Oceananigans community,
I am new to using Oceananigans and am trying to amend some of the functions and equations within LOBSTER in OceanBioME. Right now, LOBSTER.jl defines nitrification rate as a constant 'nitrification_rate::FT = 5.8e-7, # 1/s'.
However, I would like to amend the nitrification rate to depend on pH, ideally by adding an equation such as 'nitrification_rate = -2e-6*pH + 2e-5', which also requires pH to be solved for before defining the nitrification rate. Ideally I would like to not amend the LOBSTER source code, but somehow amend this equation after calling in LOBSTER. I have heard that there may be ways to do this by re-declaring a second version of LOBSTER, somehow making it a field, and/or adding a forcing function to amend the nitrification rate. However, I do not have experience with any of these actions, so suggestions (and/or new ideas) are welcomed!
Thank you!
Kalina
Beta Was this translation helpful? Give feedback.
All reactions