g-editing with Intel compiler v13.0

g-editing with Intel compiler v13.0

Hello,

it appears that the output generated by the g edit descriptor has been changed between

version 12.1 and 13.0.  Consider the following example:

  print '(a,5g10.3)', "g10.3:", 0.0, 1.0, 1.23, 123., 1234.
  print *
  print '(a,5g10.1)', "g10.1:", 0.0, 1.0, 0.1, 0.01, 10.
end

With v12.1 I get:

g10.3:  0.00      1.00      1.23      123.     0.123E+04
 
g10.1:    0.        1.       0.1       0.1E-01   0.1E+02

while version 13.0.0.079 writes:

g10.3:  0.00     1.000      1.23      123.     0.123E+04
 
g10.1:    0.       1.0       0.1E+00   0.1E-01   0.1E+02

Is there a reason why 1. is printed differently with g10.3,

or similarly why 0.1 has an exponent for g10.1?

Regards,

Harald

4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

The rules for G editing changed in Fortran 2008 and, I think, again in Corrigendum 1 for F2008. I know we made changes in this area but will have to study your example to see if we got it all right.

Steve - Intel Developer Support

Hi Steve,

I checked the table in the F2008 FDIS in section 10.7.5.2.2:

Magnitude of Internal Value Equivalent Conversion
N =0 F(w −n).(d − 1), n(’b’)
0.1 − r × 10^−d−1 ≤ N < 1 − r × 10^−d F(w −n).d, n(’b’)
1 − r × 10^−d ≤ N < 10 − r × 10^−d+1 F(w −n).(d − 1), n(’b’)
...

I'm not sure what the default rounding mode is, but the cases of 0.1 and 1.0
of the above example appears to be covered by the lines quoted here,
and the equivalent format should be Fx.y in the way generated by version 12.1,
not by version 13.0. I could not find anything in the Corrigendum 1 for F2008.

Harald

Steve,

I just checked this case with the following compiler version:

Intel(R) Fortran Compiler XE for applications running on IA-32, Version 14.0.1.106 Build 20131008

I now obtain:

g10.3:  0.00      1.00      1.23      123.     0.123E+04
 
g10.1:    0.        1.       0.1       0.1E-01   0.1E+02

This nicely agrees with the result from v12.1 and should be correct now.

Thanks,

Harald

 

Leave a Comment

Please sign in to add a comment. Not a member? Join today