Changeset 1314


Ignore:
Timestamp:
10/24/17 11:27:52 (3 years ago)
Author:
ymipsl
Message:

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

Location:
XIOS/dev/XIOS_DEV_CMIP6/src
Files:
10 added
19 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/XIOS_DEV_CMIP6/src/config/node_type.conf

    r1301 r1314  
    6868 
    6969#ifdef __XIOS_CReduceAxisToAxis__ 
    70    DECLARE_NODE(ReduceAxisToAxis, reduce_domain) 
     70   DECLARE_NODE(ReduceAxisToAxis, reduce_axis_to_axis) 
    7171#endif //__XIOS_CReduceAxisToAxis__ 
    7272 
     
    9595#endif //__XIOS_CTemporalSplitting__ 
    9696 
     97#ifdef __XIOS_CDuplicateScalarToAxis__ 
     98   DECLARE_NODE(DuplicateScalarToAxis, duplicate_scalar_to_axis) 
     99#endif //__XIOS_CDuplicateScalarToAxis__ 
     100 
     101#ifdef __XIOS_CReduceScalarToScalar__ 
     102   DECLARE_NODE(ReduceScalarToScalar, reduce_scalar_to_scalar) 
     103#endif //__XIOS_CReduceScalarToScalar_ 
     104 
    97105#ifdef __XIOS_CContext__ 
    98106   DECLARE_NODE_PAR(Context, context) 
  • XIOS/dev/XIOS_DEV_CMIP6/src/config/reduce_axis_to_axis_attribute.conf

    r1301 r1314  
    11DECLARE_ENUM4(operation, min, max, sum, average) 
    2  
    3 /* Direction to apply operation (i, j) */ 
    4 DECLARE_ATTRIBUTE(bool, local) 
  • XIOS/dev/XIOS_DEV_CMIP6/src/generate_fortran_interface.cpp

    r1301 r1314  
    4747  CExtractAxisToScalar extractAxisToScalar; 
    4848  CReduceDomainToScalar reduceDomainToScalar; 
     49  CDuplicateScalarToAxis duplicateScalarToAxis; 
     50  CReduceScalarToScalar reduceScalarToScalar; 
    4951   
    5052  ostringstream oss; 
     
    344346  file.close(); 
    345347  
    346   file.open((path+"reduce_domain_to_axis_interface_attr.F90").c_str()); 
    347   reduceDomainToAxis.generateFortran2003Interface(file); 
    348   file.close(); 
    349  
    350348  file.open((path+"icreduce_domain_to_axis_attr.cpp").c_str()); 
    351349  reduceDomainToAxis.generateCInterface(file); 
     
    360358  file.close(); 
    361359  
    362   file.open((path+"reduce_axis_to_axis_interface_attr.F90").c_str()); 
    363   reduceAxisToAxis.generateFortran2003Interface(file); 
    364   file.close(); 
    365  
    366360  file.open((path+"icreduce_axis_to_axis_attr.cpp").c_str()); 
    367361  reduceAxisToAxis.generateCInterface(file); 
     
    376370  file.close(); 
    377371 
     372  file.open((path+"icextract_domain_to_axis_attr.cpp").c_str()); 
     373  extractDomainToAxis.generateCInterface(file); 
     374  file.close(); 
     375 
     376  file.open((path+"iextract_domain_to_axis_attr.F90").c_str()); 
     377  extractDomainToAxis.generateFortranInterface(file); 
     378  file.close(); 
     379 
     380 
    378381  file.open((path+"temporal_splitting_interface_attr.F90").c_str()); 
    379382  temporalSplitting.generateFortran2003Interface(file); 
    380383  file.close(); 
    381384 
    382   file.open((path+"icextract_domain_to_axis_attr.cpp").c_str()); 
    383   extractDomainToAxis.generateCInterface(file); 
    384   file.close(); 
    385  
    386385  file.open((path+"ictemporal_splitting_attr.cpp").c_str()); 
    387386  temporalSplitting.generateCInterface(file); 
    388387  file.close(); 
    389388 
    390   file.open((path+"iextract_domain_to_axis_attr.F90").c_str()); 
    391   extractDomainToAxis.generateFortranInterface(file); 
    392   file.close(); 
    393  
    394389  file.open((path+"itemporal_splitting_attr.F90").c_str()); 
    395390  temporalSplitting.generateFortranInterface(file); 
     
    397392 
    398393 
     394  file.open((path+"duplicate_scalar_to_axis_interface_attr.F90").c_str()); 
     395  duplicateScalarToAxis.generateFortran2003Interface(file); 
     396  file.close(); 
     397   
     398  file.open((path+"icduplicate_scalar_to_axis_attr.cpp").c_str()); 
     399  duplicateScalarToAxis.generateCInterface(file); 
     400  file.close(); 
     401   
     402  file.open((path+"iduplicate_scalar_to_axis_attr.F90").c_str()); 
     403  duplicateScalarToAxis.generateFortranInterface(file); 
     404  file.close(); 
    399405  /*! 
    400406    Scalar transformations 
     
    424430  file.close(); 
    425431 
     432 
    426433  file.open((path+"reduce_domain_to_scalar_interface_attr.F90").c_str()); 
    427434  reduceDomainToScalar.generateFortran2003Interface(file); 
    428435  file.close(); 
    429436 
    430   file.open((path+"temporal_splitting_interface_attr.F90").c_str()); 
    431   temporalSplitting.generateFortran2003Interface(file); 
    432   file.close(); 
    433  
    434437  file.open((path+"icreduce_domain_to_scalar_attr.cpp").c_str()); 
    435438  reduceDomainToScalar.generateCInterface(file); 
     
    440443  file.close(); 
    441444 
     445 
     446  file.open((path+"reduce_scalar_to_scalar_interface_attr.F90").c_str()); 
     447  reduceScalarToScalar.generateFortran2003Interface(file); 
     448  file.close(); 
     449 
     450  file.open((path+"icreduce_scalar_to_scalar_attr.cpp").c_str()); 
     451  reduceScalarToScalar.generateCInterface(file); 
     452  file.close(); 
     453 
     454  file.open((path+"ireduce_scalar_to_scalar_attr.F90").c_str()); 
     455  reduceScalarToScalar.generateFortranInterface(file); 
     456  file.close(); 
     457 
     458 
     459 
     460 
     461 
    442462  file.open((path+"context_interface_attr.F90").c_str()); 
    443463  context->generateFortran2003Interface(file); 
  • XIOS/dev/XIOS_DEV_CMIP6/src/group_factory_decl.cpp

    r1301 r1314  
    4141  macro(CReduceDomainToScalarGroup) 
    4242  macro(CTemporalSplittingGroup) 
     43  macro(CDuplicateScalarToAxisGroup) 
     44  macro(CReduceScalarToScalarGroup) 
    4345 
    4446} 
  • XIOS/dev/XIOS_DEV_CMIP6/src/group_template_decl.cpp

    r1301 r1314  
    3030  macro(ReduceDomainToScalar) 
    3131  macro(TemporalSplitting) 
     32  macro(DuplicateScalarToAxis) 
     33  macro(ReduceScalarToScalar) 
    3234} 
  • XIOS/dev/XIOS_DEV_CMIP6/src/node/axis.cpp

    r1301 r1314  
    5454     m["extract_domain"] = TRANS_EXTRACT_DOMAIN_TO_AXIS; 
    5555     m["temporal_splitting"] = TRANS_TEMPORAL_SPLITTING; 
     56     m["duplicate_scalar"] = TRANS_DUPLICATE_SCALAR_TO_AXIS; 
     57 
    5658   } 
    5759 
  • XIOS/dev/XIOS_DEV_CMIP6/src/node/node_enum.hpp

    r1301 r1314  
    3535         eExtractAxisToScalar, 
    3636         eReduceDomainToScalar, 
    37          eTemporalSplitting 
    38       } ENodeType; 
     37         eTemporalSplitting, 
     38         eDuplicateScalarToAxis, 
     39         eReduceScalarToScalar 
     40       } ENodeType; 
    3941 
    4042} // namespace xios 
  • XIOS/dev/XIOS_DEV_CMIP6/src/node/node_type.hpp

    r1301 r1314  
    2626#include "reduce_domain_to_scalar.hpp" 
    2727#include "temporal_splitting.hpp" 
     28#include "duplicate_scalar_to_axis.hpp" 
     29#include "reduce_scalar_to_scalar.hpp" 
    2830 
    2931 
  • XIOS/dev/XIOS_DEV_CMIP6/src/node/reduce_axis_to_axis.cpp

    r1301 r1314  
    4747             << "Axis destination " << axisDst->getId()); 
    4848 
    49     if (this->local.isEmpty()) local=false ; 
    5049 
    5150    if (axisDst->n_glo != axisSrc->n_glo) 
  • XIOS/dev/XIOS_DEV_CMIP6/src/node/scalar.cpp

    r1158 r1314  
    3434     m["extract_axis"]  = TRANS_EXTRACT_AXIS_TO_SCALAR; 
    3535     m["reduce_domain"] = TRANS_REDUCE_DOMAIN_TO_SCALAR; 
     36     m["reduce_scalar"] = TRANS_REDUCE_SCALAR_TO_SCALAR; 
    3637   } 
    3738 
  • XIOS/dev/XIOS_DEV_CMIP6/src/node/transformation_enum.hpp

    r1301 r1314  
    2222        TRANS_TEMPORAL_SPLITTING = 13, 
    2323        TRANS_REDUCE_AXIS_TO_AXIS = 14, 
     24        TRANS_DUPLICATE_SCALAR_TO_AXIS = 15, 
     25        TRANS_REDUCE_SCALAR_TO_SCALAR = 16, 
    2426      } ETranformationType; 
    2527 
  • XIOS/dev/XIOS_DEV_CMIP6/src/object_factory_decl.cpp

    r1301 r1314  
    4242  macro(CReduceDomainToScalar) 
    4343  macro(CTemporalSplitting) 
     44  macro(CDuplicateScalarToAxis) 
     45  macro(CReduceScalarToScalar) 
    4446 
    4547  macro(CFieldGroup) 
     
    6668  macro(CReduceDomainToScalarGroup) 
    6769  macro(CTemporalSplittingGroup) 
     70  macro(CDuplicateScalarToAxisGroup) 
     71  macro(CReduceScalarToScalarGroup) 
     72 
    6873} 
  • XIOS/dev/XIOS_DEV_CMIP6/src/object_template_decl.cpp

    r1301 r1314  
    2929  template class CObjectTemplate<CReduceDomainToScalar>; 
    3030  template class CObjectTemplate<CTemporalSplitting>; 
     31  template class CObjectTemplate<CDuplicateScalarToAxis>; 
     32  template class CObjectTemplate<CReduceScalarToScalar>; 
    3133 
    3234  template class CObjectTemplate<CContextGroup>; 
     
    5355  template class CObjectTemplate<CReduceDomainToScalarGroup>; 
    5456  template class CObjectTemplate<CTemporalSplittingGroup>; 
     57  template class CObjectTemplate<CDuplicateScalarToAxisGroup>; 
     58  template class CObjectTemplate<CReduceScalarToScalarGroup>; 
     59 
    5560} 
  • XIOS/dev/XIOS_DEV_CMIP6/src/transformation/algo_types.hpp

    r1301 r1314  
    2727#include "domain_algorithm_compute_connectivity.hpp" 
    2828#include "domain_algorithm_expand.hpp" 
     29#include "axis_algorithm_duplicate_scalar.hpp" 
     30#include "scalar_algorithm_reduce_scalar.hpp" 
    2931 
    3032 
  • XIOS/dev/XIOS_DEV_CMIP6/src/transformation/axis_algorithm_reduce_axis.cpp

    r1301 r1314  
    7070 
    7171  reduction_ = CReductionAlgorithm::createOperation(CReductionAlgorithm::ReductionOperations[op]); 
    72   local = algo->local ; 
    7372} 
    7473 
  • XIOS/dev/XIOS_DEV_CMIP6/src/transformation/axis_algorithm_reduce_axis.hpp

    r1301 r1314  
    4040  static bool registerTrans(); 
    4141protected: 
    42   bool local ; 
    4342   
    4443protected: 
  • XIOS/dev/XIOS_DEV_CMIP6/src/transformation/grid_transformation_selector.cpp

    r1301 r1314  
    2222  CScalarAlgorithmExtractAxis::registerTrans(); 
    2323  CScalarAlgorithmReduceDomain::registerTrans(); 
     24  CScalarAlgorithmReduceScalar::registerTrans(); 
    2425 
    2526  //! Axis 
     
    3132  CAxisAlgorithmReduceAxis::registerTrans(); 
    3233  CAxisAlgorithmTemporalSplitting::registerTrans(); 
     34  CAxisAlgorithmDuplicateScalar::registerTrans(); 
    3335 
    3436  //! Domain 
  • XIOS/dev/XIOS_DEV_CMIP6/src/type/type_util.hpp

    r1301 r1314  
    5252    class CTemporalSplitting; 
    5353    class CTemporalSplittingGroup; 
    54      
     54    class CDuplicateScalarToAxis; 
     55    class CDuplicateScalarToAxisGroup; 
     56    class CReduceScalarToScalar; 
     57    class CReduceScalarToScalarGroup; 
     58   
    5559  template <typename T> inline string getStrType(void); 
    5660 
     
    120124  macro(CTemporalSplitting) 
    121125  macro(CTemporalSplittingGroup) 
     126  macro(CDuplicateScalarToAxis) 
     127  macro(CDuplicateScalarToAxisGroup) 
     128  macro(CReduceScalarToScalar) 
     129  macro(CReduceScalarToScalarGroup) 
    122130   
    123131#undef macro 
  • XIOS/dev/XIOS_DEV_CMIP6/src/xml_parser_decl.cpp

    r1301 r1314  
    3535    macro( ReduceDomainToScalar ) 
    3636    macro( TemporalSplitting ) 
     37    macro( DuplicateScalarToAxis ) 
     38    macro( ReduceScalarToScalar ) 
    3739  } 
    3840} 
Note: See TracChangeset for help on using the changeset viewer.