! Joe Bruce
! init.f90
! 7-3-97

subroutine initialize(params, anm_, an_, anp_, bnm_, bn_, bnp_, &
     cnm_, cn_, cnp_, dnm_, dn_, dnp_, phi_, phim_, phip_, temp)
  use input_params
  implicit none

  INTERFACE

     subroutine initial(params, a0, b0, c0, d0, phi0)
       use input_params
       implicit none
       real*8, dimension(100)     :: params
       real*8, dimension (:,:,:) :: a0, b0, c0, d0, phi0
       INTENT(OUT) :: a0, b0, c0, d0, phi0
     end subroutine initial
     
     subroutine initstep(params, anm, an, anp, bnm, bn, bnp, cnm, cn, cnp, &
          dnm, dn, dnp, temp)
       use input_params
       implicit none
       real*8, dimension (100) :: params
       real*8, dimension(:,:,:), target :: anm, an, anp, bnm, bn, bnp, &
            cnm, cn, cnp, dnm, dn, dnp, temp
     end subroutine initstep


     subroutine dump_2d(params, name, u)
       use input_params  
       implicit none
       real*8, dimension(100) :: params
       character*(*) name
       real*8, dimension(:,:,:) :: u
     end subroutine dump_2d
     
  END INTERFACE

  real*8, dimension(100) :: params
  real*8, dimension(:,:,:), target :: anm_, an_, anp_, &
       bnm_, bn_, bnp_, cnm_, cn_, cnp_, dnm_, dn_, dnp_, &
       phi_, phim_, phip_, temp 

  call initial(params, an_, bn_, cn_, dn_, phi_)

!DAGH$ sync(an_,bn_,cn_,dn_,phi_)  

  call initstep(params, anm_, an_, anp_, bnm_, bn_, bnp_, cnm_, cn_, cnp_, &
       dnm_, dn_, dnp_, temp)

phim_=0;
phip_=0;

!DAGH$ equals(phim_,#0)
!DAGH$ equals(phip_,#0)


end subroutine initialize

