OceanBioME / OceanBioME.jl

🌊 🦠 🌿 A fast and flexible modelling environment written in Julia for modelling the coupled interactions between ocean biogeochemistry, carbonate chemistry, and physics
https://oceanbiome.github.io/OceanBioME.jl/
MIT License
40 stars 20 forks source link

Added passing of time to sediment tendency calculation #162

Closed jagoosw closed 8 months ago

jagoosw commented 9 months ago

I've come across an instance where I'm trying to write a different sediment model and need the forcings to have a time dependence so need to pass the time to _calculate_tendencies!, and modifies sediment tendency kernel to make new method definition possible.

navidcy commented 8 months ago

@jagoosw my plate is a bit full now... But could try to look at this in a week or so..

jagoosw commented 8 months ago

looks ok, I don't know how deep I can review this. is there a test that tests this? or a validation that now works and before it wasn't?

Thank you for reviewing!

The reason I made these changes is that I'm using a sediment model (not BGC but this was the easiest interface for it) that depended on the surface radiation which I have as a time-dependent function, and I also realised it was more generally consistent with other tendency calculations that the time be included.

I then moved the kernels to be functions because (I think) you can't externally define new methods for @kernels. If a user wanted to implement their own sediment model I think this would be essential.