12.07.2015 Views

PGI Fortran - Servidor WWW del Cluster Ladon-Hidra

PGI Fortran - Servidor WWW del Cluster Ladon-Hidra

PGI Fortran - Servidor WWW del Cluster Ladon-Hidra

SHOW MORE
SHOW LESS
  • No tags were found...

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

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

SpecifierDescriptionPOSITION=pos Specifies the position of an opened file. ASIS indicates the file positionremains unchanged. REWIND indicates the file is to be rewound, andAPPEND indicates the file is to positioned just before an end-of-filerecord, or at its terminal point.RECL=rlSTATUS=staWhere rl is an integer which defines the record length in a file connectedfor direct access and is the number of characters when formattedinput/output is specified. This specifier must only be given when a file isconnected for direct access.The file status where sta is a character expression: it can be NEW, OLD,SCRATCH, REPLACE or UNKNOWN. When OLD or NEW is specified a filespecifier must be given. SCRATCH must not be used with a named file.The default is UNKNOWN.A unit may be the subject of a CLOSE statement from within any module. If the unit specifieddoes not exist or has no file connected to it, the use of the CLOSE statement has no effect.Provided the file is still in existence it may be reconnected to the same or a different unit after theexecution of a CLOSE statement. Note that an implicit CLOSE is executed when a program stops.In the following example the file on UNIT 6 is closed and <strong>del</strong>eted.CLOSE(UNIT=6,STATUS='DELETE')5.3 Data Transfer StatementsOnce a unit is connected, either using a preconnection, or by executing an OPEN statement, datatransfer statements may be used. The available data transfer statements include: READ, WRITE,and PRINT. The general form for these data transfer statements is shown in Chapter 3, FortranStatements; refer to that section for details on the READ, WRITE and PRINT statements and theirvalid I/O control specifiers.5.4 Unformatted Data TransferUnformatted data transfer allows data to be transferred between the current record and the itemsspecified in an input/output list. Use OPEN to open a file for unformatted output:OPEN (2, FILE='new.dat', FORM='UNFORMATTED')The unit specified must be an external unit.Fortran Intrinsics 155

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

Saved successfully!

Ooh no, something went wrong!