Closed climberlenny closed 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
- 097b141 https://github.com/OpenDrift/opendrift/pull/1250/commits/097b1417a50971d6ef48cab8820a96625453da70 Typo fix to connect ROMS reader to save interpolator
- f8252ea https://github.com/OpenDrift/opendrift/pull/1250/commits/f8252ea58366bb685fad2d49830286ef70ecbc78 Bug correction : save state_to_buffer
- a51f2ed https://github.com/OpenDrift/opendrift/pull/1250/commits/a51f2edc3f41501bbfa5442db0a43d0ce3350385 Bug correction : save with state_to_buffer
File Changes
(8 files https://github.com/OpenDrift/opendrift/pull/1250/files)
- A examples/example_biodegradation.py https://github.com/OpenDrift/opendrift/pull/1250/files#diff-eba2ade697122533c70e69d5c578b94ed9be149990be3c7478c98215e61844de (43)
- M examples/example_macondo.py https://github.com/OpenDrift/opendrift/pull/1250/files#diff-998987017bea97298c070393637810c8d23de40f64c5458668051d06b1f77eb7 (1)
- M opendrift/models/basemodel/init.py https://github.com/OpenDrift/opendrift/pull/1250/files#diff-3508b8ba9f30e30e3e65290748905cb2f06a90d67d2a7ede8c06e8fabc16c1b1 (4221)
- M opendrift/models/basemodel/environment.py https://github.com/OpenDrift/opendrift/pull/1250/files#diff-6508406a6b983730bdc8b25dec50c66bd306e4326dd9ab4252fca1196efc263b (9)
- M opendrift/models/openoil/openoil.py https://github.com/OpenDrift/opendrift/pull/1250/files#diff-5173e27a76b42daa6ab61d9c2b658f1b93934645cc88027102e302ffd18c34e3 (89)
- M opendrift/readers/basereader/structured.py https://github.com/OpenDrift/opendrift/pull/1250/files#diff-93bd6129a95ad8a894d86600aefae1769f93ee358c639fcd391d26bc2f0e87b4 (13)
- M opendrift/readers/reader_ROMS_native.py https://github.com/OpenDrift/opendrift/pull/1250/files#diff-e8bb6de9d5f842a302a347821fd8734bbae0109243a85aea2d3cf02b8b5bdd6d (49)
- M opendrift/readers/reader_schism_native.py https://github.com/OpenDrift/opendrift/pull/1250/files#diff-967042082a14e8ab31786a610af399734a11b089271bb49f2f87425e191a48f0 (4)
Patch Links:
- https://github.com/OpenDrift/opendrift/pull/1250.patch
- https://github.com/OpenDrift/opendrift/pull/1250.diff
— 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: @.***>
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
- 097b141 https://github.com/OpenDrift/opendrift/pull/1250/commits/097b1417a50971d6ef48cab8820a96625453da70 Typo fix to connect ROMS reader to save interpolator
- f8252ea https://github.com/OpenDrift/opendrift/pull/1250/commits/f8252ea58366bb685fad2d49830286ef70ecbc78 Bug correction : save state_to_buffer
- a51f2ed https://github.com/OpenDrift/opendrift/pull/1250/commits/a51f2edc3f41501bbfa5442db0a43d0ce3350385 Bug correction : save with state_to_buffer
File Changes
(8 files https://github.com/OpenDrift/opendrift/pull/1250/files)
- A examples/example_biodegradation.py https://github.com/OpenDrift/opendrift/pull/1250/files#diff-eba2ade697122533c70e69d5c578b94ed9be149990be3c7478c98215e61844de (43)
- M examples/example_macondo.py https://github.com/OpenDrift/opendrift/pull/1250/files#diff-998987017bea97298c070393637810c8d23de40f64c5458668051d06b1f77eb7 (1)
- M opendrift/models/basemodel/init.py https://github.com/OpenDrift/opendrift/pull/1250/files#diff-3508b8ba9f30e30e3e65290748905cb2f06a90d67d2a7ede8c06e8fabc16c1b1 (4221)
- M opendrift/models/basemodel/environment.py https://github.com/OpenDrift/opendrift/pull/1250/files#diff-6508406a6b983730bdc8b25dec50c66bd306e4326dd9ab4252fca1196efc263b (9)
- M opendrift/models/openoil/openoil.py https://github.com/OpenDrift/opendrift/pull/1250/files#diff-5173e27a76b42daa6ab61d9c2b658f1b93934645cc88027102e302ffd18c34e3 (89)
- M opendrift/readers/basereader/structured.py https://github.com/OpenDrift/opendrift/pull/1250/files#diff-93bd6129a95ad8a894d86600aefae1769f93ee358c639fcd391d26bc2f0e87b4 (13)
- M opendrift/readers/reader_ROMS_native.py https://github.com/OpenDrift/opendrift/pull/1250/files#diff-e8bb6de9d5f842a302a347821fd8734bbae0109243a85aea2d3cf02b8b5bdd6d (49)
- M opendrift/readers/reader_schism_native.py https://github.com/OpenDrift/opendrift/pull/1250/files#diff-967042082a14e8ab31786a610af399734a11b089271bb49f2f87425e191a48f0 (4)
Patch Links:
- https://github.com/OpenDrift/opendrift/pull/1250.patch
- https://github.com/OpenDrift/opendrift/pull/1250.diff
— 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: @.***>
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, )`