Hi,
I am trying to run a simple f77 program on gfortran. Program is as follows.
program trial
implicit real*8 (a-h,o-z)
common/var/a(2),b,c(4),d
a=(/0,0/)
b=0
c=(/0,0,0,0/)
d=0
call add(a,b,c,d)
write(*,'(2f6.2)') (a(i),i=1,2)
write(*,'(f6.2)') b
write(*,'(4f6.2)') (c(i),i=1,4)
write(*,'(f6.2)') d
end program
subroutine add(a,b,c,d)
implicit real*8 (a-h,o-z)
common/inputvar/a(2),b,c(4),d
do ii=1,2
a(ii)=a(ii)+10
enddo
bb=bb+20
do ii=1,4
c(ii)=c(ii)+30
enddo
d=0
return
end
I am getting following error.
trial.f:20.24:
common/inputvar/a(2),b,c(4),d
1
Error: COMMON attribute conflicts with DUMMY attribute in 'a' at (1)
trial.f:22.8:
a(ii)=a(ii)+10
1
Error: Unclassifiable statement at (1)
trial.f:27.8:
c(ii)=c(ii)+30
1
Error: Unclassifiable statement at (1)
anshul@anshulfy:~/ftran$
What is the problem. Please help me.
Thanks in advance.
--
Anshul