[Users] best way to maintain CCTK_COMPLEX precision with Fortran?

Bernard Kelly physicsbeany at gmail.com
Sun Jul 19 13:16:05 CDT 2015


Hi all.

The Cactus documentation shows a set of C routines CCTK_CmplxXXXXXX
that presumably preserve precision between CCTK_REAL and CCTK_COMPLEX
types. Is there a "right" way to handle this in Cactus with Fortran
(that isn't "recode in C")?

Context: I have some Fortran code in a Cactus thorn that works with
real & complex fields. I've noticed that when the numbers are very
large in magnitude, taking a simple real(z) drops precision --- a
finite but large real part ends up as +/- Inf instead. I suspect it's
dropping to single precision at some stage. Switching to "dreal"
doesn't help, and avoiding the use of CCTK_COMPLEX altogether ---
while possible --- leads to longer, less readable code.

Thanks,

Bernard


More information about the Users mailing list