From deec5eda63a32980298ffd9ae8f93c3d6a9a33b1 Mon Sep 17 00:00:00 2001 From: Knut-Frode Dagestad Date: Tue, 27 Feb 2024 00:26:49 +0100 Subject: [PATCH] Silencing warning of no wind for parameterized Stokes drift, and adding comment that this calculation should be made with newer environment_mapping mechanism --- opendrift/models/basemodel/environment.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/opendrift/models/basemodel/environment.py b/opendrift/models/basemodel/environment.py index 999bb4af6..1d0a53dbd 100644 --- a/opendrift/models/basemodel/environment.py +++ b/opendrift/models/basemodel/environment.py @@ -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