-
Dear OpenDrift community: I am experiencing some problems running an output from Croco in OpenDrift. I have merged the croco_grd.nc and the variable Vstretching (from the .bry file) to my croco_his.nc file; it should work that way. But during the run, I get some warnings and errors like: 01:38:40 WARNING opendrift.readers.basereader.structured:50: No proj string or projection could be derived, using 'fakeproj'. This assumes that the variables are structured and gridded approximately equidistantly on the surface (i.e. in meters). This must be guaranteed by the user. You can get rid of this warning by supplying a valid projection to the reader. 01:38:46 WARNING opendrift.models.basemodel:730: Seafloor check not being run because environment is missing. This will happen the first time the function is run but if it happens subsequently there is probably a problem. 01:38:46 ERROR opendrift.models.basemodel.environment:666: No mask found for x_sea_water_velocity At the end of the simulation, my particles do not move. I recently shared my file with another colleague with a different operating system (Linux), and the file works fine for him. My operating system is Windows. I reinstalled Anaconda and OpenDrift, but they still do not work for me (the examples that are in OpenDrift work fine, but my Croco file does not). Has anyone experienced something similar? I'd really appreciate it if anyone could look at my file and code (.txt). Thank you in advance. Link to croco_var.nc https://drive.google.com/file/d/1vnoP8uW6rhDwx93cWGG2JLj1BHRsPoRu/view?usp=drive_link |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 5 replies
-
Hi, The listed warnings are not a problem here, but there seem to be a mismatch for the mask of velocity component (variable u -> x_sea_water_velocity) In your file (that I downloaded), the dimensions of u seems to be Thus first horizontal spatial coordinate in your Croco file is I am not an expert (nor a user) of ROMS native files, but perhaps @kthyng knows more about the difference between ROMS and Croco? |
Beta Was this translation helpful? Give feedback.
-
Yes I have the same dimensions for ds.u
Out[5]:
<xarray.DataArray 'u' (ocean_time: 210249, s_rho: 30, eta_u: 1044, xi_u: 723)>
dask.array<open_dataset-u, shape=(210249, 30, 1044, 723), dtype=float32, chunksize=(1, 15, 522, 362), chunktype=numpy.ndarray>
Coordinates:
lat_u (eta_u, xi_u) float64 dask.array<chunksize=(1044, 723), meta=np.ndarray>
lon_u (eta_u, xi_u) float64 dask.array<chunksize=(1044, 723), meta=np.ndarray>
* ocean_time (ocean_time) datetime64[ns] 1999-01-01T01:00:00 ... 2023-01-01
* s_rho (s_rho) float64 -0.9833 -0.95 -0.9167 ... -0.05 -0.01667
Dimensions without coordinates: eta_u, xi_u
Attributes:
cell_methods: ocean_time: point
field: u-velocity
grid: grid
location: edge1
long_name: u-momentum component
standard_name: sea_water_x_velocity
time: ocean_time
units: meter second-1 However, the main things are that the u_mask exist and that the dimensions match the variable identified as opendrift/opendrift/readers/reader_ROMS_native.py Lines 561 to 568 in 8022e94 I don't have access to that file to look at the variables myself, and I am not familiar with CROCO, just ROMS. |
Beta Was this translation helpful? Give feedback.
-
Hi, Sorry for the delay, I was on vacation. The original CROCO file (without the merge) has the following dimensions for u and v
I still do not know why my file does not work in OpenDrift |
Beta Was this translation helpful? Give feedback.
-
Btw, I noticed that there are several more errors in this croco-file, e.g. the standard_name of current variables are of the form So as a user of Croco, perhaps you could report to the developers that their output (in particular standard_names) is not CF-compliant, and also mentioned the bug above that wrong dimensions are used for current variables? |
Beta Was this translation helpful? Give feedback.
-
Hi @knutfrode I am going to check that points. Thank you very much! |
Beta Was this translation helpful? Give feedback.
-
Really, I can't think of why it would work on a linux machine though, if this is the issue? |
Beta Was this translation helpful? Give feedback.
-
@kthyng thank you very much. Changing the names works just fine! |
Beta Was this translation helpful? Give feedback.
-
Very good! Thus I believe it is better in the long run to rather correct such errors at their origin (in this case Croco), instead of making patches in downstream softwares (in this case OpenDrift). |
Beta Was this translation helpful? Give feedback.
Really,
eta_rho
andeta_u
are the same values andxi_rho
andxi_v
are the same values. You can see this in this ROMS grid image if you note that eta is in the j index direction and xi is the i index direction: https://www.myroms.org/wiki/Grid_Generation. So that is why they may be mixed up. However, the ROMS reader would need to be written more generally to accept that. Shouldn't be too hard but it might be easier at least initially to first change the names in your file and see if that fixes the problem? I won't be able to do this change in the ROMS reader right away myself if it is the issueI can't think of why it would work on a linux machine though, if this is the issue?