From a916e8fbcb024e1f917a18325ee73c903076225c Mon Sep 17 00:00:00 2001 From: Anne Philipp <anne.philipp@univie.ac.at> Date: Fri, 12 Jun 2020 01:14:56 +0200 Subject: [PATCH] ECMWF server output directory renamed; reformulate dapoly formula; changed template filenames; make use of config jobscript names --- Run/run.sh | 2 +- Source/Python/Mods/disaggregation.py | 14 ++++++++------ Source/Python/_config.py | 2 ++ Source/Python/install.py | 11 +++++++---- Source/Python/submit.py | 11 ++++++----- Templates/jobscript.template | 4 ++-- 6 files changed, 26 insertions(+), 18 deletions(-) diff --git a/Run/run.sh b/Run/run.sh index 1cbe354..5c1ec77 100755 --- a/Run/run.sh +++ b/Run/run.sh @@ -37,7 +37,7 @@ AREA=None INPUTDIR=None OUTPUTDIR=None PP_ID=None -JOB_TEMPLATE='jobscript.template' +JOB_TEMPLATE='submitscript.template' CONTROLFILE='CONTROL_EA5' DEBUG=0 REQUEST=2 diff --git a/Source/Python/Mods/disaggregation.py b/Source/Python/Mods/disaggregation.py index da272af..12ec74a 100644 --- a/Source/Python/Mods/disaggregation.py +++ b/Source/Python/Mods/disaggregation.py @@ -18,6 +18,9 @@ # to a new module named disaggregation # - added the new disaggregation method for precipitation # +# June 2020 - Anne Philipp (University of Vienna): +# - reformulated formular for dapoly +# # @License: # (C) Copyright 2014-2020. # Anne Philipp, Leopold Haimberger @@ -91,12 +94,11 @@ def dapoly(alist): Migration from Fortran to Python """ - - pya = (alist[3] - alist[0] + 3. * (alist[1] - alist[2])) / 6. - pyb = (alist[2] + alist[0]) / 2. - alist[1] - 9. * pya / 2. - pyc = alist[1] - alist[0] - 7. * pya / 2. - 2. * pyb - pyd = alist[0] - pya / 4. - pyb / 3. - pyc / 2. - nfield = 8. * pya + 4. * pyb + 2. * pyc + pyd + + nfield = -1./12.*alist[0] + \ + 7./12.*alist[1] + \ + 7./12.*alist[2] - \ + 1./12.*alist[3] return nfield diff --git a/Source/Python/_config.py b/Source/Python/_config.py index d394e04..77c1fc1 100644 --- a/Source/Python/_config.py +++ b/Source/Python/_config.py @@ -6,6 +6,8 @@ # @Date: August 2018 # # @Change History: +# June 2020 - Anne Philipp +# - changed template filenames to .template # # @License: # (C) Copyright 2014-2020. diff --git a/Source/Python/install.py b/Source/Python/install.py index f621217..c52935b 100755 --- a/Source/Python/install.py +++ b/Source/Python/install.py @@ -16,6 +16,11 @@ # - changed static path names to variables from config file # - splitted install function into several smaller pieces # - use of tarfile package in python +# June 2020 - Anne Philipp +# - renamed "convert" functions to "fortran" functions +# - reconfigured mk_tarball to select *.template files instead +# of *.nl and *.temp +# - added check for makefile settings # # @License: # (C) Copyright 2014-2020. @@ -372,9 +377,7 @@ def mk_tarball(tarball_path, target): testfiles = [os.path.relpath(x, ecd) for x in UioFiles(_config.PATH_REL_TEST, '*').files] tempfiles = [os.path.relpath(x, ecd) - for x in UioFiles(_config.PATH_REL_TEMPLATES, '*.temp').files] - nlfiles = [os.path.relpath(x, ecd) - for x in UioFiles(_config.PATH_REL_TEMPLATES, '*.nl').files] + for x in UioFiles(_config.PATH_REL_TEMPLATES, '*.template').files] gribtable = [os.path.relpath(x, ecd) for x in UioFiles(_config.PATH_REL_TEMPLATES, '*grib*').files] ffiles = [os.path.relpath(x, ecd) @@ -386,7 +389,7 @@ def mk_tarball(tarball_path, target): jobdir = [_config.PATH_REL_JOBSCRIPTS] # concatenate single lists to one for a better looping - filelist = pyfiles + pytestfiles + controlfiles + tempfiles + nlfiles + \ + filelist = pyfiles + pytestfiles + controlfiles + tempfiles + \ ffiles + gribtable + hfiles + makefiles + ecmwf_env_file + \ runfile + jobdir + testfiles +\ ['CODE_OF_CONDUCT.md', 'LICENSE.md', 'README.md'] diff --git a/Source/Python/submit.py b/Source/Python/submit.py index 4277d93..5265a43 100755 --- a/Source/Python/submit.py +++ b/Source/Python/submit.py @@ -20,6 +20,9 @@ # additionally, as option without submitting the mars jobs # - splitted submit function to use genshi templates for the # job script and avoid code duplication +# June 2020 - Anne Philipp +# - changed finale job_file to filename from config file +# instead of generating from the template filename # # @License: # (C) Copyright 2014-2020. @@ -71,8 +74,6 @@ from Mods.tools import (setup_controldata, normal_exit, submit_job_to_ecserver) from Mods.get_mars_data import get_mars_data from Mods.prepare_flexpart import prepare_flexpart -#from Classes.ControlFile import ControlFile - # ------------------------------------------------------------------------------ # METHODS @@ -150,7 +151,7 @@ def submit(jtemplate, c, queue): print('---- On-demand mode! ----') job_file = os.path.join(_config.PATH_JOBSCRIPTS, - jtemplate[:-5] + '.ksh') + _config.FILE_JOB_OD) # divide time periode into specified number of job chunks # to have multiple job scripts @@ -188,7 +189,7 @@ def submit(jtemplate, c, queue): print('---- Operational mode! ----') job_file = os.path.join(_config.PATH_JOBSCRIPTS, - jtemplate[:-5] + 'oper.ksh') + _config.FILE_JOB_OP) c.start_date = '${MSJ_YEAR}${MSJ_MONTH}${MSJ_DAY}' c.end_date = '${MSJ_YEAR}${MSJ_MONTH}${MSJ_DAY}' @@ -213,7 +214,7 @@ def mk_jobscript(jtemplate, job_file, clist): Parameters ---------- jtemplate : str - Job template file from sub-directory "_templates" for + Job template file from sub-directory "Templates" for submission to ECMWF. It contains all necessary module and variable settings for the ECMWF environment as well as the job call and mail report instructions. diff --git a/Templates/jobscript.template b/Templates/jobscript.template index d6138af..60054a8 100644 --- a/Templates/jobscript.template +++ b/Templates/jobscript.template @@ -48,8 +48,8 @@ case $$$${HOST} in esac cd $$$${SCRATCH} -mkdir -p python$$$$$$$$ -cd python$$$$$$$$ +mkdir -p extract$$$$$$$$ +cd extract$$$$$$$$ export CONTROL=CONTROL -- GitLab