X

Help Articles are product support tips and information straight from the NV5 Geospatial Technical Support team developed to help you use our products to their fullest potential.



15558 Rate this article:
2.4

Deciphering NC_ERROR Codes

When working with NetCDF files in IDL, one can receive error messages that include error codes returned from the NetCDF library. This article discusses how to find information about what those error codes mean.

NetCDF library error codes can show up in IDL error messages using the syntax: NC_ERROR=xx
. . . where xx is the number of the NetCDF library error. For example:

% NCDF_OPEN: Unable to open the file "fakename.net0090". (NC_ERROR=-51)

It is possible to find some information about what type of problem the given error number indicates by looking in the netcdf.inc ASCII file, which is part of the NetCDF library.

There are two places in this file which can be helpful. First, starting at the line that reads "parameter (nf_noerr = 0)") is a list of parameter codes, in which you can look up the numerical value for NC_ERROR provided in the IDL message. For example, NC_ERROR=-51 corresponds to nf_enotnc. It takes a bit of imagination, but that code can be understood as "not a NetCDF file". You can confirm that interpretation by noticing that the string "nf_enotnc" appears again in a later line. The line just above that line is the interpretation for the code, and it reads "not a netcdf file".

To summarize, a good way to use ' netcdf.inc' in debugging is
  1. Do a text search in it for the NC_ERROR value that IDL output. That will give you the cross-reference to the NetCDF error name associated with the error number.
  2. Now do a text search for the error name to see if 'netcdf.inc' has an explanatory comment about that error.
  3. Even if there is no explanatory comment, the substring that follows "nf_e" in the error name will probably give you a good clue as to what the error means.

Reviewed 10/15/14 by PS

2 comments on article "Deciphering NC_ERROR Codes"

Avatar image

Sorosh Shoaie

Dear Excelis,

I have an "NC_ERROR=-31" error, and I have tried to use the NetCDF library to find out what that stands for, however, for some reason, the "Appendix D NetCDF-3 Error Codes" does not contain the "-31" index, but starts with the "-33" index.

My code is: "id=ncdf_open('Oa01_radiance.nc')", which gives the following error message: "NCDF_OPEN: Unable to open the file"Oa01_radiance.nc". (NC_ERROR=-31)".

I thought it might have something to do with the path of the file, so I tried to find the path by using the following function: "path=filepath('S3A_OL_1_ERR', subdir=['TDS'])" which resulted in a path. I then copied that complete path and pasted it before the file name and it resulted in the following: "id=ncdf_open('/software/idl/8.2/idl82/TDS/S3A_OL_1_ERR/Oa01_radiance.nc')"

Unfortunately it gives me the same error. I hope I have been able to clearly explain what the problem is, I have spend quite some time in order to figure this out without any result.

I hope you can help me.


Avatar image

Sorosh Shoaie

I solved the problem, it seemed to be the path that was wrongly indicated. I solved it by dragging the file in the terminal window, which then shows the complete path.

Please login or register to post comments.
Featured

End-of-Life Policy Enforcement for ENVI 5.3 / IDL 8.5 and Earlier Versions

5/6/2024

April 1, 2024 Dear ENVI/IDL Customer,  We are reaching out to notify you of our supported... more »

How to Upgrade licenses to ENVI 6.x / IDL 9.x

12/5/2023

What is the new Upgrade function? Starting with ENVI 6.0 and IDL 9.0, we have implemented an... more »

What to do if the 'License Administrator - License Server' for the Next-Generation License Server does not start?

6/13/2023

Background: With the release of ENVI 5.7 & IDL 8.9 and the corresponding Next-Generation licensing... more »

Next-Generation Licensing FAQ

4/28/2023

  NV5 Geospatial has adopted a new licensing technology for all future releases of our ENVI, IDL... more »

The IDL Virtual Machine

6/6/2013

What is the IDL Virtual Machine? An IDL Virtual Machine is a runtime version of IDL that can... more »