subroutine Agen(Ag)
use work

complex Ag(n,n)

ag =(0.,0.)

! Ex.1:
!ag(1,1) =1
!ag(1,2) =-sqrt(2.)/2
!ag(1,3)=0

!ag(2,1) =ag(1,2)
!ag(2,2) =1.5
!ag(2,3) =-2/sqrt(5.)

!ag(3,1) =0
!ag(3,2) =ag(2,3)
!ag(3,3) =2.4


! Frank:
i_do: do i =1,n
ag(i,i) =cmplx(n-i+1,0.)
if(i>=2) ag(i,i-1) =ag(i,i)

j_do: do j =i+1,n
ag(i,j) =cmplx(n -(j-1),0.)

enddo j_do
enddo i_do

! eps:
! eps =1E-10
! a(1,n) =a(1,n)+eps

end

