# module NumRu::GPhys::Grib_IO

helps read Grib-formatted data

## Module functions

#### `is_a_Grib? filename)`

  test whether the file is a Grib file.

  ARGUMENTS

  - filename (String): filename to test.

  RETURN VALUE

  - true/false

#### `open(file, varname)`

  GPhys constructor from Grib.

  ARGUMENTS

  - file (Grib or String): file to read. If string, it must be the name (path) of a Grib file.
  - varname (String): name of the varible in the file, for which a GPhys object is constructed.

  RETURN VALUE

  - a GPhys

  EXAMPLE

  - Suppose that you have a file temp in the currentdirectly, and it contains a variable "T". The following creates a GPhys object representing the variable in the file.

        require "numru/gphys"
        include GPhys
        temp = GPhys::Grib_IO.open("temp","T")

#### `write(file, gphys, name_dummy=nil)`

  Write a GPhys into a Grib file. The whole data under the GPhys (such as coordinate vars) are written self-descriptively.

  ARGUMENTS

  - file (Grib): the Grib file to write in. Must be writable of course.
  - gphys (GPhys): the GPhys to write.
  - name_dummy (nil) : Unused in this module; Just for consistency with others.

  RETURN VALUE

  - nil

#### `var_names(file)`

  ARGUMENTS

  - file (Grib or String): if string, it must be the name (path) of a Grib file.

  RETURN VALUE

  - names of variables (Array): this return the names of variables which the file has.

#### `var_names_except_coordinates(file)`

  - same as var_names