GithubHelp home page GithubHelp logo

ofmla / gravmod3d Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 1.41 MB

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

License: BSD 3-Clause "New" or "Revised" License

Fortran 74.55% Shell 25.45%
3d prisms variable-density forward-modeling geophysical-modeling gravity-method fortran

gravmod3d's Introduction

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

gravmod3d's People

Contributors

ofmla avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.