How to stop calling a subroutine in fortran

61 views Asked by At

I am attempting to call a subroutine within my code that looks like this;

           CALL RAYLEY(SIGR,AL2,Fwater,FNCR)

And when the code reaches this line, it gives me;

Program received signal SIGFPE: Floating-point exception - erroneous arithmetic operation.

I believe I know why this is occurring, because as this subroutine is running its calculations, after it iterates for a while, it ends up producing zeroes for 2 of the variables. This then results in the erroneous arithmetic expression. Is it possible in anyway to force the subroutine to stop being called when a variable becomes equal to 0, so that this can be avoided?

0

There are 0 answers