Commit f34246fb authored by Ruth Lorenz's avatar Ruth Lorenz
Browse files

added uas and vas to variable_checks.py, variable_list_default.py, variable_ranges.py

parent 86a2cfa5
......@@ -673,6 +673,38 @@ def check_zos(da, model):
return check_range_full(da, 'zos', warning=True)
def check_uas(da, model):
if model == 'ICON-ESM-LR':
if da.dims != DIMENSIONS_3D_3:
logger.error(f'{da.dims} != {DIMENSIONS_3D_3}')
return False
else:
if da.dims != DIMENSIONS_3D:
logger.error(f'{da.dims} != {DIMENSIONS_3D}')
return False
if not check_unit(da, 'm s-1'):
return False
if not check_range_full(da, 'uas'):
return False
return check_range_full(da, 'uas', warning=True)
def check_vas(da, model):
if model == 'ICON-ESM-LR':
if da.dims != DIMENSIONS_3D_3:
logger.error(f'{da.dims} != {DIMENSIONS_3D_3}')
return False
else:
if da.dims != DIMENSIONS_3D:
logger.error(f'{da.dims} != {DIMENSIONS_3D}')
return False
if not check_unit(da, 'm s-1'):
return False
if not check_range_full(da, 'vas'):
return False
return check_range_full(da, 'vas', warning=True)
def variable_checks(ds, varn, model):
if varn in ['pr']:
return check_pr(ds[varn], model)
......@@ -753,5 +785,9 @@ def variable_checks(ds, varn, model):
return check_treeFrac(ds[varn], model)
elif varn in ['zos']:
return check_zos(ds[varn], model)
elif varn in ['uas']:
return check_uas(ds[varn], model)
elif varn in ['vas']:
return check_vas(ds[varn], model)
else:
raise NotImplementedError(f'{varn}')
......@@ -107,6 +107,8 @@ AMON_VARNS = [
'hfls',
'zg500',
'co2mass',
'uas',
'vas',
]
# -- ocean variables --
......
......@@ -63,6 +63,8 @@ ERROR_RANGE = {
'treeFrac': (0, 100.1), # Tree Cover Percentage (%)
'zg500': (4000., 6500), # Geopotential Height at 500hPa (m)
'zos': (-20., 20), # Sea surface height above_geoid (m)
'uas': (-50, 50), # Eastward Near-Surface Wind (m s-1)
'vas': (-50, 50), # Northward Near-Surface Wind (m s-1)
}
# by default the warning range is equivalent to the error range
......@@ -97,4 +99,6 @@ WARNING_RANGE.update({
'tauv': (-1.5, 1.5),
'tsl': (178., 333.),
'treeFrac': (0, 100),
'uas': (-20, 20),
'vas': (-20, 20),
})
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment