module m_grid_base

   implicit none
   
   type :: t_grid_base
      real    :: ox
      real    :: oy 
      real    :: oz
      integer :: nx
      integer :: ny 
      integer :: nz
      real    :: dx
      real    :: dy 
      real    :: dz
   end type t_grid_base

contains

   logical function inside_grid(grid,x,y)
     
       real, intent(in)         :: x, y
       type(t_grid_base), intent(in) :: grid

       inside_grid=.true.
       if (x<grid%ox .or. x>(grid%ox+(grid%nx-1)*grid%dx)) &       
          inside_grid=.false.
       if (y<grid%oy .or. y>(grid%oy+(grid%ny-1)*grid%dy)) &
          inside_grid=.false.
          
   end function inside_grid
      

end module m_grid_base
