module NumRu::GPhys::IO

A module to handle file IO regarding GPhys.

Many of the functionality of this module is implemented in the modules for specific file types such as NumRu::GPhys::NetCDF_IO, to which this module directs operations.

For example, GPhys::IO.open(file, name) simply calls GPhys::*_IO.open(file, name), where '*' is NetCDF, GrADS, or grib.

Module functions

open(file, varname)

Opens a GPhys in file having the name varname.

ARGUMENTS

RETURN VALUE

open_multi(files, varname)

Opens a GPhys by combining a variable across multiple files. It initializes GPhys objects over the files by calling open and unites them into a single GPhys object by using GPhys.join or GPhys.join_md.

ARGUMENTS

RETURN VALUE

write(file, gphys, name=nil)

Writes a GPhys object in a file

ARGUMENTS

write_grid(file, grid_or_gphys)

each_along_dims_write(gphyses, files, *loopdims){...} # a block is expected

var_names(file)

var_names_except_coordinates(file)

See the manual of NumRu::GPhys::NetCDF_IO for the methods listed above.

file2type(file)

Figures out the file type supported in this module.

ARGUMENTS

RETURN VALUE

file2specific_module(file)

Same as file2type, but returns GPhys::NetCDF_IO, GPhys::GrADS_IO, or GPhys::Grib_IO.

file2file_class(file)

Same as file2type, but returns NetCDF, GrADS_Gridded, or Grib.

parse_gturl(gturl)

Parses GTOOL4-type URLs to specify path, variable name, and optionally subsets, whose format is path[@|/]varname[,dimname=pos1[:pos2[:thinning_intv]][,dimname=...]]

ARGUMENTS

RETURN VALUES

open_gturl(gturl)

a GPhys constructor from a Gtool4-type URL. See parse_gturl for its format.

RETURN VALUE

str2gphys(str)

Open a GPhys from a slash("/")-separated String such as "U.nc/U" and "U.nc".

ARGUMENTS

RETURN VALUE

Module constants

GTURLfmt

The format of Gtool4URL.