From 392e29e20dae316f878eaa902098f40ccb9bd14c Mon Sep 17 00:00:00 2001 From: "Edgar P. Burkhart" Date: Tue, 29 Mar 2022 09:43:23 +0200 Subject: [PATCH] Add config files for spec+spec_nb, make output directory parent --- swash/config-nb.ini | 20 ++++++++++++++++++++ swash/config.ini | 11 +++-------- swash/processing/swash.py | 1 + 3 files changed, 24 insertions(+), 8 deletions(-) create mode 100644 swash/config-nb.ini diff --git a/swash/config-nb.ini b/swash/config-nb.ini new file mode 100644 index 0000000..66c13c0 --- /dev/null +++ b/swash/config-nb.ini @@ -0,0 +1,20 @@ +[data] +out=../data/out_nb + +[swash] +input=sws/SPEC_buoy_nb.sws +path=/opt/swash +out=out/spec_nb +mpi=8 + +[post] +inp=inp_post +compare=inp_post_nb +out=out_post +#nperseg=1024 +dt=0.25 +x0=-1250 +t0=180 + +[plot] +out=out_plt diff --git a/swash/config.ini b/swash/config.ini index 479dfea..39792c7 100644 --- a/swash/config.ini +++ b/swash/config.ini @@ -1,16 +1,11 @@ -[proc] -#plot=True - [data] out=../data/out -out_nb=../data/out [swash] -nb=True -input=sws/INPUT.sws +input=sws/SPEC_buoy.sws path=/opt/swash -out=out_sws -mpi=4 +out=out/spec +mpi=8 [post] inp=inp_post diff --git a/swash/processing/swash.py b/swash/processing/swash.py index 814c8b0..c47aadb 100644 --- a/swash/processing/swash.py +++ b/swash/processing/swash.py @@ -25,6 +25,7 @@ out = pathlib.Path(config.get("swash", "out")) if out.exists(): log.error(f"Swash output '{out}' already exists") sys.exit(1) +out.parent.mkdir(parents=True, exist_ok=True) with tempfile.TemporaryDirectory(prefix="swash_", dir=".") as tmp_raw: tmpdir = pathlib.Path(tmp_raw)