Skip to content

Commit

Permalink
Silencing warning of no wind for parameterized Stokes drift, and addi…
Browse files Browse the repository at this point in the history
…ng comment that this calculation should be made with newer environment_mapping mechanism
  • Loading branch information
knutfrode committed Feb 26, 2024
1 parent 6689864 commit deec5ed
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions opendrift/models/basemodel/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -851,14 +851,13 @@ def get_environment(self, variables, time, lon, lat, z, profiles):
env_profiles['sea_water_temperature'][:,t_kelvin] = \
env_profiles['sea_water_temperature'][:,t_kelvin] - 273.15

#######################################################
############################################################
# Parameterisation of unavailable variables
#######################################################
# TODO: use instead "environment mapping" mechanism for this
#############################################################
if 'drift:use_tabularised_stokes_drift' in self._config and self.get_config(
'drift:use_tabularised_stokes_drift') is True:
if 'x_wind' not in variables:
logger.debug('No wind available to calculate Stokes drift')
else:
if 'x_wind' in variables:
if 'sea_surface_wave_stokes_drift_x_velocity' not in variables or (
env['sea_surface_wave_stokes_drift_x_velocity'].max()
== 0 and
Expand Down

0 comments on commit deec5ed

Please sign in to comment.