      subroutine initialize_grid_functions(lp,level,t)
      use amr
      type(LEVEL_INFO), dimension(maxlev) :: lp
      integer                             :: level
      real                              :: t 

      type(ADAPTIVE_MESH),pointer         :: grid
      real                              :: dr,dt

      INTERFACE
      subroutine init_gf(grid,t,dt,dr)
      use bh02
      type(GF3TL),pointer :: grid
      real              :: t,dt,dr
      end subroutine init_gf
      END INTERFACE

      write(6,*) 'start igf'

      nullify(grid)
      grid=>lp(level)%ml
    
      dr=lp(level)%ldr(1)
      dt=lp(level)%ldt

      write(6,*) 'initialize grid:',associated(grid%grid)

      call init_gf(grid%grid,t,dt,dr)

      write(6,*) 'end igf'

      return 
      end subroutine initialize_grid_functions





