Next: 1.4 Function interpreter
Up: 1 General
Prev: 1.2 Utilization levels
Index
Contents
Only "formatted" data was accepted in Fortran 66. For example, the input format (3I6,2X,F15.7) requests three "integers" appearing in columns 1 to 6, 7 to 12, 13 to 18, followed by a "real" number in columns 21 to 35. This type of read can be rather rigid and tedious.
Fortran 77 brought along a major improvement with the "list directed read", which has the form: READ (UNIT,*). In this case the data items are entered more naturally, one after the other.
With free format, MODULEF further allows the user to include comments, arithmetic expressions, variables and commands. The example below illustrates the form in which data is entered into a program.
Firstly, program CHOLXX is called interactively
(section 1.2.2), i.e. it creates a data file to be used subsequently
(select the CREATE option from the main menu by entering a capital C in response to the first question). Each data item may start in any column:
B$ cholxx ************************************** EXECUTING THE CHOLESKY SOLUTION METHOD ************************************** -- CREATE THE DATA =-= EXECUTE MODULE (DATA EXISTING) =-= END =-= ? - - --- C -- FIRST DATA ITEM ******************************************************************************* CONVERSATIONAL DATA CREATION FOR THE CHOLESKY SEQUENCE (SEQUENTIAL) ******************************************************************************* -- NAME OF DATA FILE TO CREATE ? CHOLXX.D -- SECOND DATA ITEM -- FILE NAME OF THE INPUT D.S. MAIL ? X.MAIL -- THIRD DATA ITEM -- NUMBER OF LOAD CASES (NDSM) ? TYPE OF VALUES OF THE PROBLEM (NTYP) ? 1 2 -- NUMBER OF D.O.F. PER NODE IS CONSTANT (YES-NO) ? YES ...
The preceding call resulted in the following editable data file:
B$ cat cholxx.d X.MAIL $ FILE NAME 1 $ AND LEVEL OF THE D.S. MAIL 1 2 3 $ NDSM NTYP ND X.TAE $ FILE NAME 1 $ AND LEVEL OF THE D.S. TAE 1 $ 1 IF BDCL IS USED , 0 IF NOT X.BDCL $ FILE NAME 1 $ AND LEVEL OF THE D.S. BDCL 0 $ 1 IF BOUNDARY CONDITIONS I.T.O. LINEAR RELATIONS EXIST X.B $ FILE NAME 1 $ AND LEVEL OF THE D.S. B 5 $ IMPREB
This editable file is then read interactively by CHOLXX (select the EXECUTE option from the main menu by entering a capital E in response to the first question):
B$ cholxx ************************************** EXECUTING THE CHOLESKY SOLUTION METHOD ************************************** -- CREATE THE DATA =-= EXECUTE MODULE (DATA EXISTING) =-= END =-= ? - - --- E -- NAME OF DATA FILE ? cholxx.d ...
The numerous possibilities available with free format are discussed in chapter 1 of this user guide. For a beginner, it suffices to be familiar with the following notions:
'THIS STRING CONTAINS FOUR BLANKS'
--
)
is considered a comment zone.
It suffices to call a certain number of basic utilities (figure 1.1),
for example:
CALL LIBENT(I) reads an integer I
and
CALL LIBRSP(R) reads a single precision real R.