OpenDrift / opendrift

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

missing variables 'land_binary_mask' #681

Closed arian-dialectaquiz closed 1 year ago

arian-dialectaquiz commented 3 years ago

Hello! I'm dealing with a problem that I don't quite understand why. I wish to use the land mask of the model, not the general one, so I disabled the use of the general land mask as in [https://opendrift.github.io/gallery/example_model_landmask.html], doing: o.set_config('general:use_auto_landmask', False)

but an error was raised:

Simulation stopped within first timestep. "Missing variables: ['land_binary_mask']", 'The simulation stopped before requested end time was reached.'

However, when I print the reader, it finds the variable 'land_binary_mask' as shown in the figure:

image

Could you help me? I've no idea why this happens.

Thank you!

knutfrode commented 3 years ago

Hi, This reader is valid for a given time (25Oct2019 to 27Oct2019) and for a given area. Could it be that the seeded elements are outside this area or time interval?

If not, can you post the full log until the given error message?

arian-dialectaquiz commented 3 years ago

Hi! Yes, both in time and space it is valid, as shown in the figure that is generated when I used the general land mask:

test

The full log is in the .txt attached file.

log_test.txt

knutfrode commented 3 years ago

There is an error message IndexError: index 62 is out of bounds for axis 0 with size 1, indicating that there could be something wrong with this file.

Could you post an ncdump of it?

You can also try the following from commandline: readerinfo.py <file> -p land_binary_mask

arian-dialectaquiz commented 3 years ago

I did not understand how to perform your last advice readerinfo.py <file> -p land_binary_mask. But this error IndexError: index 62 is out of bounds for axis 0 with size 1 did not occur befor I disable the general land_mask. The index 62 is probably the indx position, that is no longer match with the space configuration.

The ncdump log is in the .txt, and the FSM: free surface mask variable is the land_binary_mask ncdump_from_r298.txt

knutfrode commented 3 years ago

There is no standard_name for FSM in this file, and it is not an ordinary ROMS file, hence you are probably here using a self-made reader? Then you could insert some debug-statements in this reader, to check the 'land_binary_mask' variable before it is returned at the bottom. There seem to be some indexing issues with this one, so that not a 2D array (y, x) is returned, as is expected.

arian-dialectaquiz commented 3 years ago

Yes. The readerwas made based at the ROMS_native_reader, but for other model. I've declared the FSM with a new standard name of land_binary_mask:

image

And I also defined it before the get_variables funtion:

image

I'll insert some debug to check it better. The indexing issues to which you refer are the indx and indy indexes?

arian-dialectaquiz commented 3 years ago

I managed to overcome the index error via remapping the FSM name befor the initialization

`self.Dataset_a = xr.open_dataset(filename)

remap_names_a = {'FSM': 'land_binary_mask'} self.Dataset_1 = self.Dataset_a.rename(remap_names_a)`

But the same error appears regarding the land_mask

ValueError: Simulation stopped within first timestep. "Missing variables: ['land_binary_mask']", 'The simulation stopped before requested end time was reached.'

knutfrode commented 3 years ago

Ok, if the index error is gone, there must be another error also causing you reader not to work for landsmask. Please look for the first error message in your log, this is normally the real error.

On Thu, Aug 19, 2021, 00:22 Arian Dialectaquiz Santos < @.***> wrote:

I managed to overcome the index error via remapping the FSM name befor the initialization

`self.Dataset_a = xr.open_dataset(filename)

remap_names_a = {'FSM': 'land_binary_mask'} self.Dataset_1 = self.Dataset_a.rename(remap_names_a)`

But the same error appears regarding the land_mask

ValueError: Simulation stopped within first timestep. "Missing variables: ['land_binary_mask']", 'The simulation stopped before requested end time was reached.'

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/OpenDrift/opendrift/issues/681#issuecomment-901468108, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABH25I2WLRMFTAYSS7G2YT3T5QXBNANCNFSM5CMV75XQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

arian-dialectaquiz commented 3 years ago

Hello! Sorry for the delay to answer. It worked. I looked to the initial erros and wrote some debug.

image

Thank you so much!

log_test.txt