Skip to content

Commit

Permalink
Adapt function parameters for other jobs and cfg_variables
Browse files Browse the repository at this point in the history
  • Loading branch information
mjaehn committed Oct 30, 2023
1 parent 9a8b790 commit a5ea616
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 9 deletions.
3 changes: 1 addition & 2 deletions jobs/cosmo.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
from datetime import datetime, timedelta


def set_cfg_variables(cfg, model_cfg):

def set_cfg_variables(startdate, enddate, cfg, model_cfg):
setattr(cfg, 'cosmo_base', os.path.join(cfg.chain_root, 'cosmo'))
setattr(cfg, 'cosmo_input', os.path.join(cfg.chain_root, 'cosmo', 'input'))
setattr(cfg, 'cosmo_run', os.path.join(cfg.chain_root, 'cosmo', 'run'))
Expand Down
2 changes: 1 addition & 1 deletion jobs/icon.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from datetime import timedelta


def main(starttime, hstart, hstop, cfg, model_cfg):
def main(startdate, enddate, cfg, model_cfg):
"""Setup the namelists for an **ICON** tracer run and submit the job to
the queue
Expand Down
4 changes: 2 additions & 2 deletions jobs/int2lm.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from . import tools, prepare_data


def set_cfg_variables(cfg, starttime, hstart):
def set_cfg_variables(startdate, enddate, cfg, model_cfg):

setattr(cfg, 'int2lm_run', os.path.join(cfg.chain_root, 'int2lm', 'run'))
setattr(cfg, 'int2lm_output',
Expand All @@ -29,7 +29,7 @@ def set_cfg_variables(cfg, starttime, hstart):
return cfg


def main(starttime, hstart, hstop, cfg, model_cfg):
def main(startdate, enddate, cfg, model_cfg):
"""Setup the namelist for **int2lm** and submit the job to the queue.
Necessary for both **COSMO** and **COSMOART** simulations.
Expand Down
2 changes: 1 addition & 1 deletion jobs/obs_nudging.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from . import tools


def main(starttime, hstart, hstop, cfg, model_cfg):
def main(startdate, enddate, cfg, model_cfg):
"""Copy and rename the obs_nudging files to the **COSMO** input directory.
In the folder ``cfg.obs_nudging_dir``, the files are saved in the format
Expand Down
2 changes: 1 addition & 1 deletion jobs/octe.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def perturb_bgs_in_dir(lambdas_nc, directory):
entry.name))


def main(starttime, hstart, hstop, cfg, model_cfg):
def main(startdate, enddate, cfg, model_cfg):
"""Copy necessary input files for **COSMO** and perturb BG.
Copies the NetCDF-files found at cfg.octe_maps and cfg.octe_lambdas to
Expand Down
3 changes: 1 addition & 2 deletions jobs/prepare_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@
from calendar import monthrange


def set_cfg_variables(cfg, startdate, enddate):

def set_cfg_variables(startdate, enddate, cfg, model_cfg):
# TODO: Change setattr() to direct assignment
if cfg.model.startswith('cosmo'):
setattr(cfg, 'int2lm_root', os.path.join(cfg.chain_root, 'int2lm'))
Expand Down

0 comments on commit a5ea616

Please sign in to comment.