Fortran runtime error "fixed" by writing output

I'm having problems with some old code used for research, which I would like to compile using the Intel Fortran compiler. In a particular routine, I get segmentation errors if I do not add to the write statement, which simply displays the loop index value.

 do j=1,ne SOME STUFF write(*,*) 'j=', j end 

What could be causing my error, so this write statement will correct my segmentation error? (Note: j is declared as an integer)

thanks keely

+4
source share
1 answer

The classic ways to cause this type of error, which is "fixed" by inserting entries:

  • Coming out of the end of the array - use your compiler to enable border checking and debugging options to check this;

  • disagreement between the arguments provided to the subroutine and the expected arguments. Again, use your compiler if possible, your eyes otherwise.

Odds from 5 to 1, which is one of the reasons.

+6
source

All Articles