BISICLES AMR ice sheet model  0.9
FieldNames.H
Go to the documentation of this file.
1  #ifdef CH_LANG_CC
2 /*
3 * _______ __
4 * / ___/ / ___ __ _ / / ___
5 * / /__/ _ \/ _ \/ V \/ _ \/ _ \
6 * \___/_//_/\___/_/_/_/_.__/\___/
7 * Please refer to Copyright.txt, in Chombo's root directory.
8 */
9 #endif
10 //===========================================================================
11 // FieldNames.H
12 // Provides a lookup tables between the various field names used in BISICLES
13 // with alternate names, units. The tables themselves (for now) are stored
14 // in ParmParse tables.
15 //===========================================================================
16 #ifndef _FIELDNAMES_H_
17 #define _FIELDNAMES_H_
18 #include "ParmParse.H"
19 #include "NamespaceHeader.H"
20 
21 namespace FieldNames
22 {
23  class CFRecord
24  {
25  std::string m_name; // name of field/variable in e.g netcdf files
26  std::string m_stdname; // standard name (CF)
27  std::string m_longname; // long name (used by CF when there is no standard name)
28  std::string m_units; //
29  Real m_scale; //conversion factor
30  public:
32  CFRecord(const std::string& a_name);
33 
34  const std::string& name() const {return m_name;}
35  const std::string& standardName() const {return m_stdname;}
36  const std::string& longName() const {return m_longname;}
37  const std::string& units() const {return m_units;}
38  Real scale() const {return m_scale;}
39  private:
40  CFRecord(){};
41 
42  };
44  void CFLookup(Vector<CFRecord>& a_records , const Vector<std::string> a_names);
45 
47  void sanitize(std::string& a_name);
48 }
49 
50 #include "NamespaceFooter.H"
51 #endif
const std::string & standardName() const
Definition: FieldNames.H:35
void CFLookup(Vector< CFRecord > &a_records, const Vector< std::string > a_names)
create CFRecords for each element of
Definition: FieldNames.cpp:20
Definition: FieldNames.H:23
const std::string & units() const
Definition: FieldNames.H:37
const std::string & name() const
Definition: FieldNames.H:34
Definition: FieldNames.H:21
const std::string & longName() const
Definition: FieldNames.H:36
void sanitize(std::string &a_name)
remove awkward characters from
Definition: FieldNames.cpp:31
Real scale() const
Definition: FieldNames.H:38