From 6e0f510a53ef8ef13de0624680c74ef758fc5371 Mon Sep 17 00:00:00 2001 From: Erich L Foster Date: Fri, 5 May 2017 13:43:29 -0600 Subject: [PATCH] Fixed Issues as per @jgfouca 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, ACME-Climate/ACME#1466 User interface changes?: Added --skip-preview-namelist to case.build and template.case.run Code review: @jgfouca, @rljacob --- config/acme/machines/template.case.run | 22 +++++++++------------- config/cesm/machines/template.case.run | 22 +++++++++------------- scripts/Tools/case.submit | 2 +- scripts/lib/CIME/case_run.py | 3 ++- 4 files changed, 21 insertions(+), 28 deletions(-) diff --git a/config/acme/machines/template.case.run b/config/acme/machines/template.case.run index db8ffec65ae..38a7fd7c8e3 100755 --- a/config/acme/machines/template.case.run +++ b/config/acme/machines/template.case.run @@ -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) @@ -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 diff --git a/config/cesm/machines/template.case.run b/config/cesm/machines/template.case.run index 2fc8102b4be..03187424a96 100755 --- a/config/cesm/machines/template.case.run +++ b/config/cesm/machines/template.case.run @@ -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) @@ -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 diff --git a/scripts/Tools/case.submit b/scripts/Tools/case.submit index 1c0f973354a..e049d78af7f 100755 --- a/scripts/Tools/case.submit +++ b/scripts/Tools/case.submit @@ -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 ) diff --git a/scripts/lib/CIME/case_run.py b/scripts/lib/CIME/case_run.py index 6c6df7c492e..011ee2bf3ec 100644 --- a/scripts/lib/CIME/case_run.py +++ b/scripts/lib/CIME/case_run.py @@ -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()