Skip to content

Conversation

@whannah1
Copy link
Contributor

This implements a missing correction for the frontogenesis function (FGF) used for the frontal gravity wave drag scheme. The FGF gradient calculations are done on model levels for convenience, but the original papers indicate a simple correction should be used to effectively put these gradients on height or pressure levels. However, going back to the original implementation in CESM with FV dynamics this correction was never implemented, and this mistake was carried through to E3SM with the SE dynamics.

The correction addresses problematic biases of excessive gravity wave drag over areas of steep topography. It is controlled by a new namelist variable "use_fgf_pgrad_correction" that is off by default to preserve the behavior of official v3 release version.

[BFB]

@whannah1 whannah1 requested a review from mt5555 October 15, 2025 16:27
@whannah1 whannah1 added Atmosphere bug fix PR BFB PR leaves answers BFB labels Oct 15, 2025
@whannah1 whannah1 changed the title implement frontogenesis function pressure gradient correction frontogenesis function pressure gradient correction Oct 15, 2025
Copy link
Contributor

@mt5555 mt5555 left a comment

Choose a reason for hiding this comment

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

verified (via inspection) the pressure gradient correction to the ugradv tensor-contraction operator.

One concern: this function is using hydrostatic pressure, computed from hvcoord struct and ps_v. In EAMxx, we are trying to avoid the use of hydrostatic pressure. We also want to avoid any assumptions about pressure coordinates, which means not using the hvcoord%a and b coefficients.

This code may be an example where we really do want to use hydrostatic pressure (since full NH pressure surfaces could intersect the ground to TOM). if that's the case, can you:

  1. document that this code is intentionally using hydrostatic pressure
  2. compute the hydrostatic pressure at interfaces by summing the "pseudo density" in each layer, starting at the model top. pseudo density is given by dp3d (dycore), pdel (EAM physics), or pseudo_density(EAMxx physics) There should be many examples of this 'scan' operation throughout the code. hydrostatic pressure at mid points is the simple average of interface pressure. this will then remove the use of hvcoord% structures.

As the scan for pint is a touch slow on GPUs, might be worth checking if the hydrostatic pint and pmid were not already computed by the calling program.

@whannah1
Copy link
Contributor Author

One concern: this function is using hydrostatic pressure, computed from hvcoord struct and ps_v. In EAMxx, we are trying to avoid the use of hydrostatic pressure. We also want to avoid any assumptions about pressure coordinates, which means not using the hvcoord%a and b coefficients.

This code may be an example where we really do want to use hydrostatic pressure (since full NH pressure surfaces could intersect the ground to TOM). if that's the case, can you:

  1. document that this code is intentionally using hydrostatic pressure
  2. compute the hydrostatic pressure at interfaces by summing the "pseudo density" in each layer, starting at the model top. pseudo density is given by dp3d (dycore), pdel (EAM physics), or pseudo_density(EAMxx physics) There should be many examples of this 'scan' operation throughout the code. hydrostatic pressure at mid points is the simple average of interface pressure. this will then remove the use of hvcoord% structures.

As the scan for pint is a touch slow on GPUs, might be worth checking if the hydrostatic pint and pmid were not already computed by the calling program.

This is a good point... Although my first reaction is that for cases where we are running the non-hydrostatic dycor we probably want to disable the frontal GWD scheme anyway.

As a side note - I'm also working on an idea to make the frontal scheme "scale aware" by comparing the local resolution to the Rossby Radius. My initial dive into this topic yielded a pretty simple metric for approximating when frontogenesis is unresolved - and for grids finer than ne120 this suggested that the frontal GWD should always be disabled. So I'm sort of hoping this thing about the hydrostatic pressure will be a non-issue. But even if it is still an issue I think modifying this scheme to calculate the hydrostatic pressure should be a straightforward thing to address in the future.

@whannah1 whannah1 force-pushed the whannah/eam/test-frontogenesis-correction branch from 473a025 to c00fc00 Compare October 23, 2025 14:32
@whannah1
Copy link
Contributor Author

NOTE that we're planning to wait for PR #7791 to be merged first to fix the CI tests for the frontal GW src routine.

@whannah1 whannah1 force-pushed the whannah/eam/test-frontogenesis-correction branch from c00fc00 to 3f4a52a Compare October 23, 2025 19:08
@singhbalwinder singhbalwinder changed the title frontogenesis function pressure gradient correction Frontogenesis function pressure gradient correction Oct 24, 2025
singhbalwinder added a commit that referenced this pull request Oct 24, 2025
…#7797)

Frontogenesis function pressure gradient correction

This implements a missing correction for the frontogenesis function (FGF) used for the frontal gravity wave drag scheme. The FGF gradient calculations are done on model levels for convenience, but the original papers indicate a simple correction should be used to effectively put these gradients on height or pressure levels. However, going back to the original implementation in CESM with FV dynamics this correction was never implemented, and this mistake was carried through to E3SM with the SE dynamics.

The correction addresses problematic biases of excessive gravity wave drag over areas of steep topography. It is controlled by a new namelist variable "use_fgf_pgrad_correction" that is off by default to preserve the behavior of official v3 release version.

[BFB]

* whannah/eam/test-frontogenesis-correction:
  comment fix
  fix namelist variable description
  misc fixes
  misc fixes
  fix white space
  update compute_frontogenesis for zgrad correction
  add get_hydro_pressure_interface subroutine
  add use_fgf_zgrad_correction namelist variable
  remove pmid_hydro
  update pressure calculation
  update comments
  switch convention for clarity
  add namelist control for frontogenesis pgrad correction
  fix typos
  add comments describing tensor vector contraction code
  bug fix
  add experimental pressure gradient correction for frontogensis function calculation
@singhbalwinder
Copy link
Contributor

on next

@rljacob
Copy link
Member

rljacob commented Oct 27, 2025

This broke the build for this case: SMS_R_Ld5.ne4_ne4.FSCM-ARM97.chrysalis_intel.eam-scm

@rljacob rljacob added the NML label Oct 27, 2025
@rljacob
Copy link
Member

rljacob commented Oct 27, 2025

Also broke the build for these cases: SMS.ne4pg2_oQU480.F2010.chrysalis_intel.eam-preqx_ftype0, SMS.ne4pg2_oQU480.F2010.chrysalis_intel.eam-preqx_ftype1, SMS.ne4pg2_oQU480.F2010.chrysalis_intel.eam-preqx_ftype4

@whannah1 whannah1 force-pushed the whannah/eam/test-frontogenesis-correction branch from 3f4a52a to 94dc8b6 Compare October 27, 2025 19:28
@singhbalwinder
Copy link
Contributor

I have re-run the failed tests. Once all the tests pass, I will merge it again to the next.

@singhbalwinder singhbalwinder merged commit d583fbe into master Oct 29, 2025
19 of 73 checks passed
@singhbalwinder singhbalwinder deleted the whannah/eam/test-frontogenesis-correction branch October 29, 2025 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants