[mpas-developers] comments on MPAS code

Michael Duda duda at ucar.edu
Wed May 19 16:35:34 MDT 2010


Hi, Todd and Phil.

Thanks very much for the comments; I think this might be something
worth fixing even in our current prototype, as it doesn't look
like it would require much effort.

In future, we'll definitely want to be writing code that is
interoperable with C (using the F2003 ISO_C_BINDING module, for
example); in your experience, are there additional considerations
when passing values between C and Fortran? It seems like we'll
need some way to ensure that the size of reals in C matches the
size of reals in Fortran so that, e.g., when we pass a pointer to
a real array from C to Fortran, the values will be correctly used
in Fortran code. 

Also, for interacting with libraries such as netCDF, where we need
to specify a kind (NF_REAL, NF_DOUBLE, etc.) as an argument to the
library call, do either of you have any thoughts on how best to
handle this?

Cheers,
Michael


On Wed, May 19, 2010 at 02:25:26PM -0600, Philip Jones wrote:
> 
> Todd et al.,
> 
> > * The macro RKIND is used with values 4 or 8 to indicate
> >  either 4 or 8-byte reals.
> 
> Using the selected_real_kind intrinsic is a good
> portable way to handle this.
> 
> >  ...  Unfortunately different compilers can have
> >  different notions of what '-r8' does,
> 
> Indeed, we've had very bad experiences with such
> autopromotion in the past...
> 
> Phil
> 
> ---
> Correspondence/TSPA/DUSA AOE
> ------------------------------------------------------------
> Philip Jones                                pwjones at lanl.gov
> T-3 MS B216                                 Ph: 505-667-6387
> Los Alamos National Lab                    Fax: 505-665-5926
> Los Alamos, NM 87545-1663
> 
> 
> 
> _______________________________________________
> mpas-developers mailing list
> mpas-developers at mailman.ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/mpas-developers


More information about the mpas-developers mailing list