Hi,
I am writing out to a file using a formatted string.
I was an exponent scientific format with 3 digits in the exponent.
Here is a test.f code:
program test
implicit none
integer :: iseq
real(8) :: time
character (1) :: snl='6'
time = 3.456
iseq = 2
iseq=mod(iseq+1,1000000)
write(*,"(i"//snl//"."//snl//",' ',ES25.16E3)") iseq,time
write(*,"(i"//snl//"."//snl//",a,ES25.16E3)") iseq,' ',time
end program test
When I run this using gfortran, I get what I expect:
$ gfortran test.f ;./a.out
000003 3.4560000896453857E+000
000003 3.4560000896453857E+000
with 6 spaces between the int and the float (the 4 I ask for, plus the 2 from the 25-width (to cover the sign and an additional space) but when I run with nvfortran, I get:
$ nvfortran test.f -o a.out.nv;./a.out.nv
000003 3.4560000896453857E+00
000003 3.4560000896453857E+00
which has 7 spaces and there are only 2 digits for the exponential!
This is a HUGE problem as we need this format to be correct for some python post processing scripts.
Even worse, on the NCSA Delta machine, this same code sometimes outputs
000003 3.4560000896453857E+00
with only 3 spaces in between!
If this is a bug, is there any way I can make the code output the correct format in the mean time (work around)?
Thanks!
– Ron