tags:

views:

182

answers:

1

Hi!

I've having trouble with some old code used for research that I would like to compile using the Intel Fortran compiler. In a particular subroutine, I get segmentation faults unless I add in a write statement that just outputs the value of the loop index.

do j=1,ne

SOME STUFF

write(*,*) 'j=', j

end

What could be causing my error such that this write statement would fix my segmentation fault? (Note: j is declared as an integer)

thanks, keely

+4  A: 

Keely

Classic ways of causing this type of error which is 'fixed' by inserting write statements:

a) walking off the end of an array -- use your compiler to switch on bounds-checking and debugging options to check for this;

b) disagreement between arguments provided to a sub-program and arguments expected. Again, use your compiler if possible, your eyes otherwise.

Odds are 5-to-1 that one of these is the cause.

Regards

Mark

High Performance Mark