program ab
  use sep
  implicit none
  integer :: n1,n2,i1,i2
  real :: o1,o2,d1,d2,tc,tl
  
  character(len=128) :: label
  real, allocatable :: cor(:,:),last(:,:),gamma(:,:)
  call sep_init()
  call sep_get_data_axis_par("in",1,n1,o1,d1,label)
  call sep_get_data_axis_par("in",2,n2,o2,d2,label)
  
  allocate(cor(n1,n2),last(n1,n2),gamma(n1,n2))
 write(0,*) "A 1",n1,n2
  call sreed("in",cor,size(cor)*4)
  write(0,*) "BB"
  call sreed("in",last,n1*n2*4)
   write(0,*) "A 1"

  do i2=1,n2
    tc=0
    tl=0
    do i1=1,n1
     tc=tc+cor(i1,i2)*cor(i1,i2)
     tl=tl+last(i1,i2)*last(i1,i2)
     gamma(i1,i2)=1+(1.-sqrt(tl)/sqrt(tc))
   end do
  end do
  call to_history("n3",1)
  call srite("out",gamma,size(gamma)*4)
  


end program