I like how novices think...and i always take the notes from them. A 100 such novices with their questions and suggestions and FTN95 will be a king of perfection (same i believe would improve for example Linux adoption rate by an order of magnitude, from below 1% to tens of %).
You are right, these variables are defined in our common sense. 'Undefined' here means that the variable was not assigned any value before its use during program execution. Undefined variable check is most powerful debugging feature of FTN77/95
And i'd say your intuition also drives you in right direction in the format question too at the beginning of this thread. I'd suggest if format E is not specified in detail in WRITE statement ( like xxE.yy ) then some kind of standard output has to be used like it is done in WRITE(,).
Any pitfalls here?
P.S.Dec 18 2009. In confirmation of my point i show here some code i found and used today to calculate the day of week based on specified daydate/month/year written by someone many years ago which has output format just 4I. I suppose these are good old VAX extensions. VAX Fortran is forgotten, but it was very popular years ago among scientists and engineers, so its extensions are included in many modern Fortran compilers, while FTN95 is a bit lagging here, some extensions are still missing. I understand that this allow it to be more strict and find more errors (this is one pitfall i see), but people are dumb in seeking the freedom of expression at any cost 😃
PROGRAM TEST
INTEGER DATE, MONTH, YEAR, DOW, DAY
YEAR = 2009
DO 10 MONTH = 1, 12, 1
DO 10 DATE = 1, 31, 1
DAY = DOW(DATE, MONTH, YEAR)
WRITE(5,20)MONTH, DATE, YEAR, DAY
10 CONTINUE
20 FORMAT(1X, 4I)
STOP
END
C
C DOW COMPUTES THE DAY OF THE WEEK BASED UPON THE GIVEN DATE,
C MONTH AND YEAR. IT USES THE ZELLER CONGRUENCE ALGORITHIM.
C DATE IS THE DAY OF THE MONTH, 1 - 31
C MONTH IS THE MONTH OF THE YEAR, 1 - 12
C YEAR IS THE YEAR, E.G., 1989
C IT RETURNS 0 FOR SUNDAY, 1 FOR MONDAY, ETC.
C
INTEGER FUNCTION DOW(DATE, MONTH, YEAR)
INTEGER DATE, MONTH, YEAR
INTEGER DAY, YR, MN
YR = YEAR
MN = MONTH
C
C IF JANUARY OR FEBRUARY, ADJUST MONTH AND YEAR
C
IF (MN.GT.2)GO TO 10
MN = MN + 12
YR = YR - 1
10 N1 = (26 * (MN + 1)) / 10
N2 = (125 * YR) / 100
DAY = (DATE + N1 + N2 - (YR / 100) + (YR / 400) - 1)
DOW = MOD(DAY, 7)
RETURN
END