Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mixed layer depth #79

Open
iuryt opened this issue May 6, 2022 · 2 comments
Open

Mixed layer depth #79

iuryt opened this issue May 6, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@iuryt
Copy link

iuryt commented May 6, 2022

I created a new package for biogeochemical models on Oceananigans and, with @glwagner help, I could create a function to estimate the mixed layer depth from a given buoyancy decrease criterium. Although this is working well for the purpose I had in mind, I believe that the mixed layer depth estimator could be better located in a more general repository. While discussing with @glwagner, he suggested me this repository.

We also had some ideas for improving the algorithm, like leaving for the user to define any general criterium for the mixed layer... even those which does not depend on the buoyancy? (but then it would be better called boundary layer? idk...).

What do you think about it and if you think this is a good match to this repo, where should I add it? I could first adapt the language and create a PR, adding it as it is and later create another issue for the enhancements.

@glwagner
Copy link
Collaborator

glwagner commented May 6, 2022

Food for thought to spark some creativity...

You could consider defining a new operand MixedLayerDepthOperand which is associated with compute! so that

const MixedLayerDepthField = Field{<:Any, <:Any, Nothing, <:MixedLayerDepthOperand}

function compute!(mld::MixedLayerDepthField)
    # code that computes this 2D field
end

the next component is to design the MixedLayerDepthOperand struct so that different criteria can be provided. Probably at the minimum you'd want to give it a buoyancy field and velocity fields. In addition, one design might ask for the entire @kernel function itself (with parameters?) eg

struct MixedLayerDepthOperand{B, U, K, P}
    buoyancy_field :: B 
    velocities :: U
    mixed_layer_depth_kernel :: K
    parameters :: P
end

Then the kernel could have a prescribed function signature (eg grid, b, u, v, w, parameters).

@tomchor
Copy link
Owner

tomchor commented May 6, 2022

I created a new package for biogeochemical models on Oceananigans and, with @glwagner help, I could create a function to estimate the mixed layer depth from a given buoyancy decrease criterium. Although this is working well for the purpose I had in mind, I believe that the mixed layer depth estimator could be better located in a more general repository. While discussing with @glwagner, he suggested me this repository.

We also had some ideas for improving the algorithm, like leaving for the user to define any general criterium for the mixed layer... even those which does not depend on the buoyancy? (but then it would be better called boundary layer? idk...).

What do you think about it and if you think this is a good match to this repo, where should I add it? I could first adapt the language and create a PR, adding it as it is and later create another issue for the enhancements.

Great start with Bioceananigans! I can definitely see a function like that being a part of this repo.

At the moment I think the best place for such an addition is in FlowDiagnostics. However, pretty much everything there is geared towards point-wise diagnostics (mostly because that's what I had in mind when I created the repo). So if there are plans to include more stuff of this nature it can also be productive to create something like a BulkDiagnostics module where these things could go. (I actually already have a background potential density calculation that would fit nicely there...)

Thoughts? Also, feel free to create a PR and we can try things out over there

@tomchor tomchor added the enhancement New feature or request label May 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants