Documentation update? gfortran return the size of an assumed-rank dummy argument

Damian Rouson damian@sourceryinstitute.org
Thu Oct 29 18:22:00 GMT 2015


All,

The transcript below shows that gfortran returns 1 for the size of an assumed-rank dummy argument associated with a scalar actual argument, which is the behavior I had hoped to see.  I assume this means the following documentation needs to be updated to reflect that the first argument to SIZE need be an array (unless an assumed-rank dummy argument is classified as an array):

https://gcc.gnu.org/onlinedocs/gfortran/SIZE.html



$ cat size-assumed-rank.f90 
program main
  implicit none
  real :: a
  call foo(a)
contains
  subroutine foo(x)
    real, intent(in) :: x(..)
    print *,size(x)
  end subroutine
end program
$ gfortran size-assumed-rank.f90 
n$ ./a.out
           1
localhost:Desktop rouson$ gfortran --version
GNU Fortran (MacPorts gcc6 6-20151018_0) 6.0.0 20151018 (experimental)



________________________________
Damian Rouson, Ph.D., P.E.
President, Sourcery Institute
http://www.sourceryinstitute.org
+1-510-600-2992 (mobile)



More information about the Fortran mailing list