Skip to content

Commit

Permalink
Fixed Issues as per @jgfouca
Browse files Browse the repository at this point in the history
Fixed some indentation inconsistencies, removed the tuple from usage in
parser, fixed logical for skip_pnl and continue_run, and finally fixed
some consistency in strings.

Test suite: scripts_regression_tests.py
Test baseline:
Test namelist changes:
Test status: bit for bit

Fixes #1276, E3SM-Project/E3SM#1466

User interface changes?:
Added --skip-preview-namelist to case.build and
template.case.run

Code review: @jgfouca, @rljacob
  • Loading branch information
Erich L Foster committed May 9, 2017
1 parent 668be81 commit 6e0f510
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 28 deletions.
22 changes: 9 additions & 13 deletions config/acme/machines/template.case.run
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,19 @@ import argparse, doctest
def parse_command_line(args, description):
###############################################################################
parser = argparse.ArgumentParser(
usage="""\n{} [--verbose]
usage="""\n{0} [--verbose]
OR
{} --help
{0} --help
OR
{} --test
{0} --test
\033[1mEXAMPLES:\033[0m
\033[1;32m# case.run SMS\033[0m
> {}
""".format(((os.path.basename(args[0]), ) * 4),

description=description,

formatter_class=argparse.ArgumentDefaultsHelpFormatter
))

parser = argparse.ArgumentParser()
> {0}
""".format(os.path.basename(args[0])),
description=description,
formatter_class=argparse.ArgumentDefaultsHelpFormatter
)

CIME.utils.setup_standard_logging_options(parser)

Expand All @@ -63,7 +59,7 @@ formatter_class=argparse.ArgumentDefaultsHelpFormatter
os.chdir(args.caseroot)

if args.skip_preview_namelist is None:
args.skip_preview_namelist = False
args.skip_preview_namelist = False

return args.caseroot, args.skip_preview_namelist

Expand Down
22 changes: 9 additions & 13 deletions config/cesm/machines/template.case.run
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,19 @@ import argparse, doctest
def parse_command_line(args, description):
###############################################################################
parser = argparse.ArgumentParser(
usage="""\n%s [--verbose]
usage="""\n{0} [--verbose]
OR
%s --help
{0} --help
OR
%s --test
{0} --test
\033[1mEXAMPLES:\033[0m
\033[1;32m# case.run SMS\033[0m
> %s
""" % ((os.path.basename(args[0]), ) * 4),

description=description,

formatter_class=argparse.ArgumentDefaultsHelpFormatter
)

parser = argparse.ArgumentParser()
> {0}
""".format(os.path.basename(args[0])),
description=description,
formatter_class=argparse.ArgumentDefaultsHelpFormatter
)

CIME.utils.setup_standard_logging_options(parser)

Expand All @@ -61,7 +57,7 @@ formatter_class=argparse.ArgumentDefaultsHelpFormatter
os.chdir(args.caseroot)

if args.skip_preview_namelist is None:
args.skip_preview_namelist = False
args.skip_preview_namelist = False

return args.caseroot, args.skip_preview_namelist

Expand Down
2 changes: 1 addition & 1 deletion scripts/Tools/case.submit
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ OR
\033[1mEXAMPLES:\033[0m
\033[1;32m# Setup case \033[0m
> {0}
""".format(os.path.basename(args[0], )),
""".format(os.path.basename(args[0])),
description=description,
formatter_class=argparse.ArgumentDefaultsHelpFormatter
)
Expand Down
3 changes: 2 additions & 1 deletion scripts/lib/CIME/case_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,9 @@ def _run_model_impl(case, lid, skip_pnl=False):
restore_from_archive(case)

orig_cont = case.get_value("CONTINUE_RUN")
if not (orig_cont or skip_pnl):
if not orig_cont:
case.set_value("CONTINUE_RUN", True)
if not skip_pnl:
create_namelists(case)

lid = new_lid()
Expand Down

0 comments on commit 6e0f510

Please sign in to comment.