Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP Fortran Compiler for HP-UX: HP Fortran Programmer's Reference > Chapter 10 HP Fortran statements

BUFFER IN (extension)

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

Provided for compatibility with the BUFFER IN Cray statement.

NOTE: Asynchronous I/O with the BUFFER IN statements is not supported. HP Fortran 90 Draft supports these statements for synchronous I/O only.

Syntax

BUFFER IN (unit, mode) (begin-loc, end-loc)
unit

is a unit identifier (integer expression).

mode

is ignored.

begin-loc, end-loc

are symbolic names of the variables, arrays, or array elements that mark the beginning and end locations of the BUFFER IN operation. begin-loc and end-loc must be either elements of a single array (or equivalenced to an array) or members of the same common block.

Description

The BUFFER IN statement is an HP Fortran extension that provides compatibility with the Cray BUFFER IN feature. The statement causes data to be transferred while allowing any subsequent statements to execute concurrently.

The BUFFER IN statement is provided as a porting aid for existing Cray code; it typically will not produce superior performance compared to conventional Fortran 90 I/O methods.

  • Other Fortran I/O statements (i.e., READ, WRITE, PRINT, ACCEPT, and TYPE) cannot be used on the same unit as the BUFFER IN statement. Mixing the standard Fortran 90 I/O operations with BUFFER IN on the same logical unit number can confuse the input stream (READ) or corrupt the data file (WRITE).

  • The BACKSPACE statement cannot be used with files that are capable of being transferred by the BUFFER IN statement. Such files are referred to as pure-data (unblocked) files.

Examples

The following program shows how to use the BUFFER IN and BUFFER OUT statements. The program must be compiled with the +autodbl option.

PROGRAM bufferedIoTest
! buffered i/o example: compile with +autodbl
   INTEGER a(10)
   OPEN ( UNIT = 7, NAME = ’test.dat’, FORM = ’UNFORMATTED’ )
   a = (/ (i,i=1,10) /)                  ! initialize the array A
   BUFFER OUT ( 7, 0 ) ( a, a(10) )      ! write out A twice
   CALL unit  ( 7 )
   BUFFER OUT ( 7, 0 ) ( a, a(10) )
   CALL unit  ( 7 )
   ! now position the file 40 bytes (5 integer values) into the    file
   CALL setpos ( 7, 5 )
   ! read the remainder of the 1st record, and half of the second
   BUFFER IN ( 7, 0 ) ( a, a(10) )
   WRITE(6,*) a
   CLOSE (7)
END PROGRAM bufferedIoTest

Related statements

BUFFER OUT

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© Hewlett-Packard Development Company, L.P.