program amr_main
!--------------------------------------------------------------------------
! F90 implementation of the Berger-Oliger AMR algorithm
! 
!                                T. Haupt NPAC at Syracuse University, 1995
!                                              comments: haupt@npac.syr.edu
!-------------------------------------------------------------------------- 

use amr
use types

type(GF3TL),pointer                     :: grid
character(200)                          :: grid_name = 'test grid'
real(SP), dimension(maxdim)             :: gmin,gmax,gd
integer(I4B)                            :: gid
real(SP)                                :: t
integer(I4B), parameter                 :: nsteps = 30
real(SP)                                :: t3(1), t1(1), t2(1) !timer

      INTERFACE 
      subroutine initialize_grid_functions(level,t)
      use amr
      use types
      integer(I4B)                        :: level
      real(SP)                            :: t 
      end subroutine initialize_grid_functions

      subroutine initialize_base_grid(grid_name)
      use amr
      use types
      character(200)                      :: grid_name 
      end subroutine initialize_base_grid

      subroutine regrid(first)
      use amr
      use types   
      logical first
      end subroutine regrid       

      subroutine propagate(crsstp)
      use amr
      use types
      integer(I4B) crsstp
      end subroutine propagate

      END INTERFACE 

!     start_timer
      t1(1) =secnds( 0.0)
  
      open(unit=72,file=  &
      '/net/kopernik-fddi.npac/export/project/K332/BH/mark/fort.74', &
           status='new')

!      open(unit=72,file=  &
!           'fort.72', &
!           status='new')

!      write(72,*) 'begin'

!     initialize data structures
      gid=get_g(-1)
      t=t_init
      curlev=1
      finlev=1  
      call initialize_level_info(lp)

      call initialize_base_grid(grid_name)      !allocate data structures
      call initialize_grid_functions(curlev,t)  !fill them with the data

! do we need initial regridding?   call regrid(.true.)

      write(6,*) ' =========== END OF INITIALIZATION ============'

      call propagate(nsteps)


      write(6,*) 'END OF PROGRAM'

!     stop_timer
      t2(1) = secnds(0.0)
      t3(1) = t2(1)-t1(1)
      print *,'time',t3(1),'seconds'
    
!      write(72,*) 'end'
!      close(72)

      stop
      end program

 
























