Is there a way to format a real number for output such that both the width and decimal parts are left unspecified? This is possible with ifort by just doing the following:
write (*, '(F)') num
...but I understand that that usage is a compiler-specific extension. Gfortran does accept the standard-compliant 0-width specifier, but I can't find anything in the standard nor in gfortran's documentation about how to leave the decimal part unspecified. The obvious guess is to just use 0 for that as well, but that yields a different result. For example, given this:
real :: num
num = 3.14159
write (*, '(F0.0)') num
...the output is just 3.
. I know I could specify a decimal value greater than zero, but then I am liable to have undesired extra zeros printed.
What are my options? Do I have any?