Ladies and Gentlemen:
The Fortran 66-style one-line IF statement is preferable in that it
minimizes the number of required Fortran statements.
I recall reading a paper on Fortran style years ago - Does anyone recall a
reference? - that as a general rule the fewer the number of source
statements the more efficient the code.
Best wishes,
Paul J. Nikolai
----- Original Message -----
From: "Ian Chivers" <[log in to unmask]>
To: <[log in to unmask]>
Sent: Thursday, September 02, 2004 4:50 AM
Subject: Style question
> I'm currently writing some programs for the
> next edition of our book and am converting
> some fortran 66 style code to fortran 90 style.
>
> The code has one line if statements, e.g.
>
> if(modulo(yyyy, 400) /= 0 .and. modulo(yyyy, 100) == 0) t = 0
>
> if(ddd > 59+t) dd = dd + 2 - t
>
> if(mm >= 1 .and. mm <= 12) return
>
> Jane and I tend to write this type of statement as an
>
> If then
>
> Endif
>
> I was curious as to what other people did with
> essentially one line if statements.
>
> cheers
>
> Ian Chivers
>
|