f77 program on gfortran

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

Here are a few pointers...

A common block is supposed to be that, common...so, if you only specify one of them, there is typically no need for it, in the first place.

What makes a common block unique? its name...so, if you have two common blocks in your program each with its own unique name, they are not doing anything for you.

Just because you intend to list the same variables in both common block does not make them the same common block.

Also, a common block is a way of sharing data between subroutines and functions...so, for this particular program or yours, you can choose to pass data to your subroutine through the subroutine's argument list during the call OR do not pass anything and let it access the main's programs data via the common block.

Certainly, do no put the same variable in the subroutine's argument list AND the common block.