WinGslib Help

WinGslib is an interface to the GSLIB programs contained in the book written by Deutsch and Journel published by Oxford University Press, second edition, 1997. The latest FORTRAN 90 GSLIB programs with dynamic memory allocation are used. WinGslib is an interface to these programs; the GSLIB programs are executed by WinGslib . WinGslib is a product of Statios LLC (see www.statios.com for corporate information).

In summary, WinGslib allows import and export of the traditional GSLIB parameter files to and from a user interface. The user interface permits straightforward modification of the parameters, execution of the programs, some error checking, and linkage to visualization. A project structure has been used that permits users to specify a default location of data, parameter files, and output files. The project structure simplifies organization and provides default locations; however, the user has the flexibility to use data from any input directory and write results anywhere.

WinGslib provides an interface to all 39 GSLIB programs with all options enabled. The options in GSLIB are there for a reason and WinGslib recognizes all of them. The programs are accessed through six menus: (1) data manipulation, (2) postscript plots, (3) variograms, (4) kriging, (5) simulation, and (6) post processing. This organization is consistent with the chapters in the GSLIB book.

A help system is available for WinGslib and all GSLIB programs. The idea behind WinGslib is to provide a user interface to aid in the use of GSLIB on a PC. There is no direct help that would teach geostatistics. The user must have an understanding of how the programs are used together to undertake a geostatistical project.

The main WinGslib window provides three views:

  • A tree structure to the left that shows all of the programs and parameter files that have been executed. The parameter files can be re- executed or results visualized by clicking the right mouse button.
  • A batch file may be created, saved, loaded, and executed in the batch window to the right. This makes repeated execution of many programs easy.
  • The messages written by the GSLIB programs are displayed in the lower window; the debugging and reporting output of GSLIB may be viewed.
Other features of WinGslib include:
  • standard Windows file selection and save protocols are used
  • labels are used in place of column numbers
  • files and parameter files may be viewed by the click of a mouse button
  • "plot" programs are available to combine multiple PostScript plots to the same page.

For help on the individual GSLIB programs, see the GSLIB help page.


GSLIB

 ---

WinGslib Help Page: GSLIB

GSLIB Provides 39 programs for many geostatistical calculations. These programs have been organized into six classes:
  • data manipulation
  • postscript plots
  • variograms
  • kriging
  • simulation
  • post processing.
This organization is consistent with the chapters in the GSLIB book. You are strongly encouraged to look in the GSLIB book for detailed information regarding the GSLIB programs and the theory behind the programs. This help system is primarily designed to recall some details behind the different options; it is not designed to teach geostatistics.


Data Utility Programs

 ---

WinGslib Help Page: "Data" Programs

The programs in this category are aimed at general data manimulation and calculation including.

The Change Coordinates System (rotcoord) program performs a 2-D translation and rotation of coordinates (or the reversal of a previous 2-D translation and rotation). A 3-D rotation can be accomplished by two successive steps. The main purpose of a global translation and rotation is to make the grid system more efficient by aligning the coordinate system parallel and perpendicular to an elongated region of interest.

Cell Declustering (declus) is used to assign declustering weights to scattered data on the basis of the number of data falling within a declustering cell. The anisotropic cells may be 3-D. The optimal cell size can be determined automatically if requested.

Normal Score Transform (nscore) geostatistical simulation often requires data to follow a normal or Gaussian distribution. Although the simulation programs transform the data prior to simulation the data must be transformed with this program prior to variogram calculation.

The Normal Score Back-Transformation (backtr) program is rarely needed since the Gaussian simulation programs, like sgsim, automatically back transform the simulated values. At times, however, it is useful to simulate in "normal-space" and keep the results so that they can be checked. Then, this program could be used for back transformation.

General Transformation (trans) program takes data following any arbitrary distribution and transfom them to any other distribution. This can be used to correct the results of simulation or for sensitivity studies.

Markov-Bayes Calibration (bicalib) is needed before indicator simulation with the Markov-Bayes option (or any other soft-indicator kriging option) the soft-data distributions must be derived from calibration data; this program determines those distributions and the required "B" parameters for Markov-Bayes simulation.

The Histogram Smoothing (histsmth) simulated annealing histogram smoothing (histsmth) program and Scattergram Smoothing (scatsmth) programs of gslib are not commonly needed or used.

Most input and output programs are in the standard GSLIB (or simplified GeoEAS format). The histsmth program creates a postscript output for quick checking, but all other programs only read and write standard GSLIB data files.


GSLIB Help: ROTCOORD

GSLIB Help Page: ROTCOORD

o Description:
  • 2-D coordinate rotation (and reverse rotation)
o Parameters:
  • datafl: the input data file.
  • icolx and icoly: The columns for the x coordinate and y coordinate.
  • outfl: file for output with rotated (or back transformed) coordinates.
  • xorigin and yorigin: the origin of the rotated system in the original coordinate system.
  • angle: the rotation angle (in degrees clockwise).
  • switch: if switch=0 then rotate to the new coordinate system (the default case). If switch=1, however, then the input x and y coordinates are considered to be already rotated and they are back transformed to the original system.


GSLIB Help: DECLUS

GSLIB Help Page: DECLUS

o Description:
  • Data are often spatially clustered; yet, we may need to have a histogram that is representative of the entire area of interest. To obtain a representative distribution, one approach is to assign declustering weights whereby values in areas/cells with more data receive less weight than those in sparsely sampled areas. The program declus provides an algorithm for determining 3-D declustering weights in cases where the clusters are known to be clustered preferentially in either high or low valued-areas. In other cases, polygon-type declustering weights might be considered whereby the weight is made proportional to the sample area (polygon) of influence.
  • The declustering weights output by declusare standardized so that they sum to the number of data. A weight greater than 1.0 implies that the sample is being overweighted and a weight lesser than 1.0 implies that the sample is being downweighted (it is clustered with other samples).
o Parameters:
  • datafl: a data file in simplified Geo-EAS format containing the variable to be declustered.
  • icolx, icoly, icolz, and icolvr: the column numbers for the x y z coordinates and the variable.
  • tmin and tmax: all values strictly less than tmin and strictly greater than tmax are ignored.
  • sumfl: the output file containing all the attempted cell sizes and the associated declustered mean values.
  • outfl: file for PostScript output.
  • anisy and anisz: the anisotropy factors to consider rectangular cells. The cell size in the x direction is multiplied by these factors to get the cell size in the y and z directions, e.g., if a cell size of 10 is being considered and anisy2 and anisz3 then the cell size in the y direction is 20 and the cell size in the z direction is 30.
  • minmax: an integer flag that specifies whether a minimum mean value (minmax=0) or maximum mean value (minmax=1) is being looked for.
  • ncell, cmin, and cmax: the number of cell sizes to consider, the minimum size, and the maximum size. Note that these sizes apply directly to the x direction and the anis factors adjust the sizes in the y and z directions.
  • noff: the number of origin offsets. Each of the ncell cell sizes are considered with noff different original starting points. This avoids erratic results caused by extreme values falling into specific cells. A good number is 4 in 2-D and 8 in 3-D. A short description of the program


GSLIB Help: NSCORE

GSLIB Help Page: NSCORE

o Description:
  • Calculate normal scores values for data from any arbitrary histogram
o Parameters:
  • datafl: a data file in simplified Geo-EAS format containing the variable to be transformed and optionally a declustering weight.
  • icolvr and icolwt: the column numbers for the variable and the weight. If icolwt less than or equal to 0, equal weighting is considered.
  • tmin and tmax: all values strictly less than tmin and strictly greater than tmax are ignored.
  • ismooth: =1 then consider a smoothed distribution, =0 then only consider the data in datafl
  • smoothfl: the smoothed distribution file
  • icolvr and icolwt: the column numbers for the variable and the weight in smoothfl
  • outfl: the output file containing the normal scores.
  • transfl: the output file containing the transformation look-up table, i.e., pairs of z and y values with z being the original data values or class bound values and y being the corresponding normal scores values.


GSLIB Help: BACKTR

GSLIB Help Page: BACKTR

o Description:
  • Back transform normal scores values according to a table look up
o Parameters:
  • datafl: a data file in simplified Geo-EAS format containing the normal scores.
  • ivr: the column number for the normal scores.
  • tmin and tmax: all values strictly less than tmin and strictly greater than tmax are ignored.
  • outfl: the output file containing the back transformed values.
  • transfl: an input file containing the transformation look-up table, i.e., pairs of z and y values with z being the original data values or class bound values and y being the corresponding normal scores values. This is an input file that corresponds to the table written out by nscore, sgsim,
  • zmin and zmax: are the minimum and maximum values to be used for extrapolation in the tails.
  • ltail and ltpar specify the back transformation implementation in the lower tail of the distribution: ltail=1 implements linear interpolation to the lower limit zmin and ltail=2 implements power model interpolation, with w=ltpar to the lower limit zmin
  • Linear interpolation is used between known data values.
  • utail and utpar specify the back transformation implementation in the upper tail of the distribution: utail=1 implements linear interpolation to the upper limit zmax utail=2 power model interpolation, with w=utpar to the upper limit zmax and utail=4 implements hyperbolic model extrapolation to the upper limit zmax with w = utpar


GSLIB Help: TRANS

GSLIB Help Page: TRANS

o Description:
  • trans is a generalization of the quantile transformation used for normal scores, the $p$-quantile of the original distribution is transformed to the $p$-quantile of the target distribution. This transform preserves the $p$-quantile indicator variograms of the original values. The variogram (standardized by the variance) will also be stable provided that the target distribution is not too different from the initial distribution.
o Parameters:
  • vartype: the variable type (1=continuous, 0=categorical)
  • refdist: the input data file with the target distribution and weights.
  • ivr and iwt: the column for the values and the column for the (declustering) weight. If there are no declustering weights then set iwt= 0.
  • datafl: the input file with the distribution(s) to be transformed.
  • ivrd and iwtd: the column for the values and the declustering weights (0 if none).
  • tmin and tmax: all values strictly less than tmin and strictly greater than tmax are ignored.
  • outfl: output file for the transformed values.
  • nsets: number of realizations or "sets" to transform. Each set is transformed separately.
  • nx, ny, and nz: size of 3-D model (for categorical variable). When transforming categorical variables it is essential to consider some type of tie-breaking scheme. A moving window (of the following size) is considered for tie-breaking when considering a categorical variable.
  • wx, wy, and wz: size of 3-D window for categorical variable tie-breaking.
  • nxyz: the number to transform at a time (when dealing with a continuous variable). Recall that nxyz will be considered nsets times.
  • zmin and zmax: are the minimum and maximum values that will be used for extrapolation in the tails.
  • ltail and ltpar specify the back transformation implementation in the lower tail of the distribution: $ltail=1$ implements linear interpolation to the lower limit zmin and $ltail=2$ implements power model interpolation, with w=ltpar, to the lower limit zmin.
  • utail and utpar specify the back transformation implementation in the upper tail of the distribution: $utail=1$ implements linear interpolation to the upper limit zmax $utail=2$ implements power model interpolation, with w=utpar, to the upper limit zmax, and $utail=4$ implements hyperbolic model extrapolation with w=utpar.
  • transcon: constrain transformation to honor local data? (1=yes, 0=no)
  • estvfl: an input file with the estimation variance (must be of size nxyz).
  • icolev: column number in estvfl for the estimation variance.
  • omega: the control parameter for how much weight is given to the original data (w between 0.33 and 3.0)
  • seed: random number seed used when constraining a categorical variable transformation to local data. A short description of the program
o Application notes:
  • When ``freezing'' the original data values, the quantile transform is applied progressively as the location gets further away from the set of data locations. The distance measure used is proportional to a kriging variance at the location of the value being transformed. That kriging variance is zero at the data locations (hence no transformation) and increases away from the data (the transform is increasingly applied). An input kriging variance file must be provided or, as an option, trans can calculate these kriging variances using an arbitrary isotropic and smooth (Gaussian) variogram model.
  • Because not all original values are transformed, reproduction of the target histogram is only approximate. A control parameter, w in [0,1], allows the desired degree of approximation to be achieved at the cost of generating discontinuities around the data locations. The greater w, the lesser the discontinuities.
  • Program trans can be applied to either continuous or categorical values. In the case of categorical values a hierarchy or spatial sequencing of the $K$ categories is provided implicitly through the integer coding $k=1,\ldots,K$ of these categories. Category $k$ may be transformed into category $(k-1)$ or $(k+1)$ and only rarely into categories further away.
  • An interesting side application of program trans is in cleaning noisy simulated images. Two successive runs (a ``roundtrip'') of trans, the first changing the original proportions or distribution, the second restituting these original proportions, would clean the original image while preserving data exactitude.


GSLIB Help: BICALIB

GSLIB Help Page: BICALIB

o Description:
  • Whenever soft data are considered in an indicator formalism, it is necessary to calculate the soft indicator values (the prior distributions). Also, when considering the Markov-Bayes option in the indicator simulation program sisim, the B(z) calibration parameters are called for. The program bicalib computes the prior distributions and the B(z) calibration parameters. These prior distributions are written to one output file and the B(z) parameters are written to a reporting file from which they must be transferred to the sisim parameter file.
  • Often in practice the sparse sample size does not provide enough resolution for the scattergram of primary vs. secondary variables. Program scatsmth could be used to smooth and add resolution to the sample scattergram. Instead of the original data pairs (size n the input data file datafl to program bicalib could contain the smoothed sample scattergram.
o Parameters:
  • datafl: a data file in simplified Geo-EAS format containing the secondary data values (the output file will contain the corresponding prior distributions for the primary variable).
  • icolsec: the column number for the secondary variable.
  • calibfl: a data file in simplified Geo-EAS format containing pairs of primary and secondary data values (the calibration data).
  • ivru, ivrv and iwt: the column numbers for the primary and secondary variables and declustering weight / bivariate frequency.
  • tmin and tmax: all values strictly less than tmin and strictly greater than tmax are ignored.
  • outfl: an output file that contains the prior distributions corresponding to all input secondary data.
  • repfl: an output file that contains a report of the pairs retained, some summary statistics, a bivariate distribution table, the prior distributions, and the B(z) parameter values.
  • ncutu: the number of thresholds applied to the primary variable.
  • cutu(i),i=1,ncutu: the threshold values applied to the primary variable.
  • ncutv: the number of thresholds applied to the secondary variable.
  • cutv(i),i=1,ncutv: the threshold values applied to the secondary variable.


GSLIB Help: HISTSMTH

GSLIB Help Page: HISTSMTH

o Description:
  • Creates a smooth distribution model constrained to a mean, variance, quantiles, and smoothmess
o Parameters:
  • datafl: the data file with the raw (perhaps declustered) data.
  • icolvr and icolwt: the column location for the variable and the declustering weight (0 if none available).
  • tmin and tmax: all values strictly less than tmin and strictly greater than tmax are ignored.
  • title: a 40-character title for the top of the PostScript plot.
  • psfl: name for the PostScript output file.
  • nhist: number of histogram classes for the PostScript output file. nhist is typically set less than nz (see below) to obtain a reasonable histogram display superimposed on the smoothed distribution.
  • outfl: output file containing the smoothed distribution (evenly spaced z values and variable p values).
  • nz, zmin and zmax: the number N of evenly spaced z values for the smoothed histogram and the limits for the evenly spaced z values
  • ilog: =0 then an arithmetic scaling is used, =1 then a logarithmic scaling (base 10) is used.
  • maxpert, report, omin and seed: after maxpert x nz perturbations the program is stopped. After report x nz perturbations the program reports on the current objective function(s). When the normalized objective function reaches omin the program is stopped. The random number seed seed should be a large odd integer.
  • imean, ivari, ismth and iquan: flags for whether closeness to a target mean, closeness to a target variance, smoothness, and closeness to specified quantiles will be considered (1 = yes, 0 = no).
  • sclmean, sclvari, sclsmth and sclquan: user imposed weights which scale the weights that the program automatically calculates.
  • nsmooth: half of the smoothing window size.
  • mean and variance: target mean and variance (if set less than -999 then they will be calculated from the input data).
  • ndq: number of quantiles defined from the data (evenly spaced cumulative probability values).
  • nuq: number of quantiles defined by the user (nuq lines must follow with a cdf and a z value). The user-defined quantiles allows the user more control over ``peaks'' and ``valleys'' in the smoothed distribution. The user should choose these quantiles to be consistent with the quantiles defined from the data.


GSLIB Help: SCATSMTH

GSLIB Help Page: SCATSMTH

o Description:
  • Creates a smooth bivariate distribution model constrained to marginal distributions, correlation coefficient, bivariate quantiles, and smoothmess
o Parameters:
  • datafl: the data file with the raw (perhaps declustered) paired observations.
  • icolx, icoly and icolwt: the column location for the z_1 variable, the z_2 variable and the declustering weight (0 if none available).
  • smoothx: the data file with the smoothed z_1 (X) distribution.
  • icolvr and icolwt: the column location for the variable and the weight (probability).
  • smoothy: the data file with the smoothed z_2 (Y) distribution.
  • icolvr and icolwt: the column location for the variable and the weight (probability).
  • dbgfl: name for the output file for debugging information.
  • finalxfl: name for the output file of the final X distribution - to check reproduction of the marginal distribution
  • finalyfl: name for the output file of the final Y distribution - to check reproduction of the marginal distribution
  • outfl: the output file. This file will contain the N_1 (nx) by N_2 (ny) X Y and probability values.
  • maxpert, report, omin and seed: after maxpert x nz perturbations the program is stopped. After report x nz perturbations the program reports on the current objective function(s). When the normalized objective function reaches omin the program is stopped. The random number seed seed should be a large odd integer.
  • imarg, icorr, ismth and iquan: flags for whether closeness to the marginal histograms, closeness to a target correlation coefficient, smoothness, and closeness to specified quantiles are considered (1 = yes, 0 = no).
  • sclmarg, sclcorr, sclsmth and sclquan: user imposed weights which scale the weights that the program automatically calculates (default is 1.0 for all weights).
  • nsmooth: size of the smoothing window.
  • correlation: target correlation coefficient.
  • ndqx and ndqy: number of quantiles defined from the data (evenly spaced cumulative probability values in x and y).
  • nenvelope: number of points defining the envelope containing the bivariate distribution (may be set to zero so that all points in the bivariate distribution are allowable)
  • x(),y(): points defining the allowable bivariate envelope. This ``envelope'' is a practical feature that restricts the non-zero bivariate probability values to fall within some user-specified region.


Postscript Programs

 ---

WinGslib Help Page: Postscript Programs

These programs create the most commonly needed geostatistical graphics in PostScript format. They are used for data analysis prior to any modeling and to evaluate the results of modeling.

Histograms (histplt) to view a histogram and summary statistics of data with or without weights to account for declustering of volumetric support. A reference value and box plot may displayed in place of the variable name on the horizontal axis.

Probability Paper (probplt) the traditional probability paper plots are useful to display the data free of the arbitrary classes used in histograms. The plot is a cross plot of the cumulative probability of each data plotted against the data value. The probability axis is such that the points will fall on a straight line if the data follow a normal distribution. A lognormal distribution is revealed by a straight line when a logarithmic scale is used for the variable axis.

Scattergram (scatplt) the scattergram or scatterplot displays paired samples on arithmetic, semilog, or logarithmic scales. A third variable may be used to gray-scale code the samples (for rock types or another continuous third variable). The declustering weights are used for calculating the statistics and correlation coefficients.

Q-Q Plots (qpplt) this program will generate a Q-Q or P-P plot. The Q-Q plot is used extensively whereas the P-P plot is rarely used. A Q-Q plot is a useful tool to compare two different data distributions. It is not really intended for paired samples, rather the idea is to compare two different data distributions (two different measurement techniques, original data distribution and simulated values, and so on).

Location Map (locmap) an X/Y (or any two variables) plot for scattered sample values indicated by gray- or color- scale coded circles. The data values may also be labeled. The axis have the same PostScript distance units as the 2-D map (pixelplt) so the experienced PostScript user can directly edit the points into the pixelplt for data checking.

2-D Map (pixelplt) an orthogonal slice through a regular gridded data set. The values are gray- or color-scale coded. Most common application is to display a kriged or simulated model on a series of slices. Although 3-D visualization is needed for more complete validation, these 2-D views are useful.

Bivariate Probability Density Map (bivplt) A very particular program to plot the combined results of the histsmth and scatsmth programs. Note that this program is not commonly used in practice.

Variogram Plot (vargplt) plots experimentally calculated variogram points (result of gam or gamv) and/or variogram model (result of vmodel). Any number of variograms can be plotted as a series of points and/or lines.

The PostScript graphics may be printed directly to a PostScript printer or loaded in the gsview/ghostscript program (see links for where to download free of charge). The PostScript output must be converted to an EPS file prior to loading into the Microsoft Office programs or similar software. Some graphics programs like Corel Draw or Adobe Illustrator can be used, but a two-step procedure in gsview works well:

  • Convert the postscript to EPS using the option under the file menu of gsview
  • Load the EPS result of the first conversion and add a preview header (under the edit menu of gsview). The windows metafile or TIFF preview work well.
The result can be loaded into Office, but you will not see the high resolution image until you print to a PostScript printer. ---


GSLIB Help: HISTPLT

GSLIB Help Page: HISTPLT

o Description:
  • histplt has been custom written to generate some univariate statistical summaries and a visual output that is compatible with a PostScript display device. The input data is a variable from a simplified Geo-EAS input file where the variable in another column can act as a weight (declustering weight, specific gravity, thickness for 2-D data,...). These weights do not need to add up to one. Minimum and maximum trimming limits can be set to remove missing values and outliers. The program will automatically scale the histogram. The user can choose to set the minimum and maximum histogram limits, number of classes, and whether or not to use a logarithmic scale.
o Parameters:
  • datafl: the data file in a simplified Geo-EAS format.
  • ivr and iwt: column number for the variable and the weight. If iwt less than or equal to 0, equal weighting is considered.
  • tmin and tmax: all values strictly less than tmin and strictly greater than tmax are ignored.
  • outfl: file for PostScript output.
  • hmin and hmax: minimum and maximum plotting limits for the variable axis (abscissa). These do not have to be compatible with tmin and tmax Values that are less than hmin or greater than hmax will appear just beyond either end of the histogram plot. They contribute to the statistics calculated. Setting hmin greater than hmax will cause the program to set the limits to the minimum and maximum data values encountered.
  • fmax: maximum frequency value for plotting vertical axis. The maximum will be determined automatically if fmax is set less than 0.0. This option is used to force the same histogram axis for different sets of data.
  • ncl: the number of classes.
  • ilog: =0 then an arithmetic scaling of the variable scale is used, =1 then a logarithmic scaling (base 10) is used.
  • icum: =0 then a frequency histogram will be constructed, =1 then a cumulative histogram will be constructed.
  • ncum: the number of quantiles to plot when constructing a cumulative histogram
  • ndec: the number of decimal places to use for the statistics annotated on the histogram plot (if set to 0, then the number will be automatically determined).
  • title: a 40-character title for the top of the plot.
  • pos: positioning of statistics. At times it is desirable to move the statistics from right to left to avoid overwriting the histogram bars (pos=1 is the left and pos=1 is the right).
  • refval: reference value for a box plot under the histogram. If this value is within the allowable range specified by tmin and tmax then a label on the horizontal X axis will not be plotted and, instead, a box plot will be shown (outside whiskers at the 95% probability interval, inside box at the 50% probability interval, vertical solid line at the median, and black dot at the reference value specified by refval)
---


GSLIB Help: PROBPLT

GSLIB Help Page: PROBPLT

o Description:
  • probplt generates either a normal or a lognormal probability plot. This plot displays all the data values on a chart that illustrates the general distribution shape and the behavior of the extreme values. Checking for normality or lognormality is a secondary issue.
o Parameters:
  • datafl: the data file in a simplified Geo-EAS format.
  • icolvr and icolwt: column number for the variable and the weight. If icolwt less than or equal to 0, equal weighting is considered.
  • tmin and tmax: all values strictly less than tmin and strictly greater than tmax are ignored.
  • outfl: file for PostScript output.
  • ilog: =0 then an arithmetic scaling of the variable scale is used, =1 then a logarithmic scaling (base 10) is used.
  • pmin, pmax and pinc: minimum, maximum plotting limits, and increment for the variable axis.
  • title: a 40-character title for the top of the plot. A short description of the program


GSLIB Help: SCATPLT

GSLIB Help Page: SCATPLT

o Description:
  • scatplt displays bivariate scatterplots and some statistical summaries for PostScript display. The summary statistics are weighted, except for the rank order (Spearman) correlation coefficient.
o Parameters:
  • datafl: The data file in a simplified Geo-EAS format.
  • icolx, icoly, icolwt and icol3vr: The columns for the x variable (horizontal axis), y variable (vertical axis), weight (if less than or equal to zero then equal weighting is used; otherwise, the weight is used to calculate the summary statistics), and third variable (if less than or equal to zero then no third variable is considered; otherwise, each bullet is gray scale coded according to this third variable)
  • tmin and tmax: all values strictly less than tmin and strictly greater than tmax are ignored.
  • outfl: file for PostScript output.
  • xmin, xmax and xlog: minimum and maximum plotting limits for the x axis. These do not have to be compatible with the trimming limits. Pairs within the trimming limits, but outside the plotting limits, are still used for computing the correlation coefficient. Setting xmin greater than or equal to xmax will cause the program to use the minimum and maximum data values encountered. If xlog=0 then an arithmetic scaling of the x axis is used, xlog=1 then a logarithmic scaling is used.
  • ymin, ymax and ylog: minimum and maximum plotting limits for the y axis. Setting ymin greater than or equal to ymax will cause the program to use the minimum and maximum data values encountered. If ylog=0 then an arithmetic scaling of the y axis will be used, ylog=1 then a logarithmic scaling will be used.
  • nthpoint: plot every nthpoint'th data point. This should normally be set to 1, however, it may be used to subset large data sets.
  • dotsiz: size of the black dot marking each data (0.1 is small, 1.0 is the default, and 10 is big)
  • gmin and gmax: minimum and maximum gray scale limits: used if a third variable is considered to shade each data point
  • title: a 40-character title for the top of the plot. A short description of the program
o Application notes:
  • If the scatterplot appears too erratic because of too few data, one may consider smoothing.
  • The plot may become quite crowded if there are too many data pairs.


GSLIB Help: QPPLT

GSLIB Help Page: QPPLT

o Description:
  • qpplt takes univariate data from two data files and generates either a Q-Q or a P-P plot. Q-Q plots compare the quantiles of two data distributions, and P-P plots compare the cumulative probabilities of two data distributions. These graphical displays are used to compare two different data distributions, e.g., compare an original data distribution to a distribution of simulated points.
o Parameters:
  • datafl1: The data file for the first variable (x axis) in a simplified Geo-EAS format.
  • ivr1 and iwt1: column number for the variable and the weight. If iwt1 less than or equal to 0, equal weighting is considered.
  • datafl2: The data file for the second variable (y axis) in a simplified Geo-EAS format. Note: It is possible that datafl2 is the same as datafl1
  • ivr2 and iwt2: column number for the variable and the weight. If iwt2 less than or equal to 0, equal weighting is considered.
  • tmin and tmax: all values strictly less than tmin and strictly greater than tmax are ignored.
  • outfl: file for PostScript output.
  • qqorpp: The flag to tell the program whether to construct a Q-Q plot (qqorpp=0) or a P-P plot (qqorpp=1).
  • npoints: number of points to use on the Q-Q or P-P plot (should not exceed the smallest number of data in datafl1 / datafl2
  • xmin and xmax: minimum and maximum limits for x axis.
  • ymin and ymax: minimum and maximum limits for y axis.
  • ilog: =0 then an arithmetic scaling of the axes is used, =1 then a logarithmic scaling (base 10) is used. Note that the log scaling only applies to the Q-Q plot; the axis for the P-P plot are between 0 and 1
  • title: a 40-character title for the top of the plot. A short description of the program


GSLIB Help: LOCMAP

GSLIB Help Page: LOCMAP

o Description:
  • For reporting small 2-D data sets it is often convenient to plot a location map where the magnitude of the data values are expressed with a gray or color scale.
o Parameters:
  • datafl: the data file in a simplified Geo-EAS format.
  • icolx, icoly, and icolvr: The columns for the x variable (horizontal axis), y variable (vertical axis), and the variable (for coding the color / gray scale of the symbol).
  • tmin and tmax: all values strictly less than tmin and strictly greater than tmax are ignored.
  • outfl: file for PostScript output.
  • xmn and xmx: the limits in the x direction,
  • ymn and ymx: the limits in the y direction,
  • idata: when data values are being posted (idata=0) then a circular symbol is used; when the results of cross validation are being posted (idata=1) then plus or minus signs are posted and filled in by the absolute magnitude of the error value.
  • ilog: =0 then an arithmetic scaling of the gray/color scale is used, =1 then a logarithmic scaling (base 10) is used.
  • igray: =0 then a gray scale is used, =1 then a color scale is used.
  • ilabel: =0 then no labels will be displayed, =1 then each location will be annotated with the attribute value
  • gmin, gmax and ginc: minimum and maximum limits for the variable axis (gray or color scale plotting) and increment for labeling a legend bar. These do not have to be compatible with tmin and tmax Values that are less than gmin or greater than gmax will appear just beyond either end of the gray/color spectrum.
  • labsiz: size of the labels (0.1 is for small labels, 1 is the default size, and 10 is for large labels)
  • title: a 40-character title for the top of the plot. A short description of the program


GSLIB Help: PIXELPLT

GSLIB Help Page: PIXELPLT

o Description:
  • For plotting 2-D slices through gridded 3-D data sets, e.g., as generated by kriging or simulation algorithms, one can use gray or color scale maps.
o Parameters:
  • datafl: The data file containing the 2-D/3-D grids with x cycling fastest, then y then z then per simulation.
  • icol: column number in the input file to consider. This is typically one (1).
  • tmin and tmax: all values strictly less than tmin and strictly greater than tmax are ignored.
  • outfl: file for PostScript output.
  • ireal: the grid or realization number to consider.
  • nx, xmn, and xsiz: the number of nodes in the x direction, the origin, and the grid node separation.
  • ny, ymn, and ysiz: the number of nodes in the y direction, the origin, and the grid node separation.
  • nz, zmn, and zsiz: the number of nodes in the z direction, the origin, and the grid node separation.
  • slice: the type of slice through the 3-D grid to consider (1=horizontal XY slice, 2=vertical XZ slice, 3=vertical YZ slice). The axes increase to the right and to the top.
  • sliceno: the slice number to consider (if slice=1 then sliceno must be between 1 to nz, if slice=2 then sliceno must be between 1 to ny, if slice=3 then sliceno must be between 1 to nx.
  • title: a 40-character title for the top of the plot.
  • xlab: a 40-character label that will appear centered below the plot.
  • ylab: a 40-character label that will appear vertically centered to the left of the plot.
  • ilog: =0 then an arithmetic scaling of the gray/color scale is used, =1 then a logarithmic scaling (base 10) is used.
  • igray: =0 then a gray scale is used, =1 then a color scale is used.
  • icont: =0 for a continuous variable, =1 for a categorical variable.
  • gmin, gmax, and ginc: minimum, maximum, and labeling increment for a continuous variable. These do not have to be compatible with tmin and tmax Values that are less than gmin or greater than gmax will appear just beyond either end of the gray/color spectrum.
  • ncat: number of categories for each category:
  • code, colorcode, and name: the integer code of the category, the color code to plot the category, and a name to put beside the color on the legend. The color codes have been chosen arbitrarily as follows: 1=red, 2=orange, 3=yellow, 4=light green, 5=green, 6=light blue, 7=dark blue, 8=violet, 9=white, 10=black, 11=purple, 12=brown, 13=pink, 14=intermediate green, and 15=gray.


GSLIB Help: BIVPLT

GSLIB Help Page: BIVPLT

o Description:
  • The histsmth and scatsmth programs smooth univariate and bivariate distributions. The bivplt program documented here displays the results. The plot also shows the original data pairs and the original unsmoothed data histogram.
o Parameters:
  • datafl: The data file with the paired data in a simplified Geo-EAS format.
  • icolx, icoly, and icolwt: The columns for the x variable (horizontal axis), y variable (vertical axis), and weight (if less than or equal to zero then equal weighting is used; otherwise, the weight is used to calculate the summary statistics).
  • ilogx and ilogy: set to 1 if log scaling has been used for the x or y axis respectively.
  • tmin and tmax: all values strictly less than tmin and strictly greater than tmax are ignored.
  • smoothx: the data file with the smoothed x distribution.
  • icolvr and icolwt: the column location for the variable and the weight (probability).
  • smoothy: the data file with the smoothed y distribution.
  • icolvr and icolwt: the column location for the variable and the weight (probability).
  • smoothxy: the data file with the smoothed bivariate distribution.
  • icolx, icoly and icolwt: the column locations for the x and y variables and the weight (probability).
  • outfl: file for PostScript output.
  • imap and icolor: specify whether a pixel map of the bivariate probabilities will be created (imap1 will create one) and whether it will be color (icolor1) or gray scale ( icolor=0).
  • pmin, pmax and pinc: minimum and maximum plotting limits for the pixel map.
  • title: a 40-character title for the top of the plot.


GSLIB Help: VARGPLT

GSLIB Help Page: VARGPLT

o Description:
  • The program vargplt takes the special output format used by the variogram programs and creates graphical displays for PostScript display devices. This program is a straightforward display program and does not provide any facility for variogram calculation or model fitting. Good interactive variogram fitting programs are available in the public domain


Variogram Programs

 ---

WinGslib Help Page: Variogram Programs

An essential step in virtually all geostatistical studies is the calculation and modeling of a variogram. The variogram specifies the spatial continuity associated to the variable being studied. Uncertainty and heterogeneity are directly linked to this model of spatial variability.

The program for Regularly Spaced Data (gam) is for gridded secondary data (from seismic or remote sensing) or to check the result of simulation. The directions are specified by unit increments in the grid directions. The output from this program is not in GSLIB data format; it is in a format ready for the variogram plotting program.

In general, the primary variable of interest will not fall on a regular grid. The program for Irregularly Spaced Data (gamv) is commonly used for such data. The program will simultaneously calculate an arbitrary number of variograms in an arbitrary number of directions. The lag distance specification, however, is the same for all directions; therefore, multiple executions of the program are necessary in practice. The output from this program is not in GSLIB data format; it is in a format ready for the variogram plotting program.

A Variogram Map (varmap) is useful for determining directions of continuity. After computing and displaying a variogram map it is common to go back and use the gam or gamv program to calculate the variogram in the directions of greatest and least continuity. The output from this program is in GSLIB data format and is intended to be used in pixelplt.

Most geostatistical simulation is based on the Gaussian model. At times this may be inappropriate and one could check the theoretical indicator variograms (that correspond to the Gaussian model) to the actual indicator variograms. The Indicator Variogram Computation (bigaus) calculates the theoretical indicator variograms, which can be plotted with the variogram plotting program.

The variogram file from model (vmodel) program calculates the variogram values for specific distances and directions to be plotted with experimental values for fitting and checking a variogram model. The user must specify the variogram model - this program just calculates the values for plotting. It is common to set up this program and the vargplt program in a batch file so that the plot can be displayed right away after changing a variogram model parameter.


GSLIB Help: GAM

GSLIB Help Page: GAM

o Description:
  • Variogram calculation of gridded data
o Parameters:
  • datafl: the input data in a simplified Geo-EAS formatted file. The data are ordered rowwise (x cycles fastest, then y, then z).
  • nvar and ivar(1) ... ivar(nvar): the number of variables and their columns in the data file.
  • tmin and tmax: all values, regardless of which variable, strictly less than tmin and greater than or equal to tmax are ignored.
  • outfl: the output variograms are written to a single output file named outfl The output file contains the variograms ordered by direction and then variogram type specified in the parameter file (the directions cycle fastest then the variogram number). For each variogram there is a one-line description and then nlag lines each with the following:
    • lag number (increasing from 1 to nlag
    • average separation distance for the lag.
    • the {\em semivariogram value (whatever type was specified).
    • number of pairs for the lag.
    • mean of the data contributing to the tail.
    • mean of the data contributing to the head.
    • the tail and head variances (for the correlogram).
    The {\tt vargplt program documented in section VI.1.8 may be used to create PostScript displays of multiple variograms.
  • igrid: the grid or realization number. Recall that realizations or grids are written one after another; therefore, if igrid=2 the input file must contain at least 2 x nx x ny x nz values and the second set of nx x ny x nz values will be taken as the second grid.
  • nx, xmn, xsiz: definition of the grid system (x axis).
  • ny, ymn, ysiz: definition of the grid system (y axis).
  • nz, zmn, zsiz: definition of the grid system (z axis). One or two dimensional data may be considered by setting the number of nodes in some directions to 1. Often, gam is used to check the variogram reproduction of realizations from a simulation program.
  • ndir and nlag: the number of directions and lags to consider. The same number of lags are considered for all directions and all directions are considered for all of the nvarg variograms specified below.
  • ixd, iyd and izd: these three arrays specify the unit offsets that define each of the ndir directions (see section III.2).
  • standardize: if set to 1, the semivariogram values will be divided by the variance
  • nvarg: the number of variograms to compute.
  • The "variogram type" is specified by an integer code
  • ivtail, ivhead and ivtype: for each of the nvarg variograms one must specify which variables should be used for the tail and head and which type of variogram is to be computed. For direct variograms the ivtail array is identical to the ivhead array. Cross variograms are computed by having the tail variable different from the head variable, e.g., if ivtail(i) is set to 1, ivhead(i) is set to 2, and ivtype(i) is set to 2, then distance measure i will be a cross semivariogram between variable 1 and variable 2. Note that ivtype(i) should be set to something that makes sense (e.g., types 1,2, or 3); a cross relative variogram would be difficult to interpret. Further, note that for the cross semivariogram (ivtype=2) the two variables ivtail and ivhead are used at both the tail and head locations. The ivtype variable corresponds to the integer code in the list given in section III.1.
  • cut: whenever the ivtype is set to 9 or 10, i.e., asking for an indicator variogram, then a cutoff must be specified immediately after the ivtype parameter on the same line in the input file. Note that if an indicator variogram is being computed then the cutoff/category applies to variable ivtail(i) in the input file (although the ivhead(i) variable is not used it must be present in the file to maintain consistency with the other variogram types).
o Application notes:
  • Regularly spaced data in 1-D can be handled by setting ny, nz to one and iyd, izd to zero.


GSLIB Help: GAMV

GSLIB Help Page: GAMV

o Description:
  • Variogram calculation with scattered data
o Parameters:
  • datafl: the input data in a simplified Geo-EAS formatted file.
  • icolx, icoly and icolz: the columns for the x, y, and z coordinates (any of the column numbers may be set to zero if that coordinate is not present in the data, e.g., 2-D data may be handled by setting icolz to 0)
  • nvar and ivar(1) \ldots ivar(nvar): the number of variables and their column order in the data file.
  • tmin and tmax: all values, regardless of which variable, strictly less than tmin and greater than or equal to tmax are ignored.
  • outfl: the output variograms are written to a single output file named outfl The output file contains the variograms ordered by direction and then variogram type specified in the parameter file (the directions cycle fastest then the variogram number). For each variogram there is a one-line description and then nlag lines each with the following:
    • lag number (increasing from 1 to nlag
    • average separation distance for the lag.
    • the semivariogram value (whatever type was specified).
    • number of pairs for the lag.
    • mean of the data contributing to the tail.
    • mean of the data contributing to the head.
    • the tail and head variances (for the correlogram).
  • nlag: the number of lags to compute (same for all directions).
  • xlag: the unit lag separation distance.
  • xltol: the lag tolerance. This could be one-half of xlag or smaller to allow for data on a pseudo-regular grid. If xltol is entered as negative or zero it will be reset to xlag/2. A pair will report to multiple lags if xltol is greater than one-half of xlag
  • ndir: the number of directions to consider. All these directions are considered for all of the nvarg variograms specified below.
  • azm, atol, bandwh, dip, dtol, and bandwd: the azimuth angle, the half window azimuth tolerance, the azimuth bandwidth, the dip angle, the half window dip tolerance, and the dip bandwidth. The azimuth is measured in degrees clockwise from north, e.g., azm=0 is north, azm=90 is east, and azm=135 is south-east. The dip angle is measured in negative degrees down from horizontal i.e., dip=0 is horizontal, dip=-90 is vertical downward, and dip=-45 is dipping down at 45 degrees. bandwh is the horizontal ``bandwidth'' or maximum acceptable horizontal deviation from the direction vector. bandwd is the vertical ``bandwidth'' or maximum acceptable deviation perpendicular to the dip direction in the vertical plane.
  • standardize: if set to 1, the semivariogram values will be divided by the variance
  • nvarg: the number of variograms to compute.
  • The "variogram type" is specified by an integer code
  • ivtail, ivhead and ivtype: for each of the nvarg variograms one must specify which variables should be used for the tail and head and which type of variogram is to be computed. For direct variograms the ivtail array is identical to the ivhead array. Cross variograms are computed by having the tail variable different from the head variable.
  • cut: whenever the ivtype is set to 9 or 10, i.e., asking for an indicator variogram, then a cutoff must be specified immediately after the ivtype parameter on the same line in the input file. Note that if an indicator variogram is being computed then the cutoff/category applies to variable ivtail(i) in the input file (although the ivhead(i) variable is not used it must be present in the file to maintain consistency with the other variogram types).


GSLIB Help: VARMAP

GSLIB Help Page: VARMAP

o Description:
  • Variograms are traditionally presented as 1-D curves as a function of the distance h along a particular direction. It is often useful to have a global view of the variogram values in all directions. The variogram map is a 2-D plot of the sample semivariogram for all experimentally available separation vectors
o Parameters:
  • datafl: the input data in a simplified Geo-EAS formatted file.
  • nvar and ivar(1) \ldots ivar(nvar): the number of variables and their column order in the data file.
  • tmin and tmax: all values, regardless of which variable, strictly less than tmin and greater than or equal to tmax are ignored.
  • igrid: set to 1 if the data are on a regular grid and set to 0 if the data are irregularly spaced.
  • nx, ny and nz: the number of nodes in the x, y, and z coordinate directions (used if igrid is set to 1). Any of the numbers may be set to one if that coordinate is not present in the data, e.g., 2-D data may be handled by setting nz to 1.
  • xsiz, ysiz and zsiz: the separation distance between the nodes in the x, y, and z coordinate directions (used if igrid is set to 1).
  • icolx, icoly and icolz: the columns for the x, y, and z coordinates (used if igrid is set to 0). Any of the column numbers may be set to zero if that coordinate is not present in the data, e.g., 2-D data may be handled by setting icolz to 0.
  • outfl: the output file for the variogram maps/volumes are written to a single output file named outfl This file contains each variogram map/volume written sequentially as a grid with the x direction cycling fastest, then y, then z.
  • nxlag, nylag and nzlag: the number of lags to compute in the X, Y and Z directions
  • dxlag, dylag and dzlag: the lag tolerances or ``cell sizes'' in the X, Y and Z directions
  • minpairs: the minimum number of pairs needed to define a variogram value (set to missing if fewer than minpairs is found).
  • standardize: if set to 1, the semivariogram values will be divided by the variance
  • nvarg: the number of variograms to compute.
  • The "variogram type" is specified by an integer code
  • ivtail, ivhead and ivtype: for each of the nvarg variograms one must specify which variables should be used for the tail and head and which type of variogram is to be computed. For direct variograms the ivtail array is identical to the ivhead array. Cross variograms are computed by having the tail variable different from the head variable.
  • cut: whenever the ivtype is set to 9 or 10, i.e., asking for an indicator variogram, then a cutoff must be specified immediately after the ivtype parameter on the same line in the input file. Note that if an indicator variogram is being computed then the cutoff/category applies to variable ivtail(i) in the input file (although the ivhead(i) variable is not used it must be present in the file to maintain consistency with the other variogram types).
o Application notes:
  • Directions of anisotropy are usually evident from a variogram map. Visualization of a variogram volume is best done using a graphical routine that allows continuous sectioning of the volume along any of


GSLIB Help: BIGAUS

GSLIB Help Page: BIGAUS

o Description:
  • This program allows checking for bivariate normality; a model of the normal scores variogram is input to bigaus The corresponding indicator semivariograms for specified cutoffs, lags, and directions are output from the program. The idea is to see how far the experimental indicator variograms deviate from those implied by the bivariate Gaussian distribution. A numerical integration algorithm is used to compute the Gaussian model-derived indicator variograms.
o Parameters:
  • outfl: the output file for the theoretical Gaussian indicator semivariograms. The format is the same as that created by the gam program; therefore, the program vargplt could be used to plot these indicator variograms.
  • ncut: the number of thresholds.
  • zc(ncut): ncut threshold values are required. These thresholds are expressed in units of cumulative probability, e.g., the lower quartile is 0.25, the median is 0.50. Note that the results are symmetric: the variogram for the 5th percentile (0.05) is the same as the 95th percentile (0.95).
  • ndir and nlag: the number of directions and the number of lags to be considered.
  • azm, dip and lag: for each of the ndir directions a direction must be specified by azm and dip and a unit lag offset must be specified (lag
  • nst and c0: the number of structures and the nugget effect.
  • For each of the nst nested structures one must define it the type of structure; cc the c parameter; ang1,ang2,ang3 the angles defining the geometric anisotropy; aa_hmax, the maximum horizontal range; aa_hmin, the minimum horizontal range; and aa_vert, the vertical range.


GSLIB Help: VMODEL

GSLIB Help Page: VMODEL

o Description:
  • This program will take the semivariogram model and write out a file with the same format as the gam program so that it can be plotted with vargplt The primary uses of vmodel are to overlay a model on experimental points and also to provide a utility to check the definition of the semivariogram model.
o Parameters:
  • outfl: the output file that will contain the semivariogram values.
  • ndir and nlag: the number of directions and the number of lags to be considered.
  • azm, dip and lag: for each of the ndir directions a direction must be specified by azm and dip and a unit lag offset must be specified (lag).
  • nst and c0: the number of structures and the nugget effect.
  • For each of the nst nested structures one must define it, the type of structure; cc, the c parameter; ang1,ang2,ang3, the angles defining the geometric anisotropy; aa_hmax, the maximum horizontal range; aa_hmin, the minimum horizontal range; and aa_vert, the vertical range.


Kriging Programs

 ---

WinGslib Help Page: Kriging Programs

Although kriging is rarely used directly for map making it is at the heart of virtually all geostatistical algorithms in use today. The four kriging programs in GSLIB are flexible enough for most kriging applications.

The 2D Kriging (kb2d) program is a small program designed for people learning about kriging and needing a simple program to see how it works. kb2d does 2-D point or block kriging with simple or ordinary kriging. This program is not designed for practical kriging applications; the next program should be used.

The 3-D Kriging Program (kt3d) is a general purpose kriging program for different types of kriging. The program will perform kriging on a grid, cross validation, and jackknife. This program could be tweaked to perform virtually any type of kriging (of course, there is the cokriging and indicator kriging program).

A 3-D Cokriging Program (cokb3d) is available in GSLIB to illustrate the potential of cokriging and provide a simple implementation for cokriging one variable using one or more secondary covariates.

The Indicator Kriging Program (ik3d) provides for indicator kriging with hard and soft indicator data. The use of soft indicator data requires some attention. In all rigor, a form of cokriging should be used for soft indicator data. The output of this program can be post-processed by postik or the probabilities can be mapped directly.


GSLIB Help: KB2D

GSLIB Help Page: KB2D

o Description:
  • This is a straightforward 2-D simple and ordinary kriging subroutine that can be used as is or as a basis for custom kriging programs.
o Parameters:
  • datafl: the input data in a simplified Geo-EAS formatted file.
  • icolx, icoly, and icolvr: the columns for the x and y coordinates, and the variable to be kriged.
  • tmin and tmax: all values strictly less than tmin and greater than or equal to tmax are ignored.
  • idbg: an integer debugging level between 0 and 3. The higher the debugging level the more output. Normally level 0 or 1 should be chosen. If there are suspected problems, or if you would like to see the actual kriging matrices, level 2 or 3 can be chosen. It is advisable to restrict the actual number of points being estimated when the debugging level is high (the debugging file can become extremely large).
  • dbgfl: the debugging output is written to this file.
  • outfl: the output grid is written to this file. The output file will contain both the kriging estimate and the kriging variance for all points/blocks. The output grid cycles fastest on x and then y
  • nx, xmn, xsiz: definition of the grid system (x axis).
  • ny, ymn, ysiz: definition of the grid system (y axis).
  • nxdis and nydis: the number of discretization points for a block. If both nxdis and nydis are set to 1 then point kriging is performed.
  • ndmin and ndmax: the minimum and maximum number of data points to use for kriging a block.
  • radius: the maximum isotropic search radius.
  • isk and skmean: if isk0 then simple kriging will be performed with a mean of skmean
  • nst and c0: the number of variogram structures and the isotropic nugget constant. The nugget constant does not count as a structure.
  • For each of the nst nested structures one must define it, the type of structure; cc, the c parameter; ang1, the azimuth of the maximum range; aa_hmax, the maximum range; and aa_hmin, the minimum range. A detailed description of these parameters is given in section II.3.


GSLIB Help: KT3D

GSLIB Help Page: KT3D

o Description:
  • The program kt3d provides a fairly advanced 3-D kriging program for points or blocks by simple kriging (SK), ordinary kriging (OK), or kriging with a polynomial trend model (KT) with up to nine monomial terms. The program works in 2-D and is faster than kb2d if there are many data. One of the features that makes this program fairly fast is the super block search.
o Parameters:
  • datafl: the input data in a simplified Geo-EAS formatted file.
  • icolx, icoly, icolz, icolvr and icolsec: the columns for the x, y, and z coordinates, the variable to be estimated, and the external drift variable (or non-stationary mean).
  • tmin and tmax: all values strictly less than tmin and greater than or equal to tmax are ignored.
  • option: set to 0 for kriging a grid of points or blocks, to 1 for cross validation with the data in datafl and to 2 for jackknifing with data in following file.
  • jackfl: file with locations to perform estimation (jackknife option).
  • icolx, icoly, icolz, icolvr and icolsec: the columns for the x, y, and z coordinates, the variable, and the secondary variable in jackfl
  • idbg: an integer debugging level between 0 and 3. The higher the debugging level the more output. The normal levels are 0 and 1 which summarize the results. Levels 2 and 3 provide all the kriging matrices and data used for the estimation of every point/block. It is recommended that a high debugging level not be used with a large grid.
  • dbgfl: the debugging output is written to this file.
  • outfl: the output grid is written to this file. The output contains the estimate and the kriging variance for every point/block on the grid, cycling fastest on x then y and finally z Unestimated points are flagged with a large negative number (-999.). The parameter UNEST, in the source code, can be changed if a different number is preferred.
  • nx, xmn, xsiz: definition of the grid system (x axis).
  • ny, ymn, ysiz: definition of the grid system (y axis).
  • nz, zmn, zsiz: definition of the grid system (z axis).
  • nxdis, nydis and nzdis: the number of discretization points for a block. If nxdis, nydis and nzdis are all set to 1 then point kriging is performed.
  • ndmin and ndmax: the minimum and maximum number of data points to use for kriging a block.
  • noct: the maximum number to retain from an octant (an octant search is not used if noct=0
  • radius_hmax radius_hmin and radius_vert the search radii in the maximum horizontal direction, minimum horizontal direction, and vertical direction (see angles below).
  • sang1, sang2 and sang3: the angle parameters that describe the orientation of the search ellipsoid. See the discussion on anisotropy specification associated with Figure II.4.
  • ikrige and skmean: if ikrige is set to 0 then stationary simple kriging with (skmean) will be performed, if ikrige is set to 1 then ordinary kriging will be performed, if ikrige is set to 2 then non-stationary simple kriging with means taken from secfile will be performed, and if ikrige is set to 3 then kriging with an external drift will be performed. Note that power law variogram models (it=4) are not allowed with simple kriging.
  • idrif(i),i=1...9: indicators for those drift terms to be included in the trend model. idrif(i) is set to 1 if the drift term number i should be included, and is set to zero if not. The nine drift terms correspond to the following:
    • i = 1 linear drift in x
    • i = 2 linear drift in y
    • i = 3 linear drift in z
    • i = 4 quadratic drift in x
    • i = 5 quadratic drift in y
    • i = 6 quadratic drift in z
    • i = 7 cross quadratic drift in xy
    • i = 8 cross quadratic drift in xz
    • i = 9 cross quadratic drift in yz
  • itrend: indicator of whether to estimate the trend (itrend =1) or the variable (itrend =0). The trend may be kriged with ordinary kriging (all idrif(i) values set to 0) or with any combination of trend kriging (some idrif(i) terms set to 1).
  • secfl: a file for the gridded external drift variable. The external drift variable is needed at all grid locations to be estimated. The origin of the grid network, the number of nodes, and the spacing of the grid nodes should be exactly the same as the grid being kriged in kt3d This variable is used only if ikrige=2 or 3.
  • iseccol: the column number in secfl for the gridded secondary variable. This variable is used if ikrige=2 or 3.
  • nst and c0: the number of variogram structures and the nugget constant. The nugget constant does not count as a structure.
  • For each of the nst nested structures one must define it, the type of structure; cc, the c parameter; ang1,ang2,ang3, the angles defining the geometric anisotropy; aa_hmax, the maximum horizontal range; aa_hmin, the minimum horizontal range; and aa_vert, the vertical range.
o Application notes:
  • The program is set up so that a novice programmer can make changes to the form of the polynomial drift. The external drift concept has been incorporated, adding an additional unbiasedness constraint to the ordinary kriging system. When using an external drift, it is necessary to know the value of the drift variable at all data locations and all the locations that will be estimated (i.e., all grid nodes).
  • The program also allows simple kriging with non-stationary means read from an input file. The non-stationary means must be known at all data locations and all locations to be estimated.


GSLIB Help: COKB3D

GSLIB Help Page: COKB3D

o Description:
  • A cokriging program for a points or blocks on a regular grid.
o Parameters:
  • datafl: the input data in a simplified Geo-EAS formatted file.
  • nvar: the number of variables (primary plus all secondary). For example, nvar=2 if there is only one secondary variable.
  • icolx, icoly, icolz and icolvr(): the columns for the x, y and z coordinates, the primary variable to be kriged, and all secondary variables.
  • tmin and tmax: all values (for all variables) strictly less than tmin and greater than or equal to tmax are ignored.
  • coloc: set to 1 if performing co-located cokriging with a gridded secondary variable, otherwise set to 0.
  • secfl: if co-located cokriging, the file with the gridded secondary variable.
  • icolsec: if co-located cokriging, the column number for the secondary variable in secfl
  • idbg: an integer debugging level between 0 and 3. The higher the debugging level the more output. Normally level 0 or 1 should be chosen.
  • dbgfl: the debugging output is written to this file.
  • outfl: the output grid is written to this file. The output file will contain both the kriging estimate and the kriging variance for all points/blocks. The output grid cycles fastest on x then y then z
  • nx, xmn, xsiz: definition of the grid system (x axis).
  • ny, ymn, ysiz: definition of the grid system (y axis).
  • nz, zmn, zsiz: definition of the grid system (z axis).
  • nxdis, nydis and nzdis: the number of discretization points for a block. If nxdis, nydis and nzdis are set to 1 then point cokriging is performed.
  • ndmin, ndmaxp and ndmaxs: the minimum and maximum number of primary data, and the maximum number of secondary data (regardless of which secondary variable) to use for kriging a block.
  • search radii for primary data
  • search radii for secondary data (same for all types)
  • the angles defining the common orientation of the search ellipsoids for primary and secondary data
  • ktype: the kriging type must be specified: 0 = simple cokriging, 1 = standardized ordinary cokriging with re-centered variables and a single unbiasedness constraint; 2 = traditional ordinary cokriging.
  • mean(): the mean of the primary and all secondary variables are required input if either simple cokriging or standardized ordinary cokriging are used. The program calculates the data residuals from these means.
The direct and cross variograms may be specified in any order; they are specified according to the variable number Variable ``1'' is the primary (regardless of its column ordering in the input data files) and the secondary variables are numbered from ``2'' depending on their ordered specification in icolvr() It is unnecessary to specify the j to i cross variogram if the i to j cross variogram has been specified; the cross variogram is expected to be symmetric (as from theory). For each i to j variogram the following are required:
  • nst and c0: the number of variogram structures and the isotropic nugget constant. The nugget constant does not count as a structure.
  • For each of the nst nested structures one must define it the type of structure (the power model is not allowed); cc the c parameter; ang1,ang2,ang3 the angles defining the geometric anisotropy; aa_hmax, the maximum horizontal range; aa_hmin, the minimum horizontal range; and aa_vert, the vertical range.
o Application notes:
  • The construction of the cokriging matrix requires the linear model of coregionalization. The input variogram parameters are checked for positive definiteness. The power model is not allowed.
  • A specific search is done for secondary data (same for all secondary) allowing the option of collocated cokriging.
  • A cokriging program for scattered points and cross validation is not provided; programs cokb3d and kt3d could be combined for this purpose.


GSLIB Help: IK3D

GSLIB Help Page: IK3D

o Description:
  • The program ik3d considers ordinary or simple indicator kriging of either categorical and cdf-type indicators, it performs all order relation corrections, and, optionally, allows the direct input of already transformed indicator data, including possibly soft data and constraint intervals.
o Parameters:
  • vartype: the variable type (1=continuous, 0=categorical)
  • ncat: the number of thresholds or categories
  • cat: the thresholds or categories (there should be ncat values on this line of input)
  • pdf: the global cdf or pdf values (there should be ncat values on this line of input)
  • datafl: the input continuous data in a simplified Geo-EAS formatted file.
  • icolx, icoly, icolz, and icolvr: the columns for the x, y, and z coordinates, and the continuous variable to be estimated.
  • directik: already transformed indicator values are read from this file. Missing values are identified as less than tmin which would correspond to a constraint interval. Otherwise, the cdf data should steadily increase from 0 to 1 and soft categorical probabilities must be between 0 to 1 and sum to 1.0.
  • icolx, icoly, icolz, and icoli: the columns for the x, y, and z coordinates, and the indicator variables.
  • tmin and tmax: all values strictly less than tmin and greater than or equal to tmax are ignored.
  • idbg: an integer debugging level between 0 and 3. The higher the debugging level the more output.
  • dbgfl: the debugging output is written to this file.
  • outfl: the output grid is written to this file. The output file will contain the order relation corrected conditional distributions for all nodes in the grid. The conditional probabilities or ccdf values will be written to the same line or ``record''; there are ncat variables in the output file. Unestimated nodes are identified by all ccdf values equal to -9.9999.
  • nx, xmn, xsiz: definition of the grid system (x axis).
  • ny, ymn, ysiz: definition of the grid system (y axis).
  • nz, zmn, zsiz: definition of the grid system (z axis).
  • ndmin and ndmax: the minimum and maximum number of data points to use for kriging a block.
  • radius_hmax radius_hmin and radius_vert the search radii in the maximum horizontal direction, minimum horizontal direction, and vertical direction (see angles below).
  • sang1, sang2 and sang3: the angle parameters that describe the orientation of the search ellipsoid. See the discussion on anisotropy specification associated with Figure II.4.
  • noct: the maximum number of samples per octant (octant search is not used if noct=0
  • mik and mikcut: If mik=0, then a full IK is performed. If mik=1, then a median IK approximation is performed where the kriging weights from the category or cutoff closest to mikcut are used for all cutoffs.
  • ktype: simple kriging is performed if ktype=0 ordinary kriging is performed if ktype=1
A variogram is is required for each of the ncat thresholds/categories:
  • nst, and c0: the number of variogram structures and the nugget constant, for the corresponding indicator variogram.
  • For each of the nst nested structures one must define it the type of structure (the power model is not allowed); cc the c parameter; ang1,ang2,ang3 the angles defining the geometric anisotropy; aa_hmax the maximum horizontal range; aa_hmin the minimum horizontal range; and aa_vert the vertical range. A detailed description of these parameters is given in section II.3. A short description of the program


Simulation Programs

 ---

WinGslib Help Page: Simulation Programs

There are numerous simulation programs in GSLIB. Most are rarely used; the sgsim and sisim programs are used extensively.

The Monte Carlo Drawing (draw) program is a very basic simulation program that can be used for the bootstrap or to understand the elements of stochastic simulation.

There are two Gaussian simulation programs: the LU (lusim) program, and the Sequential Gaussian (sgsim) simulation program. The LU simulation program is a small matrix-method program that is suitable for small grids (less than 2500 or so grid nodes). The sgsim program is widely used for simulation and cosimulation.

The Gaussian Truncated (gtsim) program may be used in conjunction with sgsim to accomplish simulation of categorical variables. This program performs no simulation, rather simulated Gaussian values (from sgsim) are truncated according to locally-variable thresholds.

The Probability Field (pfsim) program is another post-processing program that takes one file of conditional distributions (Gaussian or indicator) and simultaneously draws from them with correlated probabilities that are input as either Gaussian or uniform scores.

The Boolean (ellipsim) program is to illustrate the concept of randomly placing objects to create a categorical-variable 3-D realization. This program does not honor local data.

There are three Sequential Indicator Simulation (sisim) programs. The sisim program is a general purpose indicator simulation program. There is a special version for local means (_lm program) and for a gridded secondary variable (_gs program).

The two Simulated Annealing (anneal and sasim) programs are for image cleaning and continuous variable simulation, respectively. The anneal program will extract statistics from a training image and post- process input realizations to more closely honor the input statistics. The sasim program will generate realizations that honor input histograms, variograms, bivariate relationships, and indicator variograms. These programs require some tradecraft for difficult problems to set realistic annealing schedules.


GSLIB Help: ANNEAL

GSLIB Help Page: ANNEAL

o Description:
  • This program requires an integer-coded training image, a series of initial integer-coded realizations (possibly only one) to post-process, and information about what components of a two-point histogram are to be reproduced. The integer coding could be derived naturally from a categorical variable or it could be derived from the discretization of a continuous variable.
    o Parameters:
    • datafl: a file that contains the input realizations to post-process. The realizations must be integer-coded. The maximum number of different integer codes is specified in anneal.inc. The input file has one integer per line cycling fastest on x, then y, then z, then by realization.
    • trainfl: a file with the training image. The training image must have the same integer code values as the realizations to post-process and have the same size and discretization.
    • idbg and report: an integer debugging level between 0 and 3, and a reporting interval. After a fixed number of iterations (report) the realization is written to the output file.
    • dbgfl: file for the debugging information.
    • outfl: the output file that will contain the post-processed realizations.
    • nsim: the number of initial realizations to post process.
    • nx, ny, and nz: definition of the grid system.
    • seed: random number seed (a large odd integer).
    • maxit and tol: the maximum number of iterations over the entire grid network. Typically 99\% of the improvement is reached in 5 iterations and the remaining 1\% may be reached by 10 iterations. More than 10 iterations is not recommended. The initial objective function is normalized to one; when it is lowered to tol the simulation is stopped.
    • ndir: the number of directions for the two-point histogram control. For each direction the following parameters are needed:
      • ixl: the offset in the x direction for a unit lag
      • iyl: the offset in the y direction for a unit lag
      • izl: the offset in the z direction for a unit lag
      • nlag: the number of lags


GSLIB Help: DRAW

GSLIB Help Page: DRAW

o Description:
  • The draw program, documented below, reads as input a Kvariate probability density function, computes the corresponding Kvariate cdf and draws a user specified number L samples from that distribution. The input probability density function could be the equal weighted data distribution, the declustered distribution, a smoothed version of the data distribution (e.g., the output of histsmth or scatsmth) or any user-specified distribution.
o Parameters:
  • datafl: a data file in simplified Geo-EAS format containing the Kvariate distribution.
  • nvar: the number of variables (K making up the distribution being drawn from.
  • icolvr(1,..,nvar): the column numbers for the nvar variables of interest
  • icolwt: the column number for the probability values (if icolwt0 then the samples will be equal weighted).
  • tmin and tmax: all values strictly less than tmin and strictly greater than tmax are ignored.
  • seed and num: the random number seed (a large odd integer) and the number L=num of simulated values to draw.
  • outfl: the output file containing the simulated values


GSLIB Help: LUSIM

GSLIB Help Page: LUSIM

o Description:
  • Creates Gaussian-based realizations with LU matrix method
o Parameters:
  • datafl: the input data are in a simplified Geo-EAS formatted file.
  • icolx, icoly, icolz, and icolvr: the column numbers for the x,y and z coordinates, and the variable to be simulated. One or two of the coordinate column numbers can be set to zero which indicates that the simulation is 2-D or 1-D.
  • tmin and tmax: all values strictly less than tmin and strictly greater than tmax are ignored.
  • idbg: an integer debugging level between 0 and 3. The higher the debugging level the more output.
  • dbgfl: a file for the debugging output.
  • outfl: the output grid is written to this file. The output file will contain the grid, cycling fastest on x then y then z and last per simulation.
  • nsim: the number of simulations to generate.
  • nx, xmn, xsiz: definition of the grid system (x axis).
  • ny, ymn, ysiz: definition of the grid system (y axis).
  • nz, zmn, zsiz: definition of the grid system (z axis).
  • seed: random number seed (a large odd integer).
  • nst and c0: the number of variogram structures and the isotropic nugget constant.
  • For each of the nst nested structures one must define it the type of structure; cc the c parameter; ang1,ang2,ang3 the angles defining the geometric anisotropy; aa_hmax, the maximum horizontal range; aa_hmin, the minimum horizontal range; and aa_vert, the vertical range.
o Application notes:
  • This program requires standard normal data and writes standard normal simulated values. Normal score transform and back transform are to be performed outside of this program
  • Recall that the power model is not a legitimate model for a multiGaussian phenomenon and it is not allowed in lusim
  • The semivariogram model is that of the normal scores. The kriging variance is directly interpreted as the variance of the conditional distribution; consequently, the nugget constant c0 and c (sill) parameters should add to 1.0.


GSLIB Help: SGSIM

GSLIB Help Page: SGSIM

o Description:
  • Sequential Gaussian simulation program
o Parameters:
  • datafl: the input data in a simplified Geo-EAS formatted file. If this file does not exist then an unconditional simulation will be generated.
  • icolx, icoly, icolvr, icolwt and icolsec: the column numbers for the x,y and z coordinates, the variable to be simulated, the declustering weight, and the secondary variable (e.g., for external drift if used). One or two of the coordinate column numbers can be set to zero which indicates that the simulation is 2-D or 1-D. For equal weighting, set icolwt to zero.
  • tmin and tmax: all values strictly less than tmin and strictly greater than tmax are ignored.
  • itrans: if set to 0 then no transformation will be performed; the variable is assumed already standard normal (the simulation results will also be left unchanged). If itrans=1, transformations are performed.
  • transfl: output file for the transformation table if transformation is required (igauss=0).
  • ismooth: if set to 0, then the data histogram, possibly with declustering weights is used for transformation, if set to 1, then the data are transformed according to the values in another file (perhaps from histogram smoothing).
  • smthfl: file with the values to use for transformation to normal scores (if ismooth is set to 0).
  • icolvr and icolwt: columns in smthfl for the variable and the declustering weight (set to 1 and 2 if smthfl is the output from histsmth).
  • zmin and zmax the minimum and maximum allowable data values. These are used in the back transformation procedure.
  • ltail and ltpar specify the back transformation implementation in the lower tail of the distribution: ltail=1 implements linear interpolation to the lower limit zmin, and ltail=2 implements power model interpolation, with w=ltpar, to the lower limit zmin.
  • The middle class interpolation is linear.
  • utail and utpar specify the back transformation implementation in the upper tail of the distribution: utail=1 implements linear interpolation to the upper limit zmax, utail=2 implements power model interpolation, with w=utpar, to the upper limit zmax, and utail=4 implements hyperbolic model extrapolation with w=utpar. The hyperbolic tail extrapolation is limited by zmax.
  • idbg: an integer debugging level between 0 and 3. The larger the debugging level the more information written out.
  • dbgfl: the file for the debugging output.
  • outfl: the output grid is written to this file. The output file will contain the results, cycling fastest on x then y then z then simulation by simulation.
  • nsim: the number of simulations to generate.
  • nx, xmn, xsiz: definition of the grid system (x axis).
  • ny, ymn, ysiz: definition of the grid system (y axis).
  • nz, zmn, zsiz: definition of the grid system (z axis).
  • seed: random number seed (a large odd integer).
  • ndmin and ndmax: the minimum and maximum number of original data that should be used to simulate a grid node. If there are fewer than ndmin data points the node is not simulated.
  • ncnode: the maximum number of previously simulated nodes to use for the simulation of another node.
  • sstrat: if set to 0, the data and previously simulated grid nodes are searched separately: the data are searched with a super block search and the previously simulated nodes are searched with a spiral search (see section II.4). If set to 1, the data are relocated to grid nodes and a spiral search is used and the parameters ndmin and ndmax are not considered.
  • multgrid: a multiple grid simulation will be performed if this is set to 1 (otherwise a standard spiral search for previously simulated nodes is considered).
  • nmult: the number of multiple grid refinements to consider (used only if multgrid is set to 1).
  • noct: the number of original data to use per octant. If this parameter is set less than or equal to 0, then it is not used; otherwise, it overrides the ndmax parameter and the data is partitioned into octants and the closest noct data in each octant is retained for the simulation of a grid node.
  • radius_hmax, radius_hmin and radius_vert: the search radii in the maximum horizontal direction, minimum horizontal direction, and vertical direction (see angles below).
  • sang1, sang2 and sang3: the angle parameters that describe the orientation of the search ellipsoid. See the discussion on anisotropy specification associated with Figure II.4.
  • ktype: the kriging type (0 = simple kriging, 1 = ordinary kriging, 2 = simple kriging with a locally varying mean, 3 = kriging with an external drift, or 4 = collocated cokriging with one secondary variable) used throughout the loop over all nodes. SK is required by theory; only in cases where the number of original data found in the neighborhood is large enough can OK be used without the risk of spreading data values beyond their range of influence
  • rho: correlation coefficient to use for collocated cokriging (used only if ktype = 4).
  • secfl: the file for the locally varying mean, the external drift variable, or the secondary variable for collocated cokriging (the secondary variable must be gridded at the same resolution as the model being constructed by sgsim).
  • nst and c0: the number of semivariogram structures and the isotropic nugget constant.
  • For each of the nst nested structures one must define it, the type of structure; cc, the c parameter; ang1,ang2,ang3, the angles defining the geometric anisotropy; aa_hmax, the maximum horizontal range; aa_hmin, the minimum horizontal range; and aa_vert, the vertical range.
o Application notes:
  • This program requires standard normal data and writes standard normal simulated values. Normal score transform and back transform are to be performed outside of this program
  • Recall that the power model is not a legitimate model for a multiGaussian phenomenon and it is not allowed in sgsim
  • The semivariogram model is that of the normal scores. The kriging variance is directly interpreted as the variance of the conditional distribution; consequently, the nugget constant c0 and c (sill) parameters should add to 1.0.


GSLIB Help: PFSIM

GSLIB Help Page: PFSIM

o Description:
  • The pfsim program is for simulation of categorical or continuous variables with p-field simulation.
o Parameters:
  • vartype: the variable type (1=continuous, 0=categorical)
  • idist: if set to 1, then the conditional distributions are taken to be defined by indicator thresholds. If set to 0, then the conditional distributions are Gaussian requiring a mean and variance
  • ncat: number of thresholds or categories (idist=1 or vartype=0)
  • cat: the threshold values or category codes (there should be ncat values on this line of input)
  • datafl: the data file containing z-data that provides the details between the IK thresholds. This file is used only if table look-up values are called for in one of the interpolation/extrapolation options.
  • icolvr and icolwt: when either ltail, middle or utail is 3 then these variables identify the column for the values and the column for the (declustering) weight in datafl that will be used for the global distribution.
  • zmin and zmax: minimum and maximum data values allowed. Even when not using linear interpolation it is safe to control the minimum and maximum values entered. The lognormal or hyperbolic upper tail is constrained by zmax
  • ltail and ltpar specify the extrapolation in the lower tail: ltail=1 implements linear interpolation to the lower limit zmin; ltail=2 implements power model interpolation, with w=ltpar, to the lower limit zmin; and ltail=3 implements linear interpolation between tabulated quantiles.
  • middle and midpar specify the interpolation within the middle of the distribution: middle=1 implements linear interpolation to the lower limit zmin; middle=2 implements power model interpolation, with w=midpar, to the lower limit zmin; and middle=3 allows for linear interpolation between tabulated quantile values;
  • utail and utpar specify the extrapolation in the upper tail of the distribution: utail=1 implements linear interpolation to the upper limit zmax, utail=2 implements power model interpolation, with w=utpar, to the upper limit zmax; utail=3 implements linear interpolation between tabulated quantiles; and, utail=4 implements hyperbolic model extrapolation with w=utpar.
  • distfl: input data file with the conditional distributions.
  • imean and ivar: columns for the Gaussian ccdf means and variances (idist=0) or the ccdf values (idist=1).
  • tmin and tmax: all values strictly less than tmin and strictly greater than tmax are ignored.
  • pfile: file containing the input p-field probability realizations
  • icolp: column number in pfile for the p-field probability value.
  • pflag: if set to 0, then the p-field probability values are taken to be Gaussian deviates that need to be converted to cumulative probability values. If set to 1, then the p-field probability values are already cumulative distribution values between 0 and 1.
  • outfl: the output grid is written to this file. The output file will contain the results, cycling fastest on x, then y, then z, then simulation by simulation.
  • nsim: number of realizations
  • nx, ny, and nz: size of the simulation grid A short description of the program


GSLIB Help: ELLIPSIM

GSLIB Help Page: ELLIPSIM

o Description:
  • This program provides a very simple example of Boolean simulation: ellipsoids of various sizes and anisotropies are dropped at random until a target proportion of points within-ellipse is met. The ellipsoids are allowed to overlap each other.
o Parameters:
  • outfl: the simulated realizations are written to this file. The output file will contain the unconditional simulated indicator values (1 if in an ellipse, zero otherwise) cycling fastest on x then y, then z, and then simulation by simulation.
  • nsim: the number of simulations to generate.
  • nx, xsiz: definition of the grid system (x axis).
  • ny, ysiz: definition of the grid system (y axis).
  • nz, zsiz: definition of the grid system (y axis).
  • seed: random number seed (a large odd integer).
  • targprop: the target proportion of ellipse volume.
  • For the different types of ellipsoids to be added: radiusx, radiusy, radiusz, angle1, angle2, angle3, and weight specify the ellipsoid size, orientation, and relative proportion (counting). A short description of the program


GSLIB Help: GTSIM

GSLIB Help Page: GTSIM

o Description:
  • Truncate multiple Gaussian fields according to thresholds that can vary locally.
o Parameters:
  • gausfl: input data file with the Gaussian realizations that will be truncated to create categorical variable realizations.
  • outfl: output data file for categorical variable realizations.
  • nsim: number of realizations
  • nx, ny, and nz: size of the simulation grid
  • ncat: number of categories
  • cat() and proportion(): the integer codes for each category and its corresponding global proportion
  • pcurve: if set to 0 then there are no proportion curves and the global proportions are used to establish the thresholds for truncation. If set to 1, then proportion curve files are considered for locally varying thresholds. ncat-1 proportion files are needed:
  • propfl: file containing a regular 3-D grid (same size as the input Gaussian realizations) containing the local proportions of the ncat-1 categories.
  • icolprop: column with locally varying proportion


GSLIB Help: SISIM

GSLIB Help Page: SISIM

o Description:
  • The sisim program is for the simulation of either integer-coded categorical variables or continous variables with indicator data defined from a cdf.
o Parameters:
  • vartype: the variable type (1=continuous, 0=categorical)
  • ncat: the number of thresholds or categories
  • cat: the threshold values or category codes (there should be ncat values on this line of input)
  • pdf: the global cdf or pdf values (there should be ncat values on this line of input)
  • datafl: the input data in a simplified Geo-EAS file.
  • icolx, icoly, icolz, and icolvr: the column numbers for the x,y, and z coordinates and the variable to be simulated. One or two of the coordinate column numbers can be set to zero which indicates that the simulation is 2-D or 1-D.
  • directik: already transformed indicator values are read from this file. Missing values are identified as less than tmin which would correspond to a constraint interval. Otherwise, the cdf data should steadily increase from 0 to 1 and soft categorical probabilities must be between 0 to 1 and sum to 1.0.
  • icolx, icoly, icolz, and icoli: the columns for the x, y, and z coordinates, and the indicator variables.
  • imbsim: set to 1 if considering Markov-Bayes option for cokriging with soft indicator data, otherwise, set to 0.
  • b(z): if imbsim is set to 1, then the B(z) calibration values are needed.
  • tmin and tmax: all values strictly less than tmin and strictly greater than tmax are ignored.
  • zmin and zmax: minimum and maximum attribute values when considering a continuous variable
  • ltail and ltpar specify the extrapolation in the lower tail: ltail=1 implements linear interpolation to the lower limit z_min ltail=2 power model interpolation, with w=ltpar to the lower limit zmin and ltail=3 implements linear interpolation between tabulated quantiles (only for continuous variables).
  • middle and midpar specify the interpolation within the middle of the distribution: middle=1 implements linear interpolation; middle=2 implements power model interpolation, with w=midpar and middle=3 allows for linear interpolation between tabulated quantile values (only for continuous variables).
  • utail and utpar specify the extrapolation in the upper tail of the distribution: utail=1 implements linear interpolation to the upper limit zmax, utail=2 implements power model interpolation, with w=utpar, to the upper limit zmax utail=3 implements linear interpolation between tabulated quantiles, and utail=4 implements hyperbolic model extrapolation with w=utpar The hyperbolic tail extrapolation is limited by zmax (only for continuous variables).
  • tabfl: If linear interpolation between tabulated values is the option selected for any of the three regions then this simplified Geo-EAS format file is opened to read in the values. One legitimate choice is exactly the same file as the conditioning data, i.e., datafl Note that tabfl specifies the tabulated values for all classes.
  • icolvrt and icolwtt: the column numbers for the values and declustering weights in tabfl Note that declustering weights can be used but are not required - just set the column number less than or equal to zero. If declustering weights are not used, then the class probability is split equally between the sub-classes defined by the tabulated values.
  • idbg: an integer debugging level between 0 and 3. The larger the debugging level the more information written out.
  • dbgfl: the file for the debugging output.
  • outfl: the output grid is written to this file. The output file will contain the results, cycling fastest on x then y then z then simulation by simulation.
  • nsim: the number of simulations to generate.
  • nx, xmn, xsiz: definition of the grid system (x axis).
  • ny, ymn, ysiz: definition of the grid system (y axis).
  • nz, zmn, zsiz: definition of the grid system (z axis).
  • seed: random number seed (a large odd integer).
  • ndmax: the maximum number of original data that will be used to simulate a grid node.
  • ncnode: the maximum number of previously simulated nodes to use for the simulation of another node.
  • maxsec: the maximum number of soft data (at node locations) that will be used for the simulation of a node. This is particularly useful to restrict the number of soft data when an exhaustive secondary variable informs all grid nodes.
  • sstrat: if set to 0, the data and previously simulated grid nodes are searched separately: the data are searched with a super block search and the previously simulated nodes are searched with a spiral search. If set to 1, the data are relocated to grid nodes and a spiral search is used; the parameters ndmin and ndmax are not considered.
  • multgrid: a multiple grid simulation will be performed if this is set to 1 (otherwise a standard spiral search will be considered).
  • nmult: the target number of multiple grid refinements to consider (used only if multgrid is set to 1).
  • noct: the number of original data to use per octant. If this parameter is set less than or equal to 0, then it is not used; otherwise, the closest noct data in each octant are retained for the simulation of a grid node.
  • radius_hmax, radius_hmin and radius_vert: the search radii in the maximum horizontal direction, minimum horizontal direction, and vertical direction (see angles below).
  • sang1, sang2 and sang3: the angle parameters that describe the orientation of the search ellipsoid. See the discussion
  • mik and mikcat: if mik is set to 0, then a full indicator kriging is performed at each grid node location to establish the conditional distribution. If mik is set to 1, then the median approximation is used, i.e., a single variogram is used for all categories; therefore, only one kriging system needs to be solved and the computer time is significantly reduced. The variogram corresponding to category mikcat will be used.
  • ktype: the kriging type (0 = simple kriging, 1 = ordinary kriging) used throughout the loop over all nodes. SK is required by theory, only in cases where the number of original data found in the neighborhood is large enough can OK be used without the risk of spreading data values beyond their range of influence. The global pdf values (specified with each category) are used for simple kriging.
The following set of parameters are required for each of the ncat categories:
  • nst, and c0: the number of semivariogram structures and the isotropic nugget constant.
  • For each of the nst nested structures one must define it the type of structure; cc the c parameter; ang1,ang2,ang3 the angles defining the geometric anisotropy; aa_hmax, the maximum horizontal range; aa_hmin, the minimum horizontal range; and aa_vert, the vertical range. Each semivariogram model refers to the corresponding indicator transform. A Gaussian variogram with a small nugget constant is not a legitimate variogram model for a discontinuous indicator function. There is no need to standardize the parameters to a sill of one since only the relative shape affects the kriging weights.


GSLIB Help: SASIM

GSLIB Help Page: SASIM

o Description:
  • sasim allows conditional simulations of a continuous variable honoring any combination of the following input statistics: histogram, variogram, indicator variograms, correlation coefficient with a secondary variable, or conditional distributions with a secondary variable.
o Parameters:
  • objhist, objvarg, objivar, objcorr, objcpdf: binary flags that specify whether or not a component objective function will be considered (set to 1 if yes, 0 if not).
  • sclhist, sclvarg, sclivar, sclcorr, sclcpdf: user imposed scaling factors that will multiply the scaling factors that the program automatically calculates (see section V.6).
  • ilog: if set to 1, the logarithm (base 10) of the variable will be considered. This is appropriate for positively skewed variables with large variance.
  • nsim: the number of realizations to generate.
  • nx, xmn, xsiz: definition of the grid system (x axis).
  • ny, ymn, ysiz: definition of the grid system (y axis).
  • nz, zmn, zsiz: definition of the grid system (z axis).
  • seed: random number seed (a large odd integer).
  • idbg: an integer debugging level between 0 and 3.
  • dbgfl: the file for the debugging output.
  • outfl: the output grid is written to this file. The output file will contain the results, cycling fastest on x then y then z then simulation by simulation.
  • isas: the annealing schedule (next set of parameters) can be set explicitly or it can be set automatically (0=automatic,1=then use the next three lines of input).
  • t0, redfac, ka, k, num, omin: the annealing schedule: initial temperature, the reduction factor, the maximum number of perturbations at any one given temperature, and the target number of acceptable perturbations at a given temperature, the stopping number (maximum number of times that the ka is reached), and a low objective function value indicating convergence.
  • maxpert: the maximum number of perturbations (will be scaled by nx x ny x nz)
  • report: After a fixed number of swaps (report scaled by nx x ny x nz) the objective function is written to the screen and the debugging file.
  • icond: set to 1 if there is conditioning data (0 implies no conditioning data).
  • condfl: an input data file with the conditioning data (simplified Geo-EAS format). If this file does not exist then an unconditional simulation is generated.
  • icolx, icoly, icolz, and icolvr: the column numbers for the x,y, and z coordinates and the variable to be simulated. One or two of the coordinate column numbers can be set to zero which indicates that the simulation is 2-D or 1-D.
  • tmin and tmax: all values strictly less than tmin and strictly greater than tmax are ignored.
  • ihist: set to 1 if the histogram should be taken from the following file (set to 0 if not).
  • histfl: an input data file with the histogram in simplified Geo-EAS format.
  • icolvr, and icolwt: the column numbers for the variable to be simulated and a declustering weight.
  • nquant: number of quantiles for the histogram objective function
  • nivar: number of indicator variograms to consider. The threshold values (in units of the primary variable) are input next and the variograms are input directly after the direct variogram of the primary variable with the same format.
  • ithreshold: The threshold values (in units of the primary variable) for the indicator variograms
  • secfl: an input data file with the secondary variable model (needed if cosimulation is being performed)
  • icolsec: the column number for the secondary variable in secfl
  • vertavg: if set to 1, then the correlation applies to the secondary variable and a vertical average of the variable being simulated. Otherwise, the secondary variable is considered at each grid node location.
  • corrcoef: The correlation coefficient (used if the fourth component objective function is turned on).
  • bivfl: an input data file with the bivariate data to define the conditional distributions (simplified Geo-EAS format)
  • icolpri and icolsec: the column numbers for the primary and secondary variables in bivfl
  • tmin and tmax: all values strictly less than tmin and strictly greater than tmax are ignored.
  • npricut: number of thresholds to define the conditional distributions of the primary variable within a class of the secondary variable.
  • nseccut: number of thresholds to define the classes of secondary variable.
  • nlag: the number of variogram lags to consider in the objective function. The closest nlag lags, measured in terms of variogram distance, are retained.
  • istand: a flag specifying whether or not to standardize the sill of the semivariogram to the variance of the univariate distribution (istand=1 will standardize). It is essential that the variance of the values of the initial random image matches the spatial (dispersion) variance implied by the variogram model. That dispersion variance should be equal to the total sill if it exists (i.e., a power model has not been used) and the size of the field is much larger than the largest range in the variogram model.
  • nst and c0: the number of variogram structures and the isotropic nugget constant
  • For each of the nst nested structures one must define it, the type of structure; cc, the c parameter; ang1,ang2,ang3, the angles defining the geometric anisotropy; aa_hmax, the maximum horizontal range; aa_hmin, the minimum horizontal range; and aa_vert, the vertical range. A detailed description of these parameters is given in section II.3.
  • Indicator variograms follow the definition of the direct primary variable variogram.


Post Processing Programs

 ---

WinGslib Help Page: Post Processing Programs

The GSLIB programs write gridded values in a specific order (X fastest, then Y, then Z, then by realization). It is often convenient to add the spatial coordinates so that the results can be imported to commercial software. The Add Coordinates (addcoord) program performs this operation.

Indicator kriging (ik3d) reports the probabilities associated to specified cutoffs. The Indicator Kriging Post Processing (postik) program will calculate a number of summary statistics of the local indicator kriging-based distributions, e.g., the fraction and mean value above a threshold.

Often, it is convenient to summarize multiple realizations to display the local average (which will be close to kriging), the probability to exceed a critical threshold and so on. The Processing of Multiple Realizations (postsim) program will read multiple realizations from any of the GSLIB programs and calculate the requested summary statistics.


GSLIB Help: ADDCOORD

GSLIB Help Page: ADDCOORD

o Description:
  • This program adds 3-D coordinates to gridded points in an ordered GSLIB output file (as from kriging or simulation).
o Parameters:
  • datafl: the input gridded data file.
  • outfl: file for output with X, Y and Z coordinates.
  • ireal: the grid or realization number to consider.
  • nx, xmn, and xsiz: the number of nodes in the x direction, the origin, and the grid node separation.
  • ny, ymn, and ysiz: the number of nodes in the y direction, the origin, and the grid node separation.
  • nz, zmn, and zsiz: the number of nodes in the z direction, the origin, and the grid node separation.


GSLIB Help: POSTIK

GSLIB Help Page: POSTIK

o Description:
  • The output from ik3d requires additional processing before being used. The program postik performs order relations corrections, change of support calculations, and computes various statistics according to the following options:
  • Compute the ``E-type'' estimate, i.e., the mean value of the conditional distribution
  • Compute the variance the conditional distribution.
  • Compute the probability of exceeding a fixed threshold, the average value above that threshold, and the average value below that threshold.
  • Compute the value where a fixed conditional cumulative distribution function (cdf) value p is reached, i.e., the conditional p-quantile value.
o Parameters:
  • distfl: the output IK file (from program ik3d) which is considered as input.
  • outfl: the output file (output differs depending on output option, see below).
  • iout and outpar: iout=1 computes the E-type estimate and the conditional variance, iout=2 computes the probability and means above and below the value outpar, iout=3 computes the z value (p-quantile) corresponding to the cdf value outpar=p, iout=4 computes the conditional variance
  • ncut: the number of thresholds.
  • cut(i),i=1,ncut: the threshold values used in ik3d.
  • ivol, ivoltyp, and varred: if ivol = 1 then volume support correction is attempted with the affine correction (ivoltyp=1) or the indirect correction through permanence of a lognormal distribution (ivoltyp=2). The variance reduction factor (between 0 and 1) is specified as varred.
  • datafl: the data file containing z-data that provides the details between the IK thresholds. This file is used only if table look-up values are called for in one of the interpolation/extrapolation options.
  • icolvr and icolwt: when either ltail, middle or utail is 3 then these variables identify the column for the values and the column for the (declustering) weight in datafl that will be used for the global distribution.
  • tmin and tmax: all values strictly less than tmin and strictly greater than tmax are ignored.
  • zmin and zmax: minimum and maximum data values allowed. Even when not using linear interpolation it is safe to control the minimum and maximum values entered. The lognormal or hyperbolic upper tail is constrained by zmax.
  • ltail and ltpar specify the extrapolation in the lower tail: ltail=1 implements linear interpolation to the lower limit zmin; ltail=2 implements power model interpolation, with w=ltpar, to the lower limit zmin; and ltail=3 implements linear interpolation between tabulated quantiles.
  • middle and midpar specify the interpolation within the middle of the distribution: middle=1 implements linear interpolation to the lower limit zmin; middle=2 implements power model interpolation, with w=midpar, to the lower limit zmin; and middle=3 allows for linear interpolation between tabulated quantile values.
  • utail and utpar specify the extrapolation in the upper tail of the distribution: utail=1 implements linear interpolation to the upper limit zmax, utail=2 implements power model interpolation, with w=utpar, to the upper limit zmax; utail=3 implements linear interpolation between tabulated quantiles; and, utail=4 implements hyperbolic model extrapolation with w=utpar.
  • maxdis: a maximum discretization parameter. The default value of 50 is typically fine; greater accuracy is obtained with a larger number and quicker execution time is obtained with a lower number. A short description of the program
o Application notes:
  • Although order relations are corrected by ik3d they are checked again in postik.
  • A facility for volume support correction has been provided although we strongly suggest that volume support correction be approached through small-scale simulations. Either the affine correction or the indirect lognormal correction is available.
  • There are a number of consequential decisions that must be made about how to interpolate between and extrapolate beyond known values of the cumulative distribution function.
  • Both the conditional (E-type) mean and the mean above a specified threshold are calculated by summing the z values at regularly spaced ccdf increments. A parameter maxdis specifies how many such cdf values to calculate. This can be increased depending on the precision required.


GSLIB Help: POSTSIM

GSLIB Help Page: POSTSIM

o Description:
  • postsim allows a number of summaries to be extracted from a set of simulated realizations:
    • the ``E-type'' estimates, i.e., the point-by-point average of the realizations.
    • Compute the variance of the conditional distribution.
    • the probability of exceeding a fixed threshold, the average value above that threshold, and the average value below that threshold.
    • the value where a fixed conditional cumulative distribution function (cdf) value p is reached, i.e., the conditional p-quantile value.
o Parameters:
  • simfl: the output simulation file that contains all of the realizations. This file should contain the simulated values, one value per line, cycling fastest on x then y then z and last per simulation.
  • nsim specifies the number of realizations.
  • tmin and tmax: all values strictly less than tmin and strictly greater than tmax are ignored.
  • nx, ny, and nz specify the number of nodes in the x,y, and z direction.
  • outfl: an output file that contains the E-type estimate, the fraction and mean above threshold, the fraction and mean below threshold, or the conditional p-quantile values.
  • iout and outpar: iout=1 computes the E-type estimate, iout=2 computes the probability and mean above and below the value outpar, iout=3 computes the z-value (p-quantile) corresponding to the cdf value outpar=p, iout=4 computes the symmetric probability interval (total width = outpar), and iout=5 computes an estimate of the conditional variance A short description of the program


Main GSLIB Help Page

 ---

GSLIB Help Page

Deutsch, C.V. and Journel A.G., GSLIB: Geostatistical Software Library and User's Guide, Oxford University Press, New York, NY, 1992, 340 pp.

o Compiling Programs
o Data and Parameter Files
o Help with Programs
---


GSLIB Help Page: File Formats

o Data Files:
  • Although users are strongly encouraged to customize the programs, workable main programs are useful starting points. The main programs read and write data with a format similar to the menu-driven Geo-EAS package. The format, described below, is a simple ASCII format with no data compression or alphanumeric characters.

  • The data file format is a simplified Geo-EAS format, hence with no allowance for the user to specify explicitly the input format. The data values are always read with free format. The accessibility of the source code allows this to be easily changed.
  • The following conventions are used by the ``simplified Geo-EAS format'' used by GSLIB data files:
    • The first line in the file is taken as a title and is possibly transferred to output files.
    • The second line should be a numerical value specifying the number of numerical variables nvar in the data file.
    • The next nvar lines contain character identification labels and additional text (optional) that describe each variable.
    • The following lines, from nvar+3 until the end of the file, are considered as data points and must have nvar numerical values per line. Missing values are typically considered as large negative or positive numbers (e.g., less than -1.0e21 or greater than 1.0e21). The number of data will be the number of lines in the file minus nvar+2 minus the number of missing values. The programs read numerical values and not alphanumeric characters; alphanumeric variables may be transformed to integers or the source code modified.
    Clustered 140 primary and secondary data
5
Xlocation
Ylocation
Primary
Secondary
Declustering Weight
39.5 18.5   .06   .22 1.619
 5.5  1.5   .06   .27 1.619
38.5  5.5   .08   .40 1.416
20.5  1.5   .09   .39 1.821
o Grid Definition:
  • Regular grids of data points or block values are often considered as input or output. The conventions used throughout GSLIB are:
    • The X axis is associated to the east direction. Grid node indices ix increase from 1 to nx in the positive x direction, i.e., to the east.
    • The Y axis is associated to the north direction. Grid node indices iy increase from 1 to ny in the positive y direction, i.e., to the north.
    • The Z axis is associated to the elevation. Grid node indices iz increase from 1 to nz in the positive z direction, i.e., upward.
  • The user can associate these three axes to any coordinates system that is appropriate for the problem at hand. For example, if the phenomenon being studied is a stratigraphic unit, then some type of stratigraphic coordinates relative to a marker horizon could make the most sense. The user must perform the coordinate transformation; there is no allowance for rotation or stratigraphic grids within the existing set of subroutines.
  • The coordinate system is established by specifying the coordinates at the center of the first block (xmn,ymn,zmn), the number of blocks/grid nodes (nx,ny,nz), and the size/spacing of the blocks/nodes (xsiz,ysiz,zsiz).
  • Sometimes a special ordering is used to store a regular grid. This avoids the requirement of storing node coordinates or grid indices. The ordering is point by point to the east, then row by row to the north, and finally level by level upward, i.e., x cycles fastest, then y, and finally z. The index location of any particular node ix,iy,iz can be located by:
    loc = (iz-1)*nx*ny + (iy-1)*nx + ix
    Given the above one-dimensional index location of a node the three coordinate indices can be calculated as
    iz = 1 + int( (loc-1)/(nx*ny) )
    iy = 1 + int( (loc-(iz-1)*nx*ny)/nx )
    ix = loc - (iz-1)*nx*ny - (iy-1)*nx
o Parameter Files:
  • The default driver programs read the name of a parameter file from standard input. If the parameter file is named for the program and has a ``.par'' extension, then simply keying a carriage return will be sufficient (e.g., the program gam would automatically look for gam.par). All of the program variables and names of input/output files are contained in the parameter file. A typical parameter file:

                           Parameters for GAM
                       ******************
START OF PARAMETERS:
../data/true.dat       \file with data
2   1   2              \   number of variables, column numbers
-1.0e21     1.0e21     \   trimming limits
gam.out                \file for variogram output
1                      \grid or realization number
50   0.5   1.0         \nx, xmn, xsiz
50   0.5   1.0         \ny, ymn, ysiz
 1   0.5   1.0         \nz, zmn, zsiz
2  10                  \number of directions, number of lags
 1  0  0               \ixd(1),iyd(1),izd(1)
 0  1  0               \ixd(2),iyd(2),izd(2)
1                      \standardize sill? (0=no, 1=yes)
2                      \number of variograms
1   1   1              \tail variable, head variable, variogram type
1   1   3              \tail variable, head variable, variogram type
  • The user can have as many lines of comments at the top of the file as desired, but formatted input is started immediately after the characters ``START'' are found at the beginning of a line. Some in-line documentation is available to supplement the detailed documentation provided in this electronic help and the actual book.


GSLIB Help Page: Programs

o Coordinate transformation:
  • addcoord add coordinates to a GSLIB grid file
  • rotcoord 2-D coordinate rotation
o Probability distribution weighting, transformation, and smoothing:
  • declus cell declustering
  • nscore normal score transformation
  • backtr back transformation from normal scores
  • trans general distribution transformation
  • histsmth smooth histogram / univariate distribution
  • scatsmth smooth scaterplot / bivariate distribution (see also bivplt)
o Variograms:
  • gam variogram calculation of regular grid (use vargplt to plot results)
  • gamv variogram calculation of scattered data (use vargplt to plot results)
  • varmap variogram map / volume calculation (use pixelplt to plot results)
  • vmodel creates a variogram from an analytical model that can be plotted with vargplt
  • bigaus can be used to get the indicator variograms from a Gaussian or normal scores variogram
  • The "variogram type" is specified by an integer code. The type of variogram model is specified by another integer code.
o Kriging:
  • kb2d straightforward 2-D kriging
  • kt3d flexible 3-D kriging
  • cokb3d cokriging
  • ik3d indicator kriging (use postik to postprocess results)
o Stochastic simulation:
  • draw simple Monte Carlo stochastic simulation
  • lusim LU matrix Gaussian simulation
  • sgsim sequential Gaussian simulation
  • gtsim truncated Gaussian simulation (uses the result of sgsim and proportion curves)
  • sisim sequential indicator simulation including categorical and continuous and Markov-Bayes (program bicalib is used to process calibration data)
  • pfsim probability field simulation
  • ellipsim 3-D ellipsoid simulation
  • anneal annealing-based post processing / simulation
  • sasim annealing-based simulation and cosimulation
  • postsim is used to post process a number of simulated realizations
o PostScript plotting:
  • histplt histogram and cumulative histogram
  • probplt normal and lognnormal probability plot
  • scatplt scatterplot
  • qpplt Q-Q or P-P plot to compare two distributions
  • locmap gray and color 2-D data location map
  • pixelplt gray and color 2-D pixel map
  • bivplt plot a smoothed bivariate probability distribution with the marginal distributions


GSLIB Help: Variogram Model Types

GSLIB Help Page: Variogram Model Types

  • 1. Spherical (use actual range)
  • 2. Exponential (use practical range)
  • 3. Gaussian (use practical range)
  • 4. Power law variogram
  • 5. Cosine hole effect model


GSLIB Help: Variogram Types

GSLIB Help Page: Variogram Types

  • 1. Traditional semivariogram
  • 2. Traditional cross semivariogram
  • 3. Covariance
  • 4. Correlogram
  • 5. General relative semivariogram
  • 6. Pairwise relative semivariogram
  • 7. Semivariogram of logarithms
  • 8. Semimadogram
  • 9. Indicator semivariogram (continuous variable)
  • 10. Indicator semivariogram (categorical variable)


GSLIB Help Page: Compiling

GSLIB Help Page: Program Compiling

o Getting Started:
  • GSLIB does not provide executable programs and tutorials. All of the programs must be compiled prior to running them. This appendix provides some information and hints about loading and compiling the GSLIB programs.
  • The programs in this version of GSLIB have been developed and are used primarily in the UNIX environment; however, there are no restrictions on the type of operating system. These programs have also been tested in the DOS environment and are distributed on 3.5 inch DOS diskettes. The following information is necessarily general because of the many different possible operating systems.
  • As mentioned in the book, the GSLIB programs are distributed without any support or warranty.
o Installation:
  • Choose a target computer with a Fortran compiler. The first step is to choose a specific computer to load GSLIB. In many cases this is evident; nevertheless, keep the intended applications in mind. Workstations or larger machines would be appropriate if large 3-D simulations and kriging runs are anticipated. A compiler for ANSI standard Fortran 77 (or any later release) must be available on the target computer.
  • Load the distribution software. The second step is to copy all of the files from the distribution diskettes to the target computer. Ensure that the directory structure is unchanged; there are files with the same name in different directories. The files may be copied directly if the target computer reads IBM-type high density diskettes; otherwise, they will have to be transferred through an IBM-type PC to the target computer via some file transfer protocol.

    The type of transfer protocol will be accessible from the local system expert or administrator. Some possibilities include a modem connection to the target computer, an ethernet card, or some other network connection.

  • File naming conventions. Different Fortran compilers require different file naming conventions, e.g., most UNIX implementations require Fortran source code files to be names with a .f extension, most DOS implementations require a .for extension, and some compilers require a .ftn extension. All of the Fortran code (named with a .for extension on the distribution diskettes) should be systematically renamed if appropriate. A UNIX shell script mvsuff is provided to change file suffixes, e.g., entering mvsuff for f will cause all files with a .for extension in the current working directory to be renamed with a .f extension.
  • Choose compiler options. The next step is to choose the compiler options and to document the changes that are required for the programs to be compiled. Compiler options vary considerably; the following should be kept in mind:
    • The code can be optimized unless the use of a symbolic debugger is being considered. A high level of optimization on certain computers can introduce problems. For example, the vargplt program has failed to work properly when compiled with a high level of optimization on certain compilers.
    • The source code is in mixed upper and lower case. In some cases a compiler option must be set or the source code may have to be systematically changed to upper case (the ANSI standard).
    • Some compilers force each do loop to be executed at least once (i.e., the test for completion is at the end of the loop). This will cause problems and must be avoided by additional coding (adding an {\tt if statement before entering a loop) or setting the appropriate option when compiling the programs.
    Modifications required in one program will surely be required in other programs. It is good practice to modify systematically all programs at one time rather than when needed.

    On UNIX machines a makefile can be used to facilitate source code management. If extensive modifications and upgrades are anticipated some type of source code control system could be considered.

  • Compile the GSLIB subroutine library. The 37 programs in GSLIB version 2 require a compiled GSLIB subroutine library. The subroutines are in the GSLIB subdirectory on the diskettes.
  • Compile the programs. Each program is in its own subdirectory and can be compiled separately once the GSLIB library has been compiled.
  • Testing. A necessary but not sufficient check that the programs are working correctly is to reproduce the example run of each program.
o Troubleshooting:
  • This section describes some known installation pitfalls. When attempting to isolate a problem it would be a good idea to scan all of the following points:
  • MAC users note that the quotes around the file name in the ``include'' statement must be removed.
  • VAX/VMS users note that the file opening convention will have to be modified in some cases. The VMS compiler does not accept the \newline status='UNKNOWN' option when opening files.
  • Lahey Fortran users note that a variable that is in a common block can not be initialized by a ``data'' statement; a ``block data'' statement must be used.
  • File not found errors are often due to users forgetting that all file names are read as 40 characters. For example, accidentally removing some of the blank spaces before the start of a comment (e.g., data file) will cause the program to fail.
  • Nonexistent file names are often used to inform the program that a particular operation is not needed, e.g., if the file specifying conditioning data, in the simulation programs, is missing then an unconditional simulation is constructed. It is good practice to explicitly specify a name that is never used, e.g., nodata
  • Difficulty reproducing simulation results may be due to differences of numerical precision (machine representation of numbers) and a different sequence of pseudo-random numbers.
  • A DOS ``end of line'' is marked by two characters. Some file transfer protocols automatically remove the extra character or a special command is available on most computers (dos2unix on SUN computers, to\_unix on SGI machines,\ldots).
  • End-of-record code: The programs in GSLIB read in the data in free format, so each line should contain the correct number of data values separated by white space. Some of the programs and editors, such as EMACS, that are used to create data files for GSLIB may terminate the very last line with an end-of-file (EOF) code without an explicit end-of-record code; if this is the case, GSLIB may not be able to read the very last record in the file. If users notice that the number of data being read is one less than the number that they intended, a blank line at the end of their data file may solve the problem.


GSLIB Help: GETDATA

GSLIB Help Page: GETDATA

o Description:
o Parameters:.