This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
Christiane, > To: address@hidden > cc: address@hidden > From: Christiane Ludescher <address@hidden> > Subject: NF_MAX_VARS limit > Organization: UCAR/Unidata > Keywords: 200103262032.f2QKWmL04283 The above message contained the following: > we have been happily using netCDF files for collaboration for several years. > > Recently we run into a severe problem with the > NF_MAX_VARS = 2000 limit. > > > We are hesitant to modify "netcdf.inc", since this might cause problems > with our collaborators. > > Are there any plans to increase the limit -- or increase nf90_max_vars -- > in the near future ? The reason for the "NF_MAX_VARS = 2000" limit is to permit interfaces in languages such as Fortran-77 to be written without requiring such implementations to allocate an unreasonable amount of static storage. The underlying netCDF library is written in C and doesn't statically allocate anything according to the limits. As it says in the file "netcdf.h", /* * These maximums are enforced by the interface, to facilitate writing * applications and utilities. However, nothing is statically allocated to * these sizes internally. */ #define NC_MAX_DIMS 100 /* max dimensions per file */ The only risk of building a netCDF library with increased limits in both the C and Fortran header files (netcdf.h and netcdf.inc) is that you might create a netCDF file with so many variables that a collaborator couldn't read it without rebuilding their netCDF library with higher limits. If you can agree with your collaborators what the limits should be, then go ahead and rebuild your netCDF library with the increased values. > Sincerely > > Christiane Ludescher > --------------------------------- > Christiane Ludescher E-mail: address@hidden > Princeton University Phone: +1 609 243 2402 > Princeton, NJ 08543-0451 FAX: +1 609 243 3086 Regards, Steve Emmerson <http://www.unidata.ucar.edu>