Skip to content

Commit

Permalink
Merge pull request #937 from brian-eaton/misc01
Browse files Browse the repository at this point in the history
cam6_3_142: Miscellaneous tag
  • Loading branch information
brian-eaton authored Dec 13, 2023
2 parents e64a526 + b953252 commit 6df58c0
Show file tree
Hide file tree
Showing 16 changed files with 148 additions and 53 deletions.
2 changes: 1 addition & 1 deletion bld/namelist_files/use_cases/waccmx_ma_2000_cam6.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
'OMEGA_24_COS', 'OMEGA_24_SIN', 'OMEGA_12_COS', 'OMEGA_12_SIN', 'OMEGA_08_COS', 'OMEGA_08_SIN'
</fincl5>
<!-- Average every day -->
<fincl7>
<fincl7 dyn="fv">
'MSKtem', 'PS', 'PSL', 'VTHzm', 'UVzm', 'UWzm', 'Uzm', 'Vzm', 'THzm','Wzm', 'PHIS'
</fincl7>

Expand Down
8 changes: 4 additions & 4 deletions cime_config/buildnml
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,14 @@ def buildnml(case, caseroot, compname):
# call buildcpp to set both cppdefs and config_cache.xml file for generating namelist
#--------------------------------------------------------------------
call_buildcpp = False
if not os.path.exists(os.path.join(caseroot,"LockedFiles","env_build.xml")):
camconf = os.path.join(caseroot, "Buildconf", "camconf")
filename = os.path.join(camconf, "config_cache.xml")
if not os.path.isfile(filename):
call_buildcpp = True
else:
file1 = os.path.join(caseroot,"env_build.xml")
file2 = os.path.join(caseroot,"LockedFiles","env_build.xml")
if not filecmp.cmp(file1, file2):
if os.path.isfile(file2) and not filecmp.cmp(file1, file2):
call_buildcpp = True
if call_buildcpp:
cmd = os.path.join(os.path.join(srcroot,"cime_config","buildcpp"))
Expand All @@ -78,8 +80,6 @@ def buildnml(case, caseroot, compname):
raise

# Verify that we have a config_cache file (generated by the call to buildcpp)
camconf = os.path.join(caseroot, "Buildconf", "camconf")
filename = os.path.join(camconf, "config_cache.xml")
expect(os.path.isfile(filename),
" Missing config_cache.xml - cannot run build-namelist")

Expand Down
1 change: 1 addition & 0 deletions cime_config/config_tests.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ TMC CAM mass conservation test
<STOP_N>9</STOP_N>
<HIST_OPTION>$STOP_OPTION</HIST_OPTION>
<HIST_N>$STOP_N</HIST_N>
<ALLOW_SINGLE_EXE>TRUE</ALLOW_SINGLE_EXE>
</test>

<test NAME="SUB">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
./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
@@ -1,4 +1,3 @@
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
@@ -1,3 +1,2 @@
./xmlchange ROF_NCPL=\$ATM_NCPL
./xmlchange GLC_NCPL=\$ATM_NCPL
./xmlchange LND_DOMAIN_FILE="domain.lnd.mpasa120_gx1v7.201215.nc"
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
hist_nhtfrq = 9
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
@@ -1,3 +1,2 @@
./xmlchange ROF_NCPL=\$ATM_NCPL
./xmlchange GLC_NCPL=\$ATM_NCPL
./xmlchange LND_DOMAIN_FILE="domain.lnd.mpasa480_gx1v7.201001.nc"
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
hist_nhtfrq = 9
hist_mfilt = 1
hist_ndens = 1
fsurdat = '${DIN_LOC_ROOT}/lnd/clm2/surfdata_map/surfdata_mpasa480_hist_78pfts_CMIP6_simyr2000_c201001.nc'
126 changes: 126 additions & 0 deletions doc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,131 @@
===============================================================

Tag name: cam6_3_142
Originator(s): jedwards, ekluzek, goldy, bstephens82, eaton
Date: 13 December 2023
One-line Summary: Resolve miscellaneous issues
Github PR URL: https://github.com/ESCOMP/CAM/pull/937

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

. https://github.com/ESCOMP/CAM/issues/863 - Incorrect error message
- remove the code in cam_history that was checking fincl input for the
names of zonal mean fields and writing a message to the atm log file if
the dycore was not FV. These messages are now incorrect and have been
removed.

. https://github.com/ESCOMP/CAM/issues/837 - Remove setting of CTSM fsurdat
file and LND_DOMAIN_FILE in mpas testmods
- The LND_DOMAIN_FILE is no longer needed. The fsurdat file is now
appropriately set by CTSM.

. https://github.com/ESCOMP/CAM/pull/792 - changes to fix single-exe option
for PLB tests
- Fix from jedwards

. https://github.com/ESCOMP/CAM/issues/931 - Bad outfld calls in
cam_development?
- Fix several bad outfld calls. The size of the 1st dimension of the
passed data did not match the size passed as a separate argument.

. https://github.com/ESCOMP/CAM/pull/855 - Bug fix for SILHS history output
being garbled.
- Fix from bstephens82.

. resolves #863
. resolves #837
. resolves #792
. resolves #931
. resolves #855


Describe any changes made to build system: none

Describe any changes made to the namelist: none

List any changes to the defaults for the boundary datasets: none for cam, but
. The fsurdat file has changed for mpasa grids.

Describe any substantial timing or memory changes: none

Code reviewed by: cacraigucar, nusbaume

List all files eliminated: none

List all files added and what they do: none

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

bld/namelist_files/use_cases/waccmx_ma_2000_cam6.xml
. add dyn="fv" attribute to fincl7 element so that zonal mean output is only
requested for the FV dycore.

cime_config/buildnml
cime_config/config_tests.xml
. fix single-exe option for PLB tests (from Jim Edwards)

cime_config/testdefs/testmods_dirs/cam/outfrq1d_physgrid_tem_mpasa120_wcmsc/shell_commands
cime_config/testdefs/testmods_dirs/cam/outfrq9s_mpasa120/shell_commands
cime_config/testdefs/testmods_dirs/cam/outfrq9s_mpasa480/shell_commands
. remove xmlchange for LND_DOMAIN_FILE.

cime_config/testdefs/testmods_dirs/cam/outfrq1d_physgrid_tem_mpasa120_wcmsc/user_nl_clm
cime_config/testdefs/testmods_dirs/cam/outfrq9s_mpasa120/user_nl_clm
cime_config/testdefs/testmods_dirs/cam/outfrq9s_mpasa480/user_nl_clm
. remove setting for fsurdat

src/control/cam_history.F90
. subroutine fldlst
- remove code that inspects the fincl lists for the zonal mean fields
that used to only be available when using FV dycore. This code removed
these fields from the fincl list and printed a message to the atm log
file. These messages are no longer correct and have been removed.
. subroutine addfld_nd
- fix conditional so that is_subcol gets set correctly for fields
representing subcolumns.

src/physics/cam/cam_diagnostics.F90
src/physics/cam/vertical_diffusion.F90
src/physics/rrtmg/rrtmg_state.F90
src/physics/spcam/spcam_drivers.F90
src/physics/waccm/mo_aurora.F90
. fix several outfld calls - make sure 1st dimension of the data array matches
the value passed as the size of the 1st dimension

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.

derecho/intel/aux_cam:
ERP_Ln9_Vnuopc.C96_C96_mg17.F2000climo.derecho_intel.cam-outfrq9s_mg3 (Overall: PEND) details:
ERP_Ln9_Vnuopc.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq9s (Overall: FAIL) details:
- pre-existing failures

ERS_Ln9_P288x1_Vnuopc.mpasa120_mpasa120.F2000climo.derecho_intel.cam-outfrq9s_mpasa120 (Overall: DIFF) details:
ERS_Ln9_P36x1_Vnuopc.mpasa480_mpasa480.F2000climo.derecho_intel.cam-outfrq9s_mpasa480 (Overall: DIFF) details:
- fsurdat file changed resulting in baseline comparison failures

SMS_D_Ln9_Vnuopc.ne16_ne16_mg17.FX2000.derecho_intel.cam-outfrq9s (Overall: NLFAIL) details:
- use_case file modified to exclude the fincl7 list of zonal mean fields.
Previous code was ignoring these fields and printing a message to the
atm.log file.

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

izumi/gnu/aux_cam: All PASS

CAM tag used for the baseline comparison tests if different than previous
tag:

Summarize any changes to answers: BFB except for MPAS tests due to a change
in the fsurdat file specified by CTSM.

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

Tag name: cam6_3_141
Originator(s): eaton
Date: 8 December 2023
Expand Down
32 changes: 3 additions & 29 deletions src/control/cam_history.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2584,16 +2584,6 @@ subroutine fldlst ()
! on that grid.
integer, allocatable :: gridsontape(:,:)

! The following list of field names are only valid for the FV dycore. They appear
! in fincl settings of WACCM use case files which are not restricted to the FV dycore.
! To avoid duplicating long fincl lists in use case files to provide both FV and non-FV
! versions this short list of fields is checked for and removed from fincl lists when
! the dycore is not FV.
integer, parameter :: n_fv_only = 10
character(len=6) :: fv_only_flds(n_fv_only) = &
[ 'VTHzm ', 'WTHzm ', 'UVzm ', 'UWzm ', 'Uzm ', 'Vzm ', 'Wzm ', &
'THzm ', 'TH ', 'MSKtem' ]

integer :: n_vec_comp, add_fincl_idx
integer, parameter :: nvecmax = 50 ! max number of vector components in a fincl list
character(len=2) :: avg_suffix
Expand All @@ -2610,25 +2600,9 @@ subroutine fldlst ()
n_vec_comp = 0
vec_comp_names = ' '
vec_comp_avgflag = ' '
fincls: do while (fld < pflds .and. fincl(fld,t) /= ' ')
do while (fld < pflds .and. fincl(fld,t) /= ' ')
name = getname (fincl(fld,t))

if (.not. dycore_is('FV')) then
! filter out fields only provided by FV dycore
do i = 1, n_fv_only
if (name == fv_only_flds(i)) then
write(errormsg,'(3a,2(i0,a))')'FLDLST: ', trim(name), &
' in fincl(', fld,', ',t, ') only available with FV dycore'
if (masterproc) then
write(iulog,*) trim(errormsg)
call shr_sys_flush(iulog)
end if
fld = fld + 1
cycle fincls
end if
end do
end if

mastername=''
listentry => get_entry_by_name(masterlinkedlist, name)
if (associated(listentry)) mastername = listentry%field%name
Expand Down Expand Up @@ -2656,7 +2630,7 @@ subroutine fldlst ()
end if
end if
fld = fld + 1
end do fincls
end do

! Interpolation of vector components requires that both be present. If the fincl
! specifier contains any vector components, then the complement was saved in the
Expand Down Expand Up @@ -6121,8 +6095,8 @@ subroutine addfld_nd(fname, dimnames, avgflag, units, long_name, &
write(errormsg, *) "Cannot add ", trim(fname), &
"Subcolumn history output only allowed on physgrid"
call endrun("ADDFLD: "//errormsg)
listentry%field%is_subcol = .true.
end if
listentry%field%is_subcol = .true.
end if
end if
! Levels
Expand Down
2 changes: 1 addition & 1 deletion src/physics/cam/cam_diagnostics.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1407,7 +1407,7 @@ subroutine diag_phys_writeout_moist(state, pbuf, p_surf_t)
do k=2,pver
ftem(:ncol,1) = ftem(:ncol,1) + ftem(:ncol,k)
end do
call outfld ('ATMEINT ',ftem(:ncol,1) ,pcols ,lchnk )
call outfld ('ATMEINT ', ftem(:ncol,1), ncol, lchnk)

!! Boundary layer atmospheric stability, temperature, water vapor diagnostics

Expand Down
16 changes: 8 additions & 8 deletions src/physics/cam/vertical_diffusion.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1108,9 +1108,9 @@ subroutine vertical_diffusion_tend( &
call outfld( 'slv_pre_PBL ', slv_prePBL, pcols, lchnk )
call outfld( 'u_pre_PBL ', state%u, pcols, lchnk )
call outfld( 'v_pre_PBL ', state%v, pcols, lchnk )
call outfld( 'qv_pre_PBL ', state%q(:ncol,:,1), pcols, lchnk )
call outfld( 'ql_pre_PBL ', state%q(:ncol,:,ixcldliq), pcols, lchnk )
call outfld( 'qi_pre_PBL ', state%q(:ncol,:,ixcldice), pcols, lchnk )
call outfld( 'qv_pre_PBL ', state%q(:,:,1), pcols, lchnk )
call outfld( 'ql_pre_PBL ', state%q(:,:,ixcldliq), pcols, lchnk )
call outfld( 'qi_pre_PBL ', state%q(:,:,ixcldice), pcols, lchnk )
call outfld( 't_pre_PBL ', state%t, pcols, lchnk )
call outfld( 'rh_pre_PBL ', ftem_prePBL, pcols, lchnk )

Expand Down Expand Up @@ -1472,11 +1472,11 @@ subroutine vertical_diffusion_tend( &
call outfld( 'vflx_cg_PBL' , vflx_cg, pcols, lchnk )
call outfld( 'slten_PBL' , slten, pcols, lchnk )
call outfld( 'qtten_PBL' , qtten, pcols, lchnk )
call outfld( 'uten_PBL' , ptend%u(:ncol,:), pcols, lchnk )
call outfld( 'vten_PBL' , ptend%v(:ncol,:), pcols, lchnk )
call outfld( 'qvten_PBL' , ptend%q(:ncol,:,1), pcols, lchnk )
call outfld( 'qlten_PBL' , ptend%q(:ncol,:,ixcldliq), pcols, lchnk )
call outfld( 'qiten_PBL' , ptend%q(:ncol,:,ixcldice), pcols, lchnk )
call outfld( 'uten_PBL' , ptend%u, pcols, lchnk )
call outfld( 'vten_PBL' , ptend%v, pcols, lchnk )
call outfld( 'qvten_PBL' , ptend%q(:,:,1), pcols, lchnk )
call outfld( 'qlten_PBL' , ptend%q(:,:,ixcldliq), pcols, lchnk )
call outfld( 'qiten_PBL' , ptend%q(:,:,ixcldice), pcols, lchnk )
call outfld( 'tten_PBL' , tten, pcols, lchnk )
call outfld( 'rhten_PBL' , rhten, pcols, lchnk )

Expand Down
2 changes: 1 addition & 1 deletion src/physics/rrtmg/rrtmg_state.F90
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ subroutine rrtmg_state_update(pstate,pbuf,icall,rstate)
chi_eff(:) = chi_eff(:) / 2.1415e-5_r8 ! O3 column above in DU
endwhere

call outfld('O3colAbove', chi_eff(:ncol), pcols, lchnk)
call outfld('O3colAbove', chi_eff(:ncol), ncol, lchnk)

end subroutine rrtmg_state_update

Expand Down
2 changes: 1 addition & 1 deletion src/physics/spcam/spcam_drivers.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2053,7 +2053,7 @@ subroutine spcam_radiation_finalize_sam1mom(cam_in, state, pbuf, rad_avgdata, ca
call outfld('FSN200 ',rad_avgdata%fsn200_m(:),pcols,lchnk)
call outfld('FSN200C ',rad_avgdata%fsn200c_m(:),pcols,lchnk)
call outfld('FSNR' ,rad_avgdata%fsnr_m(:) ,pcols,lchnk)
call outfld('SWCF ',rad_avgdata%fsntoa_m(:ncol)-rad_avgdata%fsntoac_m(:ncol) ,pcols,lchnk)
call outfld('SWCF ',rad_avgdata%fsntoa_m(:ncol)-rad_avgdata%fsntoac_m(:ncol) ,ncol,lchnk)

do i=1, Nday
do k=1, pver
Expand Down
4 changes: 2 additions & 2 deletions src/physics/waccm/mo_aurora.F90
Original file line number Diff line number Diff line change
Expand Up @@ -476,8 +476,8 @@ subroutine aurora_prod( tn, o2, o1, mbar, rlats, &
!-----------------------------------------------------------------------
! ... output mag lons, lats
!-----------------------------------------------------------------------
call outfld( 'ALONM', r2d*alonm(:ncol,lchnk), pcols, lchnk )
call outfld( 'ALATM', r2d*alatm(:ncol,lchnk), pcols, lchnk )
call outfld( 'ALONM', r2d*alonm(:ncol,lchnk), ncol, lchnk )
call outfld( 'ALATM', r2d*alatm(:ncol,lchnk), ncol, lchnk )

if (indxQTe>0) then
call pbuf_get_field(pbuf, indxQTe, qteaur)
Expand Down

0 comments on commit 6df58c0

Please sign in to comment.