diff --git a/Run/run.sh b/Run/run.sh index 1cbe354d3e81de851e8fe83fe341aa560aa9a08e..5c1ec77666eb9e78a3d2838271b04dc5ccf13857 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 da272af85d7e01963ac8c766b28bb31b4d188a5c..12ec74a7ee4cc0d0fe4555406160fcd7b4b9945e 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 d394e045bf3ca350dd7cfaeef3e68466fc8805ad..77c1fc152b4fbe52eb01159dba29ab1a71bec218 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 f621217ccd1db707fae454275ea9fce0dcb7df15..c52935bff19a40bf025bf5015516e763c748b3a0 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 4277d935f82bc7f590af01d3cc4f9e2a1b7710b4..5265a433cc79c51f0363b46159df3839bbcaab8e 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 d6138af671497a9893a4ae77d656335ee9a504c5..60054a8e34fd4b565280105f663144576a23c132 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