diff --git a/Source/Python/Classes/ControlFile.py b/Source/Python/Classes/ControlFile.py index da0ff93b94474e820c7036ad190e60b18ae259da..c570da7d14ffb090b0e742a91e4e7f107033980d 100644 --- a/Source/Python/Classes/ControlFile.py +++ b/Source/Python/Classes/ControlFile.py @@ -22,7 +22,7 @@ # - update default makefile name # # @License: -# (C) Copyright 2014-2019. +# (C) Copyright 2014-2020. # Anne Philipp, Leopold Haimberger # # SPDX-License-Identifier: CC-BY-4.0 diff --git a/Source/Python/Classes/EcFlexpart.py b/Source/Python/Classes/EcFlexpart.py index 067806772e1dd6a9d0770439f42da7ea8715084b..09e6f35c68e55a515dc536a5c565264506048e3c 100644 --- a/Source/Python/Classes/EcFlexpart.py +++ b/Source/Python/Classes/EcFlexpart.py @@ -38,7 +38,7 @@ # duplication, easier testing) # # @License: -# (C) Copyright 2014-2019. +# (C) Copyright 2014-2020. # Anne Philipp, Leopold Haimberger # # SPDX-License-Identifier: CC-BY-4.0 diff --git a/Source/Python/Classes/GribUtil.py b/Source/Python/Classes/GribUtil.py index 809544e0397b28a2ea32735421add16746ab0bec..a4c7bbca6166cf6a7c9f4975bef6ca0e222cd77d 100644 --- a/Source/Python/Classes/GribUtil.py +++ b/Source/Python/Classes/GribUtil.py @@ -12,7 +12,7 @@ # - changed some naming # # @License: -# (C) Copyright 2014-2019. +# (C) Copyright 2014-2020. # Anne Philipp, Leopold Haimberger # # SPDX-License-Identifier: CC-BY-4.0 diff --git a/Source/Python/Classes/MarsRetrieval.py b/Source/Python/Classes/MarsRetrieval.py index 105f9b95b5d9f1f23752b81b946295be038ad8a3..007322155b96fe69b211b9ab3ae7b86280a2824c 100644 --- a/Source/Python/Classes/MarsRetrieval.py +++ b/Source/Python/Classes/MarsRetrieval.py @@ -19,7 +19,7 @@ # - added writing of mars request attributes to a csv file # # @License: -# (C) Copyright 2014-2019. +# (C) Copyright 2014-2020. # Anne Philipp, Leopold Haimberger # # SPDX-License-Identifier: CC-BY-4.0 diff --git a/Source/Python/Classes/UioFiles.py b/Source/Python/Classes/UioFiles.py index 0fe9448a9b97d4192688f3ba21e14eb9236235dd..f3e5a7ce2e22dea67b5ba241b7ffcee67c825c2f 100644 --- a/Source/Python/Classes/UioFiles.py +++ b/Source/Python/Classes/UioFiles.py @@ -22,7 +22,7 @@ # - added delete method # # @License: -# (C) Copyright 2014-2019. +# (C) Copyright 2014-2020. # Anne Philipp, Leopold Haimberger # # SPDX-License-Identifier: CC-BY-4.0 diff --git a/Source/Python/Classes/__init__.py b/Source/Python/Classes/__init__.py index c44e32301dd7d73dac05abfef800984e01266407..0d9bde9a1b2920dc905c2aaaa42b6b9bad138354 100644 --- a/Source/Python/Classes/__init__.py +++ b/Source/Python/Classes/__init__.py @@ -6,9 +6,14 @@ # @Date: September 2018 # # @License: -# (C) Copyright 2015-2018. +# (C) Copyright 2014-2020. +# Anne Philipp, Leopold Haimberger # -# This software is licensed under the terms of the Apache Licence Version 2.0 -# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. +# SPDX-License-Identifier: CC-BY-4.0 +# +# This work is licensed under the Creative Commons Attribution 4.0 +# International License. To view a copy of this license, visit +# http://creativecommons.org/licenses/by/4.0/ or send a letter to +# Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. # #******************************************************************************* diff --git a/Source/Python/Mods/__init__.py b/Source/Python/Mods/__init__.py index c44e32301dd7d73dac05abfef800984e01266407..0d9bde9a1b2920dc905c2aaaa42b6b9bad138354 100644 --- a/Source/Python/Mods/__init__.py +++ b/Source/Python/Mods/__init__.py @@ -6,9 +6,14 @@ # @Date: September 2018 # # @License: -# (C) Copyright 2015-2018. +# (C) Copyright 2014-2020. +# Anne Philipp, Leopold Haimberger # -# This software is licensed under the terms of the Apache Licence Version 2.0 -# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. +# SPDX-License-Identifier: CC-BY-4.0 +# +# This work is licensed under the Creative Commons Attribution 4.0 +# International License. To view a copy of this license, visit +# http://creativecommons.org/licenses/by/4.0/ or send a letter to +# Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. # #******************************************************************************* diff --git a/Source/Python/Mods/checks.py b/Source/Python/Mods/checks.py index 5e0c65c3d6f13131d390ffbba6f70b49c999fd3c..d6d5b8f9849a59be39c7c2cf4ef324fd6c5ee10b 100644 --- a/Source/Python/Mods/checks.py +++ b/Source/Python/Mods/checks.py @@ -8,7 +8,7 @@ # @Change History: # # @License: -# (C) Copyright 2014-2019. +# (C) Copyright 2014-2020. # Anne Philipp, Leopold Haimberger # # SPDX-License-Identifier: CC-BY-4.0 diff --git a/Source/Python/Mods/disaggregation.py b/Source/Python/Mods/disaggregation.py index 5a3561928bd4a6e5b0c90ab44a1f28a13c3264c7..da272af85d7e01963ac8c766b28bb31b4d188a5c 100644 --- a/Source/Python/Mods/disaggregation.py +++ b/Source/Python/Mods/disaggregation.py @@ -19,7 +19,7 @@ # - added the new disaggregation method for precipitation # # @License: -# (C) Copyright 2014-2019. +# (C) Copyright 2014-2020. # Anne Philipp, Leopold Haimberger # # SPDX-License-Identifier: CC-BY-4.0 diff --git a/Source/Python/Mods/get_mars_data.py b/Source/Python/Mods/get_mars_data.py index ecdb311f8b4cbf3661fa0be9987e36062d135c22..114cc025393f32a159669a400f2987a99021a2c8 100755 --- a/Source/Python/Mods/get_mars_data.py +++ b/Source/Python/Mods/get_mars_data.py @@ -25,7 +25,7 @@ # write_reqheader, mk_server, mk_dates, remove_old, do_retrievment # # @License: -# (C) Copyright 2014-2019. +# (C) Copyright 2014-2020. # Anne Philipp, Leopold Haimberger # # SPDX-License-Identifier: CC-BY-4.0 diff --git a/Source/Python/Mods/prepare_flexpart.py b/Source/Python/Mods/prepare_flexpart.py index 57323245dfadc05b833b2090964a39c6b506dafa..d6e99f6215b77516fb79bf370368ecf62523e0a1 100755 --- a/Source/Python/Mods/prepare_flexpart.py +++ b/Source/Python/Mods/prepare_flexpart.py @@ -28,7 +28,7 @@ # arguments and prepare_flexpart into it # # @License: -# (C) Copyright 2014-2019. +# (C) Copyright 2014-2020. # Anne Philipp, Leopold Haimberger # # SPDX-License-Identifier: CC-BY-4.0 diff --git a/Source/Python/Mods/profiling.py b/Source/Python/Mods/profiling.py index 043937748085da8cbf99d906e21ac106ebab1069..308db40e7d8294c8bc90fed6956ed5e5ce43d3ce 100644 --- a/Source/Python/Mods/profiling.py +++ b/Source/Python/Mods/profiling.py @@ -11,7 +11,7 @@ # @Date: March 2018 # # @License: -# (C) Copyright 2018. +# (C) Copyright 2020. # # This software is licensed under the terms of the Apache Licence Version 2.0 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. diff --git a/Source/Python/Mods/tools.py b/Source/Python/Mods/tools.py index 7888926bc9b14abe78d494d7dcd9819590b5d5b9..df0af4ec8d483cf19af85a11858892a0bf2d76e0 100644 --- a/Source/Python/Mods/tools.py +++ b/Source/Python/Mods/tools.py @@ -23,7 +23,7 @@ # get_dimensions, execute_subprocess, none_or_int, none_or_str # # @License: -# (C) Copyright 2014-2019. +# (C) Copyright 2014-2020. # Anne Philipp, Leopold Haimberger # # SPDX-License-Identifier: CC-BY-4.0 diff --git a/Source/Python/__init__.py b/Source/Python/__init__.py index c44e32301dd7d73dac05abfef800984e01266407..0d9bde9a1b2920dc905c2aaaa42b6b9bad138354 100644 --- a/Source/Python/__init__.py +++ b/Source/Python/__init__.py @@ -6,9 +6,14 @@ # @Date: September 2018 # # @License: -# (C) Copyright 2015-2018. +# (C) Copyright 2014-2020. +# Anne Philipp, Leopold Haimberger # -# This software is licensed under the terms of the Apache Licence Version 2.0 -# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. +# SPDX-License-Identifier: CC-BY-4.0 +# +# This work is licensed under the Creative Commons Attribution 4.0 +# International License. To view a copy of this license, visit +# http://creativecommons.org/licenses/by/4.0/ or send a letter to +# Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. # #******************************************************************************* diff --git a/Source/Python/_config.py b/Source/Python/_config.py index f7907c35329ade8838b8978862b542a8a7179507..02adfacb9051710d4277502614844230c9e46bcb 100644 --- a/Source/Python/_config.py +++ b/Source/Python/_config.py @@ -8,7 +8,7 @@ # @Change History: # # @License: -# (C) Copyright 2014-2019. +# (C) Copyright 2014-2020. # Anne Philipp, Leopold Haimberger # # SPDX-License-Identifier: CC-BY-4.0 diff --git a/Source/Python/_config.py~ b/Source/Python/_config.py~ new file mode 100644 index 0000000000000000000000000000000000000000..82b7bc0883ad7b67e87003258a2deb02c7914dfe --- /dev/null +++ b/Source/Python/_config.py~ @@ -0,0 +1,120 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +#******************************************************************************* +# @Author: Anne Philipp (University of Vienna) +# +# @Date: August 2018 +# +# @Change History: +# +# @License: +# (C) Copyright 2014-2019. +# Anne Philipp, Leopold Haimberger +# +# SPDX-License-Identifier: CC-BY-4.0 +# +# This work is licensed under the Creative Commons Attribution 4.0 +# International License. To view a copy of this license, visit +# http://creativecommons.org/licenses/by/4.0/ or send a letter to +# Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. +#******************************************************************************* +'''Configurations for flex_extract. + +Defines a couple of global constant parameters as well as filenames +and pathes. +''' +# ------------------------------------------------------------------------------ +# MODULES +# ------------------------------------------------------------------------------ +import os +import sys +import inspect +import platform + +# ------------------------------------------------------------------------------ +# PARAMETERS +# ------------------------------------------------------------------------------ + +_VERSION_STR = '7.1' + +FLAG_ON_ECMWFSERVER = 'ecgb' in platform.node() + +QUEUES_LIST = ['ecgate', 'cca', 'ccb'] + +INSTALL_TARGETS = ['local', 'ecgate', 'cca', 'ccb'] + +CDS_DATASET = 'reanalysis-era5-complete' + +# up-to-date available maximum level numbers at ECMWF, 05.10.2018 +MAX_LEVEL_LIST = [16, 19, 31, 40, 50, 60, 62, 91, 137] + +# ------------------------------------------------------------------------------ +# FILENAMES +# ------------------------------------------------------------------------------ + +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' +FILE_INSTALL_COMPILEJOB = 'compilejob.ksh' +TEMPFILE_INSTALL_JOB = 'job.template' +TEMPFILE_JOB = 'job.temp' +FILE_JOB_OD = 'job.ksh' +FILE_JOB_OP = 'jopoper.ksh' +TEMPFILE_NAMELIST = 'convert.nl' +FILE_NAMELIST = 'fort.4' +FILE_GRIB_INDEX = 'date_time_stepRange.idx' +FILE_GRIBTABLE = 'ecmwf_grib1_table_128' + +# ------------------------------------------------------------------------------ +# DIRECTORY NAMES +# ------------------------------------------------------------------------------ + +FLEXEXTRACT_DIRNAME = 'flex_extract_v' + _VERSION_STR +INPUT_DIRNAME_DEFAULT = 'Workspace' + +# ------------------------------------------------------------------------------ +# PATHES +# ------------------------------------------------------------------------------ + +# path to the local python source files +# first thing to get because the submitted python script starts in here +PATH_LOCAL_PYTHON = os.path.dirname(os.path.abspath( + inspect.getfile(inspect.currentframe()))) +# add path to pythonpath +if PATH_LOCAL_PYTHON not in sys.path: + sys.path.append(PATH_LOCAL_PYTHON) +PATH_FLEXEXTRACT_DIR = os.path.normpath(os.path.dirname(os.path.abspath( + inspect.getfile(inspect.currentframe()))) + '/../../') +PATH_RUN_DIR = os.path.join(PATH_FLEXEXTRACT_DIR, 'Run') +PATH_SOURCES = os.path.join(PATH_FLEXEXTRACT_DIR, 'Source') +PATH_TEMPLATES = os.path.join(PATH_FLEXEXTRACT_DIR, 'Templates') +PATH_ECMWF_ENV = os.path.join(PATH_RUN_DIR, FILE_USER_ENVVARS) +PATH_GRIBTABLE = os.path.join(PATH_TEMPLATES, FILE_GRIBTABLE) +PATH_JOBSCRIPTS = os.path.join(PATH_RUN_DIR, 'Jobscripts') +PATH_FORTRAN_SRC = os.path.join(PATH_SOURCES, 'Fortran') +PATH_PYTHONTEST_SRC = os.path.join(PATH_SOURCES, 'Pythontest') +PATH_INPUT_DIR = os.path.join(PATH_RUN_DIR, INPUT_DIRNAME_DEFAULT) +PATH_TEST = os.path.join(PATH_FLEXEXTRACT_DIR, 'Testing') +if os.getenv('CONTROL'): + # this is only needed if (gateway) version with job script is used! + # because job is directly submitted from SCRATCH and because the + # CONTROL file is stored there, the normal path is not valid. + PATH_CONTROLFILES = '.' +else: + PATH_CONTROLFILES = os.path.join(PATH_RUN_DIR, 'Control') +# +# ------------------------------------------------------------------------------ +# RELATIVE PATHES FOR INSTALLATION TAR-BALL +# ------------------------------------------------------------------------------ + +PATH_REL_PYTHON_SRC = os.path.relpath(PATH_LOCAL_PYTHON, PATH_FLEXEXTRACT_DIR) +PATH_REL_PYTHONTEST_SRC = os.path.relpath(PATH_PYTHONTEST_SRC, PATH_FLEXEXTRACT_DIR) +PATH_REL_CONTROLFILES = os.path.relpath(PATH_CONTROLFILES, PATH_FLEXEXTRACT_DIR) +PATH_REL_TEMPLATES = os.path.relpath(PATH_TEMPLATES, PATH_FLEXEXTRACT_DIR) +PATH_REL_ECMWF_ENV = os.path.relpath(PATH_ECMWF_ENV, PATH_FLEXEXTRACT_DIR) +PATH_REL_RUN_DIR = os.path.relpath(PATH_RUN_DIR, PATH_FLEXEXTRACT_DIR) +PATH_REL_JOBSCRIPTS = os.path.relpath(PATH_JOBSCRIPTS, PATH_FLEXEXTRACT_DIR) +PATH_REL_FORTRAN_SRC = os.path.relpath(PATH_FORTRAN_SRC, PATH_FLEXEXTRACT_DIR) +PATH_REL_TEST = os.path.relpath(PATH_TEST, PATH_FLEXEXTRACT_DIR) diff --git a/Source/Python/install.py b/Source/Python/install.py index 2ed782b2636344fb930ebdc98ca9d4fa8c3c79ca..d96e45de233ee9a7c85929d4b0747a85c34dd2d1 100755 --- a/Source/Python/install.py +++ b/Source/Python/install.py @@ -18,7 +18,7 @@ # - use of tarfile package in python # # @License: -# (C) Copyright 2014-2019. +# (C) Copyright 2014-2020. # Anne Philipp, Leopold Haimberger # # SPDX-License-Identifier: CC-BY-4.0 diff --git a/Source/Python/submit.py b/Source/Python/submit.py index 885c030f601eb1112d85026ec5bd667bbf9dd7d5..3f3a6591c5c30f8562f004999fb4da12dcf32ad9 100755 --- a/Source/Python/submit.py +++ b/Source/Python/submit.py @@ -22,7 +22,7 @@ # job script and avoid code duplication # # @License: -# (C) Copyright 2014-2019. +# (C) Copyright 2014-2020. # Anne Philipp, Leopold Haimberger # # SPDX-License-Identifier: CC-BY-4.0