# 1 "<stdin>"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "<stdin>"
program sg_mig
  use wei_mig_standard_mod
  complex, allocatable :: image(:,:,:,:,:)
  complex, allocatable :: wfld(:,:,:,:,:)
  type(wfile) :: ifile,data
  type(wspace),pointer :: space
  integer :: nth

  integer,external :: omp_get_thread_num,omp_get_num_threads


  allocate(space)
  call sep_init()
  call mig_init(space,ifile,data)


!$OMP PARALLEL
  space%nth=omp_get_num_threads()
!$OMP END PARALLEL



  allocate(wfld(space%npad(1),space%npad(2),space%npad(3),&
    space%npad(4),space%nth))
  allocate(image(space%npad(1),space%npad(2),space%npad(3),&
    space%npad(4),space%nzb))
  call mig_of(space,ifile,data,wfld,image)

  call sep_end_prog()



end program
