Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

Adding NC_NAT to nc_type

Hi,

The modification that Harvey made to the nc_type structure is
something that I would find quite useful if it were in the 
standard netCDF distribution. That is, adding an undefined
type to the enumerated list.

        NC_NAT =         0,      /* NAT = 'Not A Type' (c.f. NaN) */

Having such a type has proved necessary when checking whether
a variable object has had its type defined yet. I do this all
the time in NCO (especially to work with packed values) and I end up 
comparing an nc_type to an integer flag, which generates a compiler
warning. It would be cleaner to be able to set the nc_type value of
un-typed objects to NC_NAT which is enumerated in nc_type.

Please consider adding this modification to netCDF 3.5.

Thanks,
Charlie

/*
 *  The netcdf external data types
 */
typedef enum {
        NC_NAT =         0,      /* NAT = 'Not A Type' (c.f. NaN) */
        NC_BYTE =       1,      /* signed 1 byte integer */
        NC_CHAR =       2,      /* ISO/ASCII character */
        NC_SHORT =     3,      /* signed 2 byte integer */
        NC_INT =           4,      /* signed 4 byte integer */
        NC_FLOAT =      5,      /* single precision floating point number */
        NC_DOUBLE =   6       /* double precision floating point number */
} nc_type;

-- 
Charlie Zender zender@xxxxxxx (949) 824-2987/FAX-3256, Department of
Earth System Science, University of California, Irvine CA 92697-3100

 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Community Programs   Unidata is a member of the UCAR Community Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690