fortran90 bugreport

Steve Kargl sgk@troutmask.apl.washington.edu
Tue Oct 25 13:02:00 GMT 2011


On Tue, Oct 25, 2011 at 09:17:46PM +0900, naoya.takahashi wrote:
> Hello!
> 
> This is Naoya-Takahashi. I Have a trouble. I want to change F77 code
> from F90 code. But, I faced on a trouble!
> 
> Pleese see the source code(PRO11_b.f90) and debugreport.txt. The
> variable ITM is 1 to 24 step 1. Otherwise
> 
> it became 183600. I can't understand the number. Anyone please teach me.
> 

Before jumping into gdb to debug your code, try using
-fcheck=all or -fbounds-check.  Compiling and running
your code, I see

laptop:kargl[203] gfc4x -o z -fcheck=all PRO11_b.f90 
PRO11_b.f90:46.39:

      CALL CALH(H,Z,B,Q,SN,H0,G,DX,EPS,IE,NJ)
                                       1
Warning: Type mismatch in argument 'ie' at (1); passed REAL(8) to REAL(4)
laptop:kargl[204] ./z
At line 23 of file PRO11_b.f90
Fortran runtime error: Index '7' of dimension 1 of array 'ptim' above upper bound of 6

It appears that you are writing to an out-of-bounds array element,
which probably overwrite the value of I.

-- 
Steve



More information about the Fortran mailing list