24.05.2014 Views

XL Fortran Enterprise Edition for AIX : User's Guide - IBM

XL Fortran Enterprise Edition for AIX : User's Guide - IBM

XL Fortran Enterprise Edition for AIX : User's Guide - IBM

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

I/O Redirection<br />

The important things to note are:<br />

▌1▐ The behavior of the xlf90, xlf90_r, xlf90_r7, xlf95, xlf95_r, and xlf95_r7<br />

commands when you do not specify an option is different from <strong>XL</strong> <strong>Fortran</strong><br />

Version 2.3 in this case. The <strong>Fortran</strong> 90 and <strong>Fortran</strong> 95 standards require this<br />

behavior. To minimize migration problems, the xlf, xlf_r, xlf_r7, f77, and <strong>for</strong>t77<br />

commands keep the same default as <strong>XL</strong> <strong>Fortran</strong> Version 2.3 and append to the<br />

end of the file.<br />

Attention: If your program depends on the old behavior to append to the end<br />

of an existing file with STATUS=’OLD’, you need to use the option<br />

-qposition=appendold or POSITION= specifiers when making the switch to<br />

the xlf90, xlf90_r, xlf90_r7, xlf95, xlf95_r, or xlf95_r7 command. Otherwise,<br />

when you compile the program with these commands and run it, the new data<br />

will overwrite the file instead of appending to it.<br />

▌2▐ -qposition=appendold produces the default <strong>XL</strong> <strong>Fortran</strong> Version 2.3<br />

behavior <strong>for</strong> positioning the file pointer. This option is in the configuration-file<br />

stanza <strong>for</strong> the xlf, xlf_r, xlf_r7, f77, and <strong>for</strong>t77 commands but is not in the<br />

configuration-file stanza <strong>for</strong> the xlf90, xlf90_r, xlf90_r7, xlf95, xlf95_r, and<br />

xlf95_r7 commands.<br />

▌3▐ This file position was not possible in <strong>XL</strong> <strong>Fortran</strong> Version 2.3.<br />

Preserving the <strong>XL</strong> <strong>Fortran</strong> Version 2.3 File Positioning<br />

If you are upgrading from <strong>XL</strong> <strong>Fortran</strong> Version 2.3 and want the file positioning to<br />

work the same way as be<strong>for</strong>e, note the following guidelines:<br />

v<br />

v<br />

As long as you continue to use the xlf_r, xlf_r7, xlf, f77, and <strong>for</strong>t77 commands,<br />

you do not need to make any changes.<br />

When you make the transition to the xlf90, xlf90_r, xlf90_r7, xlf95, xlf95_r, and<br />

xlf95_r7 commands:<br />

– Add -qposition=appendold <strong>for</strong> programs that were previously compiled<br />

without any -qposition option.<br />

– Add -qposition=appendold:appendunknown <strong>for</strong> programs that were<br />

previously compiled with -qposition=append.<br />

You can use the redirection operator on the command line to redirect input to and<br />

output from your <strong>XL</strong> <strong>Fortran</strong> program. How you specify and use this operator<br />

depends on which shell you are running. Here is a ksh example:<br />

328 <strong>XL</strong> <strong>Fortran</strong> <strong>Enterprise</strong> <strong>Edition</strong> <strong>for</strong> <strong>AIX</strong> : User’s <strong>Guide</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!