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.
Hi, > I am using the netCDF library on an IBM Risc6000. > which is running AIX v3.2 The netCDF library was built by > someone else on this platform. I have no problem reading > and writing netcdf files using the C routines, but I am > only able to read - not write - files using the Fortran > calls. Specifically: when I try NCID=NCCRE(etc.,.....) > it always returns a bad flag. I have of course tested > the program by writing ascii files beforehand. > What do you think might be wrong? If you still have the sources from which the netCDF library was built, could you please run (or have the person who built the library run) "make test" from the top-level or from the netcdf/fortran subdirectory to see if the Fortran interface tests that are distributed with the library run OK? The Fortran test program tests every interface, including NCCRE, and checks the values of the returned error flags. If the "make test" reveals problems in the library, you might want to look at a description of a problem and workaround with AIX 3.2 that's contained in the netCDF FAQ at http://www.unidata.ucar.edu/packages/netcdf/faq.html I've appended a copy of this question and answer, in case it's relevant. If the "make test" works OK, then I suspect the problem is with permissions. Do you have permissions set properly to permit you to create files in the directory in which you are seeing NCCRE failures? Are you using the NCCLOB flag to replace any existing file by the same name? If not, you will get an error if a file already exists by the name you are trying to create. ______________________________________________________________________________ Russ Rew UCAR Unidata Program address@hidden http://www.unidata.ucar.edu 12. Is there a problem with building netCDF under AIX 3.2? We have observed a problem with the optimizer in the C compiler of AIX 3.2. The default for our configure script is to specify optimization by using the "-O" compiler flag, but that causes the netCDF library to be built incorrectly under AIX 3.2, with the symptom that "make test" will fail even though there are no compile or link errors when building from source. A workaround is to build the netCDF library with CFLAGS="" (or "-g") explicitly, by setting the environment variable CFLAGS to "" or "-g" before invoking configure, or by using one of the other methods suggested in the INSTALL file to prevent the use of the "-O" flag for compilation. The specific file that is incorrectly compiled with "-O" is libsrc/string.c, so another workaround is to recompile that file without "-O". Delete the ncgen and ncdump executables before rebuilding, so they will get rebuilt using the new library. NOTE: This is no longer a problem on AIX 4.1.2.