diff --git a/source/python/classes/ControlFile.py b/source/python/classes/ControlFile.py index 2ebeee7350d6707d2e9cea98440e3df043c45e2d..3dfdc071ad2d9be0900fda95379ae6b179cfc9b1 100644 --- a/source/python/classes/ControlFile.py +++ b/source/python/classes/ControlFile.py @@ -149,11 +149,13 @@ class ControlFile(object): self.request = 0 self.public = 0 self.ecapi = None + self.purefc = 0 self.rrint = 0 self.logicals = ['gauss', 'omega', 'omegadiff', 'eta', 'etadiff', 'dpdeta', 'cwc', 'wrf', 'grib2flexpart', 'ecstorage', - 'ectrans', 'debug', 'request', 'public', 'rrint'] + 'ectrans', 'debug', 'request', 'public', 'purefc', + 'rrint'] self.__read_controlfile__() @@ -478,6 +480,8 @@ class ControlFile(object): print('Use default value "12" for flux forecast!') self.accmaxstep='12' + self.purefc = check_purefc(self.type) + self.grid = check_grid(self.grid) self.area = check_area(self.grid, self.area, self.upper, self.lower, diff --git a/source/python/mods/checks.py b/source/python/mods/checks.py index 787047d2a2dbb5256eca39fc74e1fb3eab7529df..3de4a20e09cfd692ef93d62f92dc6090c61ba4f9 100644 --- a/source/python/mods/checks.py +++ b/source/python/mods/checks.py @@ -154,6 +154,29 @@ def check_ppid(c, ppid): return + +def check_purefc(type): + '''Check for a pure forecast mode. + + Parameters + ---------- + type : :obj:`list` of :obj:`string` + List of field types. + + Return + ------ + True or False: + True if pure forecasts are to be retrieved. False if there are + analysis fields in between. + ''' + + if 'AN' not in type and '4V' not in type: + # pure forecast + return True + + return False + + def check_(): '''