opendrift
opendrift copied to clipboard
Backward Simulations Fail When Using Non-Full Hour Start Time in Oceandrift
Description
I am using NetCDF (nc) files containing latitude, longitude, currents, and surface wind data to initialize Oceandrift. The model runs both forward and backward trajectory simulations.
If I start at a full hour (e.g., 10:00 AM), both forward and backward simulations work correctly. If I start at a time including minutes (e.g., 10:12 AM), the forward simulation works, but the backward simulation fails.
is it because :
1- Time interpolation issue in the backward trajectory calculation. 2- Time indexing problem when retrieving forcing data at non-full-hour timestamps.
Here the Environment Details": 1- Model: Oceandrift 2- Data Source: NetCDF files (currents, surface wind) from Environment and Climate Change canada 3- Start Time Scenarios: 3.1- Full hour (10:00 AM) → Works fine 3.2- With minutes (10:12 AM) → Forward works, backward fails
Here an example: time in UTC (local time 10:12 AM ---> UTC +8 )
times_sim [datetime.datetime(2025, 2, 13, 18, 12), datetime.datetime(2025, 2, 13, 17, 12), datetime.datetime(2025, 2, 13, 16, 12), datetime.datetime(2025, 2, 13, 15, 12), datetime.datetime(2025, 2, 13, 14, 12), datetime.datetime(2025, 2, 13, 13, 12), datetime.datetime(2025, 2, 13, 12, 12), datetime.datetime(2025, 2, 13, 11, 12), datetime.datetime(2025, 2, 13, 10, 12), datetime.datetime(2025, 2, 13, 9, 12), datetime.datetime(2025, 2, 13, 8, 12), datetime.datetime(2025, 2, 13, 7, 12), datetime.datetime(2025, 2, 13, 6, 12), datetime.datetime(2025, 2, 13, 5, 12), datetime.datetime(2025, 2, 13, 4, 12), datetime.datetime(2025, 2, 13, 3, 12), datetime.datetime(2025, 2, 13, 2, 12), datetime.datetime(2025, 2, 13, 1, 12), datetime.datetime(2025, 2, 13, 0, 12), datetime.datetime(2025, 2, 12, 23, 12), datetime.datetime(2025, 2, 12, 22, 12)]