Problem with LOC intrinsic for assumed size arrays

Mark Hesselink mhesseli@caltech.edu
Tue Jan 24 22:24:00 GMT 2006


Dear all,

While trying to compile FMS (http://www.gfdl.noaa.gov/fms/) I came 
across a problem with the LOC intrinsic for assumed size arrays. The 
following code produces the error below:

PROGRAM loc_1
CONTAINS
    SUBROUTINE f (x)
       INTEGER, DIMENSION(*)   :: x
       INTEGER                 :: address
       address=LOC(*)
    END SUBROUTINE f
END PROGRAM loc_1

[aardschokker:fms/trunk/obj] mark% /usr/local/bin/gfortran -c loc_1.f90
  In file loc_1.f90:6

       address=LOC(*)
                  1
Error: Syntax error in argument list at (1)

This code has been compiled with

[aardschokker:fms/trunk/obj] mark% /usr/local/bin/gfortran -v
Using built-in specs.
Target: powerpc-apple-darwin7.9.0
Configured with: /storage/usr/src/gcc/configure --prefix=/usr/local 
--disable-libmudflap --enable-altivec --enable-languages=c,fortran 
--with-gmp=/sw --with-mpfr=/sw
Thread model: posix
gcc version 4.2.0 20060121 (experimental)

Thanks,

Mark Hesselink



More information about the Fortran mailing list