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

Compute SHF using SF, do not re-compute offline #802

Merged
merged 1 commit into from
Oct 7, 2024
Merged

Compute SHF using SF, do not re-compute offline #802

merged 1 commit into from
Oct 7, 2024

Conversation

juliasloan25
Copy link
Member

@juliasloan25 juliasloan25 commented Sep 27, 2024

Purpose

Since evaporation is no longer included in the SH computation in SF.jl, we now use the output of sensible_heat_flux provided directly by SF.jl's call to surface_conditions. This will make fluxes calculated in atmos and in land more similar, which is a good to prepare for coupled runs.

Our fluxes differ from those calculated in SurfaceFluxes still in these ways:

  • land components usually require r_sfc, an additional resistance term, in the evaporation calculation.
  • for the bucket and snow models, this is the only change
  • for the soil model, we do not allow for condensation or frost. Again we modify the evaporation using a surface resistance. We also compute SF twice, once for liquid water, and once for ice. This requires us to combine the SH_ice and SH_water into a single number also.
  • for the canopy, the surface resistance affects SH and E

To-do

Content

Note that this change required an increase in the threshold for passing in one of our tests (for the canopy temperature jacobian contribution from SHF). Previously, we used only cp_m of the atmos in the SH flux, which is indep of T_canopy. now, the coefficient in the Jacobian depends on cp_m_sfc. This does depend on T_canopy, because it depends on q_canopy, which we approximate as q_sat(T_canopy). We hypothesize that this is why the error in the SH approximation grew with this PR. @trontrytel

Previous: SHF = -rho_sfc cp_m_atmos (T_atmos - T_canopy)/resistances
Now: SHF = -rho_sfc/resistances * [stuff indep of T_canopy ..... - cp_m_sfc(T_canopy)*T_canopy ....]

Since we already have an issue open to improve the jacobian approximation, we are accepting this for now. @juliasloan25

For good measure, though, I added the derivative of rho_sfc with respect to T_sfc

Comparisons

This PR followed by implicit canopy PR long run:
Long Runs at 1/2 year:
Canopy Temp:
image
image
ET:
image
image
SWC:
image
image

Canopy Alone Convergence:
this PR vs current main
image
image
Errors:
image
image

SoilCanopy Convergence:
this PR vs current main
image
image
Errors:
image
image


  • I have read and checked the items on the review checklist.

Copy link
Member

@Sbozzolo Sbozzolo left a comment

Choose a reason for hiding this comment

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

Let's regenerate the Manifests before merging.

@kmdeck kmdeck changed the title update SurfaceFluxes compat Compute SHF using SF, do not re-compute offline Sep 30, 2024
@kmdeck kmdeck self-assigned this Sep 30, 2024
Copy link
Member

@akshaysridhar akshaysridhar left a comment

Choose a reason for hiding this comment

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

Two small issues
(1) Variable naming in canopy_boundary_fluxes.jl
(2) Neutral stability tolerance kwarg in energy_hydrology.jl

@akshaysridhar
Copy link
Member

Thanks @kmdeck ! Another note: ts_cpu.png and ts_gpu.png plots in the buildkite output (static map albedo tests) are blank; since these are visualisations of time-dependent vars maybe we can remove them entirely from static map cases.

@kmdeck
Copy link
Member

kmdeck commented Oct 4, 2024

Thanks @kmdeck ! Another note: ts_cpu.png and ts_gpu.png plots in the buildkite output (static map albedo tests) are blank; since these are visualisations of time-dependent vars maybe we can remove them entirely from static map cases.

We have some cleanup to do in our buildkite runs which will be tackled in another PR. I will add this to the list! Thank you!

@@ -304,6 +304,11 @@ Computes turbulent surface fluxes at a point on a surface given

This returns an energy flux and a liquid water volume flux, stored in
a tuple with self explanatory keys.

Please note that this function, if r_sfc is set to zero, makes no alteration
Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe we could explain what it does if r_sfc !=0 too

Copy link
Member

Choose a reason for hiding this comment

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

I am trying to work too quickly today and being a little sloppy - merged before I saw this. I'll fix this in my next PR.

@kmdeck kmdeck merged commit 8a4cfba into main Oct 7, 2024
9 of 12 checks passed
@kmdeck kmdeck deleted the js/sfv branch October 7, 2024 20:54
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.

4 participants