From 028902efba03d7741c4884c7881c7d69f0f53940 Mon Sep 17 00:00:00 2001 From: lkugler <lukas.kugler@gmail.com> Date: Mon, 13 Mar 2023 15:14:13 +0100 Subject: [PATCH] minor fix --- cycled_exp.py | 4 ++-- dartwrf/utils.py | 5 ++--- dartwrf/workflows.py | 3 +-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/cycled_exp.py b/cycled_exp.py index 1561029..f365b1b 100755 --- a/cycled_exp.py +++ b/cycled_exp.py @@ -63,7 +63,7 @@ if __name__ == "__main__": # How long shall we integrate? timedelta_integrate = timedelta_btw_assim output_restart_interval = timedelta_btw_assim.total_seconds()/60 - if time == last_assim_time: #this_forecast_init.minute in [0,]: # longer forecast every full hour + if time == last_assim_time: # this_forecast_init.minute in [0,]: # longer forecast every full hour timedelta_integrate = forecast_until - last_assim_time # dt.timedelta(hours=4) output_restart_interval = 9999 # no restart file after last assim @@ -74,7 +74,7 @@ if __name__ == "__main__": depends_on=id) # as we have WRF output, we can use own exp path as prior - prior_path_exp = cluster.archivedir + prior_path_exp = w.cluster.archivedir id_sat = w.create_satimages(time, depends_on=id) diff --git a/dartwrf/utils.py b/dartwrf/utils.py index 92e66ca..0b7120b 100755 --- a/dartwrf/utils.py +++ b/dartwrf/utils.py @@ -63,10 +63,9 @@ class ClusterConfig(object): """ if self.use_slurm: from slurmpy import Slurm - Slurm(jobname, slurm_kwargs=dict(self.slurm_cfg, **cfg_update), + return Slurm(jobname, slurm_kwargs=dict(self.slurm_cfg, **cfg_update), log_dir=self.log_dir, - scripts_dir=self.slurm_scripts_dir, - **kwargs + scripts_dir=self.slurm_scripts_dir, ).run(cmd, depends_on=depends_on) else: print(cmd) diff --git a/dartwrf/workflows.py b/dartwrf/workflows.py index 89f614b..320f548 100644 --- a/dartwrf/workflows.py +++ b/dartwrf/workflows.py @@ -138,7 +138,6 @@ class WorkFlows(object): if input_is_restart: # start WRF in restart mode """ - id = depends_on restart_flag = '.false.' if not input_is_restart else '.true.' # if False: # doesnt work with restarts at the moment# first_minute: @@ -180,7 +179,7 @@ class WorkFlows(object): if output_restart_interval: args.append('--restart_interval='+str(int(float(output_restart_interval)))) - id = self.cluster.run_job(' '.join(args), "preWRF", cfg_update=dict(time="2"), depends_on=[id]) + id = self.cluster.run_job(' '.join(args), "preWRF", cfg_update=dict(time="2"), depends_on=[depends_on]) cmd = script_to_str(self.cluster.run_WRF).replace('<exp.expname>', exp.expname ).replace('<cluster.wrf_rundir_base>', self.cluster.wrf_rundir_base) -- GitLab