PISM, A Parallel Ice Sheet Model  stable v1.2 committed by Constantine Khrulev on 2020-02-11 20:24:05 -0900
Public Types | Public Member Functions | Protected Attributes | Private Attributes | List of all members
pism::VariableMetadata Class Reference

A class for handling variable metadata, reading, writing and converting from input units and to output units. More...

#include <VariableMetadata.hh>

+ Inheritance diagram for pism::VariableMetadata:

Public Types

typedef std::map< std::string, std::string > StringAttrs
 
typedef std::map< std::string, std::vector< double > > DoubleAttrs
 

Public Member Functions

 VariableMetadata (const std::string &name, units::System::Ptr system, unsigned int ndims=0)
 
virtual ~VariableMetadata ()
 
void set_number (const std::string &name, double value)
 Set a scalar attribute to a single (scalar) value. More...
 
void set_numbers (const std::string &name, const std::vector< double > &values)
 Set a scalar attribute to a single (scalar) value. More...
 
void set_name (const std::string &name)
 
void set_string (const std::string &name, const std::string &value)
 Set a string attribute. More...
 
void set_time_independent (bool flag)
 
void set_output_type (IO_Type type)
 
void clear_all_doubles ()
 
void clear_all_strings ()
 
units::System::Ptr unit_system () const
 
double get_number (const std::string &name) const
 Get a single-valued scalar attribute. More...
 
std::vector< doubleget_numbers (const std::string &name) const
 Get an array-of-doubles attribute. More...
 
std::string get_name () const
 
std::string get_string (const std::string &name) const
 Get a string attribute. More...
 
unsigned int get_n_spatial_dimensions () const
 
bool has_attribute (const std::string &name) const
 
bool has_attributes () const
 
bool get_time_independent () const
 
IO_Type get_output_type () const
 
const StringAttrsget_all_strings () const
 
const DoubleAttrsget_all_doubles () const
 
void report_to_stdout (const Logger &log, int verbosity_threshold) const
 
void check_range (const std::string &filename, double min, double max)
 Check if the range [min, max] is a subset of [valid_min, valid_max]. More...
 
void report_range (const Logger &log, double min, double max, bool found_by_standard_name)
 Report the range of a global Vec v. More...
 

Protected Attributes

unsigned int m_n_spatial_dims
 

Private Attributes

units::System::Ptr m_unit_system
 The unit system to use. More...
 
std::map< std::string, std::string > m_strings
 string and boolean attributes More...
 
std::map< std::string, std::vector< double > > m_doubles
 scalar and array attributes More...
 
std::string m_short_name
 
bool m_time_independent
 
IO_Type m_output_type
 

Detailed Description

A class for handling variable metadata, reading, writing and converting from input units and to output units.

A NetCDF variable can have any number of attributes, but some of them get special treatment:

Also:

Typical attributes stored here:

Use the name of "PISM_GLOBAL" to read and write global attributes. (See also File.)

Definition at line 70 of file VariableMetadata.hh.


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