data not passed to subroutine

Dirk Broemmel sftgfop@gmail.com
Thu Oct 9 16:47:00 GMT 2008


Hi there,

I'm having trouble passing data into a subroutine and I'm unsure if this
is a coding error or not. The compiler does not complain about any line
of code, but the binary produces different results on different
machines/compilers. So I'm lost.

The subroutine is called like this
 call jknife(props(1:(nfiles/nmom),nm)%val(np,d1,c1,d2,c2),jsam(:),1)

props is a type I defined and whose length is allocated before the call.
nfiles/nmom evaluates to a nice integer, no remainder.

Within the subroutine I have
 subroutine jknife(in, out, n)
    integer, intent(in)        :: n
    complex, intent(in)        :: in(:)
    type(jsample), intent(out) :: out(:)

The array 'in' within the subroutine has random content when compiled
and run on one machine (gfortran 4.1.2 20071124 (Red Hat 4.1.2-42)),
however, everything works fine on another machine (gfortran 4.2.3, 4.3.2).

Thanks,
Dirk




More information about the Fortran mailing list