























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!
























The basic layout of all programs is as follows
(p.33)
PROGRAM name = heading (i.e., title) Specifications (e.g., define constants) Executions (the main part) Subprograms (see much later in the semester) END PROGRAM statement
Let’s look at each…
Examples…
Specifications…
Memory …
Specifications…
IN OTHER WORDS, A Fortran program will
assume a quantity is one of these (and nothing else).
Example:
We must be careful to avoid these problems…see below
REAL data…
COMPLEX data…
LOGICAL data…
To repeat…when you choose a name for a
quantity starting with the letters I,J,K,L,M,N, Fortran will make that quantity an INTEGER.
Otherwise it is a REAL data type.
We often choose names to make use of this…but
we also make mistakes.
Examples of format:
REAL : : grav
INTEGER : : timeofday
Says the following:
“grav” will be a REAL number
“timeofday” will be an INTEGER number
Statements like these MUST go @ start of code
(“specifications”).
As a safeguard, your first statement should be
this:
IMPLICIT NONE
Which says to the compiler … “do not assume