From d8785f85ebf5d00c87a7a37eec240b966a17d48d Mon Sep 17 00:00:00 2001 From: Anne Philipp <anne.philipp@univie.ac.at> Date: Tue, 27 Nov 2018 23:04:16 +0100 Subject: [PATCH] moved max level list definition to config file --- source/python/_config.py | 3 +++ source/python/classes/ControlFile.py | 6 ++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/source/python/_config.py b/source/python/_config.py index cbe125a..1b9339e 100644 --- a/source/python/_config.py +++ b/source/python/_config.py @@ -31,6 +31,9 @@ _VERSION_STR = '7.1' QUEUES_LIST = ['ecgate', 'cca', 'ccb'] +# 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 # ------------------------------------------------------------------------------ diff --git a/source/python/classes/ControlFile.py b/source/python/classes/ControlFile.py index bbf468c..6a54c6d 100644 --- a/source/python/classes/ControlFile.py +++ b/source/python/classes/ControlFile.py @@ -344,8 +344,6 @@ class ControlFile(object): sys.exit(1) # assure consistency of levelist and level - # up-to-date available maximum level numbers at ECMWF, 05.10.2018 - max_level_list = [16, 19, 31, 40, 50, 60, 62, 91, 137] if not self.levelist and not self.level: print('Warning: neither levelist nor level \ specified in CONTROL file') @@ -359,11 +357,11 @@ class ControlFile(object): pass # check if max level is a valid level - if int(self.level) not in max_level_list: + if int(self.level) not in _config.MAX_LEVEL_LIST: print('ERROR: ') print('LEVEL must be the maximum level of a specified ' 'level list from ECMWF, e.g.') - print('[16, 19, 31, 40, 50, 60, 62, 91 or 137]') + print(_config.MAX_LEVEL_LIST) print('Check parameter "LEVEL" or the max level of "LEVELIST"!') sys.exit(1) -- GitLab