This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

routine call with allocatable argument


Hi,

I have a routine A like this :
subroutine A(tab)
real(kind=long),dimension(:),allocatable,intent(inout):: tab
etc.

There is a second routine B which call A :

subroutine B(tab)
real(kind=long),dimension(:,:),allocatable,INTENT(INOUT)::tab
integer :: nx, ny, i
...
   if (allocated(tab)) deallocate(tab)
   allocate(tab(nx,ny))

   do i=1,nx
       call A(tab(i,:))
   end do
...

gfortran conplains with the following error message :
Error: Actual argument for 'tab' must be ALLOCATABLE at (1)
with line number of call A statement

G95 compiles this code without error message and, as far as I can know, the produced executable does its job correctly.
Which compiler is Fortran conforming ?


Regards
JBF

--
Jean-Baptiste FAURE
Cemagref - Unité de Recherche Hydrologie-Hydraulique
Tel: 04 72 20 87 76 - Fax: 04 78 47 78 75 - Web: www.lyon.cemagref.fr
Cemagref-Lyon 3bis, quai Chauveau C.P.220 69336 Lyon cedex09 FRANCE
Seuls des formats ouverts peuvent assurer la pérennité de vos documents


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]