Skip to content

Commit d583fbe

Browse files
Merge branch 'whannah/eam/test-frontogenesis-correction'(PR #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: rename altitude => geopotential for clarity add ifdef MODEL_THETA_L exceptions for phi calculations in frontogenesis function dd preqx version of get_hydro_pressure_i fix namelist variable description update compute_frontogenesis for zgrad correction add get_hydro_pressure_interface subroutine add use_fgf_zgrad_correction namelist variable update pressure calculation update comments switch convention for clarity add namelist control for frontogenesis pgrad correction add comments describing tensor vector contraction code add experimental pressure gradient correction for frontogensis function calculation
2 parents 84a830c + 6909ebc commit d583fbe

File tree

7 files changed

+275
-36
lines changed

7 files changed

+275
-36
lines changed

components/eam/bld/build-namelist

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4137,6 +4137,9 @@ if ($nl->get_value('use_gw_convect') =~ /$TRUE/io) {
41374137
add_default($nl, 'gw_drag_file');
41384138
}
41394139

4140+
# this correction is disabled in the released version E3SMv3 and prior versions
4141+
add_default($nl, 'use_fgf_pgrad_correction', 'val'=>'.false.');
4142+
add_default($nl, 'use_fgf_zgrad_correction', 'val'=>'.false.');
41404143
add_default($nl, 'use_gw_energy_fix' , 'val'=>'.true.');
41414144

41424145

components/eam/bld/namelist_files/namelist_definition.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1072,6 +1072,18 @@ Whether or not to enable gravity waves produced by convection.
10721072
Default: set by build-namelist.
10731073
</entry>
10741074

1075+
<entry id="use_fgf_pgrad_correction" type="logical" category="gw_drag"
1076+
group="phys_ctl_nl" valid_values="" >
1077+
Flag to enable frontogenesis pressure gradient correction for frontal GWD
1078+
Default: set by build-namelist.
1079+
</entry>
1080+
1081+
<entry id="use_fgf_zgrad_correction" type="logical" category="gw_drag"
1082+
group="phys_ctl_nl" valid_values="" >
1083+
Flag to enable frontogenesis geopotential gradient correction for frontal GWD
1084+
Default: set by build-namelist.
1085+
</entry>
1086+
10751087
<entry id="use_gw_energy_fix" type="logical" category="gw_drag"
10761088
group="phys_ctl_nl" valid_values="" >
10771089
Whether or not to enable GWD brute-force energy fix.

components/eam/src/dynamics/se/dp_coupling.F90

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ subroutine d_p_coupling(phys_state, phys_tend, pbuf2d, dyn_out)
3838
use cam_abortutils, only: endrun
3939
use gravity_waves_sources, only: gws_src_fnct
4040
use dyn_comp, only: frontgf_idx, frontga_idx, hvcoord
41-
use phys_control, only: use_gw_front
41+
use phys_control, only: use_gw_front, use_fgf_pgrad_correction, use_fgf_zgrad_correction
4242
use dyn_comp, only: dom_mt
4343
use gllfvremap_mod, only: gfr_dyn_to_fv_phys
4444

@@ -107,7 +107,10 @@ subroutine d_p_coupling(phys_state, phys_tend, pbuf2d, dyn_out)
107107
elem => dyn_out%elem
108108
tl_f = TimeLevel%n0 ! time split physics (with forward-in-time RK)
109109

110-
if (use_gw_front) call gws_src_fnct(elem, tl_f, nphys, frontgf, frontga)
110+
if (use_gw_front) call gws_src_fnct(elem, tl_f, nphys, &
111+
use_fgf_pgrad_correction, &
112+
use_fgf_zgrad_correction, &
113+
frontgf, frontga)
111114

112115
if (fv_nphys > 0) then
113116
!-----------------------------------------------------------------------

components/eam/src/dynamics/se/gravity_waves_sources.F90

Lines changed: 205 additions & 32 deletions
Large diffs are not rendered by default.

components/eam/src/physics/cam/phys_control.F90

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,9 @@ module phys_control
174174
! Convective
175175
logical, public, protected :: use_gw_convect = .false.
176176

177+
! Frontogenesis gradient correction options
178+
logical, public, protected :: use_fgf_pgrad_correction = .false.
179+
logical, public, protected :: use_fgf_zgrad_correction = .false.
177180
!GW energy fix
178181
logical, public, protected :: use_gw_energy_fix = .false.
179182

@@ -258,7 +261,7 @@ subroutine phys_ctl_readnl(nlfile)
258261
use_qqflx_fixer, &
259262
print_fixer_message, &
260263
use_hetfrz_classnuc, use_gw_oro, use_gw_front, use_gw_convect, &
261-
use_gw_energy_fix, &
264+
use_fgf_pgrad_correction,use_fgf_zgrad_correction, use_gw_energy_fix, &
262265
use_od_ls,use_od_bl,use_od_ss,use_od_fd,&
263266
cld_macmic_num_steps, micro_do_icesupersat, &
264267
fix_g1_err_ndrop, ssalt_tuning, resus_fix, convproc_do_aer, &
@@ -378,6 +381,8 @@ subroutine phys_ctl_readnl(nlfile)
378381
call mpibcast(use_hetfrz_classnuc, 1 , mpilog, 0, mpicom)
379382
call mpibcast(use_gw_oro, 1 , mpilog, 0, mpicom)
380383
call mpibcast(use_gw_front, 1 , mpilog, 0, mpicom)
384+
call mpibcast(use_fgf_pgrad_correction, 1 , mpilog, 0, mpicom)
385+
call mpibcast(use_fgf_zgrad_correction, 1 , mpilog, 0, mpicom)
381386
call mpibcast(use_gw_convect, 1 , mpilog, 0, mpicom)
382387
call mpibcast(use_gw_energy_fix, 1 , mpilog, 0, mpicom)
383388
call mpibcast(use_od_ls, 1 , mpilog, 0, mpicom)
@@ -429,6 +434,12 @@ subroutine phys_ctl_readnl(nlfile)
429434
! Defaults for PBL and microphysics are set in build-namelist. Check here that
430435
! values have been set to guard against problems with hand edited namelists.
431436

437+
! check frontal gwd gradient correction options
438+
if (use_fgf_pgrad_correction .and. use_fgf_zgrad_correction) then
439+
write(iulog,*)'phys_setopts: use_fgf_pgrad_correction and use_fgf_zgrad_correction cannot both be true'
440+
call endrun('phys_setopts: use_fgf_pgrad_correction and use_fgf_zgrad_correction cannot both be true')
441+
end if
442+
432443
! WACCM-X run option set in build-namelist. Check for valid values
433444
if (.not. (waccmx_opt == 'ionosphere' .or. waccmx_opt == 'neutral' .or. waccmx_opt == 'off')) then
434445
write(iulog,*)'waccm: illegal value of waccmx_opt:', waccmx_opt

components/homme/src/preqx/share/element_ops.F90

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,24 @@ subroutine get_temperature(elem,temperature,hvcoord,nt)
221221

222222
end subroutine get_temperature
223223

224+
!_____________________________________________________________________
225+
subroutine get_hydro_pressure_i(p_i,dp,hvcoord)
226+
!
227+
implicit none
228+
229+
real (kind=real_kind), intent(out) :: p_i(np,np,nlevp)
230+
real (kind=real_kind), intent(in) :: dp(np,np,nlev)
231+
type (hvcoord_t), intent(in) :: hvcoord ! hybrid vertical coordinate struct
232+
233+
integer :: k
234+
235+
p_i(:,:,1)=hvcoord%hyai(1)*hvcoord%ps0
236+
do k=1,nlev ! SCAN
237+
p_i(:,:,k+1)=p_i(:,:,k) + dp(:,:,k)
238+
enddo
239+
240+
end subroutine get_hydro_pressure_i
241+
224242
!_____________________________________________________________________
225243
subroutine copy_state(elem,nin,nout)
226244
implicit none

components/homme/src/theta-l/share/element_ops.F90

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
! get_pottemp()
4444
! get_dpnh_dp()
4545
! get_hydro_pressure()
46+
! get_hydro_pressure_i()
4647
! get_nonhydro_pressure()
4748
! get_phi()
4849
! get_cp_star()
@@ -68,7 +69,7 @@ module element_ops
6869
type(elem_state_t), dimension(:), allocatable :: state0 ! storage for save_initial_state routine
6970

7071
public get_field, get_field_i, get_state, get_pottemp
71-
public get_temperature, get_phi, get_R_star, get_hydro_pressure
72+
public get_temperature, get_phi, get_R_star, get_hydro_pressure, get_hydro_pressure_i
7273
public set_thermostate, set_state, set_state_i, set_elem_state
7374
public set_forcing_rayleigh_friction
7475
public initialize_reference_states, set_theta_ref
@@ -307,6 +308,24 @@ subroutine get_hydro_pressure(p,dp,hvcoord)
307308

308309
end subroutine get_hydro_pressure
309310

311+
!_____________________________________________________________________
312+
subroutine get_hydro_pressure_i(p_i,dp,hvcoord)
313+
!
314+
implicit none
315+
316+
real (kind=real_kind), intent(out) :: p_i(np,np,nlevp)
317+
real (kind=real_kind), intent(in) :: dp(np,np,nlev)
318+
type (hvcoord_t), intent(in) :: hvcoord ! hybrid vertical coordinate struct
319+
320+
integer :: k
321+
322+
p_i(:,:,1)=hvcoord%hyai(1)*hvcoord%ps0
323+
do k=1,nlev ! SCAN
324+
p_i(:,:,k+1)=p_i(:,:,k) + dp(:,:,k)
325+
enddo
326+
327+
end subroutine get_hydro_pressure_i
328+
310329

311330
!_____________________________________________________________________
312331
subroutine get_nonhydro_pressure(elem,pnh,exner,hvcoord,nt)

0 commit comments

Comments
 (0)