资 源 简 介
A program can make thousands of calls to NetCDF functions, and it can be very frustrating to get a generic run-time error message about NetCDF stuff and being unable to identify what exactly went wrong. It is also frustrating to handle each possible error in the code. For this reason, in 95+% of my calls to NetCDF functions I use wrappers. They save a lot of time, first during development, and then during tracking run-time errors, and also make the code more readable.
ncw provides C and Fortran wrappers to NetCDF functions, mainly for getting sensible error messages (that include the data file name). The main idea is to exclude checks inside your program code, making it shorter and more readable.
The scheme is very simple. To call a wrapper for a given NetCDF function you
1. replace nc_ with ncw_ (or nf_ with nfw_ in the case of using Fortran), and
1. add the file name as the first argument.
For exa