View previous topic :: View next topic |
Author |
Message |
Trondheimer
Joined: 01 Mar 2008 Posts: 3 Location: Norway
|
Posted: Tue Mar 04, 2008 11:20 am Post subject: Real numbers as DO indices in Fortran 95 |
|
|
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 |
|
Back to top |
|
|
IanLambley
Joined: 17 Dec 2006 Posts: 490 Location: Sunderland
|
Posted: Wed Mar 05, 2008 1:33 pm Post subject: |
|
|
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). |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7928 Location: Salford, UK
|
Posted: Wed Mar 05, 2008 5:27 pm Post subject: |
|
|
I have fixed this bug but the fix is too late for the impending release. |
|
Back to top |
|
|
|