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.
Nick, > I'd like to use UDUNITS, which is necessary to use readnetcdf.f > > I work on a 64bits SUN SPARC SOLARIS 8 system. The installation of > the UDUNITS package was uneventful and succesful. > > Upon compilation (f90 readnetcdf.f -L /usr/local/netcdf-3.5.0/lib/ > libnetcdf.a -lnetcdf -L lib/libudunits.a -ludunit), Just FYI, the string "-L /usr/local/netcdf-3.5.0/lib/libnetcdf.a -L lib/libudunits.a -ludunit" should, instead, probably be "-L /usr/local/netcdf-3.5.0/lib -l netcdf -L lib -l udunits". The "-L" option takes a directory as its argument and the "-l" option takes the library name as its argument. > I received > several error messages. Changing the include lines for UDUNITS to > # INCLUDE "../include.F" > and either renaming the file to readnetcdf.F or using the -fpp option > I was able to get rid of these error messages. > > However, now I got this error message: > ****************************************************** > integer UTMAKE,UTDEC,uttime > ^ > "readnetcdf.F", Line = 181, Column = 15: ERROR: "UTMAKE" has the > INTEGER attribute, therefore it must not be declared with the INTEGER > attribute. The "INTEGER attribute" error-message is one of the worst I've seen. I can only guess that it's complaining that UTMAKE was previously declared as being of type integer. Does the file "readnetcdf.F" declare UTMAKE? Does it also include the UDUNITS Fortran header-file "udunits.inc"? If so, then one of them must be deleted. > ****************************************************** > So I changed all declarations of UTMAKE and unitptr from INTEGER to > INTEGER*8 UDUNITS uses the macro UD_POINTER as the type necessary to hold a pointer to a units structure. Could it be that "readnetcdf.F" defines its own type (unitptr) and that this type must be the same as the UD_POINTER type defined in the include-file "udunits.inc"? What happens if both are defined as INTEGER*8? > Since then I get (during compilation) > ****************************************************** > ld: fatal: file f90: Fatal error in ld: Segmentation Fault (core dumped) > ****************************************************** > error messages. > > > Any help would be appreciated. I don't know the file "readnetcdf.F". You might try contacting the people who created it. > best regards, > Nick Schutgens > > > Dr. Nick Schutgens > Research fellow at CCSR, Tokyo University > phone: +81-4-7136-4395 > 5-1-5 Kashiwanoha, Kashiwa-shi > 2778568 Chiba > Japan Regards, Steve Emmerson Ticket Details =================== Ticket ID: UCS-582043 Department: Support UDUNITS Priority: Normal Status: Closed