Application and optimization of the perfectly matched layer boundary condition for geophysical simulations