diff --git a/Source/Fortran/makefile_fast b/Source/Fortran/makefile_fast index aee8a1befdf050e9d8c5c56396a93fa3876dab52..2e12c9c4746491a9dc5d4f2f347bc9534505b8c1 100644 --- a/Source/Fortran/makefile_fast +++ b/Source/Fortran/makefile_fast @@ -18,7 +18,8 @@ ECCODES_LIB = -Bstatic -leccodes_f90 -leccodes -Bdynamic -lm -ljasper EMOSLIB=-lemosR64 LIB = $(ECCODES_LIB) $(EMOSLIB) -ECCODES_INCLUDE_DIR=/usr/lib/x86_64-linux-gnu/fortran/gfortran-mod-15 +ECCODES_INCLUDE_DIR=/usr/local/include/ +#/usr/lib/x86_64-linux-gnu/fortran/gfortran-mod-15 INC = -I. -I$(ECCODES_INCLUDE_DIR) FC = gfortran diff --git a/Source/Python/Classes/ControlFile.py b/Source/Python/Classes/ControlFile.py index c570da7d14ffb090b0e742a91e4e7f107033980d..ffd4ddfbaf5a61943986872804624ef2f5236c66 100644 --- a/Source/Python/Classes/ControlFile.py +++ b/Source/Python/Classes/ControlFile.py @@ -18,8 +18,8 @@ # conditional statements and set default values ) # - divided assignment of attributes and the check of conditions # - outsourced the commandline argument assignments to control attributes -# June 202 - Petra Seibert (Univ of Vienna / BOKU) -# - update default makefile name +# June 2020 - Anne Philipp +# - update default makefile to None # # @License: # (C) Copyright 2014-2020. @@ -268,7 +268,7 @@ class ControlFile(object): makefile : str Name of the makefile to be used for the Fortran program. - Default value is 'makefile_local_gfortran'. + Default value is None. destination : str The remote destination which is used to transfer files @@ -403,7 +403,7 @@ class ControlFile(object): self.flexextractdir = _config.PATH_FLEXEXTRACT_DIR self.exedir = _config.PATH_FORTRAN_SRC self.installdir = None - self.makefile = 'makefile_local_gfortran' + self.makefile = None self.destination = None self.gateway = None self.ecuid = None diff --git a/Source/Python/_config.py b/Source/Python/_config.py index 02adfacb9051710d4277502614844230c9e46bcb..d394e045bf3ca350dd7cfaeef3e68466fc8805ad 100644 --- a/Source/Python/_config.py +++ b/Source/Python/_config.py @@ -56,13 +56,13 @@ FILE_MARS_REQUESTS = 'mars_requests.csv' FORTRAN_EXECUTABLE = 'calc_etadot' TEMPFILE_USER_ENVVARS = 'ECMWF_ENV.template' FILE_USER_ENVVARS = 'ECMWF_ENV' -TEMPFILE_INSTALL_COMPILEJOB = 'compilejob.template' +TEMPFILE_INSTALL_COMPILEJOB = 'installscript.template' FILE_INSTALL_COMPILEJOB = 'compilejob.ksh' -TEMPFILE_INSTALL_JOB = 'job.template' -TEMPFILE_JOB = 'job.temp' +TEMPFILE_INSTALL_JOB = 'jobscript.template' +TEMPFILE_JOB = 'submitscript.template' FILE_JOB_OD = 'job.ksh' FILE_JOB_OP = 'jopoper.ksh' -TEMPFILE_NAMELIST = 'convert.nl' +TEMPFILE_NAMELIST = 'calc_etadot_nml.template' FILE_NAMELIST = 'fort.4' FILE_GRIB_INDEX = 'date_time_stepRange.idx' FILE_GRIBTABLE = 'ecmwf_grib1_table_128' diff --git a/Source/Python/install.py b/Source/Python/install.py index d96e45de233ee9a7c85929d4b0747a85c34dd2d1..f621217ccd1db707fae454275ea9fce0dcb7df15 100755 --- a/Source/Python/install.py +++ b/Source/Python/install.py @@ -12,7 +12,7 @@ # - added documentation # - moved install_args_and_control in here # - splitted code in smaller functions -# - delete convert build files in here instead of compile job script +# - delete fortran build files in here instead of compile job script # - changed static path names to variables from config file # - splitted install function into several smaller pieces # - use of tarfile package in python @@ -38,8 +38,8 @@ # mk_env_vars # mk_compilejob # mk_job_template -# del_convert_build -# mk_convert_build +# del_fortran_build +# mk_fortran_build # #******************************************************************************* '''This script installs the flex_extract program. @@ -242,13 +242,13 @@ def install_local(c): _config.FLEXEXTRACT_DIRNAME, _config.PATH_REL_FORTRAN_SRC)) - # Create Fortran executable - CONVERT2 + # Create Fortran executable print('Install ' + _config.FLEXEXTRACT_DIRNAME + ' software at ' + c.install_target + ' in directory ' + os.path.abspath(c.installdir) + '\n') - del_convert_build('.') - mk_convert_build('.', c.makefile) + del_fortran_build('.') + mk_fortran_build('.', c.makefile) os.chdir(_config.PATH_FLEXEXTRACT_DIR) if os.path.isfile(tar_file): @@ -303,6 +303,21 @@ def check_install_conditions(c): if not c.installdir: c.installdir = _config.PATH_FLEXEXTRACT_DIR + if not c.makefile: + print('WARNING: no makefile was specified.') + if c.install_target == 'local': + c.makefile = 'makefile_local_gfortran' + print('WARNING: default makefile selected: makefile_local_gfortan') + elif c.install_target == 'ecgate': + c.makefile = 'makefile_ecgate' + print('WARNING: default makefile selected: makefile_ecgate') + elif c.install_target == 'cca' or \ + c.install_target == 'ccb': + c.makefile = 'makefile_cray' + print('WARNING: default makefile selected: makefile_cray') + else: + pass + return @@ -497,7 +512,7 @@ def mk_compilejob(makefile, ecuid, ecgid, fp_root): ---------- makefile : str Name of the makefile which should be used to compile FORTRAN - CONVERT2 program. + program. ecuid : str The user id on ECMWF server. @@ -632,9 +647,9 @@ def mk_job_template(ecuid, ecgid, fp_root): return -def del_convert_build(src_path): +def del_fortran_build(src_path): '''Clean up the Fortran source directory and remove all - build files (e.g. \*.o, \*.mod and CONVERT2) + build files (e.g. \*.o, \*.mod and FORTRAN EXECUTABLE) Parameters ---------- @@ -656,7 +671,7 @@ def del_convert_build(src_path): return -def mk_convert_build(src_path, makefile): +def mk_fortran_build(src_path, makefile): '''Compiles the Fortran code and generates the executable. Parameters @@ -685,14 +700,14 @@ def mk_convert_build(src_path, makefile): if p.returncode != 0: print(perr.decode()) print('Please edit ' + makefile + - ' or try another Makefile in the src directory.') - print('Most likely GRIB_API_INCLUDE_DIR, GRIB_API_LIB ' + ' or try another makefile in the src directory.') + print('Most likely ECCODES_INCLUDE_DIR, ECCODES_LIB ' 'and EMOSLIB must be adapted.') - print('Available Makefiles:') - print(UioFiles(src_path, 'Makefile*')) + print('Available makefiles:') + print(UioFiles(src_path, 'makefile*')) sys.exit('Compilation failed!') except ValueError as e: - print('ERROR: Makefile call failed:') + print('ERROR: makefile call failed:') print(e) else: execute_subprocess(['ls', '-l', diff --git a/Source/Python/submit.py b/Source/Python/submit.py index 3f3a6591c5c30f8562f004999fb4da12dcf32ad9..4277d935f82bc7f590af01d3cc4f9e2a1b7710b4 100755 --- a/Source/Python/submit.py +++ b/Source/Python/submit.py @@ -128,7 +128,7 @@ def submit(jtemplate, c, queue): 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. - Default is "job.temp". + Default is _config.TEMPFILE_JOB. c : ControlFile Contains all the parameters of CONTROL file and @@ -217,7 +217,7 @@ def mk_jobscript(jtemplate, job_file, clist): 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. - Default is "job.temp". + Default is _config.TEMPFILE_JOB. job_file : str Path to the job script file. diff --git a/Templates/convert.nl b/Templates/calc_etadot_nml.template similarity index 100% rename from Templates/convert.nl rename to Templates/calc_etadot_nml.template diff --git a/Templates/compilejob.template b/Templates/installscript.template similarity index 100% rename from Templates/compilejob.template rename to Templates/installscript.template diff --git a/Templates/job.template b/Templates/jobscript.template similarity index 100% rename from Templates/job.template rename to Templates/jobscript.template diff --git a/Templates/job.temp b/Templates/submitscript.template similarity index 91% rename from Templates/job.temp rename to Templates/submitscript.template index 77950192593d616bc870690fa2388124d61ec808..214608bff7cb9b417a74f716538cb9ec378ed858 100644 --- a/Templates/job.temp +++ b/Templates/submitscript.template @@ -24,7 +24,7 @@ ##PBS -l EC_memory_per_task=32000MB set -x -export VERSION=7.1 +export VERSION=7.1.1 case $${HOST} in *ecg*) module unload grib_api @@ -34,7 +34,7 @@ case $${HOST} in module load python3/3.6.8-01 module load eccodes/2.13.0 module load emos/455-r64 - export PATH=$${PATH}:$${HOME}/flex_extract_v7.1/Source/Python + export PATH=$${PATH}:$${HOME}/flex_extract_v7.1.1/Source/Python ;; *cca*) module unload python @@ -43,7 +43,7 @@ case $${HOST} in module load eccodes/2.13.0 module load emos/455-r64 export SCRATCH=$${TMPDIR} - export PATH=$${PATH}:$${HOME}/flex_extract_v7.1/Source/Python + export PATH=$${PATH}:$${HOME}/flex_extract_v7.1.1/Source/Python ;; esac diff --git a/setup.sh b/setup.sh index ba5069a4717b38b7c487baaef9ddd3bc0769ba8e..64b055f421e3814b5a4e7ce64e6de04c1867e75e 100755 --- a/setup.sh +++ b/setup.sh @@ -11,7 +11,7 @@ # guarantee necessary parameters were set. # # @Licence: -# (C) Copyright 2014-2019. +# (C) Copyright 2014-2020. # # SPDX-License-Identifier: CC-BY-4.0 #