Bugfix for CCM3 on Cray


Subject: Bugfix for CCM3 on Cray
From: ccm-core@cgd.ucar.edu
Date: Thu Oct 01 1998 - 09:14:48 MDT


CCM Users;

A user encountered a "once in many simulated decades" problem running CCM3 on
a Cray PVP machine. A fix is available on the CCM3 News page
(http://www.cgd.ucar.edu/cms/ccm3/news/). The user reported that the fix
did not change answers, but allowed the model to continue past the point
where the base code blew up. The problem has nothing to do with the code itself,
but has to do with a problem with the Cray compiler. Thus the problem does not occur
on non-Cray platforms. Furthermore, the problem causes the code to blow-up, and as
such you would only need to add this snippet of code in, if you encounter this problem.

The specific problem was as follows. In subroutine ECODYN there is the
following sequence of instructions:

         fwet(k) = max(h2ocan(k),0.) / max(maxh2o,1.e-06)
         fwet(k) = min( fwet(k), 1.) **0.667
 
In the first line, mathematically the computation of fwet(k) is guaranteed
non-negative. Unfortunately, on Cray PVP machines there are pathological
situations where the division can result in a roundoff negative. When this
happens, the second line causes a floating point error. The fix involves
inserting the statement:

          fwet(k) = max(fwet(k),0.)

between these two statements.

CCM-CORE group:



This archive was generated by hypermail 2b27 : Thu Jun 01 2000 - 09:07:02 MDT