tomchor / Oceanostics.jl

Diagnostics for Oceananigans
https://tomchor.github.io/Oceanostics.jl/
MIT License
24 stars 8 forks source link

Allow user to pass a buoyancy field to `RichardsonNumber` #54

Closed ali-ramadhan closed 2 years ago

ali-ramadhan commented 2 years ago

Right now RichardsonNumber cannot be used for models with SeawaterBuoyancy as it assumes model.tracers.b exists.

This PR allows users to pass in a b so that BuoyancyField(model) can be passed in. In particular I'm trying to revive https://github.com/CliMA/LESbrary.jl/blob/master/examples/three_layer_constant_fluxes.jl

Hoping to tag v0.6.2 once this is merged if that's okay.

tomchor commented 2 years ago

Hoping to tag v0.6.2 once this is merged if that's okay.

Tag away!

tomchor commented 2 years ago

One comment is that I think in the future we want to make the calculation of N2 more general, as per https://github.com/tomchor/Oceanostics.jl/issues/37

Then we could use Oceananigans buoyancy function to get N2 from both BuoyancyTracer and SeawaterBuoyancy models directly, with no need to pass a buoyancy field specificaly.

ali-ramadhan commented 2 years ago

Ah true, forgot to check issues to still if this was one!

tomchor commented 2 years ago

Ah true, forgot to check issues to still if this was one!

All good. That can be done in a later PR. This is already an improvement, so I'm def okay with merging this and deealing with the rest later :)