Closed Wen77777777 closed 3 months ago
Hi, can you make available this ROMS file for testing?
thanks for reply, it seems that i can't attach a ROMS file to you in a comment ,what can i do for make avaiable?
Maybe you can make it available on a a file server, such as e.g. Google Drive or Dropbox
Yes, thanks for your advice. I uploaded a ROMS file to Google Drive. Here is the link: https://drive.google.com/file/d/130GV0xvTLTLdCgYgAaFFn27kWUxXKVqF/view?usp=sharing
I used ROMS to run data from 2009-2022. The ROMS files are named "his_number.nc" ,and one day simulation for one nc file. Please help me check the cause of the error. Thank you.
It apprears that this was because your files have current components u_eastward, v_northward
, which had earlier been disabled in the ROMS reader. However, i now checked that these are handled correctly, and thus reactivated them:
https://github.com/OpenDrift/opendrift/pull/1381/files
So your example should work after updating your code from Git (new conda release will come later).
...hang on, I was a bit quick, so some tests are failing. I will make an update very soon.
Thank you for your quick response and help! I really appreciate you taking the time to check and fix this issue. I will wait for your update and look forward to testing the code after the update. Thanks again for your support and hard work!
Hi, after the last commit, it should now work well with your file. https://github.com/OpenDrift/opendrift/pull/1382
Yes, I modified the local file reader_ROMS_native to change 'u_eastward' to 'x_sea_water_velocity' and 'v_northward' to 'y_sea_water_velocity', which allowed the simulation to run. Thanks for pointing this out.
That renaming might be a little dangerous, as x/y_sea_water_velocity must be rotated internally, whereas u_eastward/northward should not be rotated. But if you discard your local changes and update to latest version from GitHub, it should be correct.
Thank you for your suggestion. I wasn’t aware of this issue, so I appreciate your advice. I’ll proceed to update to the latest version from GitHub and discard the local changes.
Once again, thank you for the excellent work you're doing.
When using ROMS model data for a test, the error ERROR opendrift.models.basemodel.environment:666: list index out of range occurs
import numpy as np from opendrift.readers import reader_ROMS_native from opendrift.models.oceandrift import OceanDrift
o = OceanDrift(loglevel=20)
roms_file = "E:\his_6238.nc" reader_roms = reader_ROMS_native.Reader(roms_file) o.add_reader(reader_roms)
o.seed_elements(lon=119.4, lat=37.8, radius=0, number=10, z=np.linspace(0, -10, 10), time=reader_roms.start_time)
o.run(time_step=3600) ############################ ERROR opendrift.models.basemodel.environment:666: list index out of range Traceback (most recent call last): File "h:\AnacondaEnvs\opendrift\Lib\site-packages\opendrift\models\basemodel\environment.py", line 641, in get_environment reader.get_variables_interpolated( File "h:\AnacondaEnvs\opendrift\Lib\site-packages\opendrift\readers\basereader\variables.py", line 904, in get_variables_interpolated env, env_profiles = self.get_variables_interpolated_xy( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "h:\AnacondaEnvs\opendrift\Lib\site-packages\opendrift\readers\basereader\variables.py", line 770, in get_variables_interpolated_xy env, env_profiles = self._get_variablesinterpolated( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "h:\AnacondaEnvs\opendrift\Lib\site-packages\opendrift\readers\basereader\structured.py", line 281, in _get_variablesinterpolated self.get_variables(blockvariables_before, time_before, File "h:\AnacondaEnvs\opendrift\Lib\site-packages\opendrift\readers\reader_ROMS_native.py", line 538, in get_variables var = self.Dataset.variables[varname[0]]