source: XIOS/dev/XIOS_DEV_CMIP6/src/node/reduce_domain_to_scalar.cpp @ 1313

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

Add "local" attribute to reduce_domain_to_scalar transformation. The reduction is only apply on local domain.

YM

File size: 1.7 KB
Line 
1#include "reduce_domain_to_scalar.hpp"
2#include "type.hpp"
3
4namespace xios {
5
6  /// ////////////////////// Définitions ////////////////////// ///
7
8  CReduceDomainToScalar::CReduceDomainToScalar(void)
9    : CObjectTemplate<CReduceDomainToScalar>(), CReduceDomainToScalarAttributes(), CTransformation<CScalar>()
10  { /* Ne rien faire de plus */ }
11
12  CReduceDomainToScalar::CReduceDomainToScalar(const StdString & id)
13    : CObjectTemplate<CReduceDomainToScalar>(id), CReduceDomainToScalarAttributes(), CTransformation<CScalar>()
14  { /* Ne rien faire de plus */ }
15
16  CReduceDomainToScalar::~CReduceDomainToScalar(void)
17  {}
18
19  CTransformation<CScalar>* CReduceDomainToScalar::create(const StdString& id, xml::CXMLNode* node)
20  {
21    CReduceDomainToScalar* reduceDomain = CReduceDomainToScalarGroup::get("reduce_domain_to_scalar_definition")->createChild(id);
22    if (node) reduceDomain->parse(*node);
23    return static_cast<CTransformation<CScalar>*>(reduceDomain);
24  }
25
26  bool CReduceDomainToScalar::registerTrans()
27  {
28    return registerTransformation(TRANS_REDUCE_DOMAIN_TO_SCALAR, CReduceDomainToScalar::create);
29  }
30
31  bool CReduceDomainToScalar::_dummyRegistered = CReduceDomainToScalar::registerTrans();
32
33  //----------------------------------------------------------------
34
35  StdString CReduceDomainToScalar::GetName(void)    { return StdString("reduce_domain_to_scalar"); }
36  StdString CReduceDomainToScalar::GetDefName(void) { return StdString("reduce_domain_to_scalar"); }
37  ENodeType CReduceDomainToScalar::GetType(void)    { return eReduceDomainToScalar; }
38
39  void CReduceDomainToScalar::checkValid(CScalar* scalarDst, CDomain* domainSrc)
40  {
41    if (this->local.isEmpty()) local=false ;
42  }
43
44}
Note: See TracBrowser for help on using the repository browser.