Skip to content
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

note on netcdf utilities module #314

Open
hkershaw-brown opened this issue Nov 29, 2021 · 2 comments
Open

note on netcdf utilities module #314

hkershaw-brown opened this issue Nov 29, 2021 · 2 comments
Labels
IO IO refactoring notes and issues state_structure notes on refactoring of state_structure_mod

Comments

@hkershaw-brown
Copy link
Member

hkershaw-brown commented Nov 29, 2021

Hit this while working with TIEGCM:

There is a module netcdf_utilities_mod, but it looks like the state io makes almost no use of netcdf_utlities_mod (execpt nc_check).
e.g. location_io_mod, direct_netcdf_mod, state_structure_mod.

linked issues:
#287
#269
#106
#309 ( 3. top level is boundary condition).

@nancycollins
Copy link
Collaborator

i do think where possible as much of our code should use the routines in the netcdf_utilities_mod for the following reasons:

  • if you use those file open/create routines the filename will be stored and provided in any error messages without the calling code having to pass it.
  • the routine names are intended to be more helpful/self-explanatory to someone unfamiliar with the netcdf API.
  • the routines hide native netcdf id numbers and use strings to identify vars, dims, etc for readability.
  • the routines are mostly single-operation for simplicity of interface, implementation and to make the calling code more self-documenting.
  • the calling code does not have to 'use netcdf' in the modules list.

however - they were also expected to cover ~90% of the cases but not 100%. the hope was they covered almost 100% of any model_mod.f90 needs, but inside the dart i/o code i expect there may be uncommon cases where something is needed that is best served by using native netcdf calls rather than try to add complex interfaces to netcdf_utilities_mod. it's a judgement call, obviously, and the more the netcdf calls can be isolated to a single module the easier it will be to swap in a different i/o library should that be required. but i suspect that module may not be able to cover every possible case.

@hkershaw-brown hkershaw-brown added the state_structure notes on refactoring of state_structure_mod label May 24, 2022
@hkershaw-brown hkershaw-brown added the IO IO refactoring notes and issues label Aug 18, 2022
@hkershaw-brown
Copy link
Member Author

linked:
#378
#404 nc_put_char but no nc_get_char (wrf time is char)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IO IO refactoring notes and issues state_structure notes on refactoring of state_structure_mod
Projects
None yet
Development

No branches or pull requests

2 participants