program FDMcc_
  use sep
  use util_
  use fft
  use fdmigcc_

  implicit none
  type(myaxis)            :: aw,ax,az
  character(len=128)      :: name
  integer                 :: method

  complex, pointer        :: dat(:,:)
  complex, pointer        :: img(:,:)
  real,    pointer        :: slo(:,:)

  call sep_init()
  call from_param("method",method,1)

  call hinaxis(aw,2)
  call hinaxis(ax,1)
  name="slo"
  call ainaxis(az,1,name)

  call houaxis(az,1)
  call houaxis(ax,2)

  call to_history("esize",8)
  call sep_close()

  allocate(dat(ax%n,aw%n))
  allocate(slo(az%n,ax%n))
  allocate(img(az%n,ax%n))

  call sep_read(dat)
  call sreed("slo",slo,size(slo)*4)

  ! init migration
  call fdmigcc_init(aw,ax,az)

  if(method==2) then
     call migcc45(dat,img,slo)
  else if(method==1) then
     call migcc15(dat,img,slo)
  else
     call migccss(dat,img,slo)     
  end if

  call sep_write(img)

  call exit (0)
end program FDMCC_




