Skip to content

Commit

Permalink
Merge branch 'whannah/atm/add-zonal-mean-mod' (PR #6311)
Browse files Browse the repository at this point in the history
This capability to calculate zonal mean quantities while the model runs
has been ported from CESM. The original CESM zonal mean calculations were
modified to work with the unstructured FV phys grid (pg2) by Patrick Callaghan
([email protected]) and then implemented in a branch of E3SMv2 by Jack Chen
([email protected]). It is re-implemented here to facilitate process oriented QBO
diagnostics for a SciDAC project; other projects may find it useful as well.

Enabling the new zonal mean outputs requires setting the new namelist variables:

phys_grid_ctem_zm_nbas = 120  # Number of basis functions used for TEM
phys_grid_ctem_za_nlat = 90   # Number of latitude points for TEM
phys_grid_ctem_nfreq = -1     # Frequency of TEM diagnostic calculations (neg => hours)

And adding the list of new variables to the desired output stream

'Uzm','Vzm','Wzm','THzm','VTHzm','WTHzm','UVzm','UWzm','THphys'

[BFB]
  • Loading branch information
wlin7 committed Apr 9, 2024
2 parents a020489 + 9999f99 commit 8e8d0cd
Show file tree
Hide file tree
Showing 11 changed files with 2,582 additions and 20 deletions.
20 changes: 20 additions & 0 deletions components/eam/bld/namelist_files/namelist_definition.xml
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,26 @@ Turn on additional verbose output for integrated conservation checks.
Default: FALSE
</entry>

<!-- Transformed Eulerian Mean (TEM) budget outputs -->

<entry id="phys_grid_ctem_zm_nbas" type="integer" category="diagnostics"
group="phys_grid_ctem_opts" valid_values="" >
Number of zonal mean basis functions (number of m=0 spherical harmonics) used in
Transformed Eulerian Mean (TEM) diagnostics
</entry>

<entry id="phys_grid_ctem_za_nlat" type="integer" category="diagnostics"
group="phys_grid_ctem_opts" valid_values="" >
Number of latitude grid points for zonal average TEM diagnostics history fields
</entry>

<entry id="phys_grid_ctem_nfreq" type="integer" category="diagnostics"
group="phys_grid_ctem_opts" valid_values="" >
Frequency of TEM diagnostic calculations.
If &gt; 0, frequency is specified as number of timesteps.
If &lt; 0, frequency is specified as number of hours.
</entry>

<!-- Dry Convective Adjustment -->

<entry id="nlvdry" type="integer" category="dry_conv_adj"
Expand Down
2 changes: 1 addition & 1 deletion components/eam/src/control/cam_history.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2727,7 +2727,7 @@ subroutine patch_init(t)
end if
do i = 1, size(tape(t)%grid_ids)
call cam_grid_compute_patch(tape(t)%grid_ids(i), patchptr%patches(i),&
beglon, endlon, beglat, endlat)
beglon, endlon, beglat, endlat, collect_column_output(t))
end do
nullify(patchptr)
end do
Expand Down
2 changes: 2 additions & 0 deletions components/eam/src/control/runtime_opts.F90
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ subroutine read_namelist(single_column_in, scmlon_in, scmlat_in, scm_multcols_in
use cam_diagnostics, only: diag_readnl
use nudging, only: nudging_readnl
use radheat, only: radheat_readnl
use phys_grid_ctem, only: phys_grid_ctem_readnl
#if ( defined OFFLINE_DYN )
use metdata, only: metdata_readnl
#endif
Expand Down Expand Up @@ -540,6 +541,7 @@ subroutine read_namelist(single_column_in, scmlon_in, scmlat_in, scm_multcols_in
call nudging_readnl(nlfilename)
call radheat_readnl(nlfilename)
call vd_readnl(nlfilename)
call phys_grid_ctem_readnl(nlfilename,dtime)
#if ( defined OFFLINE_DYN )
call metdata_readnl(nlfilename)
#endif
Expand Down
4 changes: 4 additions & 0 deletions components/eam/src/dynamics/se/inital.F90
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ subroutine cam_initial(dyn_in, dyn_out, NLFileName)
use startup_initialconds, only: initial_conds
use cam_logfile, only: iulog
use perf_mod, only: t_startf, t_stopf
use phys_grid_ctem, only: phys_grid_ctem_reg

! modules from SE
use parallel_mod, only : par
Expand All @@ -42,6 +43,9 @@ subroutine cam_initial(dyn_in, dyn_out, NLFileName)
if(par%masterproc ) write(iulog,*) 'Running phys_grid_init()'
call phys_grid_init()

! Register zonal average grid for phys TEM diagnostics
call phys_grid_ctem_reg()

! Initialize index values for advected and non-advected tracers
call phys_register()

Expand Down
4 changes: 4 additions & 0 deletions components/eam/src/dynamics/se/restart_dynamics.F90
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ subroutine read_restart_dynamics (File, dyn_in, dyn_out, NLFileName)
use spmd_dyn, only: spmd_readnl
use control_mod, only: qsplit
use time_mod, only: TimeLevel_Qdp
use phys_grid_ctem, only: phys_grid_ctem_reg

!
! Input arguments
Expand Down Expand Up @@ -413,6 +414,9 @@ subroutine read_restart_dynamics (File, dyn_in, dyn_out, NLFileName)
if(par%masterproc ) write(iulog,*) 'Running phys_grid_init()'
call phys_grid_init()

! Register zonal average grid for phys TEM diagnostics
call phys_grid_ctem_reg()

! Initialize index values for advected and non-advected tracers
call phys_register()

Expand Down
Loading

0 comments on commit 8e8d0cd

Please sign in to comment.