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