This article is currently **undergoing peer-review**
at *Geophysical Journal International*.

- Journal: Geophysical Journal International
- Source code: pinga-lab/tesseroid-variable-density

This paper builds upon Tesseroids: forward modeling gravitational fields in spherical coordinates and extends the methodology to work for depth-variable densities.

We present a new methodology to compute the gravitational fields generated by tesseroids (spherical prisms) whose density varies continuously with depth according to an arbitrary function. It approximates the gravitational fields through the Gauss-Legendre Quadrature along with two discretization algorithms that automatically control its accuracy by adaptively dividing the tesseroid into smaller ones. The first one is a preexisting adaptive discretization algorithm that reduces the errors due to the distance between the tesseroid and the computation point. The second is a new density-based discretization algorithm that decreases the errors introduced by the variation of the density function with depth. The amount of divisions made by each algorithm is indirectly controlled by two parameters: the distance-size ratio and the delta ratio. We have obtained analytical solutions for a spherical shell with radially variable density and compared them to the results of the numerical model for linear and exponential density functions. These comparisons allowed us to obtain optimum values for the distance-size and delta ratios that yield an accuracy of 0.1% of the analytical solutions. The resulting optimal values of distance-size ratio for the gravitational potential, its gradient, and Marussi tensor are 1, 2 and 8, respectively. A delta ratio of 0.2 is needed for the computation of the gravitational potential and its gradient components, while a value of 0.01 must be used for the Marussi tensor components. Lastly, we apply this new methodology to model the Neuquén Basin, a foreland basin in Argentina with a maximum depth of over 5000 m, using an exponential density function.

*Application of the methodology to the Neuquén basin in the Andes. The sedimentary
pack was modeled using an exponential density function.*