How do I verify that my port of the CCM to machine X is correct?
A paper has been published describing the procedure we use to ensure that the
CCM is producing "correct" answers (i.e. relative to a trusted machine and
compiler) when porting the code to a different machine or using a different
compiler. Please see:
Rosinski, J.M. and D.L. Williamson, 1997:
The accumulation of rounding errors and port validation for global
atmospheric models.
SIAM J. Sci. Comput., 18, 552-564.
for details. The bottom line is that 2 CCM3 simulations generated on
different machines or using different compilers or compiler options should
diverge no faster than 2 simulations generated on a "trusted" machine and
compiler where one of the simulations has a minimal perturbation imposed on
the initial conditions. There is a namelist variable available in CCM3 which
applies such a perturbation. It is called PERTLIM (see pg. 24 of the CCM3
User's Guide). An appropriate setting would be 1.E-14. It is primarily on
the basis of this procedure that we have verified CCM3 behavior and provided
switches for various architectures such as RS6K, SGI, and SUN.
One caveat must be mentioned here since the paper was written before
the land surface model (LSM) was a standard component of the CCM. In order
for the procedure outlined above to be useful, the solution difference growth
must behave "reasonably" in the sense that large jumps in the RMS difference
of a prognostic field should be avoided. An additional namelist variable,
PERGRO (in the LSM namelist and mentioned on pg. 25 of the CCM3 User's Guide)
needs to be set to .true. when applying the random perturbation and port
test.
Also, there are 2 LSM code changes which will be provided with the next
release of CCM3 (a few months from now) which need to be applied in the port
validation exercise outlined above. To change CCM3.2 code do the following:
1) In lsmzen.F, change the line which reads:
mcsec = (calday - int(calday)) * 86400.
to
mcsec = nint((calday - int(calday)) * 86400.)
2) In laktem.F, change the line which reads:
if (rhow(j,k) .gt. rhow(j+1,k)) then
to
if (rhow(j,k) .gt. rhow(j+1,k)+1.e-4) then
When applying the above test to machines which use a different floating
point format (e.g. between CRAY and SGI), the Gaussian weights and Legendre
polynomials need to be the same on each machine. In the next release of
CCM3, this will be accomplished by using real*16 arithmetic in these
routines.
Finally, be sure to reset PERGRO to .false. for ANY CCM runs other than
this special case test of perturbation error growth.
------------------------------------------------------------------------
CCM Core Group National Center for Atmospheric Research
ccm@ncar.ucar.edu Climate and Global Dynamics Division
http://www.cgd.ucar.edu/cms/ccm3 Boulder, Colorado