Structural, petrophysical and geological constraints in potential field inversion using the Tomofast-x v1.0 open-source code

1 Centre for Exploration Targeting (School of Earth Sciences), University of Western Australia, 35 Stirling Highway, 6009 Crawley Australia. 2 Mineral Exploration Cooperative Research Centre, School of Earth Sciences, University of Western Australia, 35 Stirling Highway, WA Crawley 6009 Australia. 3 The International Centre for Radio Astronomy Research, University of Western Australia, 7 Fairway, WA 10 Crawley 6009 Australia. 4 ARC Centre of Excellence for All Sky Astrophysics in 3 Dimensions (ASTRO 3D) Australia. 5 Laboratoire de Géosciences Environnement Toulouse GET, CNRS UMR 5563, Observatoire Midi-Pyrénées, Université Paul Sabatier, 14 avenue Edouard Belin, 31400 Toulouse France. †Formerly at Centre for Exploration Targeting (School of Earth Sciences), University of Western Australia, 35 15 Stirling Highway, 6009 Crawley Australia.

Abstract. The quantitative integration of geophysical measurements with data and information from other disciplines is becoming increasingly important in answering the challenges of undercover imaging and of the modelling of complex areas. We propose a review of the different techniques for the utilisation of structural, petrophysical and geological information in single physics and joint inversion as implemented in the  open-source inversion platform. We detail the range of constraints that can be applied to the inversion of potential field data. The inversion examples we show illustrate a selection of scenarios using a realistic synthetic dataset inspired by real-world geological measurements and petrophysical data from the Hamersley region (Western Australia). Using Tomofast-x's flexibility, we investigate inversions combining the utilisation of petrophysical, structural and/or geological constraints while illustrating the utilisation of the L-curve principle to determine 30 regularisation weights. Our results suggest that the utilisation of geological information to derive disjoint interval bound constraints is the most effective method to recover the true model. It is followed by model smoothness and smallness conditioned by geological uncertainty, and cross-gradient minimisation.

Introduction 35
Geophysical data provide information about the structure and composition of the Earth otherwise not accessible by direct observation methods, and thus plays a central role in every major Earth imaging initiative. Applications of geophysical modelling range from deep Earth imaging to study the crust and the mantle to shallow investigations of the subsurface for the exploration of natural resources. Recent integration of different geophysical methods has been recognised as a means to reduce interpretation ambiguity and uncertainty. Further 40 developments introduce uncertainty estimates from other geoscientific disciplines such as geology and petrophysics to produce more reliable and plausible models. Various techniques integrating different geophysical techniques have been developed with the aim to produce more geologically meaningful models, as reviewed by Parsekian et al. (2015), Lelièvre and Farquharson (2016), Moorkamp et al. (2016), and Ren and Kalscheuer (2019), (Meju and Gallardo, 2016), and several kinds of optimization for such problems exist (Bijani et al., 2017). 45 In the natural resource exploration sector, the calls of Wegener (1923), Eckhardt, (1940) and Nettleton (1949) for the development of comprehensive, thorough multi-disciplinary and multi-physical integrated modelling have been acknowledged by the scientific community, and data integration is now an area of active research: quoting André Revil's preface of the compilation of reviews proposed by (Moorkamp et al., 2016a): "The joint inversion of geophysical data with different sensitivities […] is also a new frontier". The integration of multiple physical 50 fields (both geophysical and geological) is particularly relevant for techniques relying on potential field gravity and magnetic data, as these constitute the most commonly acquired and widely available geophysical datatypes worldwide. The needs for integrated techniques is partly due to the interpretation ambiguity of geophysical data and resulting effects of non-uniqueness on inversion. Therefore, effective inversion of potential field data necessitates the utilisation of constraints derived from prior information extracted from geological and 55 petrophysical measurements or other geophysical techniques whenever available.
A number of methods for the introduction of geological and petrophysical prior information into potential-field inversion have been developed. For example, when limited geological information is available, the assumption is that spatial variation of density and magnetic susceptibility are collocated. This can be enforced through simple structural constraints encouraging structural correlation between the two models using Gramian constraints 60  or the cross-gradient technique introduced in Gallardo and Meju, (2003). When petrophysical information is available, petrophysical constraints can be applied during inversion to obtain inverted properties that match certain statistics (see techniques introduced by Paasche and Tronicke (2007), De Stefano et al. (2011), Sun and Li (2016, 2011, Lelièvre et al. (2012), Carter-McAuslan et al. (2015), Zhang and Revil (2015), Giraud et al. (2016Giraud et al. ( , 2017Giraud et al. ( , 2019c, Heincke et al. (2017). Furthermore, when geological data are available, 65 geological models can be derived and their statistics can be used to derive a candidate model for forward modelling , de La Varga et al., 2019, to derive statistical petrophysical constraints for inversion (Giraud et al., 2017(Giraud et al., , 2019d(Giraud et al., , 2019c, and to restrict the range of accepted values using spatially varying disjoint bound constraints (Ogarko et al., 2020) or multinary transformation (Zhdanov and Lin 2017).
In this paper, we present a versatile inversion platform designed to integrate geological and petrophysical 70 constraints to the inversion of gravity and magnetic data at different scales. We present Tomofast-x ('x' for 'extendable') as an open-source inversion platform capable of dealing with varying amounts and quality of input data. Tomofast-x is designed to conduct constrained single-physics and joint-physics inversion. The need for https://doi.org/10.5194/gmd- 2021-14 Preprint. Discussion started: 30 March 2021 c Author(s) 2021. CC BY 4.0 License.
reproducible research (Peng 2011) is facilitated by open-source codes (Gil et al., 2016), thus we introduce and detail the different constraints implemented in Tomofast-x before providing a realistic synthetic application 75 example using selected functionalities. We illustrate the use of Tomofast-x by performing a realistic synthetic study investigating several modelling scenarios typically encountered by practitioners, and provide information to get free access to the source-code and to run it using the synthetic data shown in this paper. We perform single physics inversion of gravity data and study the influence of prior information using several amounts and types of constraints, and run joint inversion of gravity and magnetic data. The flexibility of Tomofast-x is exploited to test 80 the effect of structural constraints combined with petrophysical and geological prior information that are yet to be demonstrated in the published literature. A challenging geological setting is used to examine the capability of cross-gradient constraints within the joint inversion method. The mathematical formulation of geophysical problems and solutions are detailed throughout the paper and sufficient information is provided to allow the reproducibility of this work using  The remainder of the contributions revolves around two main aspects. We first review the theory behind the inversion algorithm and the different techniques used, with an emphasis on the mathematical formulation of the problem. We then present a synthetic example inspired from a geological model in the Hamersley province (Western Australia), where we investigate two case scenarios. In the first case, we apply structural constraints to an area where geology contradicts the assumption of collocated and correlated density and magnetic susceptibility 90 variations. In the second case, we investigate a novel combination of petrophysical and structural information to constrain single physics inversion. Finally, we place Tomofast-x in the general context of research in geophysical inverse modelling and conclude this article.
2 Inverse modelling platform Tomofast-x 2.1 Purpose of  Tomofast-x can be used in a wide range of geoscientific scenarios as it can integrate multiple forms of prior information to constrain inversion and follow appropriate inversion strategies. Constraints can be applied through Tikhonov-style regularisation of the inverse problem Arsenin 1977, 1978). In single-physics inversion, these comprise model smallness (also called 'model damping', minimizing the norm of the model, see Hoerl and Kennard 1970) and model smoothness (also called 'gradient damping', minimizing the norm of the 100 spatial gradient of the model, see Li and Oldenburg 1996). For more detailed imaging, petrophysical constraints using Gaussian mixture models (Giraud et al., 2019c) as well as structural constraints (Giraud et al., 2019d, Martin et al., 2020, multiple interval bound constraints (Ogarko et al., 2020), can be used depending on the requirements of the study and the information available. In the case of single-physics inversion with structural constraints, structural similarity between a selected reference model and the inverted models can be maximised using structural 105 constraints based on cross-gradients (Gallardo and Meju 2003), locally weighted gradients in the same philosophy as Brown et al. (2012), Wiik et al. (2015), Yan et al. (2017), Giraud et al. (2019d). Generally speaking, in the joint inversion case, the two models inverted for are linked using the structural constraints just mentioned or petrophysical clustering constraints in the same spirit as Carter-McAuslan et al. (2015), Kamm et al. (2015), Li (2015, 2017), Zhang and Revil (2015), Bijani et al. (2017). In addition to the underlying assumptions 110 defining the relationship between properties jointly inverted for, prior information from previous modelling or https://doi.org/10.5194/gmd- 2021-14 Preprint. Discussion started: 30 March 2021 c Author(s) 2021. CC BY 4.0 License. geological information can be incorporated in inversion using model and structural covariance matrices by assigning weights that vary spatially. In such case, Tomofast-x allows utilising prior information extensively.
Furthermore, Tomofast-x allows the use of an arbitrary number of prior and starting models enabling the investigation of the subsurface in a detailed and stochastic-oriented fashion. Tomofast-x was initially developed 115 for application to regional or crustal studies (areas covering hundreds of kilometres), and retains this capability.
The current version of Tomofast-x is now more versatile as development is now directed toward use for exploration targeting and the monitoring of natural resources (kilometric scale).
Lastly, in addition to inversion, Tomofast-x offers the possibility to assess uncertainty in the recovered models.
The uncertainty assessments include: statistical measures gathered from the petrophysical constraints; posterior 120 least-squares variance matrix of the recovered model (in the Least Squares with QR-factorization algorithm -LSQR -sense of Paige and Saunders 1982, see 2.5), and the degree of structural similarity between the models (for joint inversion or structurally constrained inversion). From a practical point of view, associated with the inversion algorithm is a user manual covering most functionalities and a reduced 2D Python notebook illustrating concepts (see Sect. 7 for more information) that can be used for testing or educational purposes. A summary of 125 the inverse modelling workflow of Tomofast-x is shown in Figure 1.

General design
The implementation we present extends the original inversion platform "Tomofast" (Martin et al., 2013(Martin et al., , 2017. Tomofast-x is an extended implementation proposed and modified by Martin et al., 2018, Giraud et al. (2019d, 2019c, Martin et al. (2020), Ogarko et al. (2020). Tomofast-x follows the object-oriented Fortran 2008 standard 130 and utilizes classes designed to account for the mathematics of the problem. This introduces enhanced modularity based on the implementation of specific modules than can be called depending on the type of inversion required.
The utilisation of classes in Tomofast-x also eases the addition of new functionalities and permits to reduce software complexity while maintaining flexibility. Our implementation uses an indexed hexahedral solid body mesh, giving the possibility to adapt the problem geometry, allowing to regularize the problem in the same fashion 135 as Wiik et al. (2015) or to perform overburden stripping. By default, the sensitivity matrix to geophysical measurements is stored in a sparse format (using the Compressed Sparse Row format) to reduce memory consumption and for fast matrix-vector multiplications.
Attention has also been given to computational aspects. The only dependency of Tomofast-x is the Message Passing Interface (MPI) libraries, which eases installation and usage. This allows optimal usage of multi-CPU 140 systems regardless of the number of CPUs. Parallelization is made on the model cells using a domain decomposition approach in space. That is, the model is divided into nearly equal, non-overlapping contiguous parts distributed among the CPUs, hence enforcing minimum load imbalance. Consequently, the code is fully scalable as the maximum number of CPUs is not limited by the number of receivers or measured data points. For large 3D models, Tomofast-x can run on hundreds of CPUs for a typical problem with 10 5 -10 6 model cells and 145 10 3-10 4 data points. Parallel efficiency tests reveal excellent scalability and speed performance provided that the portions of the model sent to the CPUs are of sufficient size. In the current implementation, the optimum number of elements per CPU is 512. Interested readers can refer to 0.   Tomofast-x inversions rely on optimization of a least-squares cost function and optimized iteratively. The choice of a least-squares framework was motivated by flexibility in the number of constraints and forms of prior information used in the optimization process. 155 The objective function is derived from the log-likelihood of a probabilistic density function Θ (see Tarantola   2005, Chapters 1 and 3, for details). In the case of geophysical inversion, it is representative of the 'degree of knowledge that we have about the values of the parameters of our system' (Tarantola and Valette 1982), as summarized below. Let us first define Θ as follows: where Θ ( , ) is the density function over the geophysical data that model represents, and Θ ( ) is the 160 density function for the th type of prior information available (the set).
On the premise that Gaussian probability densities approximate the problem appropriately, Θ ( , ) can be expressed as: where ( ) is the forward data set calculated by the forward operator ; the matrix weights the data points.
where f is a function of the model and prior information. is a covariance matrix weighting of f( ) and α contains positive scalars that are introduced to adjust the relative importance of the constraint term. and α are derived from prior information, or set according to study objectives.
From equation 3, it is clear that maximizing Θ( , ) is equivalent to minimizing its negative logarithm, ( , ), defined as: 170 which corresponds to the general formulation of a cost function as formalized in the least-squares framework; α is a weight controlling the importance of the corresponding data term (i.e., gravity or magnetic) in the overall cost function.

Definition of regularization constraints
Adapting the formulation of the second term of equation (4) to the different types of prior information that we can 175 accommodate leads to the following aggregate cost function: where the different terms following the data misfit term α − ( ) constitute constraints for the inversion of geophysical data acting as regularization in the fashion of Tikhonov regularisation (Tikhonov and Arsenin 1977). In equations (2-5), represents geophysical data weighting. Generally, should be the data covariance. It is calculated by Tomofast-x as follows: 180 where is a diagonal matrix equal to the identity matrix in single domain inversion, or giving the weight of one data misfit term (i.e, gravity data) against the other (i.e., magnetic data) in joint inversion; is the i th datum. By convention, we fix to the identity matrix for gravity inversion, and use = α in joint inversion. In such cases, α is a strictly positive scalar.  ‖ ( − + )‖ is the formulation of the multiple-bounds constraint using the alternating direction of multipliers method (ADMM, detailed in Sect. 2.4.5); In the case of joint inversion, the vectors defined above are concatenated and the matrices expanded as follows: where denotes the transpose operator; for more illustrative purposes of the joint inversion, we take here the 200 gravity and magnetic joint inversion example; and refer to gravity and magnetic problems, respectively.
In the case of single domain inversion, is the model inverted for, and is equal to or depending on the type of geophysical data inverted, and is a reference model that can be used to constrain inversion from a structural point of view (see Sect. 2.4.2 and 2.4.3, and 4.4 and 4.5 for theory and example of utilisation, respectively). 205 In equation 5-7, subscript , , , and refer respectively to model, gradient, cross-gradient, petrophysics, and ADMM bound constraints, respectively.
As mentioned above, the cross-gradient constraints can be applied either to joint or single domain inversion. In the case of ADMM constraints, single or multiple bounds can be applied to define bounds for inverted model values. Such bound constraints can vary in space, and be made of an arbitrary number of intervals, be they disjoint 210 or not (see Sect. 2.4.5 and 4.5). Qualitatively, the case with multiple disjoint intervals can be interpreted as applying a dynamic smallness constraint term.
In Tomofast-x, we introduce prior information in the diagonal variance matrices such that they are no longer homogenous and can vary in space. Note that in the implementation of gravity and magnetic inversion, ( ) = , with the sensitivity matrix relating to measured geophysical data and corresponding recovered physical 215 property (see Appendix C for details about their calculation). Introducing the sensitivity matrix and for gravity and magnetic data, respectively, we obtain:  (Paige and Saunders, 1982) to solve the least-squares problem. The full 220 matrix formulation of the problem and the related system of equations are provided in Appendix D.
Generally, not all of the terms in equation 5 are used during a single inversion. The activation of selected terms from the cost function (setting α > 0 and non-null ) depends on the information available or on the requirements of the modelling to be performed. For example, a term not used during inversion has the corresponding weighting simply set to 0 (the corresponding matrix is set to 0). Conversely, setting a specific 225 weight to a relatively large value leads to the corresponding constraint to dominate the other terms. Such practice is typically used in sensitivity analysis to examine the effect of incorrectly assigned extreme weighting values on the inversion by providing an example to aid detection of this unintended situation.
In the following subsection, we detail the implementation of the different terms. The terms are introduced and detailed following the order they appear in equation 5. 230

Detailed formulation of constraints for inversion
In this Sect., we introduce the mathematical formulation of constraints applied during inversion. Throughout this paper, geological information relates to information extracted from probabilistic geological structural modelling.
Petrophysical information relates to the statistics of the values inverted for (density contrast and magnetic susceptibility). 235

Smallness term
We repeat the smallness term: The smallness term corresponds to the ridge regression constraint, or smallness term of (Hoerl and Kennard, 240 1970). To simplify the problem, the covariance matrix is assumed to be a diagonal matrix. In Tomofast-x, it is used to adjust the strength of the constraint either globally (i.e, = ) or locally (i.e., the elements of may vary from one cell to another). In the second case, can be determined using prior information such as uncertainty from geological modelling, or models and structural or statistical information derived from other geophysical techniques (e.g., seismic attributes, probabilistic results from magnetotellurics). 245

Smoothness term
The smoothness model term (Li and Oldenburg 1996), is a total variation (TV)-like regularisation term based on an original idea of Rudin et al. (1992). It constrains the degree of structural complexity allowed in the inverted model. We repeat the term: .
The covariance matrix modulates the importance of the term by assigning the weights to each cell. For the 250 sake of simplicity, the matrix is commonly assumed to be a diagonal matrix. It is commonly set as the identity  Brown et al. (2012), Yan et al. (2017) use seismic models to calculate such weights for the inversion of electromagnetic data, and Giraud et al. (2019a), who present an application case using Tomofast-x, invert gravity data using geological uncertainty information to calculate . In Tomofast-x, it can be set either globally (i.e, 255 = ) or locally (i.e., the elements of may vary from one cell to another).

Cross-gradient
The cross-gradient constraints were introduced as a means to link two models that are inverted jointly by encouraging structural correlation between them (Gallardo and Meju, 2004). We refer the reader to Meju and Gallardo (2016) for a review of applications using this technique. We repeat the term below: 260 The matrix modulates the importance of the term by assigning the weights to each cell. In previous works, it is always (to the best our knowledge) set as the identity matrix ( = ), to the exception of Rashidifard et al. (2020), who define such weights using seismic reflectivity and apply this approach to single physics inversion of gravity data constrained by fixed seismic velocity. In Tomofast-x, three finite difference numerical schemes can be chosen to calculate the cross-gradient derivatives: forward, centered, and mixed. In what follows, we use a 265 'mixed' finite difference scheme, where inversion iteration with an odd number use a forward scheme and even numbers backward scheme (e.g., iteration 3 will use a forward scheme and iteration 4 a backward scheme). This scheme was chosen as it reduces the influence of the border effects of both the forward and backward schemes onto the inverted model.

Statistical petrophysical constraints 270
One strategy to enforce the petrophysical constraints using statistics from petrophysical measurements is performed by encouraging the statistics of the recovered model to match that of a statistical model derived either from measurements made from the study area or literature values. In the current implementation of Tomofast-x, a mixture model representing the expected statistics of the modelled rock units is used. We use a Gaussian mixture model to approximate the petrophysical properties of the lithologies in the studied area. In the mixture model, the 275 weight of each Gaussian can be set in the input. We suggest to use the probability of the corresponding rock unit when this information is available. The mismatch between the statistics of the recovered model and the mixture model is minimized in the optimization framework following the same procedure described in Giraud et al., 2018, 2019b.
In the model-cell, the likelihood term P( ) of model-cell is calculated as, for the th lithology: 280 where: and symbolises the normal distribution and is the total number of rock formations observed in the modelled area.
In practice, an expectation maximisation algorithm (McLachlan and Peel, 2000) can be used to estimate the mean 285 and standard deviation of the petrophysical measurements.
In equation [12][13][14], is the weight assigned to the Gaussian distribution representative of the petrophysics of the lithology in the mixture. In equation 14a, the weight assigned to each lithology is constant across the model, while in equation 14b, the weight , is derived from information derived from another modelling technique (geology, seismic, electromagnetic methods, etc.) and varies spatially. 290 We note that a small number of Gaussian distributions might not be suitable to approximate certain types of distributions like bimodal (magnetic susceptibility) or lognormal (electrical resistivity) distributions. However, we point out that increasing the quality of such approximation depends on the number of Gaussian distributions used for approximation (McLachlan and Peel, 2000).

Dynamic bound constraints using the ADMM algorithm 295
The objective of the dynamic bound constraints is to optimize eq. 5 while ensuring that, in every model cell , the inverted value lies within the prescribed bounds such that ∈ , defined as ( (Ogarko et al., 2020)): where , and , are the lower and upper bounds for the th model-cell, and is the lithology index; ≤ is the total number of bounds allowed for the considered cell, corresponding to the number of distinct rock units 300 allowed by such constraints. During inversion, such multiple bound constraints on physical property values inverted for are gradually enforced using the ADMM algorithm. Implementation details are beyond the scope of this paper, but more information is provided in Appendix D and we refer the reader to Ogarko et al. (2020) for details. Details about the general mathematical formulation of the ADMM algorithm can be found in Dykstra (1983), chapter 7 in Bertsekas (2016) and Boyd (2011). 305 Note that the application of the ADMM bound constraints can be interpreted as are analogous to clustering constraints where (taking the example of the model-cell): the centre values depend on both the current model at any given integration and petrophysical information defining and ; the weight assigned to each centre values changes from one iteration to the next as a function of the 310 distance between and the closest bound and the number of iterations has remained outside .

Depth weighting and data weighting
To balance the decreasing sensitivity of potential field data with the depth of the considered model cell, Tomofast-x offers the possibility for the calculation of the depth weighting operator. The first one, which we use in this paper utilizes the integrated sensitivities technique following Portniaguine and Zhdanov (2002). For each model 315 cell , a weight is introduced: The second option relies on the application of an inverse depth-weighting power law function following Li and Oldenburg (1998) and Li and Chouteau (1998) for gravity, and Li and Oldenburg (1996) for magnetic data: Where is the depth of the i th model cell and ε is introduced to ensure numerical stability, such that ≫ ; the value of depends on the type of data considered (gravity or magnetic). For more details about the use of depth 320 weighting and selection of values of , the reader is referred to the references provided in this subsection. The application of depth weighting as a preconditioner to the matrix system of equation solved for during inversion is shown in Appendix D.

Posterior uncertainty metrics
Uncertainty information is an important building block of modelling and a critical aspect of decision making 325 (Scheidt et al., 2018). When available, uncertainty information can be communicated and used in subsequent modelling or for decision making (see examples of Giraud et al.2020b, 2020a, Ogarko et al., 2020 uncertainty information in the model recovered by another method as input to their modelling using Tomofast-x) . Tomofast-x allows the calculation of metrics reflecting the degree of uncertainty in the models before and after inversion. It allows monitoring the evolution of the different terms of the cost function during inversion.  x also calculates uncertainty metrics that are specific to the kind of constraints used in inversion: the posterior covariance matrix of model m as estimated by the LSQR algorithm (see Kostina et al., 2009,  In this Sect., we introduce how the data used for synthetic modelling were derived and we present examples of using prior information derived from geological modelling. The process of simulating a realistic field case study is described with the design of the numerical experiment.

Geological framework
The original geological model is based on a region in the Hamersley province (Western Australia). It was built 345 using the map2loop algorithm (Jessell. et al., n.d.) to parse the raw data and the Geomodeller® implicit modelling engine for geological interpolation  to model the contacts, stratigraphy and orientation data measurement in the area (see geographical location in Figure 2). Data used to generate the model comprise the 2016 1:500 000 Interpreted Bedrock Geology map of Western Australia (https://catalogue.data.wa.gov.au/dataset/1-500-000-state-interpreted-bedrock-geology-dmirs-016, last 350 accessed on 02/12/2020) and the WAROX outcrop database (https://catalogue.nla.gov.au/Record/7429427, last accessed on 02/12/2020). Geological modelling was assisted by interpretation of the magnetic anomaly grid compilations at 80 meters and the 400 meters gravity anomaly grid from the Geological Survey of Western Australia (https://www.dmp.wa.gov.au/Geological-Survey/ Regional-geophysical-survey-data-1392.aspx, last accessed on 02/12/2020). More information about data availability is provided in Sect. 7.

355
In what follows, we use an adapted version of the original structural geological framework of the selected region by increasing the vertical dimensions of the model cells and assuming a flat topography. The resulting reference geological model used to generate the physical properties for geophysical modelling measurements is shown in Figure 2 in terms of its geological units.

365
In addition to the modification of the structural model, we make adjustments on the original density values derived from field petrophysical measurements by reducing the differences between the density contrasts of different rock units. We increase the interpretation ambiguity of inversion results and decrease the differentiability of the different rock units. The same procedure is applied to magnetic susceptibility to make accurate imaging using inverse problem more challenging. The three-dimensional (3D) density contrast and magnetic susceptibility 370 models used to generate the gravity and magnetic data are shown in   level, and aeromagnetic data acquired by a fixed-wing aircraft flying 100 meters above surface. To test the robustness of our inversion code to noise content in the data, the geophysical data inverted here are contaminated 385 by noise.

Geophysical simulations and model discretization
The noise component was generated as follows. For each gravity measurement, we first add a perturbation value randomly sampled from the standard normal distribution of the whole dataset multiplied by 9% of the measurement's amplitude. We then add a second perturbation value randomly sampled from the standard normal distribution with an amplitude of 3 mGal (2% of the dynamical range). These values were derived manually to 390 obtain a realistic noise contamination. To simulate small-scale spatial coherence in the noise generated in this fashion, we then apply a two-dimensional Gaussian filter to the 2D noise map obtained from the previous step.
We then apply a two-dimensional median filter to the resulting noise-contaminated gravity data to simulate denoising. For magnetic data, we apply the same procedure, using, 12.5% of the measurement's amplitude for the first step, and 15 nT (1% of the dynamical range) for the second step. Similarly to gravity data, these values were 395 derived manually; no levelling noise was simulated. For comparison, the noise-free and contaminated synthetic measurements are shown in Figure 4. The resulting noise standard deviation for gravity and magnetic data are equal to 1.2 mGal and 8.5 nT, respectively.
The gravity data modelled here correspond to the complete Bouguer anomaly. Magnetic data are simulated using the magnetic strength of the Hamersley province (53011 nT, which approximates the International Geomagnetic 400 Reference Field in the area) reduced to the pole. measurements within a given set of prior uncertainty parameters. The ensemble is thus assumed to represent the geological model space, rather than just a single 'best-guess' model. Probabilities for the occurrence of different rock units can be calculated from the ensemble and used to constrain geophysical inversion (see examples of Giraud et al., 2017, 2019d, Ogarko et al., 2020. More specifically, MCUE is useful to obtain the probability , of occurrence of the different lithologies for every model cell, and to calculate the related uncertainty 415 indicators (Sect. 3.3). Detailing the probabilistic geological modelling procedure and analysing the results in 3D is beyond the scope of this paper and interested readers are referred to Lindsay et al. (2012), , Wellmann and Caumon (2018) and references therein.
In this contribution, we simulate a case study where modelling is carried out along the 2D profile materialized by the black line in Figure 3 and Figure 4, extracted from the 3D modelling framework as detailed in the next 420 subsection.

2D model simulation in a 3D world
As mentioned above, we perform the inversion of geophysical data along a 2D profile for simplicity and to simulate the challenging case of 2D data acquired in a 3D geological setting, in a part of the model where subhorizontal or gently dipping features can be observed. The philosophy of the numerical study presented here 425 is summarized in Figure 5. The 2D geological Sect. considered is shown in Figure 6 (the black line marked in Figure 3 and Figure 4). Geological certainty is estimated using a measure of the dispersion away from the perfectly uninformed case 430 where the all rock units are equiprobable. In each model-cell, this measure, which we write , is calculated as a function of the standard deviation of the probability of observing the different rock units, as follows: constrained, and minimum where the model is the most uncertain. This geological certainty metric is shown in 435 Figure 6 for the 2D Sect. considered in this example. The geophysical data we use for inversion are extracted along the line marked in Figure 3 and Figure 4. The geophysical data and reference (true) petrophysical model extracted in this fashion are shown in Figure 8. Care was taken not to use the same mesh for both generating the synthetic dataset and its inverse modelling. 450 While we focus on a 2D section extracted from a 3D model presented here (see location in Figure 3 and Figure   4), the 3D model and the associated gravity and magnetic datasets shown here are made publicly available (see 460 Sect. 7).

Application example: sensitivity analysis to constraints and prior information
In the examples shown below, we first perform single domain and joint (multiple domain) inversion (using the cross-gradient constraint) assuming identity matrices for , , and . We then investigate the influence of prior information on single domain inversion by combining structural and petrophysical information in the case 465 of gravity inversion. The combination of petrophysical and structural constraints derived from geology is tested.
The intention is to address knowledge gaps in the literature that describes the effects of parameterization of such constraints.

Experimental protocol
It is necessary to determine the appropriate weights α assigned to the terms defining the constraints applied during analysis, we set the objective value for the data misfit − ( ) to be equal to the objective data misfit Θ ( , ), defined as: so that the data is reproduced with a level of error superior or equal to the estimated noise level of the data. Here, this leads to Θ = 5.01 × 10 for gravity inversion, and to Θ =1.55 × 10 for magnetic data inversion,

respectively. 490
For the sake of consistency in our study of the influence of constraints onto inversion, we set = 0 kg/m 3 for gravity data inversion and = 0 SI for magnetic data inversion.

Homogenously constrained potential field inversions
We first perform single physics inversion following the common strategy of constraining the model using smallness and smoothness constraints. Obtaining a good approximation of the optimum values of these parameters 495 gives insights into the numerical structure of the problem. It constitutes valuable knowledge when using other kinds of constraints and we consider it a good practice to run such inversion prior to using more advanced constraints. Here, the first α parameters to determine are α and α , for both gravity and magnetic data inversion, assuming identity and matrices so that the constraints are applied homogenously over the entire model.
We generate grids in the α , α plane using α [10 , 10 ] and α [10 , 10 ] for gravity inversion, 500 and α [10 , 10 ] and α [10 , 10 ] for magnetic data inversion, respectively. These ranges were determined empirically and assumed to comprise the optimums. In this subsection, all matrices in equation (5) a the identity matrix.  For accurate estimation, the (α , α ) values are sampled more finely closer to the estimated optimum values. The 510 resulting L-surfaces are shown in Figure 9, where the vicinity of the optimum value of (α , α ) is shown with a green dot. From these values, we estimate the optimum values of (α , α ) reported in Table 1. The models corresponding to values in Table 1 are shown in Figure 10.  The values of and obtained for such constraints can be used as a starting point in subsequent inversions to 520 understand the influence of prior information when varying amounts and types of prior information are available about the structure of the subsurface or its petrophysics. For instance, in what follows we will investigate the utilisation of geological information to define and (eq. 9 and 10, respectively) and see how it can combined with petrophysical data to define (eq. 15) (see following subsection where we use global and structural and/or petrophysical information). In the case of structural constraints relying on the spatial derivatives 525 of model values (cross-gradient or local smoothness), the value of α may be kept constant and while the other α parameters (α or α ) are adjusted. Conversely, α may be kept and α set to 0 for the utilisation of petrophysical constraints acting on the model values themselves instead of the spatial derivatives (ADMM or statistical petrophysical constraints). Here, we restrict our analysis to two α values being strictly superior to zero, thereby accounting for prior information in up to two constraints terms in the definition of the regularisation term in eq. 530 5.

Joint inversion using the cross-gradient constraint
We start from the previous step to perform joint inversion using the cross-gradient constraint. Keeping the α weight constant and equal to the values determined from single domain inversion, it remains necessary to estimate the optimum values of the cross-gradient constraint weight, α , and the relative importance given to the gravity 535 and magnetic data misfit terms (setting α = 1, it remains to determine α ). We therefore investigate values in the (α , α ) plane, which we sample in the same fashion as in the previous sub-section. The resulting surfaces are shown in Figure 11.

545
In contrast to the single-physics inversion shown in Figure 9, it appears from Figure 11 that the two hyperparameters to be determined here, and α , influence the inversion differently. While the contour levels of the magnetic data misfit show a linear trend in the , α plane, it is clearly non-linear in the case of gravity data misfit. This difference might be explained by the fact that the cross-gradient is a second order regularisation (product of two spatial derivatives of model values) linking two models that are otherwise decoupled. In addition, 550 this suggests that in cases differing from this one, the hyperparameter selection may be non-unique. Nevertheless, the value of the optimum value is unambiguous in our case and can be determined easily. From Figure 11

555
Compared to Figure 12, we observe that the application of the cross-gradient constraint leads to adjustments of the model ensuring more structural consistency between density contrast and magnetic susceptibility, illustrating the applicability of the approach presented here. Also note that the model is also visually closer to the true model from approximately 7520 km Northing and more. However, despite the increased structural consistency between the density contrast and magnetic susceptibility models, some of the structures of the model are not recovered 560 accurately. For instance, the basin-shape structure around 7500 km Northing mirrors the actual geological structure (see Figure 8) and is an effect of non-uniqueness onto inversion. In this case, this illustrates the need for prior information in our inversion. While joint inversion of gravity and magnetic data using the cross-gradient constraint improves imaging comparatively with an inversion constrained only using smallness and smoothness constraints, prior geological information or petrophysical information may be necessary to alleviate the remaining 565 uncertainty.

Smallness and smoothness constraints using geological information
In this subsection, a sensitivity analysis to prior information in inversion is performed through a series of scenarios where geological structural information is introduced to adjust the smallness and smoothness constraints through and , respectively. In what follows, we apply this approach to gravity inversion. 570 The influence of geological information in defining the smallness and smoothness terms (detailed in 2.4.1 and 2.4.2) is analysed by investigating three additional scenarios allowed by the utilisation of either homogenous or geologically-derived and matrices. In each case, we start from the (α , α ) weights estimated in Sect.
4.2 from the analysis of the L-surface, which we adjust to obtain the geophysical misfit sufficiently close to objective values. We remind that α and α weight the overall contribution of the model smallness and 575 smoothness, respectively, in the cost function (eq. 5). In the first scenario we investigate (scenario b in Table 2), geological uncertainty information is used to define while keeping homogenous. This allows us to test the influence of geological prior information onto the smallness term. The values of the diagonal variance matrix are calculated using the geological certainty metric (eq. 18, shown in Figure 6b for the 2D section modelled here), and keep homogenous. 580 Contrarily to the previous tests (see 4.2) where = , we have, for the k th model cell: Because 0 ≤ ≤ 1 ∀ , we have: Consequently, setting in this fashion and keeping α constant translates in a lower overall relative importance of the smoothness term in the least-squares cost function (eq. 5), thereby moving away from the trade-off inferred from the L-curve principle (Sect. 4.2). To mitigate this, we adjust α to a value α such that: 585 which equates (α ) ( ) with (α ) so that the overall weight assigned to the smallness term remains the same with and without geological structural information (left-hand side and right-hand side of inequality in equation 20, respectively). Because the values of ‖ ‖ depend on both and , which vary in space and also depends on the other terms of the cost function, minor adjustments of the value of α are necessary to reach the objective value of data misfit. In this example, this leads to tune the suggested α = 8.4 × 10 to α = 590 8.85 × 10 (keeping α constant). The corresponding inverted model is shown in Figure 13b. The corresponding α weights are repeated in Table 2.
In the second scenario we test (scenario c in Table 2), geological uncertainty information is then used to define while keeping homogenous. This allows us to test the influence of geological prior information onto the smoothness term. Following the same procedure as for the smallness term, we adjust the suggested α = 3.6 × 595 10 to α = 4.1 × 10 . The corresponding inverted model is shown in Figure 13c. Finally, we test the case where both and are defined using geological information in the form of . Starting from values of α and α used in the previous tests, minor tuning is performed, leading to α = 6.1 × 10 and α = 6.0 × 10 .
Inversion results in the model shown in Figure 13d. As can be seen in Figure 13 by comparing Figure 13a-b with Figure 13c-d, the utilisation of geological structural information to adjust the smoothness regularization strength spatially has more impact on inversion than adjusting 610 the smallness term. While incorporating prior geological information in constrains the model to a certain extent, using to derive has more influence on the inverted model than for , with resulting models that closer to the reference model.
Comparing Figure 13c and Figure 13d indicates that the use of geological uncertainty information to adjust the smallness regularization strength spatially (through ) in addition to the model smoothness term (through ) 615 modifies inversion results further towards the reference model. Figure 13d, which results from inversion using prior information in both constraint terms, provides the model closest to the reference. While most interfaces are well-recovered when using geological information to define both and , the recovered density contrasts remain affected by the ambiguity inherent to gravity data in the presence of subhorizontal geological units (around 7460 km northing). This suggests that in this example, more prior information might be useful in recovering the 620 causative model more truthfully, especially in cases where potential field inversion is ambiguous (e.g., subhorizontal interfaces for gravity inversion). This is the object of the next subsection, which describes a new single-physics inversion scenario where petrophysical constraints are combined with structural constraints and geological information.
where and correspond to lower and upper bounds. We consider narrow bounds such that , = , + , with ≪ , , to encourage inversion to use density contrasts that closely resemble values defined a priori. Equation Four additional scenarios are tested to determine the influence of prior information onto inversion to accommodate the addition of both the damping gradient and ADMM bound constraint term. The use of prior information is illustrated in Figure 14. At a given iteration, the ADMM bounded constraint encourages inverted values to evolve inside one of the prescribed intervals depending on the current model . As mentioned above, we can then make the analogy with a smallness term that is dynamically updated. For this reason, we treat the ADMM bounded constraints in the same fashion as the smallness term, which we apply simultaneously to the model smoothness term. 650 Following the same protocol as Sect. 4.1 to determine α and α , we first perform inversion without the use of geological information in the form of the probabilities for the occurrence of different rock units or metrics that can be derived from them (Figure 14a, i.e., with and equal to the identity matrix and the corresponding regularization term weighted by α and α , respectively). It is therefore necessary to determine the value of α and α (eq. 5). We perform an L-surface analysis and sample values in the α , α plane to estimate the optimum 655 values for these hyperparameters (see Figure 15). Values of α varying from 1.585 × 10 and 1.585 × 10 , and values of α vary from 2.484 × 10 and 2.484 × 10 . The resulting L-surface is shown in Figure 15.  From Figure 15, we estimate the hyper-parameters α , α to be α , α = (2.2 × 10 , 1.3 × 10 ) in the case no geological information is used, meaning that both constraints are applied homogenously across the model.  Figure 16, and the estimates of (α , α ) are provided in Table 3.   inconsistent results can be partly mitigated by using geologically-derived smoothness constraints (Figure 16b). In 680 comparison, however, Figure 16c shows that use of geological information to determine the bounds recovers features much closer to the causative model.
While Figure 16d shows the more robust results overall, Figure 16c and Figure 16d present generally similar features. This indicates that, in this case, geological uncertainty information in structural constraints only allows refining features largely controlled by the utilisation of the ADMM constraints. This statement is supported by 685 Figure 16 where the comparison cases (a,b) and (c,d) reveal that the effect of using geological information to define bounds dominates over the effect of using uncertainty to define structural constraints.
The comparison of cases (a,b) and (c,d) in Figure 16 can be extrapolated to Figure 13 and Figure 16, to compare constraints more broadly. This is discussed in 5.1, which presents a short comparative analysis of all gravity inversion results. 690

Sensitivity analysis summary: comparison of constrained inversions
Tomofast-x was developed with the intent of providing practioners with an inversion platform accounting for various forms of prior information and geophysical datasets. We have tested a series of constraints involving joint inversion, geological and petrophysical information. The inverted density contrast models for inversion using 695 global smallness and smoothness constraints, joint inversion using the cross-gradient technique, geologicallyderived smallness and smoothness constraints, and ADMM bound constraints (both global and using geological information) are shown in Figure 17.  Firstly, it appears from Figure 17 that regardless of the type of constraints considered, the utilisation of geological information (cases b, d, e, g, h, i) to derive spatially-varying constraints for the matrix of both terms used provides the models that are visually closest to the true model. In this category, the utilisation of petrophysical information in the ADMM bound constraints provides (cases h-i) models that are closest to the true model (lowest 705 model misfit values indicated in the titles of the panels in the Figure). Secondly, the comparison of cases (a) and  (d) and (e) suggests that the utilisation of geological information to adjust the smallness strength spatially has an effect on inversion that is, with the cross-gradient 710 constraints (where structural information is passed on from another geophysical dataset), the lowest.
From the results shown in Sect. 4.2 through 4.5 and compared in Figure 17, it is possible to make a qualitative, speculative ranking of the constraints accordingly with their influence on the resulting model (from the most important influence to the least important influence): ADMM bound constraints > smoothness constraints > smallness constraints > cross-gradient constraints. This 715 observation is also corroborated by the values of the root-mean-square misfit between the true and inverted model.
From these observations we also deduce that when geological uncertainty information is added to the definition of constraints (i.e., for defining and and probabilities for defining ), the term of the cost function with the highest influence on the process will determine the main features of the model, which will be adjusted by the other term. 720 Tomofast-x was developed, with the intent of providing practioners with an inversion platform allowing various forms of prior information and geophysical data. Constraints that represent uncertainty and our level of epistemic knowledge provide useful constraint to inversion. This is encouraging as the Tomofast-x platform addresses a gap in inversion schemes that rely on a single model, and that model being as similar as possible to the target region, an often impossible requirement to meet. Thus Tomofast-x opens additional research avenues to the community 725 that are widely acknowledged, but remain largely unaddressed. Conceptual uncertainty relating the prior assumptions made about tectonic event history of the region, and thus the structure under study can be analysed.
Different event histories and topologies can be considered, giving a wider scope to the model space, and allowing the geophysics to invalidate implausible histories, but giving us pause to consider other that may be less likely, but nonetheless possible. 730

Outlook for future developments
Another research avenue under consideration is the integration of results from probabilistic modelling of seismic and electrical data into Tomofast-x. As stated in introduction, one of the goals born in mind during the design of Tomofast-x is interoperability. Current work involves the integration of Tomofast-x into the Loop 1 open source 3D probabilistic geological and geophysical modelling platform (Ailleres et al., 2019), in an effort to unify 735 geological and geophysical modelling at a more fundamental level than the more common cooperative approaches. Ongoing developments include the possibility to adjust weight assigned to the bound constraints accordingly with uncertainty levels in prior information used to defined spatially varying intervals.
Future research includes the utilisation of implicit geological modelling (in the sense of Calcagno et al., 2008) with Tomofast-x to define geological structures and rules that inversion will be encouraged to follow. It also 740 comprises the incorporation of topological laws previously used a posteriori (Giraud et al., 2019b) directly into inversion. The electrical capacitance tomography component of Tomofast-x (Martin et al., 2018), which we have not detailed here, can be extended to acoustic/seismic or electromagnetic data inversions that rely on the resolution of similar non-linear inversion problems. It opens the door to more versatility in the code and can be applied to joint inversion in similar ways but on more than two physical domains. 745 In addition, future developments comprise the collaborative and joint inversion of seismic and potential field data.

It is planned to develop an interface between Tomofast-x and Unisolver
(not yet open-source released by its authors), which is an extension of Seimic_Cpml codes (Komatitsch and Martin 2007, Martin et al., 2010, 2019 where integrated seismic imaging solvers are implemented. Unisolver is a multi-purpose 2D/3D seismic imaging platform based on high order finite difference and finite volume discretization as well as nonlinear seismic data 750 inversion procedures. Such interface would allow performing collaborative or joint inversion of seismic and gravity or magnetic data and obtain the resulting models on the same mesh while benefitting from Tomofast-x's various functionalities. This will be an easy way to provide Tomofast-x with separate seismic information like sensitivity kernels on the fly as another physical domain. In the implementation presented here, only the truncation of the matrix system based on maximum distance 755 thresholding was discussed. It is planned to reduce memory requirements using the wavelet compression of the matrix system of the inverse problem in the same fashion as (Martin et al., 2013).
We have shown a number of tests using a selected set of functionalities of Tomofast-x. However, more, or different, tests could be done. For instance, an interesting research avenue is to exploit Tomofast-x's capability to read an arbitrary number of prior and starting models to test the geological archetypes that can be identified by 760 clustering of the set of geological models probabilistic geological modelling can produce ( Pakyuz-Charrier et al., 2019). Additional features of Tomofast-x which testing lies beyond the scope of this paper are Jacobian matrix truncating, the different kinds of depth weighting, and their effects on the different types of inversion. Last, we have not used posterior uncertainty indicators listed in Sect. 2.5 and A.1 as the paper focusses on the inversion capabilities of Tomofast. The output results of Tomofast-x allow, however, to study uncertainty in the same 765 fashion as Giraud et al. (2017Giraud et al. ( , 2019c where some of them are used. Results obtained using the cross-gradient technique for joint inversion of gravity and magnetic data showed that it can improve imaging of geological structures. However, our study also revealed some of the limitations of this method. In the synthetic example, structurally coherent features of the resulting model contradict the geology of the true model. In addition, our L-curve (or L-surface) analysis suggests that the determination of the optimum α 770 weights of the cost function using the cross-gradient technique may be affected by non-uniqueness and that multiple sets of weights could equally satisfy the L-curve criterion. One interpretation is that this method remains https://doi.org/10.5194/gmd- 2021-14 Preprint. Discussion started: 30 March 2021 c Author(s) 2021. CC BY 4.0 License. affected by uncertainty and could be producing several families of models fitting geophysical data equally well.
This observation differs from similar analysis performed in the case of joint inversion using petrophysical constraints, where such potential ambiguity was not suggested by the L-surfaces (Giraud et al., 2019c). These 775 impressions, however, require a more detailed investigation and constitutes a new research avenue.
In our sensitivity analysis, we have produced a series of models that can be considered geophysically equivalent because they fit the geophysical data equally well. These models are the result of deterministic inversion, where prior information guides inversion towards one of the modes of the probability density function describing the problem (equation 1), or modifies them. It is therefore safe to assume that each mode is representative of an 780 archetype of models from the geophysical data's null-space. This highlights the interest of using 'null-space shuttles' allowing navigation of the null-space (Deal and Nolet 1996, Muñoz and Rath 2006, Vasco 2007 Zunino 2019) to explore the space of possible models without extensive sampling and to assess the robustness of the result. In addition, the plots of the L-curves corresponding to the problem we presented suggest the presence of multiple optima in the hyperparameter space (weights α), which it might be interesting to investigate in future 785 research, especially in the joint inversion case.

Conclusion
We have introduced the open source joint inversion platform Tomofast-x and demonstrated its capabilities with a realistic dataset taken from the Hamersley region in central Western Australia. The geophysical theoretical background of Tomofast-x was explained in depth to guide users in understanding and using the modelling 790 approach implemented in the source code.
We leveraged the modularity of Tomofast-x to study the sensitivity of inversion to prior structural, geological and petrophysical information, joint inversion, and the code's scalability. We tested a new combination of constraints incorporating geological structural information in the smoothness term and dynamic prior model definition using petrophysical knowledge (ADMM bound constraints), a feature usually not available to most inversion software. 795 Our sensitivity analyses on prior information and different constraints reveal that constraints using petrophysics (ADMM clustering bound constraints) dominate over gradient-based constraints (smoothness and cross-gradient constraints), which in turn exert more influence onto inversion than smallness constraints. This shows the importance of prior information in inversion and illustrates the need to study the space of geophysically equivalent models. 800 The examples described here were designed to replicate a typical, rigorous approach to the development of a geoscientific model and be relevant to real-world application. The aim to ensure rigour and reproducibility of the result presented is facilitated by the release of the source code, datasets, and a reduced, modified python version of the algorithm that accompany this paper.
7 Source code, documentation and data availability 805 The source code for Tomofast-x as used in this manuscript can be found in Ogarko et al. (2021) (https://zenodo.org/record/4454220#.YFwpEK8zZaQ). The latest versions will be available from the Github

Competing interests
The authors declare that they have no conflict of interest.

Acknowledgements
Appreciation is expressed to the CALMIP supercomputing centre (Toulouse, France), for their support through 820  Tomofast-x offers the possibility to examine the Jacobian matrix of the misfit function (eq. 5), which encapsulates the contribution of several constraint terms (see for example eq. 5), by calculating its derivative with respect to the model , ( , ) . This feature takes advantage of the LSQR solver. In the LSQR algorithm, ( , ) is calculated at the beginning of each iteration when approximating a solution to the system of equations (Appendix D). The value of ( , ) can then be calculated before or after application of the depth weighting operator. It is 870 computed as the product of the transpose of the matrix representing the left-hand side of the system of equations to be solved by the LSQR solver, by the vector of the corresponding quantities to minimize (data misfit, crossgradients, damping terms, etc., constituting the right hand side of the corresponding equation, as shown in https://doi.org/10.5194/gmd-  Preprint. Discussion started: 30 March 2021 c Author(s) 2021. CC BY 4.0 License. Appendix D). Importantly, its dimension is equal to the number of model parameters. It is therefore possible to store it on disk to provide a measure of the sensitivity of the data and the different terms of the misfit function to 875 model variations at depth or in any part of the computational domain. By computing ( , ) , it is possible to study the convergence of the algorithm, small values indicating convergence. In addition, it is a metric that measures the stability of the algorithm and which is useful to determine whether the system of equations is well conditioned.

A.1.3 Identification of rock units 880
Membership analysis of the inverted model can be performed when statistical petrophysical constraints were applied to inversion from the values of reached after inversion converged. Membership values can be used to assess inverted models by reconstructing a rock unit model from the recovered inverted physical properties (Doetsch et al., 2010, Sun et al., 2012, Giraud et al., 2019c. Rock units labels can also be assigned to model-cells when the ADMM bound constraints have converged. It allows attaching a petrophysical property interval to each 885 model-cell, allowing direct identification of rock types.

A.1.4 Cross-product of gradients
The cross-product of model gradients in 3D can be stored after inversion and its L2 norm is given after each inversion cycle. It allows to assess the degree of structural similarity between the models, and to delineate areas showing specific structural similarities or dissimilarities. 890

A.2 Jacobian matrix truncation
Tomofast-x offers the possibility to use a moving sensitivity domain approach (Čuma et al., 2012, Čuma andZhdanov 2014) limiting the sensitivity domain to a cylinder which radius is chosen by the user to reduce computational requirements (the option for a sphere is also present in the source code, but commented in the current version). The underlying assumption is that cells beyond a given distance exert a negligible influence on 895 the measurement. Generally speaking, this radius is provided by the users and should be chosen carefully.

A.3 norm
Tomofast-x also offers the possibility of performing data inversion using a Lp norm (1< p ≤ 2) to define the smallness term, as it has been proposed for electrical capacitance tomography (ECT) in  in the framework of Tomofast-x. The Lp norm inverse problem is non-linear and can be solved iteratively using L2 900 minimization. In the Lp norm case, the regularization parameter can be approximated by a p-power law of the model at each point of the computational domain and must also be recomputed at each new inversion cycle. When the Lp norm is introduced for p < 2, this procedure allows to obtain sharper models with better interface definition, and determine stronger contrasts for the specific cases under study. If = 2, the smallness term is reduced to L2 norm minimization (the commonly-used Tykhonov-like regularization) as used in this work. The choice of other 905 values such that 1< p ≤ 2 is at the discretion of the user or depending on prior information.

A.4 Electrical capacitance tomography
Detailing electrical capacitance tomography (ECT) is beyond the scope of this paper, but we can apply to joint gravity and magnetic inversion the functionalities that have been introduced to solve the ECT inverse problem based on L2 data misfit norm and Lp (1<p≤2) damping term minimization (see Sect. A.3). In Tomofast-x, ECT is 910 based on the finite-volume method for the forward problem and on a non-linear and iterative LSQR method to solve the inverse problem. As in propagative and diffusive geophysical inverse problems in frequency domain, the sensitivity matrix and the damping term depend on the current model and must be recomputed at each new iteration. We refer the reader to Martin et al. (2018) for more details on this technique. Note that algorithms developed in relation to this method can easily be extended to propagative and diffusive geophysical inverse 915 problems.
Appendix B. Summary of the notation and terms used in the paper α Weight assigned to the magnetic inverse problem (used only in joint inversion) Appendix C. Forward gravity and magnetic data calculation 920 In this Appendix we summarize the forward calculation of gravity and magnetic data as performed in Tomofast-x. In practice, Tomofast-x calculates forward data using input data expressed in units from Système International (SI), expressed in kilogram, metre, and second.The gravity field of a distribution of density anomalies ∆ over a volume of rock at a location = [ , , ] can be expressed as follows: Where = [ , , ] defines the location of mass density anonaly ∆ ( ) and is the universal gravity constant. 925 While Tomofast-x is implemented in such a way that the three spatial components of can be obtained, we consider only the vertical direction here, which we simply write for sake of clarity (note that here, when taken Where, using the formulation of (Blakely, 1995), the elements of the sensitivity matrix are given as: where, , and are the coordinates of the vertices of the prism, and , , = ( − ) + − + ( − ) In Tomofast-x, the total magnetic field anomaly is calculated by summing the responses of the prisms making up the model, following Bhattacharyya (1964Bhattacharyya ( , 1980). The Regional magnetic field is denoted = , , , and the Magnetization = , , . We write = ‖ ‖ and = ‖ ‖. Note that remnant magnetization is not 940 accounted for.
Using the formalism of (Blakely, 1995), we denote the magnitude of the total magnetic field anomaly generated by a prism oriented parallel to the , , and axes of the mesh similarly to the gravity case. We have: ( , , ) = χ , , , , where χ is the magnetic susceptibility. The sensitivity is given as: where, , , , and , are the coordinates of the vertices of the prism along the , , and directions, respectively. The other terms of equation 30 are defined below: Scaling tests Although Tomofast-x can run on personal computers in a few seconds or minutes for 2D inversions and small 3D volumes (typically a few minutes on a laptop for models smaller than approx. 100,000 model cells), it necessitates 950 a supercomputer for realistic size 3D case studies (e.g., models exceeding 500,000 model cells and 10,000 geophysical data points).
We assess Tomofast-x's parallel efficiency using the strong scaling as an indicator. The strong scaling curve is given by plotting the number of CPUs as a function of user time. It is complemented by the relative speedup curve t t ⁄ , where t and t are respectively the user times to complete inversion using the number of CPUs 955 n = 1 and a given number of CPU n , respectively. We performed the scaling tests on the EOS machine from the CALMIP supercomputing centre (https://www.top500.org/site/50539/, https://www.calmip.univtoulouse.fr/spip.php?article388 -the latter being in French only, both last accessed on 10/11/2020).
The full-size model we used is made of N N N = 128 * 128 * 32 = 524,288 cells (i.e., 2 cells), which we reduce by a factor of 2 by reducing the physical domain incrementally to N N N = 32 * 32 * 32 = 32,768 cells 960 (i.e., 2 cells) to be able to use it on a single CPU, for the purpose of parallelization efficiency analysis. In the configuration we use, the number of data points modelled is equal to: N = N N .   2, 4, 8, 16, 32, 64, 128, 256, and 512. in (c), the intersection. between the two curves symbolises the number 965 of elements below which computational resources usage is suboptimal. The line marked 'ideal law' indicates perfect scalability for the tests that were performed. Figure A 1a shows the parallelization efficiency. It reveals that the scaling is nearly perfect for up to 16 CPUs, very good for 32 CPUs and that it deteriorates above 64 CPUs. This corresponds to relative speedups (ratio between run time for one CPU and a given number of CPUs) of about 14.5, 25 and 40( Figure A 1b), respectively. 970 For the cases using 64, 128 and 256 CPUs, speedup increases from 40 to 65, indicating that overhead interprocessor communication time for n ≥ 64 increasingly impacts the total computation time, for this (small) problem size. This is noticeable in Figure A 1a and Figure A 1b as both curves seem to adopt an asymptotic behaviour for the largest numbers of CPUs. This illustrates the deterioration of performances due to interprocessor communications (Kumar et al., 1994). The deterioration of performances due to inter-processor 975 communications is due to the number of elements (or model cells) processed by each CPU becoming smaller, while the number of elements involved in communications increases; ultimately, the time spent in pure computations in each core becomes smaller than the time spent in inter-processor communications.
The efficiency curves (e.g., Figure A 1a  In Tomofast-x, depth weighting is applied as a sensitivity matrix preconditioner. The resulting system is solved 995 using the LSQR algorithm (Paige and Saunders 1982) as: At each k th inversion cycle, we solve this system of equations and calculate the model update the model as follows: The model can then be updated to obtain .
where is a projection onto the bounds such that: