10.3 The Fortran-90 API
The Fortran-90 library provides Fortran 90/95 support for modelers and scientists.
- Well documented:Complete and up-to-date Fortran-90 Users Guide
- Overloaded functions and optional arguments:
simpler API. For example, one
replaces thirty nf_put_var() functions in the Fortran-77 interface and
forty nc_put_var() functions in the C interface.
- Fewer function arguments: string lengths need not be passed
for attribute strings, and array lengths need not be passed for
- Improved error checking: use of
INTENT declarations lets
compilers check whether some arguments are used correctly.
- Array sections supported:
- Support for netCDF-4 user-defined compound types not portable, requires Fortran-2003
- Column-major subscript order (1st dimension varies fastest) reversed from CDL row-major order
- No ncgen support: ncgen cannot generate Fortran-90 code (yet),
though Fortran-77 code ncgen3 generates works from Fortran-90
- You have to explicitly provide memory
space for any netCDF data values and attribute values you read.
- Status of every function call must be explicitly checked
- Library implemented in Fortran-90 as a thin layer on top of
the Fortran-77 library, which in turn is a thin layer on top of the C
- C, C++, and Fortran netCDF libraries are separate software
distributions since netCDF-C version 4.2