02.05.2014 Views

Patrick Corde & Anne Fouilloux

Patrick Corde & Anne Fouilloux

Patrick Corde & Anne Fouilloux

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Fichier texte à accès direct 136<br />

7.3.2 – Fichier texte à accès direct<br />

real, dimension(100) :: tab<br />

integer ios, n<br />

OPEN( UNIT=1,<br />

&<br />

FILE="data_txt_direct", &<br />

FORM="formatted" &<br />

ACCESS="direct", &<br />

ACTION="read",<br />

&<br />

STATUS="old",<br />

&<br />

RECL=800,<br />

&<br />

IOSTAT=ios )<br />

if ( ios /= 0 ) stop "Problème à l’ouverture!"<br />

OPEN( UNIT=2,<br />

&<br />

FILE="data_txt_seq", &<br />

ACTION="read", &<br />

STATUS="old", &<br />

IOSTAT=ios )<br />

...<br />

READ( UNIT=2, FMT=* ) n<br />

READ( UNIT=1, REC=n, &<br />

IOSTAT=ios, FMT=’(100F8.4)’ ) tab<br />

if ( ios < 0 ) stop "enr. non existant!"<br />

if ( ios > 0 ) stop "erreur à la lecture."<br />

...<br />

CLOSE( UNIT=2 )<br />

CLOSE( UNIT=1 )<br />

INSTITUT DU DÉVELOPPEMENT<br />

ET DES RESSOURCES<br />

EN INFORMATIQUE SCIENTIFIQUE<br />

Cours langage Fortran – 27 janvier 2006<br />

<strong>Patrick</strong> <strong>Corde</strong> et <strong>Anne</strong> <strong>Fouilloux</strong>

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

Saved successfully!

Ooh no, something went wrong!