Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
2cfe297
Update registry for gw_drag (orographic at least, CAM4)
jimmielin Aug 27, 2025
5edf08a
Add host side support module for reading gravity wave ridge data.
jimmielin Aug 29, 2025
be2b7cc
Revise comment at head of module
jimmielin Aug 29, 2025
5b62e05
Update ridge input standard names
jimmielin Sep 10, 2025
a14e444
Add registry fields to read in pbuf fields to support GW CAM7.
jimmielin Sep 25, 2025
917addd
Fix ridge read; clubb pbuf input vars have _gw suffix
jimmielin Sep 25, 2025
e3c31cf
Merge branch 'development' into hplin/gw_drag
jimmielin Sep 29, 2025
4bc0bb9
Merge branch 'development' into hplin/gw_drag
jimmielin Sep 30, 2025
55f3b14
Merge branch 'development' into hplin/gw_drag
jimmielin Oct 13, 2025
6c04924
Update do_molec_diff standard name to do_molecular_diffusion
jimmielin Oct 13, 2025
d47bb6f
Remove TBD from GW names
jimmielin Oct 13, 2025
662630c
Merge branch 'development' into hplin/gw_drag
jimmielin Oct 13, 2025
679e11f
Fix closing tag in registry.xml due to bad git merge
jimmielin Oct 13, 2025
1984ac4
Calculate gw top taper in ref_pres to pass to scheme via metadata
jimmielin Oct 13, 2025
01133f1
Add gravity wave CAM4 and CAM7 SDF tests
jimmielin Oct 14, 2025
edf0bd7
Remove UVTPS outfields from snapshot gw tests as sima_state_diagnosti…
jimmielin Oct 14, 2025
0b21825
Provide frontgf, frontga from dycore (SE); remove from cam_runtime_op…
jimmielin Oct 15, 2025
f3aa434
Remove remnant gw_front(_igw) from runtime obj.
jimmielin Oct 15, 2025
4594f2c
Add bnd_topo to FCAM7 testmods; port vorticity code from CAM to SE dy…
jimmielin Oct 15, 2025
241994b
Fix port of vorticity code
jimmielin Oct 15, 2025
9310678
Move vorticity (vort4gw) to physics_state
jimmielin Oct 15, 2025
d73235f
Initialize vorticity in se dycore; registry initial_value for clubb f…
jimmielin Oct 15, 2025
a1ce363
Port cam6_4_126: Fix frontogenesis bug (SE dycore only) from CAM
jimmielin Oct 16, 2025
42f912e
Change registry access protected to allocatable=parameter
jimmielin Oct 21, 2025
10008b1
Address review comments
jimmielin Nov 3, 2025
7368353
Update src/physics/utils/gravity_wave_drag_ridge_read.F90
jimmielin Nov 3, 2025
315456f
Fix bug found during QPC4 experiment.
nusbaume Nov 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions cime_config/namelist_definition_cam.xml
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,19 @@
</values>
</entry>

<!-- Gravity wave ridge parameterization inputs -->
<entry id="bnd_rdggm">
<type>char*256</type>
<category>gravity_wave_drag</category>
<group>gw_drag_input_nl</group>
<desc>
Full pathname of boundary dataset for meso-gamma ridges.
</desc>
<values>
<value>UNSET_PATH</value>
</values>
</entry>

<!-- Vertical Coordinate -->

<entry id="pver">
Expand Down
18 changes: 18 additions & 0 deletions cime_config/testdefs/testlist_cam.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,24 @@
<option name="comment">Test for Holtslag-Boville boundary layer scheme and vertical diffusion</option>
</options>
</test>
<test compset="FPHYStest" grid="ne3pg3_ne3pg3_mg37" name="SMS_Ln2" testmods="cam/outfrq_gw_cam4_derecho">
<machines>
<machine name="derecho" compiler="gnu" category="aux_sima"/>
</machines>
<options>
<option name="wallclock">00:10:00</option>
<option name="comment">Test for orographic gravity wave scheme (CAM4)</option>
</options>
</test>
<test compset="FPHYStest" grid="ne3pg3_ne3pg3_mg37" name="SMS_Ln2" testmods="cam/outfrq_gw_cam7_derecho">
<machines>
<machine name="derecho" compiler="gnu" category="aux_sima"/>
</machines>
<options>
<option name="wallclock">00:10:00</option>
<option name="comment">Test for moving mountain, deep convective, frontogenesis, beta ridge gravity wave scheme suite (CAM7)</option>
</options>
</test>

<!-- Derecho dycore tests -->
<test compset="FKESSLER" grid="mpasa480_mpasa480" name="SMS_Ln9" testmods="cam/outfrq_kessler_mpas_derecho">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
./xmlchange CAM_CONFIG_OPTS="--dyn none --physics-suites gw_cam4"
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
! cam4 snapshot
pver = 26
ncdata = '/glade/campaign/cesm/community/amwg/sima_baselines/cam_sima_test_snapshots/cam_ne3pg3_fhistc4_gw_drag_cam4_oro_snapshot_derecho_gnu_before_c20250826.nc'
ncdata_check = '/glade/campaign/cesm/community/amwg/sima_baselines/cam_sima_test_snapshots/cam_ne3pg3_fhistc4_gw_drag_cam4_oro_snapshot_derecho_gnu_after_c20250826.nc'

debug_output = 0

! tolerances for testing
ncdata_check_err = .true.
min_difference = 2e-15

effgw_oro = 0.125D0
gw_apply_tndmax = .true.
gw_dc = 0.D0
gw_lndscl_sgh = .true.
gw_oro_south_fac = 1.d0
gw_prndl = 0.25d0
gw_qbo_hdepth_scaling = 1.0D0
gw_top_taper = .false.
pgwv = 0
tau_0_ubc = .false.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
./xmlchange CAM_CONFIG_OPTS="--dyn none --physics-suites gw_cam7_se"
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
! fhistc_ltso snapshot
pver = 58
ncdata = '/glade/campaign/cesm/community/amwg/sima_baselines/cam_sima_test_snapshots/cam_ne3pg3_fhistc_ltso_gw_drag_cam7se_snapshot_derecho_gnu_before_c20251013.nc'
ncdata_check = '/glade/campaign/cesm/community/amwg/sima_baselines/cam_sima_test_snapshots/cam_ne3pg3_fhistc_ltso_gw_drag_cam7se_snapshot_derecho_gnu_after_c20251013.nc'

debug_output = 0

! tolerances for testing
ncdata_check_err = .true.
min_difference = 2e-15

! topo file for beta ridge scheme input
bnd_topo = '/glade/campaign/cesm/cesmdata/inputdata/atm/cam/topo/se/ne3pg3_gmted2010_modis_bedmachine_nc0540_Laplace1000_noleak_20230209.nc'

gw_movmtn_use_pbl_source = .true. ! se dycore
gw_movmtn_alpha = 0.01d0
effgw_beres_dp = 0.15D0
effgw_cm = 1.D0
effgw_movmtn_pbl = 1.0d0
effgw_rdg_beta = 0.5D0
effgw_rdg_beta_max = 0.5D0
front_gaussian_width = 30.D0
gw_frontgfc = 1.25D-15
gw_apply_tndmax = .false.
gw_dc = 2.5D0
gw_dc_long = 0.D0
gw_drag_file_dp = '/glade/campaign/cesm/cesmdata/inputdata/atm/waccm/gw/newmfspectra40_dc25.nc'
gw_drag_file_movmtn = '/glade/campaign/cesm/cesmdata/inputdata/atm/waccm/gw/mfc0lookup_mm.nc'
gw_lndscl_sgh = .true.
gw_oro_south_fac = 1.d0
gw_polar_taper = .false.
gw_prndl = 0.5D0
gw_qbo_hdepth_scaling = 0.32D0
gw_movmtn_plaunch = 32500.0d0
gw_movmtn_psteer = 65000.0d0
gw_movmtn_source = 1
gw_rdg_beta_nrdg = 10
pgwv = 32
pgwv_long = 0
gw_rdg_beta_cd_llb = 1.0D0
tau_0_ubc = .true.
gw_front_taubgnd = 1.5D-3
gw_rdg_beta_trpd_leewv = .false.
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,11 @@ hist_add_inst_fields;h1: T, Q, U, V, PS
hist_output_frequency;h1: 1*nsteps
hist_write_nstep0;h1: .true.
analytic_ic_type=held_suarez_1994

! generally, analytic_ic runs do not need a topo file (see namelist_definition_cam.xml)
! however, a topo file needs to be supplied to run the Beta Ridge gravity wave scheme.
!
! in the future, the FCAM7 test can be migrated to using 'real' initial conditions,
! and this line can be removed, and
! analytic ic runs can go back to having no topo file supplied as it is by default.
bnd_topo='/glade/campaign/cesm/cesmdata/inputdata/atm/cam/topo/se/ne3pg3_gmted2010_modis_bedmachine_nc0540_Laplace1000_noleak_20230209.nc'
4 changes: 4 additions & 0 deletions src/control/cam_comp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ subroutine cam_init(caseid, ctitle, model_doi_url, &
use vert_coord, only: pver
use phys_vars_init_check, only: mark_as_initialized
use tropopause_climo_read, only: tropopause_climo_read_file
use gravity_wave_drag_ridge_read, only: gravity_wave_drag_ridge_read_file
use orbital_data, only: orbital_data_init
use ccpp_kinds, only: kind_phys
use ccpp_constituent_prop_mod, only: ccpp_constituent_prop_ptr_t
Expand Down Expand Up @@ -248,6 +249,9 @@ subroutine cam_init(caseid, ctitle, model_doi_url, &
! Read tropopause climatology
call tropopause_climo_read_file()

! Read gravity wave drag data for ridge parameterization
call gravity_wave_drag_ridge_read_file()

! TEMPORARY: Prescribe realistic but inaccurate physical quantities
! necessary for MUSICA that are currently unavailable in CAM-SIMA.
!
Expand Down
28 changes: 2 additions & 26 deletions src/control/runtime_obj.F90
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ module runtime_obj
type, public :: runtime_options
character(len=CS), private :: phys_suite = unset_str
character(len=16), private :: waccmx_opt = unset_str
! use_gw_front: Frontogenesis
logical, private :: use_gw_front = .false.
! use_gw_front_igw: Frontogenesis to inertial spectrum.
logical, private :: use_gw_front_igw = .false.
! update_thermo_variables: update thermo "constants" to composition-dependent thermo variables
logical, private :: update_thermo_variables = .false.
contains
Expand All @@ -33,8 +29,6 @@ module runtime_obj
! Runtime parameters of interest to dycore
procedure, public :: waccmx_on
procedure, public :: waccmx_option
procedure, public :: gw_front
procedure, public :: gw_front_igw
procedure, public :: update_thermodynamic_variables
end type runtime_options

Expand Down Expand Up @@ -74,35 +68,19 @@ pure character(len=16) function waccmx_option(self)

end function waccmx_option

pure logical function gw_front(self)
class(runtime_options), intent(in) :: self

gw_front = self%use_gw_front

end function gw_front

pure logical function gw_front_igw(self)
class(runtime_options), intent(in) :: self

gw_front_igw = self%use_gw_front_igw

end function gw_front_igw

pure logical function update_thermodynamic_variables(self)
class(runtime_options), intent(in) :: self

update_thermodynamic_variables = self%update_thermo_variables

end function update_thermodynamic_variables

subroutine cam_set_runtime_opts(phys_suite, waccmx_opt, &
gw_front, gw_front_igw)
subroutine cam_set_runtime_opts(phys_suite, waccmx_opt)
use cam_abortutils, only: endrun

! Initialize the CAM runtime object
character(len=CS), intent(in) :: phys_suite
character(len=16), intent(in) :: waccmx_opt
logical, intent(in) :: gw_front
logical, intent(in) :: gw_front_igw

if (runtime_configured) then
! We might need more action to reset this so do not allow it now
Expand All @@ -111,8 +89,6 @@ subroutine cam_set_runtime_opts(phys_suite, waccmx_opt, &

cam_runtime_opts%phys_suite = trim(phys_suite)
cam_runtime_opts%waccmx_opt = trim(waccmx_opt)
cam_runtime_opts%use_gw_front = gw_front
cam_runtime_opts%use_gw_front_igw = gw_front_igw
cam_runtime_opts%update_thermo_variables = (trim(waccmx_opt) == 'ionosphere' .or. &
trim(waccmx_opt) == 'neutral')

Expand Down
13 changes: 3 additions & 10 deletions src/control/runtime_opts.F90
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ subroutine read_namelist(nlfilename, single_column, scmlat, scmlon)
use inic_analytic_utils, only: analytic_ic_readnl

use tropopause_climo_read, only: tropopause_climo_readnl
use gravity_wave_drag_ridge_read, only: gravity_wave_drag_ridge_read_readnl

! use tracers, only: tracers_readnl
! use nudging, only: nudging_readnl
Expand All @@ -64,15 +65,11 @@ subroutine read_namelist(nlfilename, single_column, scmlat, scmlon)
character(len=512) :: errmsg
character(len=64), allocatable :: schemes(:)
integer :: errflg
logical :: use_gw_front
logical :: use_gw_front_igw

character(len=*), parameter :: subname = "read_namelist"

! Initialize system-wide runtime configuration variables
waccmx_opt = unset_str
use_gw_front = .false.
use_gw_front_igw = .false.

!-----------------------------------------------------------------------
! Call subroutines for modules to read their own namelist.
Expand Down Expand Up @@ -104,7 +101,7 @@ subroutine read_namelist(nlfilename, single_column, scmlat, scmlon)
call tropopause_climo_readnl(nlfilename)
! call scam_readnl(nlfilename, single_column, scmlat, scmlon)
! call nudging_readnl(nlfilename)

call gravity_wave_drag_ridge_read_readnl(nlfilename)
call dyn_readnl(nlfilename)

! Read the namelists for active physics schemes
Expand All @@ -117,12 +114,8 @@ subroutine read_namelist(nlfilename, single_column, scmlat, scmlon)
call cam_read_ccpp_scheme_namelists(nlfilename, schemes, &
mpicom, masterprocid, masterproc, iulog)

! XXgoldyXX: Need to figure out how to grab gravity-wave (and other)
! scheme variables if and only if they are compiled in.

! Finally, set the system-wide runtime configuration object
call cam_set_runtime_opts(phys_suite_name, waccmx_opt, &
use_gw_front, use_gw_front_igw)
call cam_set_runtime_opts(phys_suite_name, waccmx_opt)

end subroutine read_namelist

Expand Down
17 changes: 16 additions & 1 deletion src/data/ref_pres.F90
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ module ref_pres
logical, protected :: do_molec_diff = .false.
integer, protected :: nbot_molec = 0

! Pressure limit used to set gravity wave tapering at top of model (Pa)
real(kind_phys), parameter :: gravity_wave_taper_bot_press = 0.6E-02_kind_phys

! Bottom level for tapering gravity waves at top of model
integer, protected :: nbot_gravity_wave_top_taper = 0

!====================================================================================
contains
!====================================================================================
Expand Down Expand Up @@ -165,6 +171,11 @@ subroutine ref_pres_init(pref_edge_in, pref_mid_in, num_pr_lev_in)
top=.false.)
end if

! Find level corresponding to the bottom for tapering gravity waves
! at the top of model.
nbot_gravity_wave_top_taper = press_lim_idx(gravity_wave_taper_bot_press, &
top=.true.)

! Tell rest of model that variables have been initialized:
! pref_edge_in
call mark_as_initialized("reference_pressure_at_interface")
Expand All @@ -185,9 +196,13 @@ subroutine ref_pres_init(pref_edge_in, pref_mid_in, num_pr_lev_in)
! molec_diff_bot_press
call mark_as_initialized("pressure_at_bottom_of_molecular_diffusion")
! do_molec_diff
call mark_as_initialized("flag_for_molecular_diffusion")
call mark_as_initialized("do_molecular_diffusion")
! nbot_molec
call mark_as_initialized("index_of_pressure_at_bottom_of_molecular_diffusion")
! gravity_wave_taper_bot_press
call mark_as_initialized("largest_model_top_pressure_that_allows_tapering_gravity_wave_drag_at_model_top")
! nbot_gravity_wave_top_taper
call mark_as_initialized("vertical_index_of_bottom_limit_for_tapering_gravity_wave_drag_at_model_top")

end subroutine ref_pres_init

Expand Down
13 changes: 12 additions & 1 deletion src/data/ref_pres.meta
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
dimensions = ()
protected = True
[ do_molec_diff ]
standard_name = flag_for_molecular_diffusion
standard_name = do_molecular_diffusion
units = flag
type = logical
dimensions = ()
Expand All @@ -70,3 +70,14 @@
type = integer
dimensions = ()
protected = True
[ gravity_wave_taper_bot_press ]
standard_name = largest_model_top_pressure_that_allows_tapering_gravity_wave_drag_at_model_top
units = Pa
type = real | kind = kind_phys
dimensions = ()
[ nbot_gravity_wave_top_taper ]
standard_name = vertical_index_of_bottom_limit_for_tapering_gravity_wave_drag_at_model_top
units = index
type = integer
dimensions = ()
protected = True
Loading