[Patch, Fortran] PR fortran/35723: Some fixes to restricted-expression handling
Dominique Dhumieres
dominiq@lps.ens.fr
Fri Sep 26 12:36:00 GMT 2008
Daniel,
> 4) To fix the duplicated error message problem reported also in the PR, ...
Your "suppress-errors" is apparently too drastic. For the following code (reduced from pr36192):
program three_body
real, parameter :: &
precision_goal = 0.01, &
dt_init = 0.01, &
duration = 20, &
n = 2, &
d = 2
real, dimension(n), parameter :: m = (/ 1.0, 1.0 /)
real, dimension(n,d) :: &
x, v, & ! Configuration at current t
x_n, v_n, & ! Configuration at t+dt with step dt
x_hq, v_hq ! Configuration at t=dt with step dt/2
real, parameter :: &
G = 1
real :: &
dt = dt_init, &
t = 0
integer :: i,j
end program three_body
with your patch the errors are now:
pr36192_red.f90:10.36:
real, dimension(n), parameter :: m = (/ 1.0, 1.0 /)
1
Error: Parameter array 'm' at (1) cannot be automatic or of deferred shape
pr36192_red.f90:13.11:
x, v, & ! Configuration at current t
1
Error: The module or main program array 'v' at (1) must have constant shape
pr36192_red.f90:15.17:
x_hq, v_hq ! Configuration at t=dt with step dt/2
1
Error: The module or main program array 'v_hq' at (1) must have constant shape
pr36192_red.f90:14.15:
x_n, v_n, & ! Configuration at t+dt with step dt
1
Error: The module or main program array 'v_n' at (1) must have constant shape
pr36192_red.f90:13.8:
x, v, & ! Configuration at current t
1
Error: The module or main program array 'x' at (1) must have constant shape
pr36192_red.f90:15.11:
x_hq, v_hq ! Configuration at t=dt with step dt/2
1
Error: The module or main program array 'x_hq' at (1) must have constant shape
pr36192_red.f90:14.10:
x_n, v_n, & ! Configuration at t+dt with step dt
1
Error: The module or main program array 'x_n' at (1) must have constant shape
while before the patch several errors were repeated, but we also got:
pr36192_red.f90:10.18:
real, dimension(n), parameter :: m = (/ 1.0, 1.0 /)
1
Error: Expression at (1) must be of INTEGER type, found REAL
...
pr36192_red.f90:12.18:
real, dimension(n,d) :: &
1
Error: Expression at (1) must be of INTEGER type, found REAL
pr36192_red.f90:12.20:
real, dimension(n,d) :: &
1
Error: Expression at (1) must be of INTEGER type, found REAL
...
These errors are the ones needed to fix the other ones.
Cheers
Dominique
PS without the patch the full error list is:
------------------------------------------------------------------------------
[karma] f90/bug% gfc pr36192_red.f90
pr36192_red.f90:10.18:
real, dimension(n), parameter :: m = (/ 1.0, 1.0 /)
1
Error: Expression at (1) must be of INTEGER type, found REAL
pr36192_red.f90:10.36:
real, dimension(n), parameter :: m = (/ 1.0, 1.0 /)
1
Error: Parameter array 'm' at (1) cannot be automatic or of deferred shape
pr36192_red.f90:12.18:
real, dimension(n,d) :: &
1
Error: Expression at (1) must be of INTEGER type, found REAL
pr36192_red.f90:12.20:
real, dimension(n,d) :: &
1
Error: Expression at (1) must be of INTEGER type, found REAL
pr36192_red.f90:13.11:
x, v, & ! Configuration at current t
1
Error: The module or main program array 'v' at (1) must have constant shape
pr36192_red.f90:12.18:
real, dimension(n,d) :: &
1
Error: Expression at (1) must be of INTEGER type, found REAL
pr36192_red.f90:12.20:
real, dimension(n,d) :: &
1
Error: Expression at (1) must be of INTEGER type, found REAL
pr36192_red.f90:15.17:
x_hq, v_hq ! Configuration at t=dt with step dt/2
1
Error: The module or main program array 'v_hq' at (1) must have constant shape
pr36192_red.f90:12.18:
real, dimension(n,d) :: &
1
Error: Expression at (1) must be of INTEGER type, found REAL
pr36192_red.f90:12.20:
real, dimension(n,d) :: &
1
Error: Expression at (1) must be of INTEGER type, found REAL
pr36192_red.f90:14.15:
x_n, v_n, & ! Configuration at t+dt with step dt
1
Error: The module or main program array 'v_n' at (1) must have constant shape
pr36192_red.f90:12.18:
real, dimension(n,d) :: &
1
Error: Expression at (1) must be of INTEGER type, found REAL
pr36192_red.f90:12.20:
real, dimension(n,d) :: &
1
Error: Expression at (1) must be of INTEGER type, found REAL
pr36192_red.f90:13.8:
x, v, & ! Configuration at current t
1
Error: The module or main program array 'x' at (1) must have constant shape
pr36192_red.f90:12.18:
real, dimension(n,d) :: &
1
Error: Expression at (1) must be of INTEGER type, found REAL
pr36192_red.f90:12.20:
real, dimension(n,d) :: &
1
Error: Expression at (1) must be of INTEGER type, found REAL
pr36192_red.f90:15.11:
x_hq, v_hq ! Configuration at t=dt with step dt/2
1
Error: The module or main program array 'x_hq' at (1) must have constant shape
pr36192_red.f90:12.18:
real, dimension(n,d) :: &
1
Error: Expression at (1) must be of INTEGER type, found REAL
pr36192_red.f90:12.20:
real, dimension(n,d) :: &
1
Error: Expression at (1) must be of INTEGER type, found REAL
pr36192_red.f90:14.10:
x_n, v_n, & ! Configuration at t+dt with step dt
1
Error: The module or main program array 'x_n' at (1) must have constant shape
More information about the Fortran
mailing list