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.

c. type mytype<br />

integer a<br />

integer b<br />

end type mytype<br />

write(99,id=i) mytype(4,5)<br />

3. For WRITE, when an output item is a temporary variable:<br />

a. write(99,id=i) 99+100<br />

b. write(99,id=i) a+b<br />

c. external ff<br />

real(8) ff<br />

write(99,id=i) ff()<br />

4. For WRITE, when an output item is an expression that is an array constructor:<br />

write(99,id=i) (/1,2,3,4,5/)<br />

5. For WRITE, when an output item is an expression that is a scalarized array:<br />

integer a(5),b(5)<br />

write(99,id=i) a+b<br />

System Setup<br />

Be<strong>for</strong>e a <strong>Fortran</strong> application that is using asynchronous I/O can run on an <strong>AIX</strong><br />

system, you must enable <strong>AIX</strong> asynchronous I/O. If you did not enable <strong>AIX</strong><br />

asynchronous I/O, a <strong>Fortran</strong> program using asynchronous I/O statements cannot<br />

be loaded. This will result in the following messages being displayed:<br />

Could not load program asyncio<br />

Symbol kaio_rdwr in ksh is undefined<br />

Symbol listio in ksh is undefined<br />

Symbol acancel in ksh is undefined<br />

Symbol iosuspend in ksh is undefined<br />

Error was: Exec <strong>for</strong>mat error<br />

For in<strong>for</strong>mation on how to configure your system <strong>for</strong> asynchronous I/O, see<br />

″Changing Attributes <strong>for</strong> Asynchronous I/O″ in <strong>AIX</strong> Version 4 Kernel Extensions and<br />

Device Support Programming Concepts. If a <strong>Fortran</strong> program is not using <strong>Fortran</strong><br />

asynchronous I/O statements, it will run regardless of the availability of <strong>AIX</strong><br />

asynchronous I/O.<br />

Linking<br />

If there are no asynchronous I/O statements in an application, there is no change<br />

in the way you build an application. For example, <strong>for</strong> dynamic linking, you<br />

specify:<br />

xlf95 -o t t.f<br />

For static linking, you specify:<br />

xlf95 -o t t.f -bnso -bnodelcsect -bI:/lib/syscalls.exp<br />

If there are asynchronous I/O statements in an application, you need additional<br />

command-line options <strong>for</strong> static linking. For example:<br />

xlf95 -o t t.f -lc -bnso -bnodelcsect \<br />

-bI:/lib/syscalls.exp -bI:/lib/aio.exp<br />

Note that the additional options are -lc and -bI:/lib/aio.exp.<br />

The following table summarizes the options that you need to bind applications in<br />

different situations:<br />

Implementation Details of <strong>XL</strong> <strong>Fortran</strong> Input/Output 339

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

Saved successfully!

Ooh no, something went wrong!