program finite_diffs  
implicit none
integer:: ra(10,10),row,col,i
!computes a finite difference matrix

ra=0               
do i=1,10
       ra(i,i)=2
       if (i .ne. 10) then 
         ra(i+1,i)=-1
         ra(i,i+1)=-1
       end if
       
end do         


do row=1,10
write(*,10) (ra(row,col),col=1,10)
end do
10 format(10I2)
end program finite_diffs