Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion aeolis/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@
'max_error' : 1e-6, # [-] Maximum error at which to quit iterative solution in implicit numerical schemes
'max_iter' : 1000, # [-] Maximum number of iterations at which to quit iterative solution in implicit numerical schemes
'refdate' : '1970-01-01 00:00', # [-] Reference datetime in netCDF output
'callback' : None, # Reference to callback function (e.g. example/callback.py':callback)
'callback' : None, # Reference to callback function (e.g. example/callback.py':callback)
'wind_convention' : 'cartesian', # Convention used for the wind direction in the input files
}


Expand Down
10 changes: 9 additions & 1 deletion aeolis/inout.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def read_configfile(configfile, parse_files=True, load_defaults=True):
p[key.strip()] = parse_value(val, parse_files=parse_files)
else:
raise IOError('File not found [%s]' % configfile)

# normalize grain size distribution
if 'grain_dist' in p:
p['grain_dist'] = normalize(p['grain_dist'])
Expand Down Expand Up @@ -194,6 +194,14 @@ def check_configuration(p):
if p['wind_file'].ndim != 2 or p['wind_file'].shape[1] < 3:
raise ValueError('Invalid wind definition file')

# rotate nautical wind direction to cartesian grid
if p['wind_convention'] == 'cartesian':
pass
elif p['wind_convention'] == 'nautical':
p['wind_file'][:,2] = 270.0 - p['wind_file'][:,2]
else:
raise ValueError('Unknown convention: %s' % p['wind_convention'])

if isarray(p['tide_file']):
if p['tide_file'].ndim != 2 or p['tide_file'].shape[1] < 2:
raise ValueError('Invalid tide definition file')
Expand Down