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.
Sue Yang, > To: <address@hidden> > From: "Xue (Sue) YANG" <address@hidden> > Subject: Re: netcdf > Organization: ? > Keywords: 200107050049.f650nC104302 netCDF Fortran real The above message contained the following: > We've got netcdf installed on our Irix6.5 machine. We konw that the > size of real variables for the netCDF external data types in the > FORTRAN interface are 32 bits. We wonder whether we can change the > size to 64 bits by recompiling the software? If so, would you give us > any suggestions about how to do it? > > Thanks! > > Sue YANG The size of netCDF variables of type NF_FLOAT and NF_DOUBLE are 32-bits and 64-bits, respectively. These sizes can't be changed. The netCDF library is capable, however, of transferring netCDF NF_FLOAT variables (32-bits) to and from 64-bit Fortran variables (of type REAL or DOUBLEPRECISION -- depending on the platform). The library is also capable of transferring netCDF NF_DOUBLE variables (64-bits) to and from 32-bit Fortran variables (although some loss of precision may occur). If you wish to save values in a netCDF file using a 64-bit floating-point representation, then I recommend defining the netCDF variables as type NF_DOUBLE and transferring the values between whatever Fortran variables are 64-bits wide on the system in question. The software should not need to be recompiled. Contact me if you have further questions. Regards, Steve Emmerson <http://www.unidata.ucar.edu>