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 thermo extension with constant entropy ref state #43

Closed
wants to merge 1 commit into from

Conversation

charleskawczynski
Copy link
Member

This PR adds some pressure-entropy-total specific humidity constructors, and uses them for constructing the reference state to ensure a constant entropy reference state.

@charleskawczynski
Copy link
Member Author

Some notes/findings with this PR:

  • The reference states seem to match (visually indistinguishable) with all cases except for TRMM_LBA and GATE_III. Top candidates for why this happens: 1) different latent heats (easy to check), 2) scampy bug (see below) regarding liquid condensate at freezing temperatures
  • The newly added method, air_density_equil, may be useful to Thermodynamics.jl in its own right.
  • All cases are converging, but TRMM_LBA results (and potentially GATE_III) have worsened. There were deviations in TRMM_LBA after the initial direct translation to Julia, so there are likely bugs in TC.jl's TRMM_LBA, and perhaps these deviations are amplified by this PRs changes.
  • This begs the question, should we be running GATE_III? Perhaps as a weekly cron job, or a QA run? @trontrytel, is this something that you could set up?

This needs to be confirmed, but I believe I've found a bug in SCAMPy: liquid condensate (q_liq)-- not ice condensate--develops even when eos returns freezing temperatures (T < 273.15 K). I believe this case occurs in TRMM_LBA, will hopefully confirm soon.

bors bot added a commit that referenced this pull request Jul 27, 2021
47: Match scampy by using linear interpolation r=charleskawczynski a=charleskawczynski

This PR changes `pyinterp` to use linear interpolation, which is what `numpy.interp` does by default.

I believe TRMM should match with SCAMPy far better with these changes. This should hopefully give us a clearer view of how #43 changes the results.

Co-authored-by: Charles Kawczynski <[email protected]>
@charleskawczynski
Copy link
Member Author

charleskawczynski commented Jul 27, 2021

It seems that the thermo functions are not yet self-consistent (by about 0.1 % in entropy). Perhaps this is why there's still a discrepency? This may be easier to look into in Thermodynamics.jl.

src/ReferenceState.jl Outdated Show resolved Hide resolved
bors bot added a commit to CliMA/ClimaParams.jl that referenced this pull request Jul 27, 2021
51: Add some planet parameters r=charleskawczynski a=charleskawczynski

These parameters are from "Large-eddy simulation in an anelastic framework with closed water and entropy balances" (Pressel et. al.), Table 1. This is needed for [TurbulenceConvection.jl's #43](CliMA/TurbulenceConvection.jl#43).

Co-authored-by: Charles Kawczynski <[email protected]>
bors bot added a commit that referenced this pull request Jul 28, 2021
51: Fix inversion height bug, read Ri bulk crit from namelist, add Nieuwstadt case r=charleskawczynski a=charleskawczynski

I believe this fixes the Nieuwstadt case. This may also fix / improve other cases. cc `@yairchn.` Looking forward to re-try #25, #40, and #43.

Co-authored-by: Charles Kawczynski <[email protected]>
bors bot added a commit that referenced this pull request Jul 28, 2021
51: Fix inversion height bug, read Ri bulk crit from namelist, add Nieuwstadt case r=charleskawczynski a=charleskawczynski

I believe this fixes the Nieuwstadt case. This may also fix / improve other cases. cc `@yairchn.` Looking forward to re-try #25, #40, and #43.

Co-authored-by: Charles Kawczynski <[email protected]>
@charleskawczynski charleskawczynski force-pushed the ck/thermo_entropy branch 2 times, most recently from 178faba to 74723f3 Compare July 28, 2021 23:33
@charleskawczynski
Copy link
Member Author

charleskawczynski commented Jul 29, 2021

Updates after #47 and #51: Most results appear fine. Rico and ARM have slightly noticeable differences, but qualitatively and quantitatively satisfactory. TRMM_LBA is the one outlier, where updraft w and tke become undesirably large in the upper atmos. This also coincides with the fact that TRMM_LBA (and GATE, not compared) have noticeable differences in the reference states (the largest difference is in the upper atmos), whereas all other reference states are visually indistinguishable.

Also, I'm not sure what we can do about the difference in the reference state since SCAMPy uses a different, empirical, saturation vapor pressure based on the Magnus formula.

@charleskawczynski charleskawczynski force-pushed the ck/thermo_entropy branch 4 times, most recently from f69cd00 to dfa5918 Compare August 3, 2021 16:13
@charleskawczynski
Copy link
Member Author

I think we’re forgoing this PR in favor of #25.

@charleskawczynski charleskawczynski deleted the ck/thermo_entropy branch August 14, 2021 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants