
subroutine tstep(params, b_box, shape, t, anm_, an_, anp_, bnm_, bn_, bnp_, &
     cnm_, cn_, cnp_, dnm_, dn_, dnp_, phim_, phi, phip_, temp)
  use input_params
  implicit none

  real*8, dimension(100)     :: params
  integer, dimension(3) :: shape
  integer t
  real*8, dimension(6)  :: b_box
  real*8, dimension(:,:,:)  :: anm_, an_, anp_, &
       bnm_, bn_, bnp_, cnm_, cn_, cnp_, dnm_, dn_, dnp_, phim_, phi, phip_, temp

  integer name 
  real*8 float_t

  integer nx,ny,nz
  real*8 dt,h

!!!sh=shape(an)  use f90 intrinsic!

!  nx = shape(1)
!  ny = shape(2)
!  nz = shape(3)




  dt = params(P_TIMESTEP)
  h = params(P_GRIDSPACING)
!DAGH$ user(dt=params[P_TIMESTEP];)
!DAGH$ user(h =params[P_GRIDSPACING];)

  write(6,*) '. '

  float_t=float(t)
!DAGH$ user(float_t = (double)t;)

! that 'name' may crash your code!!!!! <====================================
! think about nx,ny,nz

!  call dump_2d_slice(name, float_t, bn_, nx,ny,nz, (ny+1)/2, &
!       b_box(1), b_box(3), h)

!WARNING: I changed shape into params!!!!!!

  call boundupdt(params, an_, anp_, bn_, bnp_, cn_,cnp_, dn_, dnp_, phip_)

  call leapfrogA(params, dt, h, anm_,an_,anp_, bn_,cn_,dn_)
  
  call leapfrogBCD(params, dt, h, an_, bnm_,bn_,bnp_, cnm_,cn_,cnp_, &
       dnm_,dn_,dnp_)
  
  call updatephi(params, dt, h, an_, phip_,phim_)

  return  
end subroutine tstep

