Skip to content

Commit

Permalink
bugfix #1706 fix PhaseDiagram use case to avoid writing into INPUT_BA…
Browse files Browse the repository at this point in the history
…SE (#1708)
  • Loading branch information
georgemccabe authored Jul 26, 2022
1 parent 502ae62 commit 23bda51
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ FCST_RUN = False
# Input and Output Directories for the OBS OLR Files and output text file containing the file list
OBS_PDTIME_FMT = %Y%m%d-%H%M%S
OBS_PDTIME_INPUT_TEMPLATE = {valid?fmt=%Y%m%d-%H%M%S}
OBS_PDTIME_OUTPUT_DIR = {INPUT_BASE}/model_applications/s2s_mjo/UserScript_obsERA_obsOnly_PhaseDiagram/
OBS_PDTIME_OUTPUT_DIR = {OUTPUT_BASE}/model_applications/s2s_mjo/UserScript_obsERA_obsOnly_PhaseDiagram/
OBS_PDTIME_OUTPUT_TEMPLATE = time_list_lead{lead?fmt=%HHH}.txt


Expand All @@ -75,7 +75,7 @@ SCRIPT_OUTPUT_BASE = {OUTPUT_BASE}
PLOT_INDEX = RMM

# Input Directories
OBS_PHASE_DIAGRAM_INPUT_DIR = {OBS_PDTIME_OUTPUT_DIR}
OBS_PHASE_DIAGRAM_INPUT_DIR = {INPUT_BASE}/model_applications/s2s_mjo/UserScript_obsERA_obsOnly_PhaseDiagram

# Input filename template
OBS_PHASE_DIAGRAM_INPUT_FILE = rmm.1x.txt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
input_file = sys.argv[1]
output_file = sys.argv[2]

output_dir = os.path.dirname(output_file)
if not os.path.exists(output_dir):
print(f'Creating output dir: {output_dir}')
os.makedirs(output_dir)

filelist = open(output_file,'a+')
filelist.write(input_file + '\n')
filelist.close()

0 comments on commit 23bda51

Please sign in to comment.