19#ifndef _PISM_FILE_ACCESS_H_
20#define _PISM_FILE_ACCESS_H_
26#include "pism/util/Units.hh"
70 std::string
name()
const;
74 unsigned int nrecords(
const std::string &
name,
const std::string &std_name,
79 unsigned int nattributes(
const std::string &var_name)
const;
99 const std::vector<std::string> &dims)
const;
106 const std::vector<unsigned int> &start,
107 const std::vector<unsigned int> &
count,
111 const std::vector<unsigned int> &start,
112 const std::vector<unsigned int> &
count,
113 const double *op)
const;
120 unsigned int z_count,
122 const double *input)
const;
130 std::string
attribute_name(
const std::string &var_name,
unsigned int n)
const;
134 void write_attribute(
const std::string &var_name,
const std::string &att_name,
135 io::Type nctype,
const std::vector<double> &values)
const;
137 void write_attribute(
const std::string &var_name,
const std::string &att_name,
138 const std::string &value)
const;
141 const std::string &att_name)
const;
143 std::string
read_text_attribute(
const std::string &var_name,
const std::string &att_name)
const;
bool dimension_exists(const std::string &name) const
Checks if a dimension exists.
unsigned int nvariables() const
void write_distributed_array(const std::string &variable_name, const Grid &grid, unsigned int z_count, bool time_dependent, const double *input) 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 define_dimension(const std::string &name, size_t length) const
std::string attribute_name(const std::string &var_name, unsigned int n) const
File & operator=(const File &)
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 open(const std::string &filename, io::Mode mode)
void set_variable_was_written(const std::string &name) const
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
bool variable_exists(const std::string &short_name) const
Checks if a variable exists.
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 define_variable(const std::string &name, io::Type nctype, const std::vector< std::string > &dims) const
Define a variable.
io::Type attribute_type(const std::string &var_name, const std::string &att_name) const
void remove_attribute(const std::string &variable_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.
std::vector< double > read_double_attribute(const std::string &var_name, const std::string &att_name) const
Get a double attribute.
bool get_variable_was_written(const std::string &name) const
unsigned int nattributes(const std::string &var_name) const
void append_history(const std::string &history) const
Append to the history global attribute.
unsigned int dimension_length(const std::string &name) const
Get the length of a dimension.
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.
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)