如何在fortran中停止调用子程序

问题描述 投票:0回答:0

我正在尝试在我的代码中调用一个如下所示的子例程;

           CALL RAYLEY(SIGR,AL2,Fwater,FNCR)

当代码到达这一行时,它给了我;

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

我相信我知道为什么会发生这种情况,因为当这个子例程运行其计算时,在迭代一段时间后,它最终会为其中 2 个变量生成零。这会导致错误的算术表达式。当变量等于 0 时,是否可以强制停止调用子例程,从而避免这种情况?

fortran call exit subroutine
© www.soinside.com 2019 - 2024. All rights reserved.