Skip to content

Commit

Permalink
make prerun script check for previously existing directories
Browse files Browse the repository at this point in the history
  • Loading branch information
teopb committed Dec 14, 2023
1 parent 5233ec5 commit 8df590c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions MPAS_true_failure_testing/pre_run_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,9 @@ def main(argv):

# create empty directories for outputs
output_folder = test_output_dir + f"/{var_name}_perturb_neg{order}"
os.mkdir(output_folder)
os.mkdir(output_folder + "/history_files")
if not os.path.exists(output_folder):
os.mkdir(output_folder)
os.mkdir(output_folder + "/history_files")

# modify namelist params
mod_nml[namelist_preface][var_name] = default_var_value * (1 - 10.**order)
Expand All @@ -118,8 +119,9 @@ def main(argv):

# create empty directories for outputs
output_folder = test_output_dir + f"/{var_name}_perturb_{order}"
os.mkdir(output_folder)
os.mkdir(output_folder + "/history_files")
if not os.path.exists(output_folder):
os.mkdir(output_folder)
os.mkdir(output_folder + "/history_files")

# modify namelist params
mod_nml[namelist_preface][var_name] = default_var_value * (1 + 10.**order)
Expand Down

0 comments on commit 8df590c

Please sign in to comment.