Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

No leading zero in real output

sgibby
Beginner
1,280 Views
How can I produce no leading zero in real output using VF 6.6A compiler?

I am porting a code from RS/6000 that does not report leading zeroes in real output.
0 Kudos
3 Replies
durisinm
Novice
1,280 Views
According to the Visual Fortran Language Reference Manual, the F edit descriptor requires that output values have at least one digit to the left of the decimal point. With the E and D descriptors, though, a zero to the left of the decimal point is optional. It seems that changing your FORMAT statements to write out values in exponential notation with an appropriate field width would suppress leading zeros.

Another option is to write the values to a character field as an internal file and then to scan the field and manually remove leading zeros.

I don't know if there's a compiler option to control this.

Mike
0 Kudos
james1
Beginner
1,280 Views
You can try PowerStation compatibility /fpscomp I believe it didn't use leading zeros.

James
0 Kudos
Steven_L_Intel1
Employee
1,280 Views
No, there's no option for this - sorry.

Steve
0 Kudos
Reply