OnWorks favicon

grdvolumegmt - Online in the Cloud

Run grdvolumegmt in OnWorks free hosting provider over Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

This is the command grdvolumegmt that can be run in the OnWorks free hosting provider using one of our multiple free online workstations such as Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator



grdvolume - Calculate grid volume and area constrained by a contour


grdvolume grdfile [ cval or low/high/delta or rlow/high ] [ base ] [ region ] [ [unit] ] [
[c|h] ] [ [level] ] [ fact[/shift] ] [ -f<flags> ] [ -o<flags> ]

Note: No space is allowed between the option flag and the associated arguments.


grdvolume reads a 2-D binary grid file and calculates the volume contained between the
surface and the plane specified by the given contour (or zero if not given) and reports
the area, volume, and maximum mean height (volume/area). Alternatively, specify a range of
contours to be tried and grdvolume will determine the volume and area inside the contour
for all contour values. Using -T, the contour that produced the maximum mean height (or
maximum curvature of heights vs contour value) is reported as well. This feature may be
used with grdfilter in designing an Optimal Robust Separator [Wessel, 1998].


The name of the input 2-D binary grid file. (See GRID FILE FORMAT below.)


-Ccval or -Clow/high/delta or -Crlow/high
find area, volume and mean height (volume/area) inside the cval contour.
Alternatively, search using all contours from low to high in steps of delta.
[Default returns area, volume and mean height of the entire grid]. The area is
measured in the plane of the contour. The Cr form on the other hand computes
volume between the grid surface and the plans defined by low and high. Note that
this is an outside volume whilst the other forms compute an inside (below the
surface) area volume. Use this form to compute for example the volume of water
between two contours.

-Lbase Also add in the volume from the level of the contour down to base [Default base is

Convert degrees to Flat Earth distances, append a unit from e|f|k|M|n|u [Default is

Determine the single contour that maximized the average height (= volume/area).
Select -Tc to use the maximum curvature of heights versus contour value rather than
the contour with the maximum height to pick the best contour value (requires -C).

-R[unit]xmin/xmax/ymin/ymax[r] (more ...)
Specify the region of interest.

-V[level] (more ...)
Select verbosity level [c].

Optionally subtract shift before scaling data by fact. [Default is no scaling].
(Numbers in -C, -L refer to values after this scaling has occurred).

-f[i|o]colinfo (more ...)
Specify data types of input and/or output columns.

-ocols[,...] (more ...)
Select output columns (0 is first column).

-^ or just -
Print a short message about the syntax of the command, then exits (NOTE: on Windows
use just -).

-+ or just +
Print an extensive usage (help) message, including the explanation of any
module-specific option (but not the GMT common options), then exits.

-? or no arguments
Print a complete usage (help) message, including the explanation of options, then

Print GMT version and exit.

Print full path to GMT share directory and exit.


By default GMT writes out grid as single precision floats in a COARDS-complaint netCDF
file format. However, GMT is able to produce grid files in many other commonly used grid
file formats and also facilitates so called "packing" of grids, writing out floating point
data as 1- or 2-byte integers. To specify the precision, scale and offset, the user should
add the suffix =id[/scale/offset[/nan]], where id is a two-letter identifier of the grid
type and precision, and scale and offset are optional scale factor and offset to be
applied to all grid values, and nan is the value used to indicate missing data. In case
the two characters id is not provided, as in =/scale than a id=nf is assumed. When
reading grids, the format is generally automatically recognized. If not, the same suffix
can be added to input grid file names. See grdconvert and Section grid-file-format of the
GMT Technical Reference and Cookbook for more information.

When reading a netCDF file that contains multiple grids, GMT will read, by default, the
first 2-dimensional grid that can find in that file. To coax GMT into reading another
multi-dimensional variable in the grid file, append ?varname to the file name, where
varname is the name of the variable. Note that you may need to escape the special meaning
of ? in your shell program by putting a backslash in front of it, or by placing the
filename and suffix between quotes or double quotes. The ?varname suffix can also be used
for output grids to specify a variable name different from the default: "z". See
grdconvert and Sections modifiers-for-CF and grid-file-format of the GMT Technical
Reference and Cookbook for more information, particularly on how to read splices of 3-,
4-, or 5-dimensional grids.


To determine the volume in km^3 under the surface hawaii_topo.nc (height in km), use

gmt grdvolume hawaii_topo.nc -Sk

To find the volume between the surface peaks.nc and the contour z = 250, use

gmt grdvolume peaks.nc -Sk -C250

To search for the contour, between 100 and 300 in steps of 10, that maximizes the ratio of
volume to surface area for the file peaks.nc, use

gmt grdvolume peaks.nc -Sk -C100/300/10 -Th > results.d

To see the areas and volumes for all the contours in the previous example, use

gmt grdvolume peaks.nc -Sk -C100/300/10 > results.d

To find the volume of water in a lake with its free surface at 0 and max depth of 300
meters, use

gmt grdvolume lake.nc -Cr-300/0


grdvolume distinguishes between gridline and pixel-registered grids. In both cases the
area and volume are computed up to the grid boundaries. That means that in the first case
the grid cells on the boundary only contribute half their area (and volume), whereas in
the second case all grid cells are fully used. The exception is when the -C flag is used:
since contours do not extend beyond the outermost grid point, both grid types are treated
the same. That means the outer rim in pixel oriented grids is ignored when using the -C

Use grdvolumegmt online using onworks.net services

Free Servers & Workstations

Download Windows & Linux apps

  • 1
    Laravel is a free, open-source PHP web
    framework. Features:Expressive,
    beautiful syntax.Database agnostic
    migrationsSchema builderPainless
    routingPowerful queu...
    Download Laravel
  • 2
    nmon for Linux
    nmon for Linux
    nmon is short for Nigel's
    Performance Monitor It either shows you
    the stats on-screen updating once a
    second or saves the data to a CSV file
    for later anal...
    Download nmon for Linux
  • 3
    zsh is a shell probably most similar to
    ksh, but with countless enhancements and
    differences.. Features:Advanced command
    line interfaceAdaptable line editingPo...
    Download zsh
  • 4
    VBA-M (Archived - Now on Github)
    VBA-M (Archived - Now on Github)
    Project has moved to
    Features:Cheat creationsave statesmulti
    system, supports gba, gbc, gb, sgb,
    Download VBA-M (Archived - Now on Github)
  • 5
    Linux System Optimizer and Monitoring
    Github Repository:
    Audience: End Users/Desktop. User
    interface: Qt. Programming La...
    Download Stacer
  • 6
    Fork of TeamWinRecoveryProject(TWRP)
    with many additional functions, redesign
    and more Features:Supports Treble and
    non-Treble ROMsUp-to-date Oreo kernel,
    Download OrangeFox
  • 7
    itop - ITSM  CMDB OpenSource
    itop - ITSM CMDB OpenSource
    IT Operations Portal: a complete open
    source, ITIL, web based service
    management tool including a fully
    customizable CMDB, a helpdesk system and
    a document man...
    Download itop - ITSM CMDB OpenSource
  • More »

Linux commands

  • 1
    aajm - ascii art jugglemaster ...
    Run aajm
  • 2
    aalib-config - script to get
    information about the installed version
    of aalib ...
    Run aalib-config
  • 3
    coqmktop - The Coq Proof Assistant
    user-tactics linker ...
    Run coqmktop
  • 4
    coqtop - The Coq Proof Assistant
    toplevel system ...
    Run coqtop
  • 5
    Gatos - ATI-TV for GNU/Linux
    and Overlay Software) is an effort to
    create standard drivers for all
    currently unsupported...
    Run gatos
  • 6
    gattrib - gEDA/gaf Schematic Attribute
    Editor ...
    Run gattrib
  • More »