I have encountered a very odd problem with formatted output of a real*8 value in a F77 program. The minimal code below reproduces the issue with PGI 18.4.
c1234567
program format_test
integer imax,i
real*8 time,dt
imax = 4
time = 9.98
dt = 0.01
do i=1,imax
time = time + dt
write(*,1000) time
enddo
1000 format(G12.5)
end
If I compile and run this with gfortran I observe the expected output, but with pgfortran I see the output below (note the missing zero in 10.000).
- 9.9900
1 .000
10.010
10.020
Switching the format code from G12.5 to F12.5 seems like an OK workaround for now. I think this is a bug, but perhaps I am missing something. Thanks for your advice and help.