problem with constants

Hi!

In my modules I defined the parameter Float to be 4.
For the rest I refer to this constant to construct my variables and parameters as REAL(Float). Today I came across a situation where I had to upgrade to Float = 8. Now the program started complaining about a multiplication with 1.2, because it should have been 1.D2 instead!
This makes it less trivial to swap from Float=4 to Float=8 and backwards.

Is there a solution to this that allows me to use the “less accurate” 1.2
in my (temporarily) higher precision use of modules?

Thanks,

Arjan

While I couldn’t get pgf90 to complain in a simple example, you can promote 1.2 to Float kind with 1.2_Float, then it should not complain and will be portable as you adjust Float.

Thanks, I’ll try it.

Arjan