The gwb-dat app

The gwb-dat app#

The gwb-dat app allows you to query the GWB world at many points at a time. As arguments, it takes a World Builder file, which specifies what the world looks like, and a .dat file, which specifies what points you want to query and what information you want. An example of how it is run is the following: gwb-dat world_builder_file.wb point_info.dat. There is only one optional extra argument which is an option to limit some consistency checks in debug mode: --limit-debug-consistency-checks (or -ldcc as a shortcut). If you want to use it, it must be added after the .dat file.

The main part of the .dat file consists of 3 (in 2D) or 4 (in 3D) columns of numbers. The first 2 or 3 columns are the coordinates of the 2D or 3D point respectively. The last column is the depth. In debug mode, spherical models are checked by default for consistency. You can turn this off using the above mentioned --limit-debug-consistency-checks option.

Lines with a # are either ignored or can have a special meaning. For example, a line with # random text here is ignored, but a line with # dim = 2 sets the dimension to 2. The available options are:

  1. dim = : 2 or 3

  2. compositions = : number of compositions

  3. grain compositions = : number of grain compositions

  4. number of grains = : number of grains per particle.

  5. convert spherical = : true or false. This option is only allowed to be set true in 3D. It allows you to input radius, longitude and latitude instead of x, y and z.

An example of a .dat file is the following:

 1# This is a comment in the data
 2# file. 
 3# Now define parameters:
 4# dim = 2
 5# compositions = 9
 6# x z d T c1 c2 c3 c4 c5
 71 2 2
 82 2 2
 93 4 0
10560e3 0 0
112000e3 0 0
122000e3 0 100e3
13100e3 0 0e3
14100e3 0 50e3
15100e3 0 100e3
16100e3 0 200e3
17100e3 0 250e3
18100e3 0 260e3
19500e3 0 0e3
20500e3 0 50e3
21500e3 0 100e3
22500e3 0 200e3
23500e3 0 250e3
24500e3 0 260e3

This file can be found in the tests directory: tests/gwb-dat/app_oceanic_plate_cartesian.dat.

Running gwb-dat tests/gwb-dat/app_oceanic_plate_cartesian.wb tests/gwb-dat/app_oceanic_plate_cartesian.dat will give the following output:

 1# x z d T c0 c1 c2 c3 c4 c5 c6 c7 c8 tag 
 21 2 2 1600 0 0 0 0 0 0 0 0 0  -1
 32 2 2 1600 0 0 0 0 0 0 0 0 0  -1
 43 4 0 1600 0 0 0 0 0 0 0 0 0  -1
 5560e3 0 0 150 0 0 0 1 0 0 0 0 0  0
 62000e3 0 0 20 0 0 1 0 0 0 0 0 0  0
 72000e3 0 100e3 20.5679 0 0 1 0 0 0 0 0 0  0
 8100e3 0 0e3 6 0 0 0 0 0 0 0.25 0.75 0  0
 9100e3 0 50e3 6 0 0 0 0 0 0 0.25 0.75 0  0
10100e3 0 100e3 7 0 0 0 0 0 0 0 1 0  0
11100e3 0 200e3 8 0 0 0 0 0 0 0 0 1  0
12100e3 0 250e3 8 0 0 0 0 0 0.25 0.75 0 0  0
13100e3 0 260e3 1720.82 0 0 0 0 0 0 0 0 0  -1
14500e3 0 0e3 12 0 0 0 0 0 0.25 0.75 0 0  0
15500e3 0 50e3 19.6 0 0 0 0 0 0.25 0.75 0 0  0
16500e3 0 100e3 27.2 0 0 0 0 0 0.25 0.75 0 0  0
17500e3 0 200e3 42.4 0 0 0 0 0 0.25 0.75 0 0  0
18500e3 0 250e3 50 0 0 0 0 0 0.25 0.75 0 0  0
19500e3 0 260e3 1720.82 0 0 0 0 0 0 0 0 0  -1

You can see it appends the temperature and 9 compositions. It also provides a header line with a symbol indicating what each field means.

More examples of .dat files can be found in the tests/gwb-dat/ directory.