The underactuated vehicles are apposite for the long-term deployment and data collection in spatiotemporally varying marine environments. However, these vehicles need to estimate their positions (states) with intrinsic sensing in their long-term trajectories. In previous studies, autonomous underwater vehicles have commonly used vision and range sensors for autonomous state estimation. Inspired by the intrinsic sensing and the persistent deployment, we investigate the localization problem (state estimation) for an inexpensive and underactuated drifting vehicle called a drifter. In this paper, we present a localization method for the drifter making use of the observations of a proprioceptive sensor, i.e., compass. We create the water flow pattern within a given region from ocean model predictions, develop a stochastic motion model, and analyze the persistent water flow behavior. Given a distribution of initial deployment states of the drifter at a particular depth of the water column within the region and the water flow pattern, our method finds attractors and their transient groups at the given depth as the persistent behavior of the water flow. A most-likely localized trajectory of the drifter for a sequence of compass observations is generated based on the persistent behavior of the water flow and hidden Markov model. Our simulation results based on data from ocean model predictions substantiate good performance of our proposed localization method with a low error rate of the state estimation in the long-term trajectory of the drifter.