Skip to content

Commit

Permalink
Merge pull request ESCOMP#1072 from brian-eaton/misc02
Browse files Browse the repository at this point in the history
cam6_4_015: Miscellaneous fixes
  • Loading branch information
brian-eaton authored Jul 23, 2024
2 parents 87f3b5d + 9f5bd87 commit fe60b8d
Show file tree
Hide file tree
Showing 6 changed files with 124 additions and 30 deletions.
4 changes: 1 addition & 3 deletions bld/namelist_files/use_cases/aquaplanet_cam5.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
<co2vmr >348.0e-6</co2vmr>

<!-- Solar insolation of 1365 -->
<solar_irrad_data_file >atm/cam/solar/ape_solar_ave_tsi_1365.nc</solar_irrad_data_file>
<solar_htng_spctrl_scl >.true.</solar_htng_spctrl_scl>
/
<solar_irrad_data_file >atm/cam/solar/ape_solar_ave_tsi_1365.nc</solar_irrad_data_file>

<!-- zonally symmetric ozone file -->
<prescribed_ozone_file >apeozone_cam3_5_54.nc</prescribed_ozone_file>
Expand Down
4 changes: 1 addition & 3 deletions bld/namelist_files/use_cases/aquaplanet_cam6.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
<co2vmr >348.0e-6</co2vmr>

<!-- Solar insolation of 1365 -->
<solar_irrad_data_file >atm/cam/solar/ape_solar_ave_tsi_1365.nc</solar_irrad_data_file>
<solar_htng_spctrl_scl >.true.</solar_htng_spctrl_scl>
/
<solar_irrad_data_file >atm/cam/solar/ape_solar_ave_tsi_1365.nc</solar_irrad_data_file>

<!-- zonally symmetric ozone file -->
<prescribed_ozone_file >apeozone_cam3_5_54.nc</prescribed_ozone_file>
Expand Down
35 changes: 14 additions & 21 deletions bld/namelist_files/use_cases/aquaplanet_rce_cam6.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?xml version="1.0"?>

<!-- Do not specify orb_*, co2vmr, ch4 or n2o for aquaplanet runs -->

<namelist_defaults>

<ncdata hgrid="ne30np4" > atm/cam/inic/se/initial_data.cam.ne30.L32.RCEMIP_c20190507.nc</ncdata>

<!-- make planet orbit circular -->
<orb_eccen >0.</orb_eccen>
<orb_obliq >0.</orb_obliq>
Expand All @@ -12,18 +13,6 @@
<!-- turn off volcanos -->
<prescribed_strataero_feedback> false </prescribed_strataero_feedback>

<prescribed_ozone_datapath > atm/cam/ozone/</prescribed_ozone_datapath>
<prescribed_ozone_file > ozone.cam.ne30.L32.RCEMIP_c20190507.nc </prescribed_ozone_file>
<ncdata hgrid="ne30np4" > atm/cam/inic/se/initial_data.cam.ne30.L32.RCEMIP_c20190507.nc</ncdata>
<solar_irrad_data_file > atm/cam/solar/solar_tsi_551_with_ssi.cam.ne30.L32.RCEMIP_c20190507.nc </solar_irrad_data_file>
<solar_htng_spctrl_scl > .false. </solar_htng_spctrl_scl>

<empty_htapes > true </empty_htapes>
<avgflag_pertape > I </avgflag_pertape>
<nhtfrq > 1 </nhtfrq>
<mfilt > 1 </mfilt>
<fincl1> 'T','Q','U','V','PS','PRECT','Z3' </fincl1>

<!-- APE ghg -->
<ch4vmr >1.650e-6</ch4vmr>
<n2ovmr >0.306e-6</n2ovmr>
Expand All @@ -32,13 +21,12 @@
<f11vmr>0.0</f11vmr>
<f12vmr>0.0</f12vmr>

<!-- Solar insolation of 1365 -->
<solar_irrad_data_file >atm/cam/solar/ape_solar_ave_tsi_1365.nc</solar_irrad_data_file>
<solar_htng_spctrl_scl >.true.</solar_htng_spctrl_scl>
/
<!-- Solar insolation -->
<solar_irrad_data_file> atm/cam/solar/solar_tsi_551_with_ssi.cam.ne30.L32.RCEMIP_c20190507.nc </solar_irrad_data_file>
<solar_htng_spctrl_scl> .false. </solar_htng_spctrl_scl>

<!-- zonally symmetric ozone file -->
<prescribed_ozone_file >apeozone_cam3_5_54.nc</prescribed_ozone_file>
<!-- ozone file -->
<prescribed_ozone_file > ozone.cam.ne30.L32.RCEMIP_c20190507.nc </prescribed_ozone_file>
<prescribed_ozone_datapath>atm/cam/ozone</prescribed_ozone_datapath>
<prescribed_ozone_name >OZONE</prescribed_ozone_name>
<prescribed_ozone_type >CYCLICAL</prescribed_ozone_type>
Expand All @@ -48,7 +36,6 @@
<use_rad_uniform_angle > .true. </use_rad_uniform_angle>
<rad_uniform_angle > 0.73391095 </rad_uniform_angle>


<!-- Revised physics constants for ape experiments -->
<omega>0.0</omega>
<sday >86164.10063718943</sday>
Expand All @@ -67,4 +54,10 @@
<tracer_cnst_specifier > "" </tracer_cnst_specifier>
<seasalt_emis_scale> 0.0 </seasalt_emis_scale>

<empty_htapes > true </empty_htapes>
<avgflag_pertape > I </avgflag_pertape>
<nhtfrq > 1 </nhtfrq>
<mfilt > 1 </mfilt>
<fincl1> 'T','Q','U','V','PS','PRECT','Z3' </fincl1>

</namelist_defaults>
7 changes: 5 additions & 2 deletions cime_config/buildcpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ sys.path.append(os.path.join(CIMEROOT, "CIME", "Tools"))

from standard_script_setup import *

from CIME.utils import run_cmd_no_fail
from CIME.utils import run_cmd
from CIME.case import Case
from CIME.buildnml import parse_input

Expand Down Expand Up @@ -127,7 +127,10 @@ def buildcpp(case):
srcroot = testpath
cmd = os.path.join(srcroot, "bld", "configure") + \
" " + " ".join(config_opts)
run_cmd_no_fail(cmd, from_dir=camconf)

stat, output, err = run_cmd(cmd, from_dir=camconf)
if stat:
logger.warning(err)

# determine cppdefs - caseroot/camconf/CESM_cppdefs is created by the call to configure
with open(os.path.join(camconf, "CESM_cppdefs"), 'r') as f:
Expand Down
101 changes: 101 additions & 0 deletions doc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,106 @@
===============================================================

Tag name: cam6_4_015
Originator(s): jedwards, eaton
Date: 23 July 2024
One-line Summary: misc fixes: buildcpp, check_energy
Github PR URL: https://github.com/ESCOMP/CAM/pull/1072

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

. Issue #1045 - buildcpp does not report errors reported by cam configure
- modify buildcpp so that error messages from CAM's configure appear in
the log output

. Issue #1015 - SILHS subcolumns output as all zeros.
- testing for this issue revealed a bug when subcolumns were used with
the SE dycore. A fix is added to check_energy.F90. This doesn't fix
the problem with zeros in the subcolumn output, but that is the same
problem previously reported for COSP in issue #944. The problem only
appears when SE grid output is interpolated. A workaround is to output
the subcolumns on the native SE grid.

. Issue #1044 - Remove solar_htng_spctrl_scl from aquaplanet use case
- also cleaned up the aquaplanet_rce_cam6.xml file which had duplicated
settings of several variables. The second setting is not used because
the first setting takes precedence. Note that the setting of
solar_htng_spctrl_scl to false in aquaplanet_rce_cam6.xml is needed
because it is overriding the default of true for cam6 with RRTMG.

. resolves #1045 (and replaces PR #1046)
. resolves #1015
. resolves #1044

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

Describe any substantial timing or memory changes: none

Code reviewed by: cacraig

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/aquaplanet_cam5.xml
bld/namelist_files/use_cases/aquaplanet_cam6.xml
. remove solar_htng_spctrl_scl

bld/namelist_files/use_cases/aquaplanet_rce_cam6.xml
. remove duplicated (and hence unused) settings for solar_irrad_data_file,
prescribed_ozone_file, and solar_htng_spctrl_scl

cime_config/buildcpp
. run configure command from run_cmd() rather than run_cmd_no_fail() and
pass error output to logger.warning()

src/physics/cam/check_energy.F90
. fix out of bounds array references when subcolumns are used in the SE
specific hydrostatic energy scaling.


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.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq9s (Overall: FAIL)
- pre-existing failure due to HEMCO not having reproducible results issues #1018 and #856

SMS_D_Ln9_P1280x1.ne0ARCTICne30x4_ne0ARCTICne30x4_mt12.FHIST.derecho_intel.cam-outfrq9s (Overall: PEND)
SMS_D_Ln9_P1280x1.ne0CONUSne30x8_ne0CONUSne30x8_mt12.FCHIST.derecho_intel.cam-outfrq9s (Overall: PEND)
- pre-existing failures -- need fix in CLM external

SMS_D_Ln9.T42_T42.FSCAM.derecho_intel.cam-outfrq9s (Overall: FAIL)
- pre-existing failure -- need fix in CICE external

izumi/nag/aux_cam:

DAE.f45_f45_mg37.FHS94.izumi_nag.cam-dae (Overall: FAIL) details:
- pre-existing failure - issue #670

izumi/gnu/aux_cam:

ERP_D_Ln9.ne3pg3_ne3pg3_mg37.QPC6.izumi_gnu.cam-outfrq9s_rrtmgp (Overall: DIFF)
- solution diffs because solar_htng_spctrl_scl is now getting the correct
value of .false. (what RRTMGP requires). The use case file was
previously incorrectly setting this value to .true. (what RRTMG requires).

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

Summarize any changes to answers: BFB

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

Tag name: cam6_4_014
Originator(s): fvitt
Date: 22 Jul 2024
Expand Down
3 changes: 2 additions & 1 deletion src/physics/cam/check_energy.F90
Original file line number Diff line number Diff line change
Expand Up @@ -485,13 +485,14 @@ subroutine check_energy_chng(state, tend, name, nstep, ztodt, &
!
if (state%psetcols == pcols) then
cp_or_cv(:ncol,:) = cp_or_cv_dycore(:ncol,:,lchnk)
scaling(:ncol,:) = cpairv(:ncol,:,lchnk)/cp_or_cv_dycore(:ncol,:,lchnk)
else
cp_or_cv(:ncol,:) = cpair
scaling(:ncol,:) = 1.0_r8
endif
!
! enthalpy scaling for energy consistency
!
scaling(:ncol,:) = cpairv(:ncol,:,lchnk)/cp_or_cv_dycore(:ncol,:,lchnk)
temp(1:ncol,:) = state%temp_ini(1:ncol,:)+scaling(1:ncol,:)*(state%T(1:ncol,:)-state%temp_ini(1:ncol,:))
call get_hydrostatic_energy(state%q(1:ncol,1:pver,1:pcnst),.true., &
state%pdel(1:ncol,1:pver), cp_or_cv(1:ncol,1:pver), &
Expand Down

0 comments on commit fe60b8d

Please sign in to comment.