Skip to content

Commit

Permalink
Merge pull request #1734 from gold2718/PreFix
Browse files Browse the repository at this point in the history
Fix PRE test with the ADESP and ADESP_TEST compsets
Fix typo: datm.input_data_list -> desp.input_data_list in desp buildnml.
Moved PRE tests to driver testlist and added SOM testmods.
Add optional argument to SystemTestsCommon.component_compare_test to
test for changed files.
Update PRE test to use new feature.
Only print pause active from one PE.
Change ADESP* compsets to use DOCN%AQPSOM and change PRE test field to match.

Test suite: scripts_regression_tests.py on Cheyenne
PRE.f19_f19.ADESP and PRE.f19_f19.ADESP_TEST on Hobart
./scripts_regression_tests.py B_CheckCode on Yellowstone

Test baseline: NA
Test namelist changes: NA
Test status: bit for bit

Fixes ESMCI/CIME/#1622

User interface changes?: NA

Update gh-pages html (Y/N)?: N

Code review: jedwards
  • Loading branch information
jedwards4b authored Jul 13, 2017
2 parents 1fd77e8 + 77dc13e commit fecd52e
Show file tree
Hide file tree
Showing 13 changed files with 41 additions and 15 deletions.
2 changes: 1 addition & 1 deletion scripts/lib/CIME/SystemTests/dae.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def _case_two_setup(self):
self._case.flush()

###########################################################################
def run_phase(self):
def run_phase(self): # pylint: disable=arguments-differ
###########################################################################
# Clean up any da.log files in case this is a re-run.
self._activate_case2()
Expand Down
7 changes: 4 additions & 3 deletions scripts/lib/CIME/SystemTests/pre.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,17 @@ def _case_two_setup(self):
self._case.flush()

###########################################################################
def run_phase(self):
def run_phase(self): # pylint: disable=arguments-differ
###########################################################################
SystemTestsCompareTwo.run_phase(self)
self._activate_case2()
should_match = (self._case.get_value("DESP_MODE") == "NOCHANGE")
SystemTestsCompareTwo.run_phase(self, success_change=not should_match)
# Look for expected coupler restart files
logger = logging.getLogger(__name__)
self._activate_case1()
rundir1 = self._case.get_value("RUNDIR")
self._activate_case2()
rundir2 = self._case.get_value("RUNDIR")
should_match = (self._case.get_value("DESP_MODE") == "NOCHANGE")
compare_ok = True
pause_comps = self._case.get_value("PAUSE_COMPONENT_LIST")
expect((pause_comps != 'none'), "Pause/Resume (PRE) test has no pause components")
Expand Down
6 changes: 5 additions & 1 deletion scripts/lib/CIME/SystemTests/system_tests_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,12 +248,16 @@ def _component_compare_copy(self, suffix):
comments = copy(self._case, suffix)
append_testlog(comments)

def _component_compare_test(self, suffix1, suffix2):
def _component_compare_test(self, suffix1, suffix2, success_change=False):
"""
Return value is not generally checked, but is provided in case a custom
run case needs indirection based on success.
If success_change is True, success requires some files to be different
"""
success, comments = compare_test(self._case, suffix1, suffix2)
if success_change:
success = not success

append_testlog(comments)
status = TEST_PASS_STATUS if success else TEST_FAIL_STATUS
with self._test_status:
Expand Down
5 changes: 3 additions & 2 deletions scripts/lib/CIME/SystemTests/system_tests_compare_two.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,10 @@ def build_phase(self, sharedlib_only=False, model_only=False):
self._case2.set_value("BUILD_COMPLETE",True)
self._case2.flush()

def run_phase(self):
def run_phase(self, success_change=False): # pylint: disable=arguments-differ
"""
Runs both phases of the two-phase test and compares their results
If success_change is True, success requires some files to be different
"""

# First run
Expand All @@ -176,7 +177,7 @@ def run_phase(self):
self._activate_case1()
self._link_to_case2_output()

self._component_compare_test(self._run_one_suffix, self._run_two_suffix)
self._component_compare_test(self._run_one_suffix, self._run_two_suffix, success_change=success_change)

# ========================================================================
# Private methods
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ def run_indv(self, suffix="base", st_archive=False):
if casename not in self.run_pass_casenames:
raise RuntimeError('casename not in run_pass_casenames')

#pylint: disable=arguments-differ
def _component_compare_test(self, suffix1, suffix2):
# Trying to use the real version of _component_compare_test would pull
# too much baggage into these tests. Since the return value from this
Expand Down Expand Up @@ -395,4 +396,3 @@ def test_run2_fails(self):
# Verify
self.assertEqual(test_status.TEST_FAIL_STATUS,
mytest._test_status.get_status(test_status.RUN_PHASE))

2 changes: 1 addition & 1 deletion scripts/lib/update_acme_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"DAE.f19_f19.A",
"PET_P32.f19_f19.A",
"SMS.T42_T42.S",
"PRE.f45_g37_rx1.ADESP")
"PRE.f19_f19.ADESP")
),

#
Expand Down
2 changes: 1 addition & 1 deletion src/components/data_comps/desp/cime_config/buildnml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def _create_namelists(case, confdir, inst_string, infile, nmlgen):
# Clear out old data.
#----------------------------------------------------
data_list_path = os.path.join(case.get_case_root(), "Buildconf",
"datm.input_data_list")
"desp.input_data_list")
if os.path.exists(data_list_path):
os.remove(data_list_path)

Expand Down
2 changes: 1 addition & 1 deletion src/components/data_comps/desp/desp_comp_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ subroutine desp_comp_run(EClock, case_name, pause_sig, atm_resume, &
call get_restart_filenames(ind, cpl_resume, errcode)
allocate(rfilenames(1))
rfilenames(1) = cpl_resume
varname = 'a2x_ax_Sa_tbot'
varname = 'x2oacc_ox_Sa_pslv'
case default
call shr_sys_abort(subname//'Unrecognized ind')
end select
Expand Down
4 changes: 2 additions & 2 deletions src/drivers/mct/cime_config/config_compsets.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@

<compset>
<alias>ADESP</alias>
<lname>2000_DATM%NYF_SLND_DICE%SSMI_DOCN%DOM_DROF%NYF_SGLC_SWAV_DESP%NOOP</lname>
<lname>2000_DATM%NYF_SLND_SICE_DOCN%SOMAQP_SROF_SGLC_SWAV_DESP%NOOP</lname>
</compset>

<compset>
<alias>ADESP_TEST</alias>
<lname>2000_DATM%NYF_SLND_DICE%SSMI_DOCN%DOM_DROF%NYF_SGLC_SWAV_DESP%TEST</lname>
<lname>2000_DATM%NYF_SLND_SICE_DOCN%SOMAQP_SROF_SGLC_SWAV_DESP%TEST</lname>
</compset>

<compset>
Expand Down
18 changes: 18 additions & 0 deletions src/drivers/mct/cime_config/testdefs/testlist_drv.xml
Original file line number Diff line number Diff line change
Expand Up @@ -614,4 +614,22 @@
</machine>
</machines>
</test>
<test name="PRE" grid="f09_g17" compset="ADESP" testmods="drv/som">
<machines>
<machine name="hobart" compiler="nag" category="pauseresume"/>
</machines>
<options>
<option name="wallclock"> 00:20 </option>
</options>
</test>
<test name="PRE" grid="f09_g17" compset="ADESP_TEST" testmods="drv/som">
<machines>
<machine name="hobart" compiler="gnu" category="prealpha"/>
<machine name="hobart" compiler="nag" category="prealpha"/>
<machine name="hobart" compiler="nag" category="pauseresume"/>
</machines>
<options>
<option name="wallclock"> 00:20 </option>
</options>
</test>
</testlist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
./xmlchange DOCN_SOM_FILENAME="pop_frc.1x1d.090130.nc"

2 changes: 1 addition & 1 deletion src/drivers/mct/main/seq_io_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ module seq_io_mod

use shr_kind_mod, only: r4 => shr_kind_r4, r8 => shr_kind_r8, in => shr_kind_in
use shr_kind_mod, only: cl => shr_kind_cl, cs => shr_kind_cs
use shr_sys_mod ! system calls
use shr_sys_mod, only: shr_sys_abort
use seq_comm_mct, only: logunit, CPLID, seq_comm_setptrs
use seq_comm_mct, only: seq_comm_namelen, seq_comm_name
use seq_flds_mod, only : seq_flds_lookup
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/mct/shr/seq_timemgr_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ subroutine seq_timemgr_clockInit(SyncClock, nmlfile, restart, restart_file, pioi
(trim(pause_option) /= seq_timemgr_optNONE) .and. &
(trim(pause_option) /= seq_timemgr_optNever)) then
do n = 1, max_clocks
if (pause_active(n)) then
if (pause_active(n) .and. (iam == 0)) then
write(logunit, '(4a)') subname, ': Pause active for ', &
trim(seq_timemgr_clocks(n)),' component'
end if
Expand Down

0 comments on commit fecd52e

Please sign in to comment.