The Queen's University of Belfast
QUBPCCParallel Computer Centre

[Next] [Previous] [Top]

New I/O Features


New I/O features

Topics

Non-advancing I/O

WRITE(*, '("Input size?")', ADVANCE='NO')
READ(*, '(I5)') n

INQUIRE by I/O list

INQUIRE (IOLENGTH=length) output-list INTEGER :: rec_len
...
INQUIRE (IOLENGTH = rec_len) name, title, &
age, address, tel
...
OPEN (UNIT = 1, FILE = 'test', RECL = rec_len, &
FORM = 'UNFORMATTED')
...
WRITE(1) name, title, age, address, tel
...

NAMELIST

NAMELIST /namelist-group-name/ variable-list &namelist-group-name var2=x, var1=y, var3=z/

Example

...
INTEGER :: size = 2
CHARACTER (LEN = 4) :: &
colour(3) = (/ ' red', 'pink', 'blue' /)
NAMELIST /clothes/ size, colour
WRITE(*, NML = clothes)
...

outputs:

&CLOTHES SIZE = 2, COLOUR = redpinkblue/

New edit descriptors

Example

To compare the differences among E, EN, ES and G edit descriptors:

PROGRAM e_en_es_g_compare
IMPLICIT NONE
REAL, DIMENSION(4) :: &
x=(/1.234, -0.5, 0.00678, 98765.4/)
PRINT '(4E14.3/4EN14.3/4ES14.3/4G14.3)',&
x, x, x, x
END PROGRAM e_en_es_g_compare

Output:

0.123E+01 -0.500E+00 0.678E-02 0.988E+05
1.234E+00 -500.000E-03 6.780E-03 98.765E+03
1.234E+00 -5.000E-01 6.780E-03 9.877E+04
1.23 -0.500 0.678E-02 0.988E+05

New statement specifiers

POSITION = 'ASIS' 'REWIND' 'APPEND'
ACTION = 'READ' 'WRITE' 'READWRITE'
DELIM = 'APOSTROPHE' 'QUOTE' 'NONE'
PAD = 'YES' 'NO'
READWRITE = )
READ = ) 'YES' 'NO' `UNKNOWN'
WRITE = )
NML = namelist_name
ADVANCE = 'YES' 'NO'
EOR = label SIZE = character_count
[Next] [Previous] [Top]
All documents are the responsibility of, and copyright, © their authors and do not represent the views of The Parallel Computer Centre, nor of The Queen's University of Belfast.
Maintained by Alan Rea, email A.Rea@qub.ac.uk
Generated with CERN WebMaker