Presentation is loading. Please wait.

Presentation is loading. Please wait.

September 8th.

Similar presentations


Presentation on theme: "September 8th."— Presentation transcript:

1 September 8th

2 Logical operators .AND. .OR. .NOT.

3 “error handling” Reaching the end of data on input ICOUNT = 0
READ (5,222, END = 72) X ICOUNT = ICOUNT + 1 FORMAT(I5) GOTO 5 WRITE (6, 91) ICOUNT FORMAT (1X, ‘ The number of values read is ‘, I10) END = ERR = label

4 Helpful hints If input is coming from the keyboard (as in this class), end of file is indicated by a <ctrl> z Suppose you have an executable called assign2.exe One way to run it is to type assign2 <return> Input will come from the keyboard Alternatively, you can type assign2 < some_filename Input will come from some_filename Output, by default comes to the screen but you can redirect it to a file using assign2 > output.txt assign2 >> output.txt

5 Statement Functions General Form Example
Function name (argument list) = expression Example AREA(SIDE1,SIDE2,ANGLE) = 0.5*SIDE1*SIDE2*SIN(ANGLE) Sample Calls AREA1 = AREA(X,Y,Z) AREA2 = AREA (A,B,C)

6 FORTRAN arrays General form Example Stored in column major order
DIMENSION array1(size),array2 (sizeA,sizeB) Example DIMENSION ALPHA (10,15),BETA (12) REAL X(10), INTEGER NUMBER(2,3) Stored in column major order Can be passed as parameters but need to pass in size.

7 Early FORTRAN’s array only capable of holding numbers
FORTRAN arrays start at 1 Array subscripts are surrounded by parentheses

8 Reserved words???? Is it legal to say END = 5.9 DO = 5 IF = 27

9 Is there a maximum integer?
Minimum integer is X =


Download ppt "September 8th."

Similar presentations


Ads by Google