Skip to content

3D forward modeling of bodies discretized by rectangular prisms with parabolic density contrast

License

Notifications You must be signed in to change notification settings

ofmla/gravmod3d

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub release (latest by date) Build Status codecovlast-commit

gravmod3d

3D forward modeling of bodies discretized by rectangular prisms with parabolic density contrast

This is a modern Fortran implementation of the three-dimensional gravity modeling with parabolic density contrast presented in 3-D forward gravity modeling of basement interfaces above which the density contrast varies continuously with depth by V. Chakravarthi, H. M. Raghuram and S. B. Singh.

Building gravmod3d

A Fortran Package Manager manifest file is included, so that the library and a simple example can be compiled with FPM. For example:

fpm build --profile release
fpm run --profile release -- data/input.dat  data/synthetic_xyz.dat data/grid_xy.dat data/gravity_anomaly.dat

The example program computes the gravity field of a sedimentary basin (which is approximated by a set of prisms) on a regular grid of observation points. It reads four command-line arguments: the relative paths for four files. The first three are input files and the last one is the output file.

  • The first input file contains six rows/entries:
    • the number of prisms,
    • the number of observation points,
    • the parameters that define the parabolic law of density variation with depth, that is,
      • the density contrast (g/cc) at the surface and
      • the alpha constant (g/cc/km) and
    • the dimensions of prisms rectangular bases (km) in the x- and y- directions.
  • The second input file describes the 3D sediment-basement contact. It contains X-coordinate, Y-coordinate, and Z-value triplets. The XY-coordinates (km) represent the geometrical centers on prisms top. Z values (km) represent the bottom boundaries of the prisms, which coincide with the basement interface.
  • The third input file contains the XY-coordinates (km) of the regular grid of observations. Such coordinates can not be placed on horizontal limits of the prisms (edges and corners) to prevent numerical problems during the computing of the gravity field.
  • The content of the output file corresponds to the XY-coordinates (km) of the regular grid of observations, along with the gravity field values (mgal).

To run the unit test use

fpm test

To build an Open-MP version of the library, use:

fpm build --profile release --flag "-fopenmp"

In this case, you must set the OMP_SET_NUM_THREADS environment variable to specify how many threads you wish to use. Use the following commands to run the example program with two OpenMP threads

export OMP_NUM_THREADS=2
fpm run --profile release --flag "-fopenmp" -- data/input.dat  data/synthetic_xyz.dat data/grid_xy.dat data/gravity_anomaly.dat

To use gravmod3d within your FPM project, add the following to your fpm.toml file:

[dependencies]
gravmod3d = { git="https://github.com/ofmla/gravmod3d.git" }

Gravity anomaly data generated from 3D synthetic model example can be ploted with the contour.sh GMT script after ran any of the fpm run commands above. Another GMT script plot_3d.sh is also provided for plotting the 3D synthetic model. Both scripts are placed in the data/gmt_scripts/ folder

NOTE: The 3D synthetic basin model is that used in the paper Regularization parameter selection in the 3D gravity inversion of the basement relief using GCV: A parallel approach, which describes a computationally efficient automatic method for the optimal selection of the regularization parameter in the 3D inversion of gravity data.

References

Documentation

The latest API documentation can be found here. This was generated from the source code using FORD (i.e. by running ford gravmod3d.md).

License