OpenDrift / opendrift

Open source framework for ocean trajectory modelling
https://opendrift.github.io
GNU General Public License v2.0
246 stars 120 forks source link

Can't find mask_rho file #148

Closed Jallel30 closed 3 years ago

Jallel30 commented 4 years ago

Hi, while I was performing some tasks I found an error 00:23:50 INFO: Exception: 00:23:50 INFO: 'mask_rho' 00:23:50 DEBUG: Traceback (most recent call last): which doesn't find the file that contains 'mask_rho' which is inside the grifile's file. And this error is not allowing the simulations to start, so since it never begins they get stuck in the coast.

knutfrode commented 4 years ago

Could you explain the circumstances a bit more? What kind of reader, and input files? A bit more from the error log would also be helpful.

Jallel30 commented 4 years ago

I’m making the simulations with an .nc input file that contains the values to perform the simulations. I also have another .nc file that generates the grid inside the simulation, and is in this file where the ‘mask_rho’ file store, this same file provides the grid within the software. The thing is that the log doesn’t recognize it (the mask_rho file) and by not recognizing it the emission points stay stranded in the start point without causing a drift in the ocean

This is my error log

00:23:51 DEBUG: Reader time: 2018-01-01 01:59:28 (before) 2018-01-01 03:00:16 (after) 00:23:51 DEBUG: Fetching variables from roms native 00:23:51 INFO: ======================== 00:23:51 INFO: Exception: 00:23:51 INFO: 'mask_rho' 00:23:51 DEBUG: Traceback (most recent call last): File "/home/lmod/software/MPI/intel/2019.2.187-GCC-8.2.0-2.31.1/impi/2019.2.187/Python/3.7.2/lib/python3.7/site-packages/OpenDrift-1.0.7-py3.7.egg/opendrift/models/basemodel.py", line 935, in get_environment z[missing_indices], self.use_block, self.proj) File "/home/lmod/software/MPI/intel/2019.2.187-GCC-8.2.0-2.31.1/impi/2019.2.187/Python/3.7.2/lib/python3.7/site-packages/OpenDrift-1.0.7-py3.7.egg/opendrift/readers/basereader.py", line 450, in get_variables_interpolated block=block) File "/home/lmod/software/MPI/intel/2019.2.187-GCC-8.2.0-2.31.1/impi/2019.2.187/Python/3.7.2/lib/python3.7/site-packages/OpenDrift-1.0.7-py3.7.egg/opendrift/readers/basereader.py", line 329, in _get_variables env = self.get_variables(variables, time, x, y, z, block) File "/home/lmod/software/MPI/intel/2019.2.187-GCC-8.2.0-2.31.1/impi/2019.2.187/Python/3.7.2/lib/python3.7/site-packages/OpenDrift-1.0.7-py3.7.egg/opendrift/readers/reader_ROMS_native.py", line 356, in get_variables self.mask_u = self.Dataset.variables['mask_rho'][:] KeyError: 'mask_rho'

knutfrode commented 4 years ago

In this case you can try with a workaround around line 355 in reader_ROMS_native.py, to read the mask from gridfile if not found in main file:

    else:
        try:
            self.mask_u = self.Dataset.variables['mask_rho'][:]
        except:
            self.mask_u = gf.variables['mask_rho'][:]
Jallel30 commented 4 years ago

Thanks!

Now I have another problem, I think that doing the simulations does not recognize the superficial speeds 17:11:14 DEBUG: Calling reader basemap_landmask 17:11:14 DEBUG: ---------------------------------------- 17:11:14 DEBUG: Data needed for 1670 elements 17:11:14 DEBUG: Reader time: None (before) None (after) 17:11:14 DEBUG: Fetching variables from basemap_landmask 17:11:14 DEBUG: Checking 578 of 1670 coordinates to polygons 17:11:14 DEBUG: Fetched env-before 17:11:14 DEBUG: No time interpolation needed - right on time. 17:11:14 DEBUG: Obtained data for all elements. 17:11:14 DEBUG: --------------------------------------- 17:11:14 DEBUG: Finished processing all variable groups 17:11:14 DEBUG: ------------ SUMMARY ------------- 17:11:14 DEBUG: x_sea_water_velocity: 0 (min) 0 (max) 17:11:14 DEBUG: y_sea_water_velocity: 0 (min) 0 (max) 17:11:14 DEBUG: x_wind: 0 (min) 0 (max) 17:11:14 DEBUG: y_wind: 0 (min) 0 (max) 17:11:14 DEBUG: land_binary_mask: 0 (min) 0 (max) 17:11:14 DEBUG: --------------------------------- 17:11:14 DEBUG: 1670 active elements 17:11:14 DEBUG: -46.30294 <- latitude -> -41.398888 17:11:14 DEBUG: -74.69689 <- longitude -> -72.29689 17:11:14 DEBUG: z = 0.0 17:11:14 DEBUG: --------------------------------- 17:11:14 DEBUG: No elements to deactivate 17:11:14 DEBUG: Calling OceanDrift.update() 17:11:14 DEBUG: No wind for wind-sheared ocean drift 17:11:14 DEBUG: 1670 active elements (0 deactivated) 17:11:14 DEBUG: to be seeded: 0, already seeded 1670 17:11:14 DEBUG: ====================================================================== 17:11:14 INFO: 2018-01-01 01:00:00 - step 2 of 5 - 1670 active elements (0 deactivated) 17:11:14 DEBUG: 0 elements scheduled.

And in the file .nc i have this information but I still can't make the particles move, Can you tell what’s the problem? Or if you know any step so I can found it

knutfrode commented 4 years ago

Hi,

Can you please post more of your log? Fetching of current should be right before what you already posted.

On Tue, Oct 15, 2019, 00:11 Jallel30 notifications@github.com wrote:

Thanks!

Now I have another problem, I think that doing the simulations does not recognize the superficial speeds 17:11:14 DEBUG: Calling reader basemap_landmask 17:11:14 DEBUG: ---------------------------------------- 17:11:14 DEBUG: Data needed for 1670 elements 17:11:14 DEBUG: Reader time: None (before) None (after) 17:11:14 DEBUG: Fetching variables from basemap_landmask 17:11:14 DEBUG: Checking 578 of 1670 coordinates to polygons 17:11:14 DEBUG: Fetched env-before 17:11:14 DEBUG: No time interpolation needed - right on time. 17:11:14 DEBUG: Obtained data for all elements. 17:11:14 DEBUG: --------------------------------------- 17:11:14 DEBUG: Finished processing all variable groups 17:11:14 DEBUG: ------------ SUMMARY ------------- 17:11:14 DEBUG: x_sea_water_velocity: 0 (min) 0 (max) 17:11:14 DEBUG: y_sea_water_velocity: 0 (min) 0 (max) 17:11:14 DEBUG: x_wind: 0 (min) 0 (max) 17:11:14 DEBUG: y_wind: 0 (min) 0 (max) 17:11:14 DEBUG: land_binary_mask: 0 (min) 0 (max) 17:11:14 DEBUG: --------------------------------- 17:11:14 DEBUG: 1670 active elements 17:11:14 DEBUG: -46.30294 <- latitude -> -41.398888 17:11:14 DEBUG: -74.69689 <- longitude -> -72.29689 17:11:14 DEBUG: z = 0.0 17:11:14 DEBUG: --------------------------------- 17:11:14 DEBUG: No elements to deactivate 17:11:14 DEBUG: Calling OceanDrift.update() 17:11:14 DEBUG: No wind for wind-sheared ocean drift 17:11:14 DEBUG: 1670 active elements (0 deactivated) 17:11:14 DEBUG: to be seeded: 0, already seeded 1670 17:11:14 DEBUG:

17:11:14 INFO: 2018-01-01 01:00:00 - step 2 of 5 - 1670 active elements (0 deactivated) 17:11:14 DEBUG: 0 elements scheduled.

And in the file .nc i have this information but I still can't make the particles move, Can you tell what’s the problem? Or if you know any step so I can found it

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/OpenDrift/opendrift/issues/148?email_source=notifications&email_token=ABH25I5B4EUXDF6TETODXN3QOU7IJA5CNFSM4I7EZYA2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBHK7YA#issuecomment-542027744, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABH25I6AD6FZWIKTD2FZYF3QOU7IJANCNFSM4I7EZYAQ .

gauteh commented 3 years ago

Closing due to inactivity.