A formulation for vertically integrated groundwater flow in a stratified coastal aquifer