OpenDrift / opendrift

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

Bug fixed #1250

Closed climberlenny closed 3 months ago

climberlenny commented 3 months ago

there was a bug writing data to the netCDF file. In some rare situations, step 100 (the default) is skipped, leading to an error as the buffer_limit _length is exceeded in the next step.

The following code produce the error : `from datetime import datetime, timedelta from opendrift.models.oceandrift import OceanDrift

o = OceanDrift(loglevel=20)

o.set_config("general:use_auto_landmask", False) o.set_config("environment:constant:land_binary_mask", 0) o.set_config("drift:max_age_seconds", 100) start_time = datetime(2024, 1, 1)

o.seed_elements(lon=3, lat=60, time=start_time) o.seed_elements(lon=3, lat=60, time=start_time + timedelta(hours=1) 7) o.seed_elements(lon=3, lat=60, time=start_time + timedelta(hours=1) 100)

o.run( steps=200, export_buffer_length=5, outfile="test.nc", time_step=3600, time_step_output=3600 * 2, )`

knutfrode commented 3 months ago

It seems some other things got messed inn here. Only the specific fix should be included, I guess just basemodel should be updated.

On Tue, Mar 12, 2024, 11:38 Lenny @.***> wrote:

there was a bug writing data to the netCDF file. In some rare situations, step 100 (the default) is skipped, leading to an error as the buffer_limit _length is exceeded in the next step.

The following code produce the error : `from datetime import datetime, timedelta from opendrift.models.oceandrift import OceanDrift

o = OceanDrift(loglevel=20)

o.set_config("general:use_auto_landmask", False) o.set_config("environment:constant:land_binary_mask", 0) o.set_config("drift:max_age_seconds", 100) start_time = datetime(2024, 1, 1)

o.seed_elements(lon=3, lat=60, time=start_time) o.seed_elements(lon=3, lat=60, time=start_time + timedelta(hours=1) 7) o.seed_elements(lon=3, lat=60, time=start_time + timedelta(hours=1) 100)

o.run( steps=200, export_buffer_length=5, outfile="test.nc", time_step=3600, time_step_output=3600 * 2, )`

You can view, comment on, or merge this pull request online at:

https://github.com/OpenDrift/opendrift/pull/1250 Commit Summary

File Changes

(8 files https://github.com/OpenDrift/opendrift/pull/1250/files)

Patch Links:

— Reply to this email directly, view it on GitHub https://github.com/OpenDrift/opendrift/pull/1250, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABH25I243VXED2YCKG2VXY3YX3LJPAVCNFSM6AAAAABER6YSW2VHI2DSMVQWIX3LMV43ASLTON2WKOZSGE4DCMRXHE3TONA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

climberlenny commented 3 months ago

Sorry for the mess,

I made a new proper one.

Cheers,

Lenny


De : Knut-Frode Dagestad @.> Envoyé : mardi 12 mars 2024 12:21 À : OpenDrift/opendrift @.> Cc : Lenny @.>; Author @.> Objet : Re: [OpenDrift/opendrift] Bug fixed (PR #1250)

It seems some other things got messed inn here. Only the specific fix should be included, I guess just basemodel should be updated.

On Tue, Mar 12, 2024, 11:38 Lenny @.***> wrote:

there was a bug writing data to the netCDF file. In some rare situations, step 100 (the default) is skipped, leading to an error as the buffer_limit _length is exceeded in the next step.

The following code produce the error : `from datetime import datetime, timedelta from opendrift.models.oceandrift import OceanDrift

o = OceanDrift(loglevel=20)

o.set_config("general:use_auto_landmask", False) o.set_config("environment:constant:land_binary_mask", 0) o.set_config("drift:max_age_seconds", 100) start_time = datetime(2024, 1, 1)

o.seed_elements(lon=3, lat=60, time=start_time) o.seed_elements(lon=3, lat=60, time=start_time + timedelta(hours=1) 7) o.seed_elements(lon=3, lat=60, time=start_time + timedelta(hours=1) 100)

o.run( steps=200, export_buffer_length=5, outfile="test.nc", time_step=3600, time_step_output=3600 * 2, )`

You can view, comment on, or merge this pull request online at:

https://github.com/OpenDrift/opendrift/pull/1250 Commit Summary

File Changes

(8 files https://github.com/OpenDrift/opendrift/pull/1250/files)

Patch Links:

— Reply to this email directly, view it on GitHub https://github.com/OpenDrift/opendrift/pull/1250, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABH25I243VXED2YCKG2VXY3YX3LJPAVCNFSM6AAAAABER6YSW2VHI2DSMVQWIX3LMV43ASLTON2WKOZSGE4DCMRXHE3TONA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

— Reply to this email directly, view it on GitHubhttps://github.com/OpenDrift/opendrift/pull/1250#issuecomment-1991415761, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AWHQWNO3U6DCEAB7XFZ7KT3YX3QJ5AVCNFSM6AAAAABER6YSW2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOJRGQYTKNZWGE. You are receiving this because you authored the thread.Message ID: @.***>