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

Add consistent environmental buoyancy gradients using mean fields and quadratures. #405

Merged
merged 1 commit into from
Oct 21, 2021

Conversation

ilopezgp
Copy link
Contributor

@ilopezgp ilopezgp commented Oct 15, 2021

This PR modifies the buoyancy_gradients closure and the struct used to compute them in the following ways:

  • The outputs of buoyancy_gradients are modified to be the buoyancy gradients in the environment, and its dry and cloudy parts. Before, a couple of partial derivatives were outputted that were not used by the model, or just added up in functions in the code. I output the dry and moist derivatives instead because I may use them to simplify the mixing length formulation in the near future.
  • Two implementations of the environmental buoyancy gradient are given. The first one corrects the implementation in Tan et al. (2018) in several ways. First, it exclusively uses environmental mean quantities for computation of buoyancy fluxes, which is consistent with not having access to a probabilistic cloud partition function. This is consistent with the original paper, although we later modified it in the code to use partial information from the quadratures. Second, it corrects the computation of the buoyancy gradient in the dry part from the one given in the paper. The derivation of this term in Tan et al (2018) is taken from Deardorff 1976 without consideration for the different assumptions allowed, and it is actually incorrect because θ_liq_ice != θ in the environment, just in the dry part of the environment. Third, it corrects the latent heat used to include effects of all condensate species.
  • The second implementation is consistent with having Quadratures in the model. The derivatives are the same as in the previous case, therefore you will find that the buoyancy_gradients function is shared. The main distinction is in the arguments passed with the EnvBuoyGrad struct. In this case, we make full use of the quadrature information to compute the gradients. Safeguards are included for gradients computed in vanishing cloudy or dry regions. In these regions, we resort to the environmental mean gradients.

src/types.jl Outdated Show resolved Hide resolved
src/types.jl Outdated Show resolved Hide resolved
@ilopezgp ilopezgp force-pushed the buoy_grad branch 2 times, most recently from 5b00de8 to fadf69f Compare October 17, 2021 23:56
@ilopezgp ilopezgp changed the title WIP: Add new buoyancy gradients. Add consistent environmental buoyancy gradients using mean fields and quadratures. Oct 18, 2021
@ilopezgp ilopezgp marked this pull request as ready for review October 18, 2021 00:19
@ilopezgp
Copy link
Contributor Author

For the MSE, I will wait until we decide whether we want to keep quadratures or mean as the default mode for the buoyancy flux. I prefer quadratures, since it should be more accurate.

@ilopezgp ilopezgp force-pushed the buoy_grad branch 2 times, most recently from 7a01f50 to b7772ce Compare October 18, 2021 19:42
Copy link
Member

@trontrytel trontrytel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me!

My only comments are about the notation. I would vote for:

  • using some abbreviation of saturated/unsaturated instead of cloud/dry
  • agreeing on some convention about the thetas so we don't confuse ourselves later. Maybe something like \theta, \theta_v, \theta_liq_ice

But if the others disagree, we can keep the notation we used. Don't want to block this PR

@ilopezgp ilopezgp self-assigned this Oct 20, 2021
Copy link
Member

@yairchn yairchn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ilopezgp
Copy link
Contributor Author

bors r+

@bors
Copy link
Contributor

bors bot commented Oct 21, 2021

Build succeeded:

@bors bors bot merged commit 26fa9d1 into main Oct 21, 2021
@bors bors bot deleted the buoy_grad branch October 21, 2021 18:17
charleskawczynski referenced this pull request Oct 25, 2021
449: Bump version for new release r=charleskawczynski a=charleskawczynski



Co-authored-by: Charles Kawczynski <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants