-
Notifications
You must be signed in to change notification settings - Fork 238
Upgrade NetCDF output writer to write arbitrary outputs for LESbrary use #643
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Beautiful. Is this documented? Is there an example? The two_dimensional_turbulence.jl
example could be appended to output vorticity, perhaps... or one of the three-dimensional examples might be modified.
The NetCDF tests fail on GPU so gotta look into that.
No and no, but yeah we should update model setup documentation and show an example of how to use it. Vorticity example might be good. Might also be nice to have the example save a horizontal average to NetCDF so we can also show how to save outputs with different dimensions. |
Codecov Report
@@ Coverage Diff @@
## master #643 +/- ##
=========================================
- Coverage 78.11% 75.2% -2.91%
=========================================
Files 119 119
Lines 2326 2267 -59
=========================================
- Hits 1817 1705 -112
- Misses 509 562 +53
Continue to review full report at Codecov.
|
Maybe just get this merged and open an issue? |
\
Outdated
"w" => Dict("longname" => "Velocity in the z-direction", "units" => "m/s"), | ||
"b" => Dict("longname" => "Buoyancy", "units" => "m/s²"), | ||
"T" => Dict("longname" => "Conservative temperature", "units" => "K"), | ||
"S" => Dict("longname" => "Absolute aalinity", "units" => "g/kg") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo
"w" => Dict("longname" => "Velocity in the z-direction", "units" => "m/s"), | ||
"b" => Dict("longname" => "Buoyancy", "units" => "m/s²"), | ||
"T" => Dict("longname" => "Conservative temperature", "units" => "K"), | ||
"S" => Dict("longname" => "Absolute aalinity", "units" => "g/kg") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo here. There is also a spurious file called /
above.
@ali-ramadhan a spurious file should be deleted before this is merged. |
Ah thanks for catching that, no idea how it happened. |
Yeah sure, there are a few other things that need updating too. |
This PR allows
NetCDFOutputWriter
to write arbitrary outputs, similar to how we pass functions that return data to be saved to disk with the JLD2 output writer, but now with metadata! Thedimensions
kwarg allows you to pass a dictionary of dimensions to apply to any outputs.I also cleaned up the
NetCDFOutputWriter
a bit and changed the name of the time dimension from"Time"
to"time"
.@suyashbire1 Let me know if I did anything wrong.
I added a pretty comprehensive test that shows how you might write a mix of scalars, profiles, and slices to a NetCDF file with grid/unit/name metadata and global attributes.
Here's what the API looks like right now: