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.
Juergen, > To: address@hidden > From: address@hidden > Subject: 2 Questions to netCDF 3.4 > Organization: . > Keywords: 199808030909.DAA13766 In the above message, you wrote: > I have 2 Questions to netCDF 3.4. > > 1. I want to use the fortran netcdf2.4 subroutine NCVPT1 in the netCDF3.4 > library on a CRAY J90 platform. But if I declare the variable as NCDOUBLE, > there is no data written in the netCDF output file. ( if I declare the > variable > as NCFLOAT, there are no problems!) > Here is my test program: > > program nc_w > > use netcdf > implicit none > > integer:: ncid,rcode,varid,TimeDimID,vaid > > real(KIND(0D0)) :: d > > ncid = nccre('test.nc',ncclob,rcode) > > TimeDimID = NCDDEF(NCID,'time',1,RCODE) > > VAID = NCVDEF(NCID,'time',NCDOUBLE,1,TimeDimID,RCODE) > d=-8.9E7 > > call ncendf(ncid,rcode) > > > CALL NCVPT1(NCID,VAID,1,d,RCODE) > > ! rcode= nf_put_var1_double(ncid,vaid,1,d) > ! with this 3.4 routine, it works!! > > call ncclos(ncid,rcode) > > end program nc_w > > I get following ncdump output: > > netcdf test { > dimensions: > time = 1 ; > variables: > double time(time) ; > data: > > time = _ ; > } Interesting. Apparently the C macro NF_DOUBLEPRECISION_IS_C_... in the file fortran/nfconfig.inc didn't get properly set by the configure script when the netCDF package was built. In order to help me determine why, would you please do the following: 1. Go to the top-level source directory of the netCDF package. 2. Send me the output from executing the "configure" script. 3. Send me the output from the following command: grep NF_DOUBLEPRECISION_IS_C_ fortran/nfconfig.in 4. Send me the output from the following command: grep NF_DOUBLEPRECISION_IS_C_ config.status 5. Please tell me the C data type on your Cray J90 that corresponds to the Fortran DOUBLEPRECISION data type. -------- Steve Emmerson <http://www.unidata.ucar.edu>