[mpas-developers] comments on MPAS code

Todd Ringler ringler at lanl.gov
Wed May 19 11:48:27 MDT 2010


Hi All,

Neil Carlson, a scientist here at LANL who has experience with big  
software projects, has made a few comments regarding the MPAS  
prototype code. There is nothing urgent here, but we should consider  
them as we thinking about redesigning MPAS. Completely separate data  
from our CCSM ocean and sea-ice models support Neil's comments.

Cheers,
Todd


* The macro RKIND is used with values 4 or 8 to indicate
  either 4 or 8-byte reals.  The code make the assumption
  that those values are synonymous with the Fortran real kind
  values that correspond to those reals, but the standard
  doesn't require this.  Of course many compilers follow this
  convention, but there are those for which default real is
  kind=1 and double precision is kind=2.  The code ought to
  be reworked to be more standard conforming in this regard.

* The code uses default real constants everywhere and assigns
  their values to 8-byte reals.  Normally this would result in
  loss of precision (e.g., pi1 -- it doesn't matter how many
  digits are written, it will get truncated to a default real
  value before being assigned to the 8-byte real variable).
  But I assume the sole purpose of the '-r8' compiler option
  is to make these constants 8-byte, so that things work the
  'right' way.  Unfortunately different compilers can have
  different notions of what '-r8' does, and it's generally
  bad form to use compiler switches to 'fix' code that isn't
  written quite correctly.


More information about the mpas-developers mailing list