Skip to content

Conversation

@jimmielin
Copy link
Member

@jimmielin jimmielin commented Dec 5, 2025

Originator(s): @jimmielin

Description (include issue title and the keyword ['closes', 'fixes', 'resolves'] and issue number):

  • Add diagnostics (parity with CAM) for gravity wave parameterizations in CAM-SIMA.

List all namelist files that were added or changed: N/A

List all files eliminated and why: N/A

List all files added and what they do:

A       schemes/sima_diagnostics/gravity_wave_drag_convection_deep_diagnostics.F90
A       schemes/sima_diagnostics/gravity_wave_drag_convection_deep_diagnostics.meta
A       schemes/sima_diagnostics/gravity_wave_drag_frontogenesis_diagnostics.F90
A       schemes/sima_diagnostics/gravity_wave_drag_frontogenesis_diagnostics.meta
A       schemes/sima_diagnostics/gravity_wave_drag_moving_mountain_diagnostics.F90
A       schemes/sima_diagnostics/gravity_wave_drag_moving_mountain_diagnostics.meta
A       schemes/sima_diagnostics/gravity_wave_drag_orographic_diagnostics.F90
A       schemes/sima_diagnostics/gravity_wave_drag_orographic_diagnostics.meta
A       schemes/sima_diagnostics/gravity_wave_drag_ridge_beta_diagnostics.F90
A       schemes/sima_diagnostics/gravity_wave_drag_ridge_beta_diagnostics.meta
  - various diagnostic schemes for various gravity wave drag parameterizations.

List all existing files that have been modified, and describe the changes:
(Helpful git command: git diff --name-status development...<your_branch_name>)

M       schemes/gravity_wave_drag/gravity_wave_drag_convection.meta
M       schemes/gravity_wave_drag/gravity_wave_drag_frontogenesis.F90
M       schemes/gravity_wave_drag/gravity_wave_drag_frontogenesis.meta
M       schemes/gravity_wave_drag/gravity_wave_drag_moving_mountain.meta
M       schemes/gravity_wave_drag/gravity_wave_drag_orographic.F90
M       schemes/gravity_wave_drag/gravity_wave_drag_orographic.meta
  - fix issues with temperature tendencies/dry air enthalpy tendency units throughout.
  - fix incorrectly annotated hdepth (m not km) units

M       schemes/sima_diagnostics/gravity_wave_drag_common_diagnostics.F90
M       schemes/sima_diagnostics/gravity_wave_drag_common_diagnostics.meta
  - populate the remaining common gravity wave drag diagnostics (TTGW,UTGW_TOTAL,VTGW_TOTAL,QTGW,CLDLIQTGW,CLDICETGW)

M       suites/suite_cam4.xml
M       suites/suite_cam7.xml
M       test/test_suites/suite_gw_cam4.xml
M       test/test_suites/suite_gw_cam7_se.xml
  - call diagnostic schemes in SDFs

List all automated tests that failed, as well as an explanation for why they weren't fixed:
New baselines will be created in the eventual CAM-SIMA PR

Is this an answer-changing PR? If so, is it a new physics package, algorithm change, tuning change, etc?
New diagnostic fields
Model "state" is b4b

If yes to the above question, describe how this code was validated with the new/modified features:

@jimmielin jimmielin self-assigned this Dec 5, 2025
@jimmielin jimmielin added enhancement New feature or request CAM4 CAM-SIMA tuning labels Dec 5, 2025
@nusbaume nusbaume requested review from nusbaume and removed request for nusbaume December 17, 2025 18:01
@jimmielin jimmielin requested a review from nusbaume January 5, 2026 17:09
Copy link
Collaborator

@nusbaume nusbaume left a comment

Choose a reason for hiding this comment

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

Thanks for bringing in these diagnostics @jimmielin! I did have some some questions/concerns, mostly related to standard names and/or units, but of course if any of them are too much of a burden at this stage then we can likely just make an issue for it and deal with them later. Thanks again!

@@ -0,0 +1,103 @@
! Diagnostics for gravity wave drag from deep convection (Beres scheme)
module gravity_wave_drag_convection_deep_diagnostics
use ccpp_kinds, only: kind_phys
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we move this use statement down to the run phase subroutine in order to better match the CAM-SIMA coding standards?

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, edited throughout

call history_add_field('BTAUNET', 'net_eastward_reynolds_stress_due_to_deep_convective_gravity_wave_drag', 'ilev', 'avg', 'Pa')

call history_add_field('NETDT', 'tendency_of_air_temperature_due_to_deep_convection', 'lev', 'avg', 'K s-1')
call history_add_field('HDEPTH', 'convective_heating_depth_due_to_deep_convective_gravity_wave_drag', horiz_only, 'avg', 'km')
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just double-checking if this is the heating depth "due" to gravity wave drag, or if it is just the convective heating depth, that is then used by the gravity wave drag scheme? If it is the latter then I think the long name here should just be convective_heating_depth, and we should maybe add a note/issue that the official standard name should be updated as well.

Copy link
Member Author

@jimmielin jimmielin Jan 22, 2026

Choose a reason for hiding this comment

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

Good point, it's the convective heating depth (that gets diagnosed inside the deep convective gravity waves code so it's an output from there).

After looking at the hdepth calculations between here and the convective schemes I decided to change due_to to for since they differ slightly, throughout the gw code.

There's a variant for shallow convection (that scheme is unused), would it be OK with you to change it to {deep,shallow}_convective_heating_depth? I think I can make all changes entirely within this atmos_phys PR

Comment on lines 31 to 32
standard_name = tendency_of_air_temperature_due_to_diffusion_due_to_deep_convective_gravity_wave_drag
units = J kg-1 s-1
Copy link
Collaborator

Choose a reason for hiding this comment

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

This standard name cannot be correct if the units are J kg-1 s-1. Is this the tendency of dry_air_enthalpy_at_constant_pressure instead of temperature?

Please note that I am happy to just make an issue for this change so that we can remember to deal with it later, instead of fixing it immediately in this PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes you are correct, it should be tendency_of_ dry_air_enthalpy_at_constant_pressure_due_to_diffusion_due_to_deep_convective_gravity_wave_drag. It gets divided by cpair only when outputting diagnostics so the unit for that is J kg-1 s-1 until its output then it's K s-1 (the output diagnostic "standard name" is kept at tendency_of_air_temperature_due_to_diffusion_due_to_deep_convective_gravity_wave_drag).

I made the change throughout. Thanks!

Comment on lines 37 to 38
standard_name = tendency_of_air_temperature_due_to_kinetic_energy_dissipation_due_to_deep_convective_gravity_wave_drag
units = J kg-1 s-1
Copy link
Collaborator

Choose a reason for hiding this comment

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

I have the same standard name concern here (either the units are wrong, or the standard name is wrong and it should be dry_air_enthalpy_at_constant_pressure instead).

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, made the same change as above

@@ -0,0 +1,126 @@
! Diagnostics for gravity wave drag from frontogenesis.
module gravity_wave_drag_frontogenesis_diagnostics
use ccpp_kinds, only: kind_phys
Copy link
Collaborator

Choose a reason for hiding this comment

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

Move this use statement down to the *_run subroutine? This same request holds for the other diagnostics source code files in this PR as well.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, edited throughout

Comment on lines 73 to 74
standard_name = tendency_of_air_temperature_due_to_diffusion_due_to_frontogenesis_gravity_wave_drag
units = J kg-1 s-1
Copy link
Collaborator

Choose a reason for hiding this comment

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

Another standard name that might not be correct according to the units? Please note that this same question holds for all of the tendency_of_air_temperature_due_to_XYZ variables with units of J kg-1 s-1 in this PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, edited the .meta file standard names for dttdf and dttke throughout to reflect that it's tendency of dry air enthalpy at constant pressure (J kg-1 s-1) coming out of the scheme; the output is in K s-1 which is the tendency of air temperature.

call history_add_field('UTGW_MOVMTN', 'tendency_of_eastward_wind_due_to_moving_mountain_gravity_wave_drag', 'lev', 'inst', 'm s-2')
call history_add_field('VTGW_MOVMTN', 'tendency_of_northward_wind_due_to_moving_mountain_gravity_wave_drag', 'lev', 'inst', 'm s-2')

call history_add_field('HDEPTH_MOVMTN', 'convective_heating_depth_due_to_moving_mountain_gravity_wave_drag', horiz_only, 'inst', 'km')
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just double-checking if this heating depth is "due" to gravity wave drag, or just an input that is used by the gravity wave scheme? If it is just used by the scheme then I might change the due_to in the long/standard name to for, or something like that.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the question. After looking at the hdepth calculations between here and the convective schemes I decided to change due_to to for since they differ slightly, throughout the gw code.

call history_add_field('UCELL_MOVMTN', 'eastward_wind_at_steering_level_due_to_moving_mountain_gravity_wave_drag', horiz_only, 'inst', 'm s-1')
call history_add_field('VCELL_MOVMTN', 'northward_wind_at_steering_level_due_to_moving_mountain_gravity_wave_drag', horiz_only, 'inst', 'm s-1')
call history_add_field('CS_MOVMTN', 'gravity_wave_phase_speed_in_source_direction_due_to_moving_mountain_gravity_wave_drag', horiz_only, 'inst', 'm s-1')
call history_add_field('XPWP_SRC_MOVMTN', 'momentum_flux_source_due_to_moving_mountain_gravity_wave_drag', horiz_only, 'inst', 'm2 s-2')
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just double-checking if this momentum flux is actually due_to, or caused by the gravity wave drag, or if it is for gravity waves, i.e. a source of gravity wave drag?

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree it should be for (it's constructed from a layer-averaged xpwp_clubb = sqrt(upwp_clubb**2 + vpwp_clubb**2) field.

I changed throughout to momentum_flux_source_for_moving_mountain_gravity_wave_drag

intent = in
[ hdepth ]
standard_name = convective_heating_depth_due_to_moving_mountain_gravity_wave_drag
units = km
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should the units actually be meters (m) here? If not then I don't think we want the conversion in the source code.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, should be m in the meta files, edited!

@jimmielin jimmielin requested a review from nusbaume January 22, 2026 15:00
@jimmielin
Copy link
Member Author

Thanks @nusbaume for the review! I edited some standard names throughout the GW parameterizations in particular to address concerns about the use of tendency_of_air_temperature_ when it is dry air enthalpy tendency - my apologies that the scope of the PR increased a little but hopefully it should be a coherent set of changes to review.

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.

2 participants