      program xpkaia
!======================================================================
      use genet_mod
      use inicia_sa
      use sep
      implicit none
      INTEGER, PARAMETER		:: dp = SELECTED_REAL_KIND(14, 60)
      integer 			:: seed, i, status
      real, allocatable 		:: x(:)
      real (dp), allocatable 		:: x1(:)
      real 			:: ctrl(12), f
!
!     First, initialize the random-number generator
!
 call sep_init()
 call sep_begin_prog()
 call parameters()
 allocate(x1(ntot),x(ntot))
! Initial model
  call genmodel(x1)
  x=sngl(x1)
  deallocate(x1)
      seed=1371
      call rninit(seed)
!
!     Set control variables (use defaults)
      ctrl = -1
      ctrl(2)=50
!     Now call pikaia
      x=x/2+0.5
      call pikaia(objfcn3,ntot,ctrl,x,f,status)
      x=2*x-1
!
!     Print the results
      write(*,*) ' status: ',status
      write(*,*) '      x: ',x
      write(*,*) '      f: ',f
      write(*,20) ctrl
 20   format(   '    ctrl: ',6f9.5/10x,6f9.5)
!
 call io(x)
 call sep_end_prog()
end program
