Skip to content
Snippets Groups Projects
Commit ff1e4c60 authored by Karl-Hermann Wieners's avatar Karl-Hermann Wieners
Browse files

Updated new script generation

* Change misnamed EXPNAME keyword to EXP_TYPE
parent 591e6289
No related branches found
No related tags found
No related merge requests found
......@@ -3,7 +3,7 @@
#
EXP_ID = mean_values
EXPNAME = amip-LR
EXP_TYPE = amip-LR
QUEUE_TYPE = blizzard
ACCOUNT = xy9999
......
......@@ -3,7 +3,7 @@
#
EXP_ID = old_input_data
EXPNAME = amip-LR
EXP_TYPE = amip-LR
QUEUE_TYPE = blizzard
ACCOUNT = xy9999
......
......@@ -3,7 +3,7 @@
#
EXP_ID = reference
EXPNAME = amip-LR
EXP_TYPE = amip-LR
QUEUE_TYPE = blizzard
ACCOUNT = xy9999
......
......@@ -54,11 +54,11 @@ def chmod_plus_x(file_name):
# Templates
def get_template_name(experiment_type, job_id):
def get_template_name(experiment_kind, job_id):
'''Determine script template, taking system default if type is unsupported.'''
run_template_name = os.path.join(exp_lib_dir, experiment_type+'.'+job_id+'.tmpl')
run_template_name = os.path.join(exp_lib_dir, experiment_kind+'.'+job_id+'.tmpl')
if not os.path.exists(run_template_name):
logging.warning("no %s template for '%s', using default", job_id, experiment_type)
logging.warning("no %s template for '%s', using default", job_id, experiment_kind)
run_template_name = os.path.join(exp_lib_dir, default_name+'.'+job_id+'.tmpl')
return run_template_name
......@@ -153,8 +153,8 @@ experiment_config_name = sys.argv[1]
pre_config = ConfigObj(experiment_config_name, interpolation=False)
experiment_id = pre_config['EXP_ID']
experiment_name = pre_config['EXPNAME']
experiment_type = re.sub(r'-\wR$', '', experiment_name)
experiment_type = pre_config['EXP_TYPE']
experiment_kind = re.sub(r'-\wR$', '', experiment_type)
queue_type = pre_config['QUEUE_TYPE']
pre_config = None
......@@ -171,12 +171,12 @@ lib_config_name = os.path.join(exp_lib_dir, default_name+'.config')
pre_config.merge(ConfigObj(lib_config_name, interpolation=False))
split_jobs(pre_config)
lib_config_name = os.path.join(exp_lib_dir, experiment_name+'.config')
lib_config_name = os.path.join(exp_lib_dir, experiment_type+'.config')
if os.path.exists(lib_config_name):
pre_config.merge(ConfigObj(lib_config_name, interpolation=False))
split_jobs(pre_config)
else:
logging.warning("cannot find config for '%s', using default only", experiment_name)
logging.warning("cannot find config for '%s', using default only", experiment_type)
# Re-read config to allow overriding default settings
# TODO: probably nicer if default experiment is given as argument
......@@ -238,6 +238,6 @@ for subjob, subconfig in config['jobs'].iteritems():
if 'extends' in config['JOB']:
template_job = config['JOB']['extends']
expand_template(config,
get_template_name(experiment_type, template_job),
get_template_name(experiment_kind, template_job),
get_script_name(experiment_id, subjob))
......@@ -31,7 +31,7 @@ START=%{JOB.start}
# followed by a number for the current experiment
#
EXP="%{EXP_ID}" # experiment identifier
expname="%{EXPNAME}" # experiments name
expname="%{EXP_TYPE}" # experiments name
#
RERUN=.true. # Rerun switch; .false. for initial run, .true. else
#
......
......@@ -31,7 +31,7 @@ START=%{JOB.start}
# followed by a number for the current experiment
#
EXP="%{EXP_ID}" # experiment identifier
expname="%{EXPNAME}" # experiments name
expname="%{EXP_TYPE}" # experiments name
#
RERUN=.true. # Rerun switch; .false. for initial run, .true. else
#
......
......@@ -31,7 +31,7 @@ START=%{JOB.start}
# followed by a number for the current experiment
#
EXP="%{EXP_ID}" # experiment identifier
expname="%{EXPNAME}" # experiments name
expname="%{EXP_TYPE}" # experiments name
#
RERUN=.true. # Rerun switch; .false. for initial run, .true. else
#
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment