[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

20041201: Unneeded line in netcdf-3.5.1 library test program (fwd)



Jonathan,

This problem should be fixed in the latest (beta) version of the netCDF
package, which is available at

    ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-beta.tar.gz

Don't be put-off by the "beta" designation.

Otherwise, if you don't want to use the latest version, then you should
modify the file nf_test/nf_test.F, replacing

    #if defined(VISUAL_CPLUSPLUS)
    !       DIGITAL Visual Fortran needs DFLIB for getarg
            USE DFLIB
    !       DIGITAL Visual Fortran needs DFPORT for iargc
            USE DFPORT
            implicit        none
    #else
            implicit        none
            integer         iargc
    #endif

with

    #if defined(VISUAL_CPLUSPLUS)
    !       DIGITAL Visual Fortran needs DFLIB for getarg
            USE DFLIB
    !       DIGITAL Visual Fortran needs DFPORT for iargc
            USE DFPORT
            implicit        none
    #elif defined(NAGf90Fortran)
            USE F90_UNIX_ENV, only : iargc, getarg
            implicit        none
    #else
            implicit        none
            integer         iargc
    #endif

This is a better solution than simply removing the "integer" declaration
of "iargc" (it's used as a function).

Regards,
Steve Emmerson

NOTE: All email exchanges with Unidata User Support are recorded in the
Unidata inquiry tracking system and then made publicly available
through the web.  If you do not want to have your interactions made
available in this way, you must let us know in each email you send to us.

------- Original Message

>To: address@hidden
>From: "Jonathan T. Parker" <address@hidden>
>Subject: Unneeded line in netcdf-3.5.1 library test program
>Organization: UCAR/Unidata
>Keywords: 200412011414.iB1EEHlI026835

Greetings,

I was attempting to compile netcdf-3.5.1 on my Linux NAG machine.

Anyway, I was having trouble with src/nf_test/nf_test.F

I got the following:
f95 -o nf_test -g -mismatch -w=unused -DNAGf90Fortran -ieee=full -I
/usr/local/lib/fl90_modules  test_get.o test_put.o nf_error.o nf_test.o
test_read.o test_write.o util.o fortlib.o ../libsrc/libnetcdf.a  -lm
nf_test.o(.text+0x24a): In function `main':
/home/jtparker/Local/netCDF/netcdf-3.5.1/src/nf_test/nf_test.F:313:
undefined reference to `getarg_'
nf_test.o(.text+0x281):/home/jtparker/Local/netCDF/netcdf-3.5.1/src/nf_test/nf_
test.F:320: undefined reference to `iargc_'
nf_test.o(.text+0x2c2):/home/jtparker/Local/netCDF/netcdf-3.5.1/src/nf_test/nf_
test.F:325: undefined reference to `getarg_'
nf_test.o(.text+0x370):/home/jtparker/Local/netCDF/netcdf-3.5.1/src/nf_test/nf_
test.F:337: undefined reference to `getarg_'
collect2: ld returned 1 exit status
make: *** [nf_test] Error 1


So I searched around the web and found the following note on the web
page:
http://www.jcu.edu.au/archives/postgrad-bulletins/msg02684.shtml


!       JTP inserted December 1, 2004.
!       The NAG fortran compiler needed an additional module.
        USE F90_UNIX_ENV
!        NAGWare f95 Compiler
!       http://www.jcu.edu.au/archives/postgrad-bulletins/msg02684.shtml
!       The NAGWare f95 Compiler provides access to a large number of
Posix
!       system calls. Two popular examples of these are facilities to
get
!       command line arguments and the ability to execute operating
system
!       commands. Access to the Posix functions is by use of the
appropriate
!       built-in module.
!       In order to find out the number of command line arguments
!       (by calling IARGC) and to get the arguments themselves
!       (by calling GETARG) it is first necessary to use the
!       F90_UNIX_ENV module, e.g.
!       USE F90_UNIX_ENV, ONLY : IARGC,GETARG
!       Similarly the SYSTEM routine, which passes a string to the
command
!       processor for execution, is in the F90_UNIX_PROC module.
!       Seven modules providing more than 60 Posix procedures covering
!       directories, files, environment and processes are available.
!       These are fully documented in the manual, on-line and at
!       http://www.nag.co.uk/nagware/np/r41_doc/Index.asp.
!       JTP end insertion December 1, 2004


After implementing this, I received the following errors:
[jtparker@athlon3 nf_test]$ make test
+ f95 -c -g -mismatch -w=unused -DNAGf90Fortran -ieee=full -I
/usr/local/lib/fl90_modules nf_test.F
Error: nf_test.F, line 136: Redeclaration of symbol IARGC from USEd
module
       detected at INTEGER@IARGC
[f95 terminated - errors found by pass 1]
make: *** [nf_test.o] Error 2


This is the reason for my letter.
In the file nf_test.F, the variable iargc is declared as an integer, but
never used. I am no Fortran wizard, but it looks unneeded.
Is this correct? If so, then I think that you should remove the line
from your code.
I have commented out the line in my working version of the netCDF
library.

Please let me know if this is the correct.

Thanks,

-- 
Jonathan T. Parker <address@hidden>
Dept. of Atmospheric, Oceanic, and Space Sciences
University of Michigan
Computer Science Support

------- End of Original Message