From e1ba175efbb0bfdd17dbbc8d641628014e3db63a Mon Sep 17 00:00:00 2001 From: Daniele Micheletti Date: Wed, 14 Oct 2015 10:26:05 +0000 Subject: [PATCH] added test in pol_limit for anpl=0 to avoid 0/0 expressions --- src/gray.f | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/gray.f b/src/gray.f index fc7361c..8ba7b8d 100644 --- a/src/gray.f +++ b/src/gray.f @@ -5083,8 +5083,14 @@ c exom=(ffo*csgam-ui*anpl*sngam)/sqrt(deno) eyom=(-ffo*sngam-ui*anpl*csgam)/sqrt(deno) c - exxm=(ffx*csgam-ui*anpl*sngam)/sqrt(denx) - eyxm=(-ffx*sngam-ui*anpl*csgam)/sqrt(denx) +c if anpl=0 the expressions for exxm and eyxm are 0/0 + if (anpl.eq.0.0_wp_) then + exxm=-ui*sngam + eyxm=-ui*csgam + else + exxm=(ffx*csgam-ui*anpl*sngam)/sqrt(denx) + eyxm=(-ffx*sngam-ui*anpl*csgam)/sqrt(denx) + end if c if (sox.lt.0.0_wp_) then ext=exom