subroutine grid_step(level,t)
use types
use parameters
use hpfdata
use adaptive
real(SP)        :: t
integer(I4B)    :: level

integer(I4B)    :: igf,it,id
                
INTERFACE

subroutine update(anew,aold,t,dt,dr,nx,ny)
use parameters
use adaptive
real, dimension(:,:,:) :: anew,aold
real                   :: t,dt
integer                :: nx,ny
real, dimension(2)     :: dr
!HPF$ PROCESSORS P(PX,PY)
!HPF$ DISTRIBUTE (BLOCK,BLOCK,*) ONTO *P :: anew,aold
end subroutine update

subroutine boundaries(g,rb,lb,t,nx,ny)!
use types
use adaptive
real(SP), dimension(:,:,:) :: g
integer(I4B), dimension(3) :: rb,lb
real(SP)                   :: t
integer(I4B)               :: nx,ny

!HPF$ PROCESSORS P(PX,PY)
!HPF$ DISTRIBUTE (BLOCK,BLOCK,*) ONTO P :: g
end subroutine boundaries

END INTERFACE

t=t+lp(level)%dr(0)

!update all grids on this level
write(6,*) 'level',level

      DO igf=1,ngf
       if(tlevels>1) then
          DO it=tlevels,2,-1
          glev1(1,igf,it,:,:,:)=glev1(1,igf,it-1,:,:,:)
          ENDDO
       endif  
      enddo
      igf=AMPL
      call update(glev1(1,igf,1,:,:,:),glev1(1,igf,2,:,:,:),t,lp(1)%dr(0), &
                  lp(1)%dr(1:2),lp(1)%head%nr(1),lp(1)%head%nr(2))
!      call boundaries(glev1(1,igf,1,:,:,:),gflb(1,1,:),gfrb(1,1,:),    &
!                  t,lp(1)%head%nr(1),lp(1)%head%nr(2)) 

return
end







