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.
Xiaohong Xu, For backward compatiblity reasons, the netCDF 2.4 error number of -31 could indicate either a problem with the underlying operating system or that too many netCDF files are open. I suggest that you check the system error code when you obtain the netCDF error. Regards, Steve Emmerson <http://www.unidata.ucar.edu> > To: address@hidden > From: Xiaohong Xu <address@hidden> > Subject: netcdf error > Organization: UCAR/Unidata > Keywords: 200105101836.f4AIaAp08380 > > Dear Sir/Madam, > I ran into a netcdf I/O error lately when outputing results(fortran). > There are 4 output files, each opened at begining of the simulation, then > at the end of each hour, output data to these 4 data files. The largest one > is for concentration, the dimension is 78x78x21x99. The other three files > are much smaller in dimension. At the end of 42 hour, the simulation would > crash when writing to the concentration file. The error code is -31, and > according to netcdf.inc, have too many netcdf files open. I did some test > to rule out the problem of the model itself. My calculation suggested that > by the time the error occured, the models has called wrvars (NCVPT)more > than 4100 times. I checked a few variables in netcdf.inc and list them below: > nf-share = 2048 > nclink=32768 > MAXNCOP = 32, max. number of files > However I don't know where to check the meaning of there variable. > Can you help me on the possible reason of the problem and how to fix it, > please. The related log file lines are listed for your reference too, > > >>> WARNING in subroutine WRVARS <<< > Error writing variable NO2 to file CTM_CONC_1 > netCDF error number -31 > > > IOAPI file ID 4 > netCDF ID 7 > variable 2 > dims array 1 1 1 43 0 > delts array 78 78 21 1 0 > > > Error writing NO2 to CTM_CONC_1 for 2000164:180000 > > > Thanks a lot. > > Xiaohong Xu > 734 936-0517 (phone) > 734 764-5137 (fax) > University of Michigan > 1214 Space Research Bld. > 2455 Hayward > Ann Arbor, MI 48109-2143 > > > ------- End of Forwarded Message