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...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

In addition list may contain one of each of the specifiers shown in Table 5-1 .5.2.1 Direct Access FilesIf a file is connected for direct access using OPEN with ACCESS='DIRECT', the record lengthmust be specified using RECL=, and optionally one of each of the other specifiers may be used.Any file opened for direct access must be via fixed length records.In the following example a new file, book.dat, is created and connected to unit 12 for directformatted input/output with a record length of 98 characters. Numeric values will have blanksignored and the variable E1 will be assigned some positive value if an error condition exists whenthe OPEN statement is executed; execution will then continue with the statement labeled 20. If noerror condition pertains, E1 is assigned the value 0 and execution continues with the statementfollowing the OPEN statement.OPEN(12,IOSTAT=E1,ERR=20,FILE='book.dat',BLANK='NULL',+ACCESS='DIRECT',RECL=98,FORM='FORMATTED',STATUS='NEW')5.2.2 Closing a FileClose a unit by specifying the CLOSE statement from within any program unit. If the unitspecified does not exist or has no file connected to it, 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. An implicit CLOSE is executed when a program stops.The CLOSE statement terminates the connection of the specified file to a unit.CLOSE ([UNIT=] u [,IOSTAT=ios] [,ERR= errs ][,STATUS= sta] [,DISPOSE= sta] [,DISP= sta])CLOSE takes the status values IOSTAT, ERR, and STATUS, similar to those described in Table5-1. In addition, CLOSE allows the DISPOSE or DISP specifier which can take a status value stawhich is a character string, where case is insignificant, specifying the file status (the samekeywords are used for the DISP and DISPOSE status). Status can be KEEP or DELETE. KEEPcannot be specified for a file whose dispose status is SCRATCH. When KEEP is specified (for afile that exists) the file continues to exist after the CLOSE statement, conversely DELETE <strong>del</strong>etesthe file after the CLOSE statement. The default value is KEEP unless the file status is SCRATCH.Fortran Intrinsics 153

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

Saved successfully!

Ooh no, something went wrong!