-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error exists when Reader sea_water_velocity from MET-Norway #1453
Comments
Hi, |
Hi again, Thanks for your quick help. The attachment is the full log file. It seems that the "x_sea_water_velocity" and "y_sea_water_velocity" are "Nan" values. According the log file, "x_sea_water_velocity" and "y_sea_water_velocity" are derived by rotating "eastward_sea_water_velocity" and "northward_sea_water_velocity". Could the error be occurring here? I also tried many other time-period data files and they all showed the same error. Moreover, even without running Openberg, the error occurs immediately when I try to display "x_sea_water_velocity" after reading the data (Command : ocean_reader.plot(variable = 'x_sea_water_velocity')). But displaying "eastward_sea_water_velocity" works fine. Thanks again. |
As you can see from the log, the reader is discarded since it is only valid for 31 Jan 2013, whereas you have seeded elements on 4th Dec 2024.
|
Hi again, After adjusting the time, the error related to ‘x_sea_water_velocity' still exists. Attached 'logfile_new.txt' is the new log file. I also tried only loading the netCDF file and then plot. When the variable is 'x_sea_water_velocity', it throws an error. The script and log file are shown below. While displaying "eastward_sea_water_velocity" works fine. ### Script: ocean_reader = reader_netCDF_CF_generic.Reader('https://thredds.met.no/thredds/dodsC/romshindcast/barents2500_2010/daily_average/2013/01/barents_avg_zdepth_20130131_m00_HC_24h.nc') print(ocean_reader.variables) ### Logfile: Assuming time step of 1 hour for https://thredds.met.no/thredds/dodsC/romshindcast/barents2500_2010/daily_average/2013/01/barents_avg_zdepth_20130131_m00_HC_24h.nc |
That file/URL is only valid for a very specific time, so it cannot be used for a simulation. And also this dataset does not cover the position you have selected. This you can read from the log. |
Hi,
I am trying to simulate iceberg drift with Openberg Module. But at the very beginning, the input of the forcing data from MET-Norway always shows error. The script and log file are shown below. I have tried other forcing data files, but the errors shown are all related to the missing sea_water_velocity information.
### Script:
import matplotlib.pyplot as plt
import numpy as np
from opendrift.models.openberg import OpenBerg
from opendrift.readers import reader_netCDF_CF_generic
from datetime import datetime,timedelta
o = OpenBerg()
o.set_config('drift:vertical_profile', False) # use surface currents for this test
ocean_reader = reader_netCDF_CF_generic.Reader('https://thredds.met.no/thredds/dodsC/romshindcast/barents2500_2010/daily_average/2013/01/barents_avg_zdepth_20130131_m00_HC_24h.nc')
print(ocean_reader.variables)
#ocean_reader.plot(variable = 'x_sea_water_velocity')
ocean_reader.plot(variable = 'sea_water_speed')
o.add_reader(ocean_reader)
o.seed_elements(lon = 60, lat = 72, time = datetime.now(), number = 1, radius = 500, sail = 10, draft = 50, length = 90, width = 40)
o.run(steps=1)
o.plot(fast = True)
### Log file:
15:20:39 INFO opendrift.models.basemodel:2140: "Missing variables: ['x_sea_water_velocity', 'y_sea_water_velocity']", 'The simulation stopped before requested end time was reached.'
15:20:39 INFO opendrift.models.basemodel:2143: ========================
Traceback (most recent call last):
File "/home/daye/Code/OpenDrift/opendrift/opendrift/models/basemodel/init.py", line 2101, in run
raise ValueError(
ValueError: No more active or scheduled elements, quitting.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/daye/Code/OpenDrift/Gallery/Test/example_openberg.py", line 43, in
o.run(steps=1)
File "/home/daye/Code/OpenDrift/opendrift/opendrift/models/basemodel/init.py", line 111, in inner
r = func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/daye/Code/OpenDrift/opendrift/opendrift/models/basemodel/init.py", line 2147, in run
raise ValueError('Simulation stopped within '
ValueError: Simulation stopped within first timestep. "Missing variables: ['x_sea_water_velocity', 'y_sea_water_velocity']", 'The simulation stopped before requested end time was reached.'
The text was updated successfully, but these errors were encountered: