      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                                :: dt
      real, dimension(3)                  :: dr

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

      write(6,*) 'start igf'

      nullify(grid)
      grid=>lp(level)%ml
    
      dr=lp(level)%ldr
      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





