source: XIOS/dev/XIOS_DEV_CMIP6/src/node/reduce_scalar_to_scalar.cpp @ 1314

Last change on this file since 1314 was 1314, checked in by ymipsl, 3 years ago

Add 2 new spatial transformations :

  • reduce_scalar_to_scalar : global reduction between scalar
  • duplicate_scalar_to_axis : a scalar value is duplicated on each level of the axis.

YM

  • Property svn:eol-style set to native
File size: 1.6 KB
RevLine 
[1314]1#include "reduce_scalar_to_scalar.hpp"
2#include "type.hpp"
3
4namespace xios {
5
6  /// ////////////////////// Définitions ////////////////////// ///
7
8  CReduceScalarToScalar::CReduceScalarToScalar(void)
9    : CObjectTemplate<CReduceScalarToScalar>(), CReduceScalarToScalarAttributes(), CTransformation<CScalar>()
10  { /* Ne rien faire de plus */ }
11
12  CReduceScalarToScalar::CReduceScalarToScalar(const StdString & id)
13    : CObjectTemplate<CReduceScalarToScalar>(id), CReduceScalarToScalarAttributes(), CTransformation<CScalar>()
14  { /* Ne rien faire de plus */ }
15
16  CReduceScalarToScalar::~CReduceScalarToScalar(void)
17  {}
18
19  CTransformation<CScalar>* CReduceScalarToScalar::create(const StdString& id, xml::CXMLNode* node)
20  {
21    CReduceScalarToScalar* reduceScalar = CReduceScalarToScalarGroup::get("reduce_scalar_to_scalar_definition")->createChild(id);
22    if (node) reduceScalar->parse(*node);
23    return static_cast<CTransformation<CScalar>*>(reduceScalar);
24  }
25
26  bool CReduceScalarToScalar::registerTrans()
27  {
28    return registerTransformation(TRANS_REDUCE_SCALAR_TO_SCALAR, CReduceScalarToScalar::create);
29  }
30
31  bool CReduceScalarToScalar::_dummyRegistered = CReduceScalarToScalar::registerTrans();
32
33  //----------------------------------------------------------------
34
35  StdString CReduceScalarToScalar::GetName(void)    { return StdString("reduce_scalar_to_scalar"); }
36  StdString CReduceScalarToScalar::GetDefName(void) { return StdString("reduce_scalar_to_scalar"); }
37  ENodeType CReduceScalarToScalar::GetType(void)    { return eReduceScalarToScalar; }
38
39  void CReduceScalarToScalar::checkValid(CScalar* scalarDst)
40  {
41  }
42
43}
Note: See TracBrowser for help on using the repository browser.