Re: force 32-bit longs?

From: David Brown <dbrown_at_nyahnyahspammersnyahnyah>
Date: Fri Jan 14 2011 - 15:08:25 MST

Hi Lesley,
NetCDF does not actually support the long type. If you look in the public NetCDF header file netcdf.h, you will see this:

#define NC_INT 4 /* signed 4 byte integer */
#define NC_LONG NC_INT /* deprecated, but required for backward compatibility. */

In other words, you can create a NetCDF variable as an NC_LONG, but that's actually the same as a 4-byte integer.

So you lose nothing by converting the long variables to integers, which is what you will need to do. See the function tointeger (http://www.ncl.ucar.edu/Document/Functions/Built-in/tointeger.shtml).
 -dave

On Jan 14, 2011, at 2:40 PM, lsmith@ucar.edu wrote:

> Hi guys,
> I have to create netcdf files for SPARC (Stratsopheric Processes and
> their Role in Climate) which contain "long" variables. I am using NCL
> which claims "netCDF does not support 64 bit longs". I can only assume
> I'm getting this message because I am running on a 64-bit machine. Is
> there any way to force NCL to create 32-bit longs?
> Thanks,
> -Lesley Smith
> ACD
> NCAR
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Jan 14 15:08:31 2011

This archive was generated by hypermail 2.1.8 : Tue Jan 25 2011 - 14:22:16 MST