19 #ifndef _PISM_FILE_ACCESS_H_
20 #define _PISM_FILE_ACCESS_H_
26 #include "pism/util/Units.hh"
27 #include "pism/util/io/IO_Flags.hh"
73 unsigned int nrecords(
const std::string &name,
const std::string &std_name,
78 unsigned int nattributes(
const std::string &var_name)
const;
100 const std::vector<std::string> &dims)
const;
107 const std::vector<unsigned int> &start,
108 const std::vector<unsigned int> &
count,
112 const std::vector<unsigned int> &start,
113 const std::vector<unsigned int> &
count,
114 const std::vector<unsigned int> &imap,
double *ip)
const;
117 const std::vector<unsigned int> &start,
118 const std::vector<unsigned int> &
count,
119 const double *op)
const;
123 unsigned int z_count,
125 const double *input)
const;
133 std::string
attribute_name(
const std::string &var_name,
unsigned int n)
const;
137 void write_attribute(
const std::string &var_name,
const std::string &att_name,
138 IO_Type nctype,
const std::vector<double> &values)
const;
140 void write_attribute(
const std::string &var_name,
const std::string &att_name,
141 const std::string &value)
const;
144 const std::string &att_name)
const;
146 std::string
read_text_attribute(
const std::string &var_name,
const std::string &att_name)
const;
bool find_dimension(const std::string &name) const
Checks if a dimension exists.
unsigned int nvariables() const
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 define_dimension(const std::string &name, size_t length) const
std::string attribute_name(const std::string &var_name, unsigned int n) const
AxisType dimension_type(const std::string &name, units::System::Ptr unit_system) const
Get the "type" of a dimension.
void set_compression_level(int level) const
void define_variable(const std::string &name, IO_Type nctype, const std::vector< std::string > &dims) const
Define a variable.
File(MPI_Comm com, const std::string &filename, IO_Backend backend, IO_Mode mode, int iosysid=-1)
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.
unsigned int nrecords() const
Get the number of records. Uses the length of an unlimited dimension.
std::string variable_name(unsigned int id) const
std::string filename() 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 remove_attribute(const std::string &variable_name, const std::string &att_name) const
std::vector< double > read_double_attribute(const std::string &var_name, const std::string &att_name) const
Get a double attribute.
void open(const std::string &filename, IO_Mode mode)
IO_Backend backend() const
unsigned int nattributes(const std::string &var_name) const
void append_history(const std::string &history) const
Append to the history global attribute.
void write_distributed_array(const std::string &variable_name, const IceGrid &grid, unsigned int z_count, bool time_dependent, const double *input) 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.
unsigned int dimension_length(const std::string &name) const
Get the length of a dimension.
std::vector< double > read_dimension(const std::string &name) const
Get dimension data (a coordinate variable).
IO_Type attribute_type(const std::string &var_name, const std::string &att_name) const
std::vector< std::string > dimensions(const std::string &variable_name) const
std::string read_text_attribute(const std::string &var_name, const std::string &att_name) const
Get a text attribute.
File & operator=(const File &)
High-level PISM I/O class.
Describes the PISM grid and the distribution of data across processors.
std::shared_ptr< System > Ptr
IO_Backend string_to_backend(const std::string &backend)
bool found_using_standard_name