speedy.f90 icon indicating copy to clipboard operation
speedy.f90 copied to clipboard

Use literals in double precision

Open tenomoto opened this issue 3 years ago • 1 comments

Unlike Python, the type of a numeric literal is implicitly assumed. Float literals are assumed to be real*4. We need to either explicitly add a type like tref = 288.0_p or promote all floats without type specification with a command line option -fdefault-real-8. With tref = 288.0, tref is declared to be real(p), but an imprecise value of real*4 is assigned without _p after the literal or without the option.

tenomoto avatar Oct 01 '22 21:10 tenomoto

The difference of surface pressure with and without -fdefault-real-8 (modified minus original). ps198201100000

tenomoto avatar Oct 01 '22 21:10 tenomoto