From ff1e4c607d1937353eb567c749626bdd097e1de0 Mon Sep 17 00:00:00 2001 From: Karl-Hermann Wieners <karl-hermann.wieners@mpimet.mpg.de> Date: Wed, 6 Mar 2013 18:40:47 +0000 Subject: [PATCH] Updated new script generation * Change misnamed EXPNAME keyword to EXP_TYPE --- examples/mean_values.config | 2 +- examples/old_input_data.config | 2 +- examples/reference.config | 2 +- mkexp | 16 ++++++++-------- standard_experiments/DEFAULT.run.tmpl | 2 +- standard_experiments/amip.run.tmpl | 2 +- standard_experiments/sstClim.run.tmpl | 2 +- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/examples/mean_values.config b/examples/mean_values.config index 5fcb0b7..13dccea 100644 --- a/examples/mean_values.config +++ b/examples/mean_values.config @@ -3,7 +3,7 @@ # EXP_ID = mean_values -EXPNAME = amip-LR +EXP_TYPE = amip-LR QUEUE_TYPE = blizzard ACCOUNT = xy9999 diff --git a/examples/old_input_data.config b/examples/old_input_data.config index 2f53e01..16210bc 100644 --- a/examples/old_input_data.config +++ b/examples/old_input_data.config @@ -3,7 +3,7 @@ # EXP_ID = old_input_data -EXPNAME = amip-LR +EXP_TYPE = amip-LR QUEUE_TYPE = blizzard ACCOUNT = xy9999 diff --git a/examples/reference.config b/examples/reference.config index f0e1a91..05421c5 100644 --- a/examples/reference.config +++ b/examples/reference.config @@ -3,7 +3,7 @@ # EXP_ID = reference -EXPNAME = amip-LR +EXP_TYPE = amip-LR QUEUE_TYPE = blizzard ACCOUNT = xy9999 diff --git a/mkexp b/mkexp index 159bede..57b1af1 100755 --- a/mkexp +++ b/mkexp @@ -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)) diff --git a/standard_experiments/DEFAULT.run.tmpl b/standard_experiments/DEFAULT.run.tmpl index 66603a6..2d1a556 100644 --- a/standard_experiments/DEFAULT.run.tmpl +++ b/standard_experiments/DEFAULT.run.tmpl @@ -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 # diff --git a/standard_experiments/amip.run.tmpl b/standard_experiments/amip.run.tmpl index bc36239..1361d95 100644 --- a/standard_experiments/amip.run.tmpl +++ b/standard_experiments/amip.run.tmpl @@ -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 # diff --git a/standard_experiments/sstClim.run.tmpl b/standard_experiments/sstClim.run.tmpl index f9df526..a3d254f 100644 --- a/standard_experiments/sstClim.run.tmpl +++ b/standard_experiments/sstClim.run.tmpl @@ -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 # -- GitLab