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.

Default Record Lengths<br />

File Permissions<br />

If a pseudo-device, pipe, or character special file is connected <strong>for</strong> <strong>for</strong>matted or<br />

un<strong>for</strong>matted sequential access with no RECL= specifier, or <strong>for</strong> <strong>for</strong>matted stream<br />

access, the default record length is 32 768 rather than 2 147 483 647, which is the<br />

default <strong>for</strong> sequential-access files connected to random-access devices. (See the<br />

default_recl run-time option.)<br />

In certain cases, the default maximum record length <strong>for</strong> <strong>for</strong>matted files is larger, to<br />

accommodate programs that write long records to standard output. If a unit is<br />

connected to a terminal <strong>for</strong> <strong>for</strong>matted sequential access and there is no explicit<br />

RECL= qualifier in the OPEN statement, the program uses a maximum record<br />

length of 2 147 483 646 (2**31-2) bytes, rather than the usual default of 32 768 bytes.<br />

When the maximum record length is larger, <strong>for</strong>matted I/O has one restriction:<br />

WRITE statements that use the T or TL edit descriptors must not write more than<br />

32 768 bytes. This is because the unit’s internal buffer is flushed each 32 768 bytes,<br />

and the T or TL edit descriptors will not be able to move back past this boundary.<br />

A file must have the appropriate permissions (read, write, or both) <strong>for</strong> the<br />

corresponding operation being per<strong>for</strong>med on it.<br />

When a file is created, the default permissions (if the umask setting is 000) are<br />

both read and write <strong>for</strong> user, group, and other. You can turn off individual<br />

permission bits by changing the umask setting be<strong>for</strong>e you run the program.<br />

Selecting Error Messages and Recovery Actions<br />

By default, an <strong>XL</strong>F-compiled program continues after encountering many kinds of<br />

errors, even if the statements have no ERR= or IOSTAT= specifiers. The program<br />

per<strong>for</strong>ms some action that might allow it to recover successfully from the bad data<br />

or other problem.<br />

To control the behavior of a program that encounters errors, set the <strong>XL</strong>FRTEOPTS<br />

environment variable, which is described in “Setting Run-Time Options” on page<br />

51, be<strong>for</strong>e running the program:<br />

v To make the program stop when it encounters an error instead of per<strong>for</strong>ming a<br />

recovery action, include err_recovery=no in the <strong>XL</strong>FRTEOPTS setting.<br />

v To make the program stop issuing messages each time it encounters an error,<br />

include xrf_messages=no.<br />

v To disallow <strong>XL</strong> <strong>Fortran</strong> extensions to <strong>Fortran</strong> 90 at run time, include<br />

langlvl=90std. To disallow <strong>XL</strong> <strong>Fortran</strong> extensions to <strong>Fortran</strong> 95 at run time,<br />

include langlvl=95std. To disallow <strong>XL</strong> <strong>Fortran</strong> extensions to <strong>Fortran</strong> 2003<br />

behaviour at run time, include langlvl=2003std. These settings, in conjunction<br />

with the -qlanglvl compiler option, can help you locate extensions when<br />

preparing to port a program to another plat<strong>for</strong>m.<br />

For example:<br />

# Switch defaults <strong>for</strong> some run-time settings.<br />

<strong>XL</strong>FRTEOPTS="err_recovery=no:cnverr=no"<br />

export <strong>XL</strong>FRTEOPTS<br />

If you want a program always to work the same way, regardless of<br />

environment-variable settings, or want to change the behavior in different parts of<br />

the program, you can call the SETRTEOPTS procedure:<br />

330 <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!