PISM, A Parallel Ice Sheet Model
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
pism::File Class Reference

High-level PISM I/O class. More...

#include <File.hh>

Classes

struct  Impl
 

Public Member Functions

 File (MPI_Comm com, const std::string &filename, IO_Backend backend, IO_Mode mode, int iosysid=-1)
 
 ~File ()
 
IO_Backend backend () const
 
MPI_Comm com () const
 
void close ()
 
void redef () const
 
void enddef () const
 
void sync () const
 
std::string filename () const
 
unsigned int nrecords () const
 Get the number of records. Uses the length of an unlimited dimension. More...
 
unsigned int nrecords (const std::string &name, const std::string &std_name, units::System::Ptr unit_system) const
 Get the number of records of a certain variable. Uses the length of an associated "time" dimension. More...
 
unsigned int nvariables () const
 
unsigned int nattributes (const std::string &var_name) const
 
void define_dimension (const std::string &name, size_t length) const
 
unsigned int dimension_length (const std::string &name) const
 Get the length of a dimension. More...
 
std::vector< std::string > dimensions (const std::string &variable_name) const
 
bool find_dimension (const std::string &name) const
 Checks if a dimension exists. More...
 
AxisType dimension_type (const std::string &name, units::System::Ptr unit_system) const
 Get the "type" of a dimension. More...
 
std::vector< double > read_dimension (const std::string &name) const
 Get dimension data (a coordinate variable). More...
 
std::string variable_name (unsigned int id) const
 
void define_variable (const std::string &name, IO_Type nctype, const std::vector< std::string > &dims) const
 Define a variable. More...
 
VariableLookupData find_variable (const std::string &short_name, const std::string &std_name) const
 Find a variable using its standard name and/or short name. More...
 
bool find_variable (const std::string &short_name) const
 Checks if a variable exists. More...
 
void read_variable (const std::string &variable_name, const std::vector< unsigned int > &start, const std::vector< unsigned int > &count, double *ip) const
 
void read_variable_transposed (const std::string &variable_name, const std::vector< unsigned int > &start, const std::vector< unsigned int > &count, const std::vector< unsigned int > &imap, double *ip) const
 
void write_variable (const std::string &variable_name, const std::vector< unsigned int > &start, const std::vector< unsigned int > &count, const double *op) const
 
void write_distributed_array (const std::string &variable_name, const IceGrid &grid, unsigned int z_count, const double *input) const
 
void set_compression_level (int level) const
 
void remove_attribute (const std::string &variable_name, const std::string &att_name) const
 
std::string attribute_name (const std::string &var_name, unsigned int n) const
 
IO_Type attribute_type (const std::string &var_name, const std::string &att_name) const
 
void write_attribute (const std::string &var_name, const std::string &att_name, IO_Type nctype, const std::vector< double > &values) const
 Write a multiple-valued double attribute. More...
 
void write_attribute (const std::string &var_name, const std::string &att_name, const std::string &value) const
 Write a text attribute. More...
 
std::vector< double > read_double_attribute (const std::string &var_name, const std::string &att_name) const
 Get a double attribute. More...
 
std::string read_text_attribute (const std::string &var_name, const std::string &att_name) const
 Get a text attribute. More...
 
void append_history (const std::string &history) const
 Append to the history global attribute. More...
 

Private Member Functions

void open (const std::string &filename, IO_Mode mode)
 
 File (const File &other)
 
Fileoperator= (const File &)
 

Private Attributes

Implm_impl
 

Detailed Description

High-level PISM I/O class.

Hides the low-level NetCDF wrapper.

Definition at line 50 of file File.hh.


The documentation for this class was generated from the following files: