# Reference manuals of the GPhys library

## Highlight

Core part of the GPhys class

- class NumRu::GPhys
- See also the entire GPhys Core Part section.

Visualization library

- module NumRu::GGraph

Application Commands

---------------------------------------------------------------------

## GPhys and its components

#### GPhys Core Part

A GPhys object has the following structure:

    -
               has 1
    a GPhys --------- array-like data (VArray)
             | has 1
             --------- grid (Grid)
                         |  has rank
                         ------------ axis (Axis)
                                       | has 1
                                       -------- 1D position data (VArray)
                                       | has 0..
                                       -------- ancillary data (VArray)

That is, a GPhys object consists of data (whose class is VArray) and grid (whose class is Grid). The latter consists of axes (whose class is Axis), which consist of VArray objects (such as ones that have 1-dimensional grid-point position data). To use GPhys, it is useful to know these four classes.

- class NumRu::VArray : Virtual Array class, which holds multi-dimensional data of various format and media (on memory or in file).
  - class NumRu::VArrayComposite : Subclass of VArray to bundle multiple VArrays by "tiling".
- class NumRu::Axis : A class to represent a discretized physical coordinate.
- class NumRu::Grid : A class to represent discretized grids of physical quantities.
- class NumRu::GPhys : Core part of the GPhys class

#### Miscellaneous Extensions of GPhys

- coordinate transformation : Extension of the NumRu::GPhys class for coordinate transformation.
- FFT : Extension of the NumRu::GPhys class for the Fast Fourier Transformation and its applications
- module NumRu::GPhys::Derivative : Module functions to make differentiation of GPhys objects.
- module NumRu::GPhys::EP_Flux : Module functions to derive the Eliassen-Palm flux and related quantities (such as the residual circulation and its mass stream function).
- interpolation : Interpolation library
- GAnalysis::Met : Meteorological analysis library

#### Miscellaneous Dependent Libraries Distributed with GPhys

- class NumRu::UNumeric : Numeric with units (combination of Numeric and Units)
- module NumRu::Derivative : Module functions to make differentiation using NArray.
- class NumRu::SubsetMapping : Sorry, yet to be written.
- class NumRu::Attribute : A Hash class compatible with NetCDF attributes.
- class NumRu::CoordMapping :
  - class NumRu::LinearCoordMapping :
- class NumRu::GrADS_Gridded : Class to handle GrADS data.
- class NumRu::Grib : a class for GRIB datasets.
- class NumRu::GDir::HtDir : A class to treat the URL of a "directory" as a directory (used in GDir).
- module NumRu::DCLExt : An extension of RubyDCL.

#### External File Handlers of GPhys

- module NumRu::GPhys::IO : GPhys file IO module for all file types.
- module NumRu::GPhys::NetCDF_IO : NetCDF data input/output.
- module NumRu::NetCDF_Conventions, module NumRu::NetCDF_Convention_Users_Guide etc. : NetCDF convention handler.
- module NumRu::GPhys::GrADS_IO : GrADS data input/output.
- module NumRu::GPhys::Grib_IO : GRIB data IO.

## Applications distributed with GPhys

To use the following, you have to require explicitly.

- module NumRu::GGraph : A graphic library using GPhys.
- class NumRu::GDir : A class to represent directories and data files for GPhys.
- irb start-up program gdir_connect_ftp-like A library to be required to interactively connect with a gdir_server.

## Application Commands

- grads2nc_with_gphys file converter from the GrADS format to NetCDF
- gdir_server A dRuby server with a GDir at the front end.
- gdir_client : A client of gdir_server using irb with gdir_connect_ftp-like
- gpcat Read a variable in multiple NetCDF files, concatenate and write them to a single netcdf file.
- gpcut extract, slicing and thinning a GPhys variable
- gplist print out variables and their dimensions
- gpmath operate a math function to a GPhys variable
- gpmaxmin prints maximum and minimum values of a GPhys variable
- gpprint prints the values of a GPhys variable
- gpview visualizer (2D, 1D)