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

Calculate concentration #741

Open oceandiff opened 2 years ago

oceandiff commented 2 years ago

Hi everybody, I'm searching for a method to calculate and plot the concentration of the particles released. Does anyone have some ideas? Thanks in advance.

knutfrode commented 2 years ago

Maybe you can use the plotting and animation techniques used in this example: https://opendrift.github.io/gallery/example_huge_output.html#sphx-glr-gallery-example-huge-output-py

oceandiff commented 2 years ago

Thank you, I've added the part of the code for the plot and the animation, but, with the animation, I obtain the following error: ''' File "C:\Users\opendrift\examples\test\sediment\tevere.py", line 57, in <module> oa.animation(background=b.where(b>0), fast=False, show_elements=False, vmin=0, vmax=1000, clabel='particles concentration', filename='conc.mp4') File "c:\users\opendrift\opendrift\models\basemodel.py", line 3059, in animation scalar = background[0,:,:] File "C:\Users\Anaconda3\envs\opendrift\lib\site-packages\xarray\core\dataarray.py", line 750, in __getitem__ return self.isel(indexers=self._item_key_to_dict(key)) File "C:\Users\Anaconda3\envs\opendrift\lib\site-packages\xarray\core\dataarray.py", line 714, in _item_key_to_dict key = indexing.expanded_indexer(key, self.ndim) File "C:\Users\Anaconda3\envs\opendrift\lib\site-packages\xarray\core\indexing.py", line 46, in expanded_indexer raise IndexError("too many indices") IndexError: too many indices ''' I'm trying to use the code on a 3d configuration for sediment transport. do you have any suggestions? tank you

knutfrode commented 2 years ago

For plot, background should be a 2D-array (lon/lat or x/y), whereas for animation it should be a 3D-array (including time dimension). It seems that you provided a 2D-array to the animation method?

oceandiff commented 2 years ago

sorry, my fault! I've used the same background data. Another question about the code, when I run with:

'vertical_mixing:diffusivitymodel', 'windspeed_Large1994'

in the run I have the following messages:

13:27:51 INFO opendrift.models.basemodel: Fallback values will be used for the following variables which have no readers: 13:27:51 INFO opendrift.models.basemodel: upward_sea_water_velocity: 0.000000 13:27:51 INFO opendrift.models.basemodel: ocean_vertical_diffusivity: 0.020000

why the ocean vertical diffusion is imposed at 0.02 when It has would use 'windspeed_Large1994'?

knutfrode commented 2 years ago

This might be a bit misleading, and is due to fallback values being inserted whenever there is no reader providing this parameter. However, these values are then afterwards overridden by the Large-parameterization, and you will also see in your log lines like: 13:51:36 DEBUG opendrift.models.oceandrift: Diffusivities are in range 0.0 to 0.05781980048418044 13:51:36 DEBUG opendrift.models.oceandrift: Vertical mixing module:windspeed_Large1994

oceandiff commented 2 years ago

Hi in the log I've:

16:59:44 DEBUG opendrift.models.basemodel: land_binary_mask: 0 (min) 1 (max) **16:59:44 DEBUG opendrift.models.basemodel: ocean_vertical_diffusivity: 0.02 (min) 0.02 (max)** 16:59:44 DEBUG opendrift.models.basemodel: ocean_mixed_layer_thickness: 35 (min) 35 (max) 16:59:44 DEBUG opendrift.models.basemodel: sea_floor_depth_below_sea_level: 0 (min) 700.393 (max)

There is anything I've misunderstood...

knutfrode commented 2 years ago

Are there no lines below this about Large94 being used?

On Thu, Oct 21, 2021, 17:02 oceandiff @.***> wrote:

Hi in the log I've:

16:59:44 DEBUG opendrift.models.basemodel: land_binary_mask: 0 (min) 1 (max) 16:59:44 DEBUG opendrift.models.basemodel: ocean_vertical_diffusivity: 0.02 (min) 0.02 (max) 16:59:44 DEBUG opendrift.models.basemodel: ocean_mixed_layer_thickness: 35 (min) 35 (max) 16:59:44 DEBUG opendrift.models.basemodel: sea_floor_depth_below_sea_level: 0 (min) 700.393 (max)

There is anything I've misunderstood...

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/OpenDrift/opendrift/issues/741#issuecomment-948707367, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABH25I7OBRCY7USOF4BEJF3UIATRVANCNFSM5GNT3XRA . 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&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

oceandiff commented 2 years ago

No, this is the few last lines of the log:

17:02:00 DEBUG opendrift.export.io_netcdf: Setting imported config: environment:fallback:ocean_vertical_diffusivity -> 0.02 17:02:00 DEBUG opendrift.export.io_netcdf: Setting imported config: environment:constant:ocean_mixed_layer_thickness -> None 17:02:00 DEBUG opendrift.export.io_netcdf: Setting imported config: environment:fallback:ocean_mixed_layer_thickness -> 50 17:02:00 DEBUG opendrift.export.io_netcdf: Setting imported config: environment:constant:sea_floor_depth_below_sea_level -> None 17:02:00 DEBUG opendrift.export.io_netcdf: Setting imported config: environment:fallback:sea_floor_depth_below_sea_level -> 0 17:02:00 DEBUG opendrift.export.io_netcdf: Setting imported config: drift:vertical_advection -> True 17:02:00 DEBUG opendrift.export.io_netcdf: Setting imported config: drift:vertical_mixing -> True 17:02:00 DEBUG opendrift.export.io_netcdf: Setting imported config: vertical_mixing:timestep -> 60.0 17:02:00 DEBUG opendrift.export.io_netcdf: Setting imported config: vertical_mixing:diffusivitymodel -> windspeed_Large1994 17:02:00 DEBUG opendrift.export.io_netcdf: Setting imported config: vertical_mixing:background_diffusivity -> 1.2e-05 17:02:00 DEBUG opendrift.export.io_netcdf: Setting imported config: vertical_mixing:TSprofiles -> False 17:02:00 DEBUG opendrift.export.io_netcdf: Setting imported config: drift:wind_drift_depth -> 0.1 17:02:00 DEBUG opendrift.export.io_netcdf: Setting imported config: drift:stokes_drift -> True 17:02:00 DEBUG opendrift.export.io_netcdf: Setting imported config: drift:use_tabularised_stokes_drift -> False 17:02:00 DEBUG opendrift.export.io_netcdf: Setting imported config: drift:tabularised_stokes_drift_fetch -> 25000 17:02:00 DEBUG opendrift.export.io_netcdf: Setting imported config: general:seafloor_action -> lift_to_seafloor 17:02:00 DEBUG opendrift.export.io_netcdf: Setting imported config: drift:truncate_ocean_model_below_m -> None 17:02:00 DEBUG opendrift.export.io_netcdf: Setting imported config: seed:seafloor -> False

and this is the output of print(o):

Readers not added for the following variables: ocean_vertical_diffusivity upward_sea_water_velocity

any idea?

knutfrode commented 2 years ago

When you have not added any readers to provide ocean_vertical_diffusivity, a fallback_value (0.02) is first inserted. However, when you have chosen the Large94-parameterization, this will again override the fallback-value. Thus the messages about fallback value of 0.02 is here a bit misleading. So for each time step in your log you should see lines like this: 13:51:36 DEBUG opendrift.models.oceandrift: Diffusivities are in range 0.0 to 0.05781980048418044 13:51:36 DEBUG opendrift.models.oceandrift: Vertical mixing module:windspeed_Large1994 You can see the vertical behavour with o.animation_profile()

oceandiff commented 2 years ago

Sorry if I return on this argument, but I'm trying to introduce an animation of the concentration of the particles on my test output, but I have the following error for the animation:

Traceback (most recent call last): File "C:\Users\opendrift\examples\test\sediment\tevere.py", line 71, in <module> oa.animation(background=bg.where(bg>0), bgalpha=1, fast=False, show_particles=False, vmin=0, vmax=1000) File "c:\users\opendrift\opendrift\models\basemodel.py", line 3099, in animation index_of_last[self.elements_deactivated.ID-1] TypeError: 'NoneType' object is not subscriptable

I'm using the method you have suggested to me in the first reply, the plot was ok, but the animation no. Here is the code for the plot and animation:

oa = opendrift.open_xarray(outfile) h = oa.get_histogram(pixelsize_m=500) b=h.isel(origin_marker=0).sum(dim='time') oa.plot(background=b.where(b>0), fast=True, show_particles=False, vmin=0, vmax=1000) bg=h.isel(origin_marker=0) oa.animation(background=bg.where(bg>0), bgalpha=1, fast=False, show_particles=False, vmin=0, vmax=1000)

any idea? thank you

knutfrode commented 2 years ago

Can you share the plot produced, and the netCDF-file?

oceandiff commented 2 years ago

here's the plot, it is not possible to attach the NetCDF due to the size: gshhsrk_conc

this is a ncdump -h of the file: simulation.txt

knutfrode commented 2 years ago

I believe the problem is that you are providing show_particles=False to the animation method (as with the plot method), whereas it shall be show_elements=False This should be consistent among the methods, so I will change this later.

oceandiff commented 2 years ago

Hi all, I have a new problem with my netcdf files, one of these creates a problem during my simulation... after ncdump it, I obtein:

`` dimensions: time = 254 ; latitude = 156 ; longitude = 181 ; variables: short VHM0_WW(time, latitude, longitude) ; VHM0_WW:scale_factor = 0.001f ; VHM0_WW:add_offset = 0.f ; VHM0_WW:_FillValue = -32767s ; VHM0_WW:missing_value = -32767s ; VHM0_WW:long_name = "Spectral significant wind wave height" ; VHM0_WW:standard_name = "sea_surface_wind_wave_significant_height" ; VHM0_WW:coordinates = "time latitude longitude" ; VHM0_WW:units = "m" ; VHM0_WW:type_of_analysis = "spectral analysis" ; VHM0_WW:WMO = 102 ; VHM0_WW:_ChunkSizes = 1, 380, 1307 ; float latitude(latitude) ; latitude:standard_name = "latitude" ; latitude:units = "degrees_north" ; latitude:long_name = "latitude" ; latitude:axis = "Y" ; latitude:valid_min = 38.02083f ; latitude:valid_max = 44.47917f ; latitude:step = 0.042f ; latitude:_CoordinateAxisType = "Lat" ; short VMDR_SW2(time, latitude, longitude) ; VMDR_SW2:scale_factor = 0.01f ; VMDR_SW2:add_offset = 180.f ; VMDR_SW2:_FillValue = -32767s ; VMDR_SW2:missing_value = -32767s ; VMDR_SW2:long_name = "Mean secondary swell wave direction from" ; VMDR_SW2:standard_name = "sea_surface_secondary_swell_wave_from_direction" ; VMDR_SW2:coordinates = "time latitude longitude" ; VMDR_SW2:units = "degree" ; VMDR_SW2:type_of_analysis = "spectral analysis" ; VMDR_SW2:WMO = 109 ; VMDR_SW2:_ChunkSizes = 1, 380, 1307 ; short VMDR(time, latitude, longitude) ; VMDR:scale_factor = 0.01f ; VMDR:add_offset = 180.f ; VMDR:_FillValue = -32767s ; VMDR:missing_value = -32767s ; VMDR:long_name = "Mean wave direction from (Mdir)" ; VMDR:standard_name = "sea_surface_wave_from_direction" ; VMDR:coordinates = "time latitude longitude" ; VMDR:units = "degree" ; VMDR:type_of_analysis = "spectral analysis" ; VMDR:WMO = 200 ; VMDR:_ChunkSizes = 1, 380, 1307 ; short VMDR_SW1(time, latitude, longitude) ; VMDR_SW1:scale_factor = 0.01f ; VMDR_SW1:add_offset = 180.f ; VMDR_SW1:_FillValue = -32767s ; VMDR_SW1:missing_value = -32767s ; VMDR_SW1:long_name = "Mean primary swell wave direction from" ; VMDR_SW1:standard_name = "sea_surface_primary_swell_wave_from_direction" ; VMDR_SW1:coordinates = "time latitude longitude" ; VMDR_SW1:units = "degree" ; VMDR_SW1:type_of_analysis = "spectral analysis" ; VMDR_SW1:WMO = 107 ; VMDR_SW1:_ChunkSizes = 1, 380, 1307 ; short VTM10(time, latitude, longitude) ; VTM10:scale_factor = 0.001f ; VTM10:add_offset = 0.f ; VTM10:_FillValue = -32767s ; VTM10:missing_value = -32767s ; VTM10:long_name = "Spectral moments (-1,0) wave period (Tm-10)" ; VTM10:standard_name = "sea_surface_wave_mean_period_from_variance_spectral_density_inverse_frequency_moment" ; VTM10:coordinates = "time latitude longitude" ; VTM10:units = "s" ; VTM10:type_of_analysis = "spectral analysis" ; VTM10:WMO = 201 ; VTM10:_ChunkSizes = 1, 380, 1307 ; short VPED(time, latitude, longitude) ; VPED:scale_factor = 0.01f ; VPED:add_offset = 180.f ; VPED:_FillValue = -32767s ; VPED:missing_value = -32767s ; VPED:long_name = "Wave principal direction at spectral peak" ; VPED:standard_name = "sea_surface_wave_from_direction_at_variance_spectral_density_maximum" ; VPED:coordinates = "time latitude longitude" ; VPED:units = "degree" ; VPED:type_of_analysis = "spectral analysis" ; VPED:WMO = "" ; VPED:_ChunkSizes = 1, 380, 1307 ; short VTPK(time, latitude, longitude) ; VTPK:scale_factor = 0.001f ; VTPK:add_offset = 0.f ; VTPK:_FillValue = -32767s ; VTPK:missing_value = -32767s ; VTPK:long_name = "Wave period at spectral peak / peak period (Tp)" ; VTPK:standard_name = "sea_surface_wave_period_at_variance_spectral_density_maximum" ; VTPK:coordinates = "time latitude longitude" ; VTPK:units = "s" ; VTPK:type_of_analysis = "spectral analysis" ; VTPK:WMO = 204 ; VTPK:_ChunkSizes = 1, 380, 1307 ; short VTM02(time, latitude, longitude) ; VTM02:scale_factor = 0.001f ; VTM02:add_offset = 0.f ; VTM02:_FillValue = -32767s ; VTM02:missing_value = -32767s ; VTM02:long_name = "Spectral moments (0,2) wave period (Tm02)" ; VTM02:standard_name = "sea_surface_wave_mean_period_from_variance_spectral_density_second_frequency_moment" ; VTM02:coordinates = "time latitude longitude" ; VTM02:units = "s" ; VTM02:type_of_analysis = "spectral analysis" ; VTM02:WMO = 221 ; VTM02:_ChunkSizes = 1, 380, 1307 ; short VHM0_SW1(time, latitude, longitude) ; VHM0_SW1:scale_factor = 0.001f ; VHM0_SW1:add_offset = 0.f ; VHM0_SW1:_FillValue = -32767s ; VHM0_SW1:missing_value = -32767s ; VHM0_SW1:long_name = "Spectral significant primary swell wave height" ; VHM0_SW1:standard_name = "sea_surface_primary_swell_wave_significant_height" ; VHM0_SW1:coordinates = "time latitude longitude" ; VHM0_SW1:units = "m" ; VHM0_SW1:type_of_analysis = "spectral analysis" ; VHM0_SW1:WMO = 202 ; VHM0_SW1:_ChunkSizes = 1, 380, 1307 ; short VMDR_WW(time, latitude, longitude) ; VMDR_WW:scale_factor = 0.01f ; VMDR_WW:add_offset = 180.f ; VMDR_WW:_FillValue = -32767s ; VMDR_WW:missing_value = -32767s ; VMDR_WW:long_name = "Mean wind wave direction from" ; VMDR_WW:standard_name = "sea_surface_wind_wave_from_direction" ; VMDR_WW:coordinates = "time latitude longitude" ; VMDR_WW:units = "degree" ; VMDR_WW:type_of_analysis = "spectral analysis" ; VMDR_WW:WMO = 101 ; VMDR_WW:_ChunkSizes = 1, 380, 1307 ; short VTM01_SW2(time, latitude, longitude) ; VTM01_SW2:scale_factor = 0.001f ; VTM01_SW2:add_offset = 0.f ; VTM01_SW2:_FillValue = -32767s ; VTM01_SW2:missing_value = -32767s ; VTM01_SW2:long_name = "Spectral moments (0,1) secondary swell wave period" ; VTM01_SW2:standard_name = "sea_surface_secondary_swell_wave_mean_period" ; VTM01_SW2:coordinates = "time latitude longitude" ; VTM01_SW2:units = "s" ; VTM01_SW2:type_of_analysis = "spectral analysis" ; VTM01_SW2:WMO = 227 ; VTM01_SW2:_ChunkSizes = 1, 380, 1307 ; short VSDX(time, latitude, longitude) ; VSDX:scale_factor = 0.001f ; VSDX:add_offset = 0.f ; VSDX:_FillValue = -32767s ; VSDX:missing_value = -32767s ; VSDX:long_name = "Stokes drift U" ; VSDX:standard_name = "sea_surface_wave_stokes_drift_x_velocity" ; VSDX:coordinates = "time latitude longitude" ; VSDX:units = "m/s" ; VSDX:type_of_analysis = "spectral analysis" ; VSDX:WMO = 215 ; VSDX:_ChunkSizes = 1, 380, 1307 ; short VTM01_SW1(time, latitude, longitude) ; VTM01_SW1:scale_factor = 0.001f ; VTM01_SW1:add_offset = 0.f ; VTM01_SW1:_FillValue = -32767s ; VTM01_SW1:missing_value = -32767s ; VTM01_SW1:long_name = "Spectral moments (0,1) primary swell wave period" ; VTM01_SW1:standard_name = "sea_surface_primary_swell_wave_mean_period" ; VTM01_SW1:coordinates = "time latitude longitude" ; VTM01_SW1:units = "s" ; VTM01_SW1:type_of_analysis = "spectral analysis" ; VTM01_SW1:WMO = 226 ; VTM01_SW1:_ChunkSizes = 1, 380, 1307 ; short VSDY(time, latitude, longitude) ; VSDY:scale_factor = 0.001f ; VSDY:add_offset = 0.f ; VSDY:_FillValue = -32767s ; VSDY:missing_value = -32767s ; VSDY:long_name = "Stokes drift V" ; VSDY:standard_name = "sea_surface_wave_stokes_drift_y_velocity" ; VSDY:coordinates = "time latitude longitude" ; VSDY:units = "m/s" ; VSDY:type_of_analysis = "spectral analysis" ; VSDY:WMO = 216 ; VSDY:_ChunkSizes = 1, 380, 1307 ; double time(time) ; time:units = "seconds since 1970-01-01 00:00:00" ; time:calendar = "standard" ; time:long_name = "time" ; time:standard_name = "time" ; time:axis = "T" ; time:step = 3600 ; time:_ChunkSizes = 1024 ; time:_CoordinateAxisType = "Time" ; time:valid_min = 1576368000. ; time:valid_max = 1577278800. ; short VHM0(time, latitude, longitude) ; VHM0:scale_factor = 0.001f ; VHM0:add_offset = 0.f ; VHM0:_FillValue = -32767s ; VHM0:missing_value = -32767s ; VHM0:long_name = "Spectral significant wave height (Hm0)" ; VHM0:standard_name = "sea_surface_wave_significant_height" ; VHM0:coordinates = "time latitude longitude" ; VHM0:units = "m" ; VHM0:type_of_analysis = "spectral analysis" ; VHM0:WMO = 100 ; VHM0:_ChunkSizes = 1, 380, 1307 ; short VTM01_WW(time, latitude, longitude) ; VTM01_WW:scale_factor = 0.001f ; VTM01_WW:add_offset = 0.f ; VTM01_WW:_FillValue = -32767s ; VTM01_WW:missing_value = -32767s ; VTM01_WW:long_name = "Spectral moments (0,1) wind wave period" ; VTM01_WW:standard_name = "sea_surface_wind_wave_mean_period" ; VTM01_WW:coordinates = "time latitude longitude" ; VTM01_WW:units = "s" ; VTM01_WW:type_of_analysis = "spectral analysis" ; VTM01_WW:WMO = 223 ; float longitude(longitude) ; longitude:standard_name = "longitude" ; longitude:units = "degrees_east" ; longitude:long_name = "longitude" ; longitude:axis = "X" ; longitude:valid_min = 8.500001f ; longitude:valid_max = 16.f ; longitude:step = 0.042f ; longitude:_CoordinateAxisType = "Lon" ; short VHM0_SW2(time, latitude, longitude) ; VHM0_SW2:scale_factor = 0.001f ; VHM0_SW2:add_offset = 0.f ; VHM0_SW2:_FillValue = -32767s ; VHM0_SW2:missing_value = -32767s ; VHM0_SW2:long_name = "Spectral significant secondary swell wave height" ; VHM0_SW2:standard_name = "sea_surface_secondary_swell_wave_significant_height" ; VHM0_SW2:coordinates = "time latitude longitude" ; VHM0_SW2:units = "m" ; VHM0_SW2:type_of_analysis = "spectral analysis" ; VHM0_SW2:WMO = 203 ; VHM0_SW2:_ChunkSizes = 1, 380, 1307 ;

// global attributes: :bulletin_type = "forecast" ; :institution = "Hellenic Centre for Marine Research (HCMR)-Athens,Greece" ; :source = "MEDWAM3" ; :credit = "Copernicus Marine Environment Monitoring Service (CMEMS)" ; :contact = "servicedesk.cmems@mercator-ocean.eu" ; :producer = "CMEMS-MED Monitoring and Forecasting Centre" ; :references = "Please check in CMEMS catalogue the INFO section for product MEDSEA_ANALYSISFORECAST_WAV_006_017 - http://marine.copernicus.eu" ; :comment = "Please check in CMEMS catalogue the INFO section for product MEDSEA_ANALYSISFORECAST_WAV_006_017 - http://marine.copernicus.eu" ; :Conventions = "CF-1.6" ; :area = "MED" ; :bulletin_date = "2021-10-28 12" ; :FROM_ORIGINAL_FILE__field_type = "hourly_instantaneous_at_time_field" ; :title = "Wave fields (2D) - Hourly Instantaneous" ; :_CoordSysBuilder = "ucar.nc2.dataset.conv.CF1Convention" ; :history = "Data extracted from dataset http://localhost:8080/thredds/dodsC/med-hcmr-wav-an-fc-h" ; } (opendrift) PS C:\Users\alessandro.mercatini\opendrift\examples\test\sediment> ncdump 15-25_12_2019_wave.nc netcdf \15-25_12_2019_wave { dimensions: time = 254 ; latitude = 156 ; longitude = 181 ; variables: short VHM0_WW(time, latitude, longitude) ; VHM0_WW:scale_factor = 0.001f ; VHM0_WW:add_offset = 0.f ; VHM0_WW:_FillValue = -32767s ; VHM0_WW:missing_value = -32767s ; VHM0_WW:long_name = "Spectral significant wind wave height" ; VHM0_WW:standard_name = "sea_surface_wind_wave_significant_height" ; VHM0_WW:coordinates = "time latitude longitude" ; VHM0_WW:units = "m" ; VHM0_WW:type_of_analysis = "spectral analysis" ; VHM0_WW:WMO = 102 ; VHM0_WW:_ChunkSizes = 1, 380, 1307 ; float latitude(latitude) ; latitude:standard_name = "latitude" ; latitude:units = "degrees_north" ; latitude:long_name = "latitude" ; latitude:axis = "Y" ; latitude:valid_min = 38.02083f ; latitude:valid_max = 44.47917f ; latitude:step = 0.042f ; latitude:_CoordinateAxisType = "Lat" ; short VMDR_SW2(time, latitude, longitude) ; VMDR_SW2:scale_factor = 0.01f ; VMDR_SW2:add_offset = 180.f ; VMDR_SW2:_FillValue = -32767s ; VMDR_SW2:missing_value = -32767s ; VMDR_SW2:long_name = "Mean secondary swell wave direction from" ; VMDR_SW2:standard_name = "sea_surface_secondary_swell_wave_from_direction" ; VMDR_SW2:coordinates = "time latitude longitude" ; VMDR_SW2:units = "degree" ; VMDR_SW2:type_of_analysis = "spectral analysis" ; VMDR_SW2:WMO = 109 ; VMDR_SW2:_ChunkSizes = 1, 380, 1307 ; short VMDR(time, latitude, longitude) ; VMDR:scale_factor = 0.01f ; VMDR:add_offset = 180.f ; VMDR:_FillValue = -32767s ; VMDR:missing_value = -32767s ; VMDR:long_name = "Mean wave direction from (Mdir)" ; VMDR:standard_name = "sea_surface_wave_from_direction" ; VMDR:coordinates = "time latitude longitude" ; VMDR:units = "degree" ; VMDR:type_of_analysis = "spectral analysis" ; VMDR:WMO = 200 ; VMDR:_ChunkSizes = 1, 380, 1307 ; short VMDR_SW1(time, latitude, longitude) ; VMDR_SW1:scale_factor = 0.01f ; VMDR_SW1:add_offset = 180.f ; VMDR_SW1:_FillValue = -32767s ; VMDR_SW1:missing_value = -32767s ; VMDR_SW1:long_name = "Mean primary swell wave direction from" ; VMDR_SW1:standard_name = "sea_surface_primary_swell_wave_from_direction" ; VMDR_SW1:coordinates = "time latitude longitude" ; VMDR_SW1:units = "degree" ; VMDR_SW1:type_of_analysis = "spectral analysis" ; VMDR_SW1:WMO = 107 ; VMDR_SW1:_ChunkSizes = 1, 380, 1307 ; short VTM10(time, latitude, longitude) ; VTM10:scale_factor = 0.001f ; VTM10:add_offset = 0.f ; VTM10:_FillValue = -32767s ; VTM10:missing_value = -32767s ; VTM10:long_name = "Spectral moments (-1,0) wave period (Tm-10)" ; VTM10:standard_name = "sea_surface_wave_mean_period_from_variance_spectral_density_inverse_frequency_moment" ; VTM10:coordinates = "time latitude longitude" ; VTM10:units = "s" ; VTM10:type_of_analysis = "spectral analysis" ; VTM10:WMO = 201 ; VTM10:_ChunkSizes = 1, 380, 1307 ; short VPED(time, latitude, longitude) ; VPED:scale_factor = 0.01f ; VPED:add_offset = 180.f ; VPED:_FillValue = -32767s ; VPED:missing_value = -32767s ; VPED:long_name = "Wave principal direction at spectral peak" ; VPED:standard_name = "sea_surface_wave_from_direction_at_variance_spectral_density_maximum" ; VPED:coordinates = "time latitude longitude" ; VPED:units = "degree" ; VPED:type_of_analysis = "spectral analysis" ; VPED:WMO = "" ; VPED:_ChunkSizes = 1, 380, 1307 ; short VTPK(time, latitude, longitude) ; VTPK:scale_factor = 0.001f ; VTPK:add_offset = 0.f ; VTPK:_FillValue = -32767s ; VTPK:missing_value = -32767s ; VTPK:long_name = "Wave period at spectral peak / peak period (Tp)" ; VTPK:standard_name = "sea_surface_wave_period_at_variance_spectral_density_maximum" ; VTPK:coordinates = "time latitude longitude" ; VTPK:units = "s" ; VTPK:type_of_analysis = "spectral analysis" ; VTPK:WMO = 204 ; VTPK:_ChunkSizes = 1, 380, 1307 ; short VTM02(time, latitude, longitude) ; VTM02:scale_factor = 0.001f ; VTM02:add_offset = 0.f ; VTM02:_FillValue = -32767s ; VTM02:missing_value = -32767s ; VTM02:long_name = "Spectral moments (0,2) wave period (Tm02)" ; VTM02:standard_name = "sea_surface_wave_mean_period_from_variance_spectral_density_second_frequency_moment" ; VTM02:coordinates = "time latitude longitude" ; VTM02:units = "s" ; VTM02:type_of_analysis = "spectral analysis" ; VTM02:WMO = 221 ; VTM02:_ChunkSizes = 1, 380, 1307 ; short VHM0_SW1(time, latitude, longitude) ; VHM0_SW1:scale_factor = 0.001f ; VHM0_SW1:add_offset = 0.f ; VHM0_SW1:_FillValue = -32767s ; VHM0_SW1:missing_value = -32767s ; VHM0_SW1:long_name = "Spectral significant primary swell wave height" ; VHM0_SW1:standard_name = "sea_surface_primary_swell_wave_significant_height" ; VHM0_SW1:coordinates = "time latitude longitude" ; VHM0_SW1:units = "m" ; VHM0_SW1:type_of_analysis = "spectral analysis" ; VHM0_SW1:WMO = 202 ; VHM0_SW1:_ChunkSizes = 1, 380, 1307 ; short VMDR_WW(time, latitude, longitude) ; VMDR_WW:scale_factor = 0.01f ; VMDR_WW:add_offset = 180.f ; VMDR_WW:_FillValue = -32767s ; VMDR_WW:missing_value = -32767s ; VMDR_WW:long_name = "Mean wind wave direction from" ; VMDR_WW:standard_name = "sea_surface_wind_wave_from_direction" ; VMDR_WW:coordinates = "time latitude longitude" ; VMDR_WW:units = "degree" ; VMDR_WW:type_of_analysis = "spectral analysis" ; VMDR_WW:WMO = 101 ; VMDR_WW:_ChunkSizes = 1, 380, 1307 ; short VTM01_SW2(time, latitude, longitude) ; VTM01_SW2:scale_factor = 0.001f ; VTM01_SW2:add_offset = 0.f ; VTM01_SW2:_FillValue = -32767s ; VTM01_SW2:missing_value = -32767s ; VTM01_SW2:long_name = "Spectral moments (0,1) secondary swell wave period" ; VTM01_SW2:standard_name = "sea_surface_secondary_swell_wave_mean_period" ; VTM01_SW2:coordinates = "time latitude longitude" ; VTM01_SW2:units = "s" ; VTM01_SW2:type_of_analysis = "spectral analysis" ; VTM01_SW2:WMO = 227 ; VTM01_SW2:_ChunkSizes = 1, 380, 1307 ; short VSDX(time, latitude, longitude) ; VSDX:scale_factor = 0.001f ; VSDX:add_offset = 0.f ; VSDX:_FillValue = -32767s ; VSDX:missing_value = -32767s ; VSDX:long_name = "Stokes drift U" ; VSDX:standard_name = "sea_surface_wave_stokes_drift_x_velocity" ; VSDX:coordinates = "time latitude longitude" ; VSDX:units = "m/s" ; VSDX:type_of_analysis = "spectral analysis" ; VSDX:WMO = 215 ; VSDX:_ChunkSizes = 1, 380, 1307 ; short VTM01_SW1(time, latitude, longitude) ; VTM01_SW1:scale_factor = 0.001f ; VTM01_SW1:add_offset = 0.f ; VTM01_SW1:_FillValue = -32767s ; VTM01_SW1:missing_value = -32767s ; VTM01_SW1:long_name = "Spectral moments (0,1) primary swell wave period" ; VTM01_SW1:standard_name = "sea_surface_primary_swell_wave_mean_period" ; VTM01_SW1:coordinates = "time latitude longitude" ; VTM01_SW1:units = "s" ; VTM01_SW1:type_of_analysis = "spectral analysis" ; VTM01_SW1:WMO = 226 ; VTM01_SW1:_ChunkSizes = 1, 380, 1307 ; short VSDY(time, latitude, longitude) ; VSDY:scale_factor = 0.001f ; VSDY:add_offset = 0.f ; VSDY:_FillValue = -32767s ; VSDY:missing_value = -32767s ; VSDY:long_name = "Stokes drift V" ; VSDY:standard_name = "sea_surface_wave_stokes_drift_y_velocity" ; VSDY:coordinates = "time latitude longitude" ; VSDY:units = "m/s" ; VSDY:type_of_analysis = "spectral analysis" ; VSDY:WMO = 216 ; VSDY:_ChunkSizes = 1, 380, 1307 ; double time(time) ; time:units = "seconds since 1970-01-01 00:00:00" ; time:calendar = "standard" ; time:long_name = "time" ; time:standard_name = "time" ; time:axis = "T" ; time:step = 3600 ; time:_ChunkSizes = 1024 ; time:_CoordinateAxisType = "Time" ; time:valid_min = 1576368000. ; time:valid_max = 1577278800. ; short VHM0(time, latitude, longitude) ; VHM0:scale_factor = 0.001f ; VHM0:add_offset = 0.f ; VHM0:_FillValue = -32767s ; VHM0:missing_value = -32767s ; VHM0:long_name = "Spectral significant wave height (Hm0)" ; VHM0:standard_name = "sea_surface_wave_significant_height" ; VHM0:coordinates = "time latitude longitude" ; VHM0:units = "m" ; VHM0:type_of_analysis = "spectral analysis" ; VHM0:WMO = 100 ; VHM0:_ChunkSizes = 1, 380, 1307 ; short VTM01_WW(time, latitude, longitude) ; VTM01_WW:scale_factor = 0.001f ; VTM01_WW:add_offset = 0.f ; VTM01_WW:_FillValue = -32767s ; VTM01_WW:missing_value = -32767s ; VTM01_WW:long_name = "Spectral moments (0,1) wind wave period" ; VTM01_WW:standard_name = "sea_surface_wind_wave_mean_period" ; VTM01_WW:coordinates = "time latitude longitude" ; VTM01_WW:units = "s" ; VTM01_WW:type_of_analysis = "spectral analysis" ; VTM01_WW:WMO = 223 ; VTM01_WW:_ChunkSizes = 1, 380, 1307 ; float longitude(longitude) ; longitude:standard_name = "longitude" ; longitude:units = "degrees_east" ; longitude:long_name = "longitude" ; longitude:axis = "X" ; longitude:valid_min = 8.500001f ; longitude:valid_max = 16.f ; longitude:step = 0.042f ; longitude:_CoordinateAxisType = "Lon" ; short VHM0_SW2(time, latitude, longitude) ; VHM0_SW2:scale_factor = 0.001f ; VHM0_SW2:add_offset = 0.f ; VHM0_SW2:_FillValue = -32767s ; VHM0_SW2:missing_value = -32767s ; VHM0_SW2:long_name = "Spectral significant secondary swell wave height" ; VHM0_SW2:standard_name = "sea_surface_secondary_swell_wave_significant_height" ; VHM0_SW2:coordinates = "time latitude longitude" ; VHM0_SW2:units = "m" ; VHM0_SW2:type_of_analysis = "spectral analysis" ; VHM0_SW2:WMO = 203 ; VHM0_SW2:_ChunkSizes = 1, 380, 1307 ;

// global attributes: :bulletin_type = "forecast" ; :institution = "Hellenic Centre for Marine Research (HCMR)-Athens,Greece" ; :source = "MEDWAM3" ; :credit = "Copernicus Marine Environment Monitoring Service (CMEMS)" ; :contact = "servicedesk.cmems@mercator-ocean.eu" ; :producer = "CMEMS-MED Monitoring and Forecasting Centre" ; :references = "Please check in CMEMS catalogue the INFO section for product MEDSEA_ANALYSISFORECAST_WAV_006_017 - http://marine.copernicus.eu" ; :comment = "Please check in CMEMS catalogue the INFO section for product MEDSEA_ANALYSISFORECAST_WAV_006_017 - http://marine.copernicus.eu" ; :Conventions = "CF-1.6" ; :area = "MED" ; :bulletin_date = "2021-10-28 12" ; :FROM_ORIGINAL_FILE__field_type = "hourly_instantaneous_at_time_field" ; :title = "Wave fields (2D) - Hourly Instantaneous" ; :_CoordSysBuilder = "ucar.nc2.dataset.conv.CF1Convention" ; :history = "Data extracted from dataset http://localhost:8080/thredds/dodsC/med-hcmr-wav-an-fc-h" ; data:

VHM0WW = 744, 758, 767, 796, 784, 792, 802, 783, 773, 774, 758, 702, 693, 686, 681, 674, 667, 682, 711, 723, 718, 715, 721, 750, 750, 750, 749, 757, 794, 800, 826, 827, 827, 826, 825, 824, 824, 825, 827, 829, 833, 909, 941, 982, 1067, 1135, 1218, 1315, 1401, 1450, 1477, 1550, 1508, 1513, 1514, 1499, 1493, 1496, 1502, 1514, 1518, 1512, 1474, 1406, 1404, 1400, 1396, 1389, 1382, 1367, 1293, 1266, 1261, 1253, 1195, 1188, 1178, 1052, 1025, 979, 968, 955, 901, 835, 821, 777, 763, 689, 669, 643, 602, 505, , 298, 304, 247, 168, , , , , , , , , , , , , , , , , , , , , , , , , , , 13, 6, 0, 0, 0, 0, 0, 0, , , , , , , 11, 16, 12, 10, 8, , , , , , , , , , , , , , , , , , , , , , , , , , 102, 201, 314, 386, 401, , , , , , , , , , 747, 786, 797, 805, 813, 822, 815, 826, 802, 776, 769, 708, 681, 674, 668, 633, 652, 644, 636, 660, 685, 683, 697, 699, 702, 737, 738, 740, 783, 784, 786, 785, 783, 781, 779, 739, 738, 742, 747, 766, 802, 833, 868, 951, 1003, 1135, 1170, 1254, 1391, 1421, 1443, 1473, 1470, 1457, 1450, 1445, 1390, 1348, 1320, 1334, 1383, 1374, 1377, 1384, 1383, 1376, 1313, 1302, 1283, 1271, 1248, 1243, 1194, 1193, 1182, 1146, 1119, 1036, 1026, 987, 972, 874, 840, 829, 796, 763, 690, 666, 652, 569, 533, 476, 428, 399, 312, 221, 162, 88, , , , , , , , 6, 0, 0, 0, , , , , , , , , , , , , , 40, 57, 56, 54, 53, 45, 40, 34, 37, 39, 43, 51, 63, 74, 85, 96, 100, 85, 70, 56, 51, 41, 39, 38, 45, , , , , , , , , , , , , , , , , , , , , , 123, 245, 319, 331, , , , , , , , , , 783, 806, 820, 827, 823, 831, 842, 830, 804, 798, 759, 736, 667, 661, 656, 617, 614, 629, 621, 615, 629, 646, 669, 673, 689, 692, 728, 730, 739, 773, 773, 730, 720, 694, 692, 680, 663, 686, 693, 701, 723, 806, 841, 906, 972, 1023, 1153, 1222, 1330, 1353, 1418, 1433, 1423, 1391, 1329, 1287, 1258, 1253, 1237, 1271, 1276, 1281, 1285, 1302, 1300, 1292, 1285, 1273, 1233, 1226, 1171, 1152, 1160, 1131, 1120, 1109, 1056, 1033, 994, 930, 878, 855, 848, 816, 761, 706, 683, 595, 576, 542, 455, 424, 398, 360, 290, 222, 170, 95, 46, 13, , , , , 13, 18, 8, 0, 0, 0, , , , , , , , , 28, 42, , 55, 79, 102, 121, 136, 148, 148, 135, 130, 131, 132, 135, 148, 163, 173, 185, 191, 203, 184, 174, 165, 147, 135, 129, 119, 109, 95, 83, , , , , , , , , , , , , , , , , , , , , 174, 248, 254, , , , , , , , , , 785, 813, 831, 841, 847, 839, 845, 825, 826, 779, 747, 727, 694, 651, 639, 606, 598, 591, 612, 606, 602, 637, 659, 663, 679, 683, 718, 721, 722, 722, 721, 712, 685, 671, 670, 653, 648, 660, 669, 678, 707, 775, 836, 863, 962, 1010, 1137, 1173, 1250, 1337, 1356, 1402, 1376, 1317, 1287, 1243, 1235, 1209, 1209, 1211, 1214, 1224, 1232, 1262, 1263, 1229, 1221, 1181, 1126, 1120, 1117, 1116, 1117, 1116, 1114, 1069, 1054, 1032, 972, 936, 884, 862, 807, 775, 735, 715, 641, 591, 537, 470, 437, 399, 372, 356, 295, 247, 203, 124, 70, 26, 14, , , 18, 25, 32, 24, 15, 7, 5, , , , , , , , 46, 62, 73, 86, 107, 133, 169, 192, 220, 244, 234, 235, 217, 217, 214, 218, 226, 250, 262, 269, 274, 278, 276, 266, 265, 243, 235, 220, 198, 187, 164, 156, 143, , , , , , , , , 83, 93, , , , , , , , , , 85, 147, 162, , , , , , , , , , 789, 817, 851, 864, 857, 855, 842, 818, 812, 810, 737, 718, 689, 681, 637, 623, 621, 614, 607, 603, 618, 635, 657, 673, 676, 710, 711, 741, 721, 712, 704, 678, 663, 662, 644, 645, 644, 656, 685, 694, 747, 801, 832, 911, 985, 1029, 1129, 1195, 1237, 1326, 1380, 1411, 1400, 1308, 1298, 1231, 1221, 1194, 1190, 1189, 1190, 1194, 1199, 1208, 1205, 1139, 1125, 1120, 1116, 1113, 1110, 1111, 1113, 1114, 1114, 1072, 1068, 1049, 986, 947, 903, 852, 794, 755, 744, 658, 618, 579, 498, 462, 391, 380, 360, 354, 305, 271, 223, 169, 114, 72, 60, 45, 42, 54, 67, 83, 66, 53, 36, 29, 24, , , , , , , 76, 99, 116, 136, 164, 201, 235, 264, 284, 304, 295, 289, 261, 260, 268, 272, 278, 285, 290, 296, 302, 317, 310, 311, 314, 305, 304, 296, 275, 265, 246, 240, 237, 222, 233, 255, 291, , 183, 253, 274, 273, 253, 243, 247, , , , , , , , , 51, 64, , , , , , , , , , 788, 819, 879, 906, 898, 855, 850, 835, 804, 802, 779, 712, 706, 677, 669, 622, 616, 610, 605, 602, 631, 657, 669, 673, 705, 706, 706, 751, 714, 697, 669, 654, 652, 627, 628, 631, 635, 648, 676, 698, 784, 818, 870, 940, 981, 1079, 1127, 1202, 1294, 1354, 1392, 1407, 1395, 1300, 1289, 1221, 1194, 1180, 1175, 1171, 1171, 1173, 1134, 1107, 1100, 1062, 1059, 1058, 1057, 1059, 1069, 1072, 1116, 1119, 1081, 1081, 1070, 1049, 998, 964, 911, 841, 807, 767, 723, 666, 614, 542, 495, 434, 390, 369, 361, 356, 314, 290, 273, 222, 175, 127, 125, 121, 122, 131, 158, 171, 158, 137, 123, 100, 93, 77, 93, 112, 135, 145, 175, 188, 208, 218, 230, 267, 286, 319, 342, 351, 356, 355, 330, 314, 314, 312, 315, 319, 333, 337, 341, 346, 351, 356, 359, 368, 371, 364, 357, 358, 335, 333, 340, 356, 359, 390, 414, 455, 455, 498, 527, 534, 514, 486, 459, 450, , 183, 256, 312, , , , , 0, 0, , , , , , , , , , 774, 811, 876, 903, 855, 848, 841, 796, 793, 791, 754, 701, 673, 667, 627, 614, 608, 604, 602, 620, 653, 671, 671, 676, 703, 702, 701, 700, 692, 665, 650, 646, 624, 618, 618, 621, 626, 657, 667, 721, 780, 812, 875, 940, 979, 1105, 1134, 1202, 1292, 1367, 1388, 1401, 1389, 1290, 1281, 1213, 1185, 1171, 1162, 1157, 1155, 1117, 1096, 1059, 1048, 1033, 1032, 1033, 1049, 1052, 1056, 1061, 1069, 1072, 1075, 1077, 1061, 1032, 981, 933, 907, 831, 787, 752, 685, 646, 563, 521, 484, 415, 383, 374, 367, 342, 310, 290, 284, 239, 196, 173, 181, 182, 184, 210, 218, 233, 223, 196, 178, 170, 156, 137, 161, 191, 212, 236, 250, 277, 280, 291, 306, 320, 344, 383, 392, 397, 398, 378, 362, 358, 360, 370, 371, 373, 371, 376, 363, 357, 362, 366, 371, 376, 387, 389, 391, 394, 397, 391, 427, 438, 452, 498, 550, 607, 636, 696, 749, 746, 728, 721, 671, 620, 556, 533, 517, 508, 374, 286, , , , 0, 0, 0, 0, , , , , , , ``

How can I solve this? Thank you

oceandiff commented 2 years ago

The model seems to run ok without the wave data, but if I introduce it, I have some problems: 1) I have these values at 0 for every step: 09:03:16 DEBUG opendrift.models.basemodel: sea_surface_wave_stokes_drift_x_velocity: 0 (min) 0 (max) 09:03:16 DEBUG opendrift.models.basemodel: sea_surface_wave_stokes_drift_y_velocity: 0 (min) 0 (max) 09:03:16 DEBUG opendrift.models.basemodel: sea_surface_wave_period_at_variance_spectral_density_maximum: 0 (min) 0 (max) 09:03:16 DEBUG opendrift.models.basemodel: sea_surface_wave_mean_period_from_variance_spectral_density_second_frequency_moment: 0 (min) 0 (max)

2)during the run sometimes appears this warnings:

09:01:25 WARNING opendrift: Only NaNs input to linearNDFast - returning 09:01:25 WARNING opendrift: Only NaNs input to linearNDFast - returning

where is the problem? with the same kind of data but for other periods it seems to go ok! thank you

knutfrode commented 2 years ago

There seem to be a problem with your wave data file. The log will tell what is the problem.

The warning is probably due to 2d fields that are below seafloor at they position of some elements, but this is not a problem as data will be extrapolated downwards from layers above.

oceandiff commented 2 years ago

Ok, in the attachment the log. thank you log.txt

knutfrode commented 2 years ago

A wave file is added, but variables not used from it. What is output from >>> print(<wave-reader>) ?

You can also check from commandline: $ readerinfo.py <wavefile>

oceandiff commented 2 years ago

Here the output of print(reader-wave):

readr info
===========================
Reader: 15-25_12_2019_wave.nc
Projection:
  +proj=latlong
Coverage: [degrees]
  xmin: 8.500001   xmax: 16.000002   step: 0.041667   numx: 180
  ymin: 38.020832   ymax: 44.479168   step: 0.0416679   numy: 155
  Corners (lon, lat):
    (  8.50,  44.48)  ( 16.00,  44.48)
    (  8.50,  38.02)  ( 16.00,  38.02)
Vertical levels [m]:
  Not specified
Available time range:
  start: 2019-12-15 00:00:00   end: 2019-12-25 13:00:00   step: 1:00:00
    254 times (0 missing)
Variables:
  sea_surface_wind_wave_significant_height
  sea_surface_secondary_swell_wave_from_direction
  sea_surface_wave_from_direction
  sea_surface_primary_swell_wave_from_direction
  sea_surface_wave_mean_period_from_variance_spectral_density_inverse_frequency_moment
  sea_surface_wave_from_direction_at_variance_spectral_density_maximum
  sea_surface_wave_period_at_variance_spectral_density_maximum
  sea_surface_wave_mean_period_from_variance_spectral_density_second_frequency_moment
  sea_surface_primary_swell_wave_significant_height
  sea_surface_wind_wave_from_direction
  sea_surface_secondary_swell_wave_mean_period
  sea_surface_wave_stokes_drift_x_velocity
  sea_surface_primary_swell_wave_mean_period
  sea_surface_wave_stokes_drift_y_velocity
  sea_surface_wave_significant_height
  sea_surface_wind_wave_mean_period
  sea_surface_secondary_swell_wave_significant_height
===========================
knutfrode commented 2 years ago

Ok, send to be properly recognized. Are you adding readers with add_readers_from_list? If so, you can add lazy=True

Wave parameters are optional, as these can be parameterized from wind. This with lazy=True (default), new readers are only initialized when strictly required variables are not covered.

oceandiff commented 2 years ago

No, I'm not adding the reader from the list:

reader_current = reader_netCDF_CF_generic.Reader('15-25_12_2019_uv.nc')
reader_wave = reader_netCDF_CF_generic.Reader('15-25_12_2019_wave.nc')
.
.
.
.

I know these parameters are optional, but I would like to see the difference between the real wave data and the data parametrized from the wind.

knutfrode commented 2 years ago

Ok, then it is very strange that this reader is not used. It seems to be added at the top of your log, but below it is never mentioned again. Can you share the invoking script?

oceandiff commented 2 years ago

The problem connected to the reader seems to disappear after restarting conda... But now the first step goes ok, but after I have this output relative to the wave file:

11:35:18 WARNING opendrift: Only NaNs input to linearNDFast - returning
11:35:18 WARNING opendrift: Only NaNs input to linearNDFast - returning
11:35:19 WARNING opendrift.models.physics_methods: Zero wave period found - replacing with mean
11:35:20 INFO    opendrift.models.basemodel: 2019-12-24 20:00:00 - step 472 of 500 - 27596 active elements (19604 deactivated)
11:35:20 WARNING opendrift.readers.basereader.structured: Data block from 2019-2021_wind.nc not large enough to cover element positions within timestep. Buffer size (9) must be increased. See `Variables.set_buffer_size`.
11:35:20 WARNING opendrift: Only NaNs input to linearNDFast - returning
11:35:20 WARNING opendrift: Only NaNs input to linearNDFast - returning
11:35:21 WARNING opendrift.models.basemodel: Missing variables: ['land_binary_mask']
11:35:21 WARNING opendrift.models.physics_methods: Zero wave period found - replacing with mean
11:35:22 INFO    opendrift.models.basemodel: 2019-12-24 20:30:00 - step 473 of 500 - 27695 active elements (19605 deactivated)
11:35:22 WARNING opendrift.readers.basereader.structured: Data block from 2019-2021_wind.nc not large enough to cover element positions within timestep. Buffer size (9) must be increased. See `Variables.set_buffer_size`.
11:35:22 WARNING opendrift: Only NaNs input to linearNDFast - returning
11:35:22 WARNING opendrift: Only NaNs input to linearNDFast - returning
11:35:22 WARNING opendrift.models.physics_methods: Zero wave period found - replacing with mean
11:35:23 INFO    opendrift.models.basemodel: 2019-12-24 21:00:00 - step 474 of 500 - 27795 active elements (19605 deactivated)
11:35:23 WARNING opendrift.readers.basereader.structured: Data block from 2019-2021_wind.nc not large enough to cover element positions within timestep. Buffer size (9) must be increased. See `Variables.set_buffer_size`.
11:35:23 WARNING opendrift: Only NaNs input to linearNDFast - returning
11:35:23 WARNING opendrift: Only NaNs input to linearNDFast - returning
11:35:23 WARNING opendrift.models.physics_methods: Zero wave period found - replacing with mean
11:35:24 INFO    opendrift.models.basemodel: 2019-12-24 21:30:00 - step 475 of 500 - 27895 active elements (19605 deactivated)
11:35:24 WARNING opendrift.readers.basereader.structured: Data block from 2019-2021_wind.nc not large enough to cover element positions within timestep. Buffer size (9) must be increased. See `Variables.set_buffer_size`.
11:35:24 WARNING opendrift: Only NaNs input to linearNDFast - returning
11:35:24 WARNING opendrift: Only NaNs input to linearNDFast - returning
11:35:24 WARNING opendrift.models.basemodel: Missing variables: ['land_binary_mask']
11:35:25 WARNING opendrift.models.physics_methods: Zero wave period found - replacing with mean
11:35:25 INFO    opendrift.models.basemodel: 2019-12-24 22:00:00 - step 476 of 500 - 27994 active elements (19606 deactivated)
11:35:26 WARNING opendrift.readers.basereader.structured: Data block from 2019-2021_wind.nc not large enough to cover element positions within timestep. Buffer size (9) must be increased. See `Variables.set_buffer_size`.
11:35:26 WARNING opendrift: Only NaNs input to linearNDFast - returning
11:35:26 WARNING opendrift: Only NaNs input to linearNDFast - returning
11:35:26 WARNING opendrift.models.basemodel: Missing variables: ['land_binary_mask']
11:35:26 WARNING opendrift.models.physics_methods: Zero wave period found - replacing with mean
11:35:26 INFO    opendrift.models.basemodel: 2019-12-24 22:30:00 - step 477 of 500 - 28093 active elements (19607 deactivated)
11:35:27 WARNING opendrift.readers.basereader.structured: Data block from 2019-2021_wind.nc not large enough to cover element positions within timestep. Buffer size (9) must be increased. See `Variables.set_buffer_size`.
11:35:27 WARNING opendrift: Only NaNs input to linearNDFast - returning
11:35:27 WARNING opendrift: Only NaNs input to linearNDFast - returning
11:35:27 WARNING opendrift.models.physics_methods: Zero wave period found - replacing with mean
11:35:28 INFO    opendrift.models.basemodel: 2019-12-24 23:00:00 - step 478 of 500 - 28193 active elements (19607 deactivated)
11:35:28 WARNING opendrift.readers.basereader.structured: Data block from 2019-2021_wind.nc not large enough to cover element positions within timestep. Buffer size (9) must be increased. See `Variables.set_buffer_size`.
11:35:28 WARNING opendrift: Only NaNs input to linearNDFast - returning
11:35:28 WARNING opendrift: Only NaNs input to linearNDFast - returning
11:35:28 WARNING opendrift.models.physics_methods: Zero wave period found - replacing with mean
11:35:29 INFO    opendrift.models.basemodel: 2019-12-24 23:30:00 - step 479 of 500 - 28293 active elements (19607 deactivated)
11:35:29 WARNING opendrift.readers.basereader.structured: Data block from 2019-2021_wind.nc not large enough to cover element positions within timestep. Buffer size (9) must be increased. See `Variables.set_buffer_size`.
11:35:29 WARNING opendrift: Only NaNs input to linearNDFast - returning
11:35:29 WARNING opendrift: Only NaNs input to linearNDFast - returning
11:35:29 WARNING opendrift.models.basemodel: Missing variables: ['land_binary_mask']
11:35:30 WARNING opendrift.models.physics_methods: Zero wave period found - replacing with mean
11:35:30 INFO    opendrift.models.basemodel: 2019-12-25 00:00:00 - step 480 of 500 - 28391 active elements (19609 deactivated)
11:35:30 WARNING opendrift.models.basemodel: Missing variables: ['land_binary_mask']
11:35:31 WARNING opendrift.models.physics_methods: Zero wave period found - replacing with mean
11:35:31 INFO    opendrift.models.basemodel: 2019-12-25 00:30:00 - step 481 of 500 - 28490 active elements (19610 deactivated)
11:35:32 WARNING opendrift.models.physics_methods: Zero wave period found - replacing with mean
11:35:33 INFO    opendrift.models.basemodel: 2019-12-25 01:00:00 - step 482 of 500 - 28590 active elements (19610 deactivated)
11:35:33 WARNING opendrift.models.physics_methods: Zero wave period found - replacing with mean
11:35:34 INFO    opendrift.models.basemodel: 2019-12-25 01:30:00 - step 483 of 500 - 28690 active elements (19610 deactivated)
11:35:34 WARNING opendrift.models.physics_methods: Zero wave period found - replacing with mean
11:35:35 INFO    opendrift.models.basemodel: 2019-12-25 02:00:00 - step 484 of 500 - 28790 active elements (19610 deactivated)
11:35:35 WARNING opendrift.models.physics_methods: Zero wave period found - replacing with mean
11:35:36 INFO    opendrift.models.basemodel: 2019-12-25 02:30:00 - step 485 of 500 - 28890 active elements (19610 deactivated)
11:35:37 WARNING opendrift.models.physics_methods: Zero wave period found - replacing with mean
11:35:37 INFO    opendrift.models.basemodel: 2019-12-25 03:00:00 - step 486 of 500 - 28990 active elements (19610 deactivated)
11:35:38 WARNING opendrift.models.physics_methods: Zero wave period found - replacing with mean
11:35:38 INFO    opendrift.models.basemodel: 2019-12-25 03:30:00 - step 487 of 500 - 29090 active elements (19610 deactivated)
11:35:39 WARNING opendrift.models.physics_methods: Zero wave period found - replacing with mean
11:35:40 INFO    opendrift.models.basemodel: 2019-12-25 04:00:00 - step 488 of 500 - 29190 active elements (19610 deactivated)
11:35:40 WARNING opendrift.models.physics_methods: Zero wave period found - replacing with mean
11:35:41 INFO    opendrift.models.basemodel: 2019-12-25 04:30:00 - step 489 of 500 - 29290 active elements (19610 deactivated)
11:35:41 WARNING opendrift.models.physics_methods: Zero wave period found - replacing with mean
11:35:42 INFO    opendrift.models.basemodel: 2019-12-25 05:00:00 - step 490 of 500 - 29390 active elements (19610 deactivated)
11:35:42 WARNING opendrift.models.physics_methods: Zero wave period found - replacing with mean
11:35:43 INFO    opendrift.models.basemodel: 2019-12-25 05:30:00 - step 491 of 500 - 29490 active elements (19610 deactivated)
11:35:44 WARNING opendrift.models.physics_methods: Zero wave period found - replacing with mean
11:35:44 INFO    opendrift.models.basemodel: 2019-12-25 06:00:00 - step 492 of 500 - 29590 active elements (19610 deactivated)
11:35:44 WARNING opendrift.models.physics_methods: Zero wave period found - replacing with mean
11:35:45 INFO    opendrift.models.basemodel: 2019-12-25 06:30:00 - step 493 of 500 - 29690 active elements (19610 deactivated)
11:35:46 WARNING opendrift.models.physics_methods: Zero wave period found - replacing with mean
11:35:46 INFO    opendrift.models.basemodel: 2019-12-25 07:00:00 - step 494 of 500 - 29790 active elements (19610 deactivated)
11:35:47 WARNING opendrift.models.physics_methods: Zero wave period found - replacing with mean
11:35:47 INFO    opendrift.models.basemodel: 2019-12-25 07:30:00 - step 495 of 500 - 29890 active elements (19610 deactivated)
11:35:48 WARNING opendrift.models.physics_methods: Zero wave period found - replacing with mean
11:35:48 INFO    opendrift.models.basemodel: 2019-12-25 08:00:00 - step 496 of 500 - 29990 active elements (19610 deactivated)
11:35:49 WARNING opendrift.models.physics_methods: Zero wave period found - replacing with mean
11:35:49 INFO    opendrift.models.basemodel: 2019-12-25 08:30:00 - step 497 of 500 - 30090 active elements (19610 deactivated)
11:35:50 WARNING opendrift.models.physics_methods: Zero wave period found - replacing with mean
11:35:51 INFO    opendrift.models.basemodel: 2019-12-25 09:00:00 - step 498 of 500 - 30190 active elements (19610 deactivated)
11:35:51 WARNING opendrift.models.physics_methods: Zero wave period found - replacing with mean
11:35:52 INFO    opendrift.models.basemodel: 2019-12-25 09:30:00 - step 499 of 500 - 30290 active elements (19610 deactivated)
11:35:52 WARNING opendrift.models.physics_methods: Zero wave period found - replacing with mean
11:35:53 INFO    opendrift.models.basemodel: 2019-12-25 10:00:00 - step 500 of 500 - 30390 active elements (19610 deactivated)
11:35:53 WARNING opendrift.models.physics_methods: Zero wave period found - replacing with mean
11:35:56 INFO    opendrift.export.io_netcdf: Wrote 51 steps to file simulation.nc
===========================
--------------------
Reader performance:
--------------------
15-25_12_2019_uv.nc
 0:01:57.0  total
 0:00:01.7  preparing
 0:01:54.8  reading
 0:01:50.2  interpolation
 0:00:00.5  interpolation_time
 0:00:00.3  masking
--------------------
gebco_2021.nc
 0:00:16.6  total
 0:00:01.6  preparing
 0:00:14.6  reading
 0:00:14.0  interpolation
 0:00:00.0  interpolation_time
 0:00:00.2  masking
--------------------
2019-2021_wind.nc
 0:00:07.7  total
 0:00:00.8  preparing
 0:00:06.4  reading
 0:00:04.2  interpolation
 0:00:00.1  interpolation_time
 0:00:00.3  masking
--------------------
15-25_12_2019_mld.nc
 0:00:05.1  total
 0:00:00.8  preparing
 0:00:04.1  reading
 0:00:02.3  interpolation
 0:00:00.0  interpolation_time
 0:00:00.1  masking
--------------------
15-25_12_2019_wave.nc
 0:00:19.0  total
 0:00:00.8  preparing
 0:00:17.4  reading
 0:00:11.4  interpolation
 0:00:00.1  interpolation_time
 0:00:00.6  masking
--------------------
global_landmask
 0:00:10.2  total
 0:00:01.0  preparing
 0:00:09.0  reading
 0:00:00.0  masking
--------------------
Performance:
11:48.1 total time
    1.1 configuration
    8.2 preparing main loop
      5.0 making dynamical landmask
      0.4 moving elements to ocean
   3:40.3 readers
       11.8 global_landmask
       14.1 postprocessing
 9:49.1 main loop
       19.0 gebco_2021.nc
     2:00.0 15-25_12_2019_uv.nc
        9.5 2019-2021_wind.nc
        6.5 15-25_12_2019_mld.nc
       21.5 15-25_12_2019_wave.nc
   5:58.3 updating elements
     4:05.1 vertical mixing
 1:49.4 cleaning up
--------------------
===========================
Model:  SedimentDrift     (OpenDrift version 1.7.2)
        30390 active SedimentElement particles  (19610 deactivated, 0 scheduled)
-------------------
Environment variables:
  -----
  x_sea_water_velocity
  y_sea_water_velocity
     1) 15-25_12_2019_uv.nc
  -----
  sea_floor_depth_below_sea_level
     1) gebco_2021.nc
  -----
  x_wind
  y_wind
     1) 2019-2021_wind.nc
  -----
  ocean_mixed_layer_thickness
     1) 15-25_12_2019_mld.nc
  -----
  sea_surface_wave_mean_period_from_variance_spectral_density_second_frequency_moment
  sea_surface_wave_period_at_variance_spectral_density_maximum
  sea_surface_wave_stokes_drift_x_velocity
  sea_surface_wave_stokes_drift_y_velocity
     1) 15-25_12_2019_wave.nc
  -----
  land_binary_mask
     1) global_landmask
  -----
Readers not added for the following variables:
  ocean_vertical_diffusivity
  upward_sea_water_velocity

Time:
        Start: 2019-12-15 00:30:00
        Present: 2019-12-25 10:30:00
        Calculation steps: 500 * 0:30:00 - total time: 10 days, 10:00:00
        Output steps: 251 * 1:00:00
-------------------
"Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']", "Missing variables: ['land_binary_mask']"
===========================

The same run without wave reader seems ok!

knutfrode commented 2 years ago

I recommend using loglevel=0 to see what is going on.

Regarding blocks too small, you can try with o.max_speed=10 after o is created. However, this could also be an effect of potentially corrupted wave parameters - ref warnings about zero wave periods.

oceandiff commented 2 years ago

I have added o.max_speed=10 ofter o is created, but the problem persist... Here is log.txt the log...

knutfrode commented 2 years ago

A plot of the simulation may indicate what is the problem.

oceandiff commented 2 years ago

The run stop during the process of plotting... the only plot is:

252019_z

the output after run is:

13:43:11 DEBUG   opendrift.models.basemodel: Adding 17 config items from basemodel
13:43:11 DEBUG   opendrift.models.basemodel: Adding 5 config items from basemodel
13:43:11 DEBUG   opendrift.models.basemodel: Adding 26 config items from basemodel
13:43:11 INFO    opendrift.models.basemodel: OpenDriftSimulation initialised (version 1.7.2 / v1.7.2-dirty)
13:43:11 DEBUG   opendrift.models.basemodel: Adding 14 config items from oceandrift
13:43:11 DEBUG   opendrift.models.basemodel:   Overwriting config item seed:z
13:43:11 DEBUG   opendrift.export.io_netcdf: Importing with Xarray from simulation.nc
13:43:11 INFO    opendrift: Returning <class 'opendrift.models.sedimentdrift.SedimentDrift'> object
Traceback (most recent call last):
  File "C:\Users\opendrift\examples\test\sediment\tevere.py", line 71, in <module>
    h = oa.get_histogram(pixelsize_m=200)
  File "c:\users\opendrift\opendrift\models\basemodel.py", line 3824, in get_histogram
    lonbin, latbin = self.get_lonlat_bins(pixelsize_m)
  File "c:\users\opendrift\opendrift\models\basemodel.py", line 3818, in get_lonlat_bins
    latbin = np.arange(latmin-deltalat, latmax+deltalat, deltalat)
ValueError: arange: cannot compute length
oceandiff commented 2 years ago

I did some tests, and the problem seems to be in the lift_to_seafloor module, if I run with seafloor_action = previous, the run seems to give no problem.... any idea?