Skip to content

Commit

Permalink
Merge pull request #677 from fvitt/physgrid_tem_diags
Browse files Browse the repository at this point in the history
cam6_3_089:  TEM diagnostics calculated on the physics grid
  • Loading branch information
fvitt authored Jan 10, 2023
2 parents 4e10c3b + 479bf60 commit ad46750
Show file tree
Hide file tree
Showing 19 changed files with 2,745 additions and 3 deletions.
1 change: 1 addition & 0 deletions bld/namelist_files/namelist_defaults_cam.xml
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@

<ncdata dyn="se" hgrid="ne5np4" nlev="66" ic_ymd="101">atm/waccm/ic/wa3_ne5np4_1950_spinup.cam2.i.1960-01-01-00000_c150810.nc</ncdata>
<ncdata dyn="se" hgrid="ne30np4" nlev="70" ic_ymd="101">atm/waccm/ic/FW2000_ne30_L70_01-01-0001_c200602.nc</ncdata>
<ncdata dyn="se" hgrid="ne30np4" nlev="70" npg="3" chem="waccm_sc_mam4">atm/waccm/ic/FWsc2000climo_ne30pg3_L70_0002-01-01_c221103.nc</ncdata>
<ncdata dyn="se" hgrid="ne30np4" nlev="70" npg="3" ic_ymd="101">atm/waccm/ic/FW2000_ne30pg3_L70_01-01-0001_c200602.nc</ncdata>
<ncdata dyn="se" hgrid="ne30np4" nlev="110" ic_ymd="101">atm/waccm/ic/FWsc2000_ne30pg3_L110_01-01-0001_c200521.nc</ncdata>

Expand Down
18 changes: 18 additions & 0 deletions bld/namelist_files/namelist_definition.xml
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,24 @@ Default: .false., unless it is overridden (WACCM with interactive chemistry and
configurations do this)
</entry>

<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 diagnostics calucation.
If &gt; 0, frequency is specified as number of timesteps.
If &lt; 0, frequency is specified as number of hours.
</entry>

<entry id="print_energy_errors" type="logical" category="diagnostics"
group="check_energy_nl" valid_values="" >
Turn on verbose output identifying columns that fail energy/water
Expand Down
6 changes: 3 additions & 3 deletions bld/namelist_files/use_cases/waccm_sc_2000_cam6.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<solar_parms_data_file>atm/cam/solar/SolarForcing1995-2005avg_c160929.nc</solar_parms_data_file>

<!--Species IC -->
<ncdata dyn="fv" hgrid="0.9x1.25">cesm2_init/f.e21.FWsc2000climo.f09_f09_mg17.cesm2.1-exp011.001/0003-01-01/f.e21.FWsc2000climo.f09_f09_mg17.cesm2.1-exp011.001.cam.i.0003-01-01-00000.nc</ncdata>
<ncdata dyn="fv" hgrid="0.9x1.25">cesm2_init/f.e21.FWsc2000climo.f09_f09_mg17.cesm2.1-exp011.001_v2/0003-01-01/f.e21.FWsc2000climo.f09_f09_mg17.cesm2.1-exp011.001_v2.cam.i.0003-01-01-00000.nc</ncdata>
<ncdata dyn="fv" hgrid="1.9x2.5" >atm/waccm/ic/f2000.waccm-mam3_1.9x2.5_L70.cam2.i.0017-01-01.c120410.nc</ncdata>

<!-- LBC, UBC Files -->
Expand Down Expand Up @@ -91,7 +91,7 @@
</srf_emis_specifier>

<!-- History Files -->
<do_circulation_diags>.true.</do_circulation_diags>
<do_circulation_diags dyn="fv">.true.</do_circulation_diags>
<history_chemistry>.true.</history_chemistry>

<mfilt> 1, 30, 120, 240, 240, 480, 365, 73, 30 </mfilt>
Expand All @@ -109,7 +109,7 @@
</fincl7>

<!-- Reduce output size by removing some variables. -->
<fexcl1>
<fexcl1 dyn="fv">
'BTAUN', 'BTAUS', 'BTAUE', 'BTAUW', 'BTAUNET', 'BUTEND1', 'BUTEND2', 'BUTEND3', 'BUTEND4', 'BUTEND5', 'BVTGWSPEC',
'MAXQ0', 'HDEPTH', 'NETDT', 'TAUN', 'TAUS', 'TAUE', 'TAUW', 'TAUGWX', 'TAUGWY', 'UTEND1', 'UTEND2', 'UTEND3',
'UTEND4', 'UTEND5', 'FRONTGF', 'FRONTGFA', 'EKGW', 'QNO', 'QRLNLTE', 'QRL_TOT', 'DUV', 'DVV', 'TTPXMLC'
Expand Down
35 changes: 35 additions & 0 deletions cime_config/testdefs/testlist_cam.xml
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,41 @@
<option name="wallclock">00:30:00</option>
</options>
</test>
<!-- TEM diagnostics and zonal-average output -->
<test compset="QPWmaC4" grid="ne5_ne5_mg37" name="SMS_D_Ln6_Vnuopc" testmods="cam/outfrq3s_physgrid_tem">
<machines>
<machine name="izumi" compiler="nag" category="aux_cam"/>
<machine name="izumi" compiler="nag" category="waccm"/>
<machine name="cheyenne" compiler="intel" category="waccm"/>
<machine name="izumi" compiler="nag" category="tem_diags"/>
<machine name="cheyenne" compiler="intel" category="tem_diags"/>
</machines>
<options>
<option name="comment" >TEM diagnostics and zonal-average output</option>
<option name="wallclock">00:10:00</option>
</options>
</test>
<test compset="FWsc2000climo" grid="mpasa120_mpasa120" name="ERS_Ld3_Vnuopc_P360x1" testmods="cam/outfrq1d_physgrid_tem_mpasa120_wcmsc">
<machines>
<machine name="cheyenne" compiler="intel" category="prealpha"/>
<machine name="cheyenne" compiler="intel" category="waccm"/>
<machine name="cheyenne" compiler="intel" category="tem_diags"/>
</machines>
<options>
<option name="comment" >TEM diagnostics and zonal-average output</option>
<option name="wallclock">00:20:00</option>
</options>
</test>
<test compset="FWsc2000climo" grid="f09_f09_mg17" name="ERP_Ln9_Vnuopc" testmods="cam/outfrq9s_physgrid_tem_1deg">
<machines>
<machine name="cheyenne" compiler="intel" category="waccm"/>
<machine name="cheyenne" compiler="intel" category="tem_diags"/>
</machines>
<options>
<option name="comment" >TEM diagnostics and zonal-average output</option>
<option name="wallclock">00:20:00</option>
</options>
</test>
<!-- carma sulfate -->
<test compset="FW4ma2000" grid="f10_f10_mg37" name="SMS_D_Ln9_Vnuopc" testmods="cam/carma_sulfate">
<machines>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
./xmlchange ROF_NCPL=\$ATM_NCPL
./xmlchange LND_DOMAIN_FILE="domain.lnd.mpasa120_gx1v7.201215.nc"
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
ncdata = '$DIN_LOC_ROOT/atm/waccm/ic/mpasa120km.waccm_fulltopo_c220818.nc'

mpas_cam_coef = 0.2D0
mpas_rayleigh_damp_u_timescale_days = 5.D0
mpas_zd = 80000.0D0
mpas_apvm_upwinding = 0.0D0
mpas_dt = 600.D0
mpas_dynamics_split_steps = 4
mpas_epssm = 0.5D0

use_gw_front = .false.

phys_grid_ctem_nfreq = -12
phys_grid_ctem_zm_nbas = 120
phys_grid_ctem_za_nlat = 90

fincl1 = ' '
fexcl1 = ' '

fincl2 = 'VTHzaphys','WTHzaphys','UVzaphys','UWzaphys'

mfilt=1,1,1,1,1,1,1,1,1,1
ndens=1,1,1,1,1,1,1,1,1,1
nhtfrq=-24,-24,-24,-24,-24,-24,-24,-24,-24,-24
inithist='ENDOFRUN'
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
hist_nhtfrq = -24
hist_mfilt = 1
hist_ndens = 1
fsurdat = '${DIN_LOC_ROOT}/lnd/clm2/surfdata_map/release-clm5.0.34/surfdata_mpasa120_hist_78pfts_CMIP6_simyr2000_c201215.nc'
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
./xmlchange ROF_NCPL=\$ATM_NCPL
./xmlchange GLC_NCPL=\$ATM_NCPL
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
mfilt=1,1,1,1,1,1,1,1,1
ndens=1,1,1,1,1,1,1,1,1
nhtfrq=3,3,3,3,3,3,3,3,3
inithist='ENDOFRUN'
phys_grid_ctem_nfreq=3
phys_grid_ctem_zm_nbas=16
phys_grid_ctem_za_nlat=15
fincl3 = 'VTHzaphys','WTHzaphys','UVzaphys','UWzaphys'
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
!----------------------------------------------------------------------------------
! Users should add all user specific namelist changes below in the form of
! namelist_var = new_namelist_value
!
! Include namelist variables for drv_flds_in ONLY if -megan and/or -drydep options
! are set in the CLM_NAMELIST_OPTS env variable.
!
! EXCEPTIONS:
! Set use_cndv by the compset you use and the CLM_BLDNML_OPTS -dynamic_vegetation setting
! Set use_vichydro by the compset you use and the CLM_BLDNML_OPTS -vichydro setting
! Set use_cn by the compset you use and CLM_BLDNML_OPTS -bgc setting
! Set use_crop by the compset you use and CLM_BLDNML_OPTS -crop setting
! Set spinup_state by the CLM_BLDNML_OPTS -bgc_spinup setting
! Set irrigate by the CLM_BLDNML_OPTS -irrig setting
! Set dtime with L_NCPL option
! Set fatmlndfrc with LND_DOMAIN_PATH/LND_DOMAIN_FILE options
! Set finidat with RUN_REFCASE/RUN_REFDATE/RUN_REFTOD options for hybrid or branch cases
! (includes $inst_string for multi-ensemble cases)
! Set glc_grid with CISM_GRID option
! Set glc_smb with GLC_SMB option
! Set maxpatch_glcmec with GLC_NEC option
! Set glc_do_dynglacier with GLC_TWO_WAY_COUPLING env variable
!----------------------------------------------------------------------------------
hist_nhtfrq = 3
hist_mfilt = 1
hist_ndens = 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
./xmlchange ROF_NCPL=\$ATM_NCPL
./xmlchange GLC_NCPL=\$ATM_NCPL
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
mfilt=1,1,1,1,1,1,1,1,1
ndens=1,1,1,1,1,1,1,1,1
nhtfrq=9,9,9,9,9,9,9,9,9
inithist='ENDOFRUN'
phys_grid_ctem_nfreq=-2
phys_grid_ctem_zm_nbas=120
phys_grid_ctem_za_nlat=90
fincl3 = 'VTHzaphys','WTHzaphys','UVzaphys','UWzaphys'
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
!----------------------------------------------------------------------------------
! Users should add all user specific namelist changes below in the form of
! namelist_var = new_namelist_value
!
! Include namelist variables for drv_flds_in ONLY if -megan and/or -drydep options
! are set in the CLM_NAMELIST_OPTS env variable.
!
! EXCEPTIONS:
! Set use_cndv by the compset you use and the CLM_BLDNML_OPTS -dynamic_vegetation setting
! Set use_vichydro by the compset you use and the CLM_BLDNML_OPTS -vichydro setting
! Set use_cn by the compset you use and CLM_BLDNML_OPTS -bgc setting
! Set use_crop by the compset you use and CLM_BLDNML_OPTS -crop setting
! Set spinup_state by the CLM_BLDNML_OPTS -bgc_spinup setting
! Set irrigate by the CLM_BLDNML_OPTS -irrig setting
! Set dtime with L_NCPL option
! Set fatmlndfrc with LND_DOMAIN_PATH/LND_DOMAIN_FILE options
! Set finidat with RUN_REFCASE/RUN_REFDATE/RUN_REFTOD options for hybrid or branch cases
! (includes $inst_string for multi-ensemble cases)
! Set glc_grid with CISM_GRID option
! Set glc_smb with GLC_SMB option
! Set maxpatch_glcmec with GLC_NEC option
! Set glc_do_dynglacier with GLC_TWO_WAY_COUPLING env variable
!----------------------------------------------------------------------------------
hist_nhtfrq = 9
hist_mfilt = 1
hist_ndens = 1

109 changes: 109 additions & 0 deletions doc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,114 @@
===============================================================

Tag name: cam6_3_089
Originator(s): fvitt, patc
Date: 10 Jan 2013
One-line Summary: Introduce zonal mean and Transformed Eulerian Mean diagnostics capabilities on arbitrary grids
Github PR URL: https://github.com/ESCOMP/CAM/pull/677

Purpose of changes (include the issue number and title text for each relevant GitHub issue):

Add capability to calculate zonal mean of physics fields on arbatrary grids (structured or unstructured).
The synthesis of zonal mean values is based on m=0 spherical harmonics. (patc)

Implement TEM circulation diagnostics in physics #653
Need to add zonal mean grid to history for fields on arbitrary grids #652

Describe any changes made to build system: N/A

Describe any changes made to the namelist:

Namelist options added:

phys_grid_ctem_zm_nbas:
Number of zonal mean basis functions (number of m=0 spherical harmonics) used in
Transformed Eulerian Mean (TEM) diagnostics

phys_grid_ctem_za_nlat:
Number of latitude grid points for zonal average TEM diagnostics history fields

phys_grid_ctem_nfreq:
Frequency of TEM diagnostics calucation.
If > 0, frequency is specified as number of timesteps.
If < 0, frequency is specified as number of hours.

List any changes to the defaults for the boundary datasets: N/A

Describe any substantial timing or memory changes:

The physics grid TEM diagnostics is expected have a small impact (on the order of a few percent)
when activated.

Code reviewed by: peverwhee, cacraigucar, nusbaume

List all files eliminated: N/A

List all files added and what they do:

A src/physics/cam/phys_grid_ctem.F90
- computes terms of the TEM diags on the physics grid

A src/utils/zonal_mean_mod.F90
- computes zonal means on arbitrary physics grids based on m=0 order spherical harmonics

A cime_config/testdefs/testmods_dirs/cam/outfrq1d_physgrid_tem_mpasa120_wcmsc/shell_commands
A cime_config/testdefs/testmods_dirs/cam/outfrq1d_physgrid_tem_mpasa120_wcmsc/user_nl_cam
A cime_config/testdefs/testmods_dirs/cam/outfrq1d_physgrid_tem_mpasa120_wcmsc/user_nl_clm
A cime_config/testdefs/testmods_dirs/cam/outfrq3s_physgrid_tem/shell_commands
A cime_config/testdefs/testmods_dirs/cam/outfrq3s_physgrid_tem/user_nl_cam
A cime_config/testdefs/testmods_dirs/cam/outfrq3s_physgrid_tem/user_nl_clm
A cime_config/testdefs/testmods_dirs/cam/outfrq9s_physgrid_tem_1deg/shell_commands
A cime_config/testdefs/testmods_dirs/cam/outfrq9s_physgrid_tem_1deg/user_nl_cam
A cime_config/testdefs/testmods_dirs/cam/outfrq9s_physgrid_tem_1deg/user_nl_clm
- for testing TEM diags on physics grids

List all existing files that have been modified, and describe the changes:

M bld/namelist_files/namelist_definition.xml
- new phys_grid_ctem options (see above)

M bld/namelist_files/namelist_defaults_cam.xml
- update IC file for WACCM-SC on ne30pg3 grid (spun up stable IC file)

M bld/namelist_files/use_cases/waccm_sc_2000_cam6.xml
- correct IC file path for 0.9x1.25 grid

M cime_config/testdefs/testlist_cam.xml
- add tests for TEM diags on physics grids

M src/control/cam_comp.F90
- invoke phys_grid_ctem_reg

M src/control/runtime_opts.F90
- invoke phys_grid_ctem_readnl

M src/physics/cam/physpkg.F90
- invoke :
phys_grid_ctem_init
phys_grid_ctem_final
phys_grid_ctem_diags

If there were any failures reported from running test_driver.sh on any test
platform, and checkin with these failures has been OK'd by the gatekeeper,
then copy the lines from the td.*.status files for the failed tests to the
appropriate machine below. All failed tests must be justified.

cheyenne/intel/aux_cam: All PASS

izumi/nag/aux_cam:
DAE_Vnuopc.f45_f45_mg37.FHS94.izumi_nag.cam-dae (Overall: FAIL) details:
- pre-existing failure

SMS_D_Ln6_Vnuopc.ne5_ne5_mg37.QPWmaC4.izumi_nag.cam-outfrq3s_physgrid_tem (Overall: DIFF) details:
- new test

izumi/gnu/aux_cam: All PASS

Summarize any changes to answers: bit-for-bit unchanged

===============================================================
===============================================================

Tag name: cam6_3_088
Originator(s): cacraig
Date: Dec 21, 2022
Expand Down
4 changes: 4 additions & 0 deletions src/control/cam_comp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ subroutine cam_init( &
#if (defined BFB_CAM_SCAM_IOP)
use history_defaults, only: initialize_iop_history
#endif
use phys_grid_ctem, only: phys_grid_ctem_reg

! Arguments
character(len=cl), intent(in) :: caseid ! case ID
Expand Down Expand Up @@ -168,6 +169,9 @@ subroutine cam_init( &
! Initialize physics grid decomposition
call phys_grid_init()

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

! Register advected tracers and physics buffer fields
call phys_register ()

Expand Down
2 changes: 2 additions & 0 deletions src/control/runtime_opts.F90
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ subroutine read_namelist(nlfilename, single_column, scmlat, scmlon)
use qneg_module, only: qneg_readnl
use lunar_tides, only: lunar_tides_readnl
use upper_bc, only: ubc_readnl
use phys_grid_ctem, only: phys_grid_ctem_readnl

!---------------------------Arguments-----------------------------------

Expand Down Expand Up @@ -195,6 +196,7 @@ subroutine read_namelist(nlfilename, single_column, scmlat, scmlon)
call dyn_readnl(nlfilename)
call ionosphere_readnl(nlfilename)
call qneg_readnl(nlfilename)
call phys_grid_ctem_readnl(nlfilename)

end subroutine read_namelist

Expand Down
Loading

0 comments on commit ad46750

Please sign in to comment.