-
Notifications
You must be signed in to change notification settings - Fork 69
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
Support for writing Self Attraction and Loading (SAL) files in NetCDF for the ADCIRC model #231
Conversation
…and 0/360 format forced for fes2014, oceanmesh mesh can be in either format and will work
…ent for incorrect database entry
…e() function. adding error catch for wrong format input
I think fort.24 netcdf format could be improved by adding number of frequency dimensions and metadata information. I can work on this a bit later today. |
@zcobell @krober10nd see what you think of the format.. |
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.
made adjustments. back to KJR for re-review.
Are there CF conventions for tide parameters? The current adcirc format is loosely CF-ish in naming and variable fields and attributes |
These appear to be the CF conventions https://www.bodc.ac.uk/resources/delivery_formats/cfnetcdf_format/ Also Zach brought this up offline but the __FillValue should be 0.0 so that NetCDF (at least the compressed versions) won't write that data to the file and save a lot of memory potentially for meshes with many dry nodes. So in each variable probably should have
Probably should also have this at the end:
|
There is a |
A couple suggestions:
|
The salnodes is different to other output files for the nodes, because it is (potentially) a subset of nodes where SAL is defined on. The fill value of zero is redundant because actually SAL is defined non-zero everywhere (even overland, same as the potential). |
Oh okay, that part wasn't clear. Wouldn't this then be different then from how all the other output files are defined? Is it really more efficient to store indices of where the values are defined vs. use a _FillValue? |
It's just that ADCIRC requires knowing the indices that each SAL point is defined on. Although as a standalone file its worth knowing the geographic locations this is for an input file for ADCIRC. |
Okay this is good to go by me. I added some global attributes to the created file. I also added a warning telling users about the potential to use the NetCDF format.
|
Cool, you didn't want to change to |
I think this format should probably mirror the
|
Pass vertices to writefort24.
|
Cool this is fine by me, since it is more standalone. @zcobell so, is your proposal to do the mapping of the nodes inside adcirc? Or, since practically speaking we generally always apply sal nodes everywhere you could enforce that number of nodes between this file and the fort.14 are the same? |
Right, I think this file becomes tied to the mesh numbering similar to the fort.13 and apply the values inside of adcirc as appropriate. Having the lookup table also complicates the decomposed |
I'm fine to merge it if we are good btw. |
In regard to the CF standard names for http://cfconventions.org/Data/cf-standard-names/docs/guidelines.html |
For merging, I'd say let's throw the format example up on the adcirc issue for feedback and probably no use merging this here until ADCIRC/ADCPREP/PADCIRC actually support it too. |
Yep, agreed it has to wait for changes in ADCIRC anyway. |
Let's update this with the current branch and merge it in. Having SAL files in a simple NetCDF format may be useful for other models besides ADCIRC at some point too. |
Addresses Create SAL input files (fort.24) in NetCDF #229 @zcobell
Currently SAL forcing files for ADCIRC are written in ASCII text which can become cumbersome.
This PR writes these forcing files (fort.24) in a compressed NetCDF format by default and deprecates the ASCII files.
Note this requires upstream development in the ADCIRC source code that reflects these changes netCDF based SAL files (fort.24) adcirc/adcirc#271 (comment)
For a small mesh with 191,600 nodes the reduction from the previous ASCII format is ~2x (e.g., 55 mb to 22 mb).
MWE
The following codes creates a fort.24 file called
testing.24.nc
with the following header containing 8 major tidal constituents. Note the constituents are named with a unique alphanumeric identifier corresponding to FES2004. Any thoughts on a better way to do this are suggested. Note the *_omega values are scalars.