strange memory leak
Tobias Burnus
burnus@gmx.de
Thu Oct 19 12:45:00 GMT 2006
Hi Mattias,
mattias alveteg wrote:
> Yes, you're definitely right, I used dim= in the wrong way. I'm a bit
> surprised that neither GFortran nor Absoft noticed that at compile time.
> Thanks for pointing that out.
Well, the problem is: It is not known at compile time.
You use:
| subroutine EvaluateStateError(states1,error)
| real(rk),dimension(:,:),intent(in) :: states1
| real(rk) :: Diff(size(states1,1),size(states1,2))
| integer :: i(1),j(1)
The i(1) is correct if size(states1,2) is one. When compiling the module
there is no possibility to find out which size the argument to
EvaluateStateError will have.
The only possibility to check this is at run time. And gfortran catches
this with -fbounds-check. (It is actually a good idea to use the check
options of the compiler, if the program crashes.)
Tobias
More information about the Fortran
mailing list