Repository navigation
Add filters to compress (deflate) and chunk standard and custom netCDF outputs - #94
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds NetCDF4 compression (deflate) and chunking settings to both standard and custom NetCDF outputs, aiming to reduce file sizes (especially for NaN-heavy variables) and improve performance for time-series access.
Changes:
- Enable NetCDF variable deflate compression (configurable via
NETCDF_DEFLATE_LEVEL) across standard and custom outputs. - Add chunking configuration for NetCDF variables, including heuristics to target ~10MB chunks for 2D outputs.
- Introduce a computed output time dimension size (
Options.n_out_time) and a helper to approximate custom-output timestep counts.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/StandardOutput.cpp | Adds deflate/chunking for time and output variables; updates NetCDF metadata helpers to apply compression/chunking. |
| src/RavenInclude.h | Introduces NetCDF compression/chunking constants and adds optStruct::n_out_time. |
| src/ParseInput.cpp | Computes Options.n_out_time from duration/timestep/output interval. |
| src/CustomOutput.h | Declares ApproximateNumTimeSteps for custom NetCDF chunk sizing. |
| src/CustomOutput.cpp | Implements timestep approximation and applies deflate/chunking to custom NetCDF variables. |
| src/ModelInitialize.cpp | Minor whitespace-only change. |
| src/Makefile | Adds a debug build note. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…amework into deflate_and_chunk
Collaborator
Author
|
Running into segfaults for a large scale simulation.... investigating. |
Collaborator
|
this passed the full set of benchmarking models, with output files ~1/2 to ~1/3rd of original size. No segfaults here. |
1 task done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Checklist:
What kind of change does this PR introduce?
Compression is particularly useful with simulations that do not include q_obs. Without compression, we still need to store the full array of NaNs.
Does this PR introduce a breaking change?
Other information: