Silverfrost Forums

Welcome to our forums

Real numbers as DO indices in Fortran 95

4 Mar 2008 10:20 #2880

Real numbers as DO indices are from Fortran 95 on not any more a part of the standard. Using the ISO option when compiling (Plato) is supposed to ensure that the code is in agreement with the standard. However the compiler (version 5.10 and earlier) does not block real numbers as DO indices. This is demonstrated in the following example code:

OPTIONS( ISO ) ! To ensure that the code is in agreement with the Fortran 95 standard PROGRAM trigonometrisktabell_ISO IMPLICIT NONE REAL, PARAMETER :: PI = 3.1415927 REAL :: radianer, grader, faktor

WRITE( *, * ) ' Vinkel Sinus Cosinus' faktor = 2.0 * PI / 360.0 DO grader = 0.0, 90.0, 0.1 ! Should produce a compilation error message radianer = grader * faktor WRITE( *, * ) grader, SIN( radianer ), COS( radianer ) END DO

END PROGRAM trigonometrisktabell_ISO

5 Mar 2008 12:33 #2885

Hei,

Sjekker er at det/non_standard bryter er skrudd av, da en å varsle utgitt.

Ha det bra

Ian

PS Jeg snakke ikke Norsk (but I try every now and then).

5 Mar 2008 4:27 #2886

I have fixed this bug but the fix is too late for the impending release.

Please login to reply.