OceanBioME.jl
OceanBioME.jl copied to clipboard
Implements `PISCES` model
To do (for me but others feel free to open a PR into this branch doing them if you want to):
- [ ] Update/fix Morel model (return PAR, PAR^P and PAR^D)
- [ ] Get day length function from Walrus
- [ ] Add mixed layer depth
- [ ] Add euphotic depth (simplest if anyone else wants todo it)
- [ ] Add yearly maximum silicate concentration
- [ ] Add Calcite saturation ratio (probably going to have to make the carbonate chemistry model have pressure dependence)
CC: @hannahmw1 @ciadht
Btw, I've temporarily turned off the automatic testing for this branch since its not testing any of the PISCES stuff anyway yet, and we have a limited quota for testing. When it gets closer to completion let me know and I'll turn it back on.
Comment origionally posted by @ciadht in #209:
This where we're leaving PISCES after the internship:
PISCES is currently a working and (hopefully) correct model. She can run with a timestep of >=50mins on standard box and column models.
What remains to be done: Although sinking speed has been implemented, w_GOC is not yet depth dependent. Currently this is because of issues with setup_velocity_fields requiring the velocity fields to be a named tuple of scalars, or a velocity field itself. As I am not sure how velocity fields work, I have left this, but the function field in the way I had tried did not work. Yearly maximum silicate, carbonate saturation ratio and dust deposition, have all been assigned temporary values but not implemented fully. Length of day is currently set to 1.0. This would need to be changed to allow more accurate phytoplankton growth. Latitude is currently set at -1. This also needs a proper input function, as although the Aumont Paper only needs a positive or negative value of latitude, to add correct length of day we would need latitude. The Aumont Paper assumes a constant vertical diffusivity of 1.0. Jago mentioned that this is actually determined by Oceananigans and OceanBioME, so this would need to be corrected. PISCES does not work with open_bottom = false. Donβt know if this must be addressed but for testing it probably should do. Testing files for the model. Fix the Calcite model according to TOP/PISCES/P4Z/p4zlys.F90, and https://bg.copernicus.org/articles/4/505/2007/bg-4-505-2007.pdf. Box Model could be altered to be a slice at different z values. Currently only z = 0 is possible, even with the changing of the grid type. Fix the air-sea CO2 flux in the Column Model.
This leaves the to-do above.
Updates:
Changes from Aumount 2015 to match NEMO:
enhanced quadratic mortality rate for diatoms changes from w_0 + w_1 (1-L) to w_0 + 0.25 w_1 (1 - L^2)/(0.25 + L^2) P-I slope can vary from alpha, but default behaviour is to not enhance with depth, also diatom parameterization always returns the same as nano so ignoring it Iron ratios now come from NEMO and are in nmol/\mu mol = \mu mol / m mol, for microzooplankton it is 0.01, mesozooplankton 0.015, maximum in phytoplankton 0.06, and in bacteria 0.06I'm sure there are others that I've not come across yet
So, I think chlorophyll production should be given as:
\frac{\partial IChl}{\partial t} += 12 (\theta^{min} + \rho(\theta^{max}-\theta^{min}))\mu I,\rho = \left[L_{day}\frac{\mu I}{f_1}\right]L\frac{12I}{IChl}\frac{L_P}{\alpha PAR},which makes
\rhounitless.It feels like
\theta^{max}should be something else like the actual\thetavalue since there is nothing stopping\thetagoing bigger than\theta^{max}, but this is how it is in NEMO/CROCO
So I had todo some horrible things to get this to work on GPU because it seems that _apply_iterate is not implemented in CUDA C or CUDA.jl or somewhere along the line for very long tuples, so this code also introduces a hack which I will hopefully implement in Oceananigans.
If I can get it done before the meeting on Thursday I'm going to change this to be discrete form because I think that will help a lot with future flexibility too
@johnryantaylor I think this is now ready to merge. You can see the (brief) documentation I've written here https://oceanbiome.github.io/OceanBioME.jl/previews/PR178/model_components/biogeochemical/PISCES/PISCES/
with notes on what is different to Aumount, 2015 here https://oceanbiome.github.io/OceanBioME.jl/previews/PR178/model_components/biogeochemical/PISCES/notable_differences/
Is there anything else you think needs doing?
@ciadht @hannahmw1, I'm probably going to merge this soon. Thank you for all your work, it was really helpful and I'm not sure I'd have had the dedication to track down all of the bugs that you found.
If there's anything else you think we need todo before we merge let me know! But no worries if you don't want to look through it all (I've changed the code quite a lot, mainly to make it work on GPU).
Hi Jago,
Thanks for keeping us in the loop - exciting to hear its nearly ready to be merged! Hope all goes well with the merge and future of PISCES.
Hannah
From: Jago Strong-Wright @.>
Sent: 04 October 2024 17:17
To: OceanBioME/OceanBioME.jl @.>
Cc: hannahmw1 @.>; Mention @.>
Subject: Re: [OceanBioME/OceanBioME.jl] Implements PISCES model (PR #178)
@ciadhthttps://github.com/ciadht @hannahmw1https://github.com/hannahmw1, I'm probably going to merge this soon. Thank you for all your work, it was really helpful and I'm not sure I'd have had the dedication to track down all of the bugs that you found.
If there's anything else you think we need todo before we merge let me know! But no worries if you don't want to look through it all (I've changed the code quite a lot, mainly to make it work on GPU).
β Reply to this email directly, view it on GitHubhttps://github.com/OceanBioME/OceanBioME.jl/pull/178#issuecomment-2394184806, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BCJ3NJMOCYDI5W3FS34Q4NTZZ3ESXAVCNFSM6AAAAABKTERLBWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOJUGE4DIOBQGY. You are receiving this because you were mentioned.
Hi Jago,
This all looks fantastic! Great to see PISCES becoming a part of OceanBioME!
I'm just writing my presentation at the moment and I wondered if you could let me know what happened with the Paris meeting just so I can add it to the end?
Thanks, Ciadh
Great to hear from you both!
@ciadht I'll message you on slack about it
This PR probably isn't API breaking but there are some major internal changes to support discrete form models so going to bump minor version