Changeset 1549 for XIOS


Ignore:
Timestamp:
06/25/18 12:12:42 (6 years ago)
Author:
oabramkina
Message:

Adding a new domain transformation "domain_extract".

For now it has only the functionalities of zoom.

Location:
XIOS/trunk/src
Files:
7 added
16 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/config/domain_attribute.conf

    r1493 r1549  
    6262DECLARE_ATTRIBUTE(StdString, domain_ref) 
    6363DECLARE_ATTRIBUTE(int,       prec) 
     64 
     65DECLARE_ATTRIBUTE_PRIVATE(int,  global_zoom_ibegin) 
     66DECLARE_ATTRIBUTE_PRIVATE(int,  global_zoom_ni) 
     67DECLARE_ATTRIBUTE_PRIVATE(int,  global_zoom_jbegin) 
     68DECLARE_ATTRIBUTE_PRIVATE(int,  global_zoom_nj) 
  • XIOS/trunk/src/config/domain_attribute_private.conf

    r1410 r1549  
    2626DECLARE_ARRAY_PRIVATE(double, 2, bounds_latvalue_unstructured_read_from_file) 
    2727 
    28 DECLARE_ATTRIBUTE_PRIVATE(int,  global_zoom_ibegin) 
    29 DECLARE_ATTRIBUTE_PRIVATE(int,  global_zoom_ni) 
    30 DECLARE_ATTRIBUTE_PRIVATE(int,  global_zoom_jbegin) 
    31 DECLARE_ATTRIBUTE_PRIVATE(int,  global_zoom_nj) 
     28//DECLARE_ATTRIBUTE_PRIVATE(int,  global_zoom_ibegin) 
     29//DECLARE_ATTRIBUTE_PRIVATE(int,  global_zoom_ni) 
     30//DECLARE_ATTRIBUTE_PRIVATE(int,  global_zoom_jbegin) 
     31//DECLARE_ATTRIBUTE_PRIVATE(int,  global_zoom_nj) 
    3232 
    3333// Local zoom information 
  • XIOS/trunk/src/config/node_type.conf

    r1457 r1549  
    105105#ifdef __XIOS_CReorderDomain__ 
    106106   DECLARE_NODE(ReorderDomain, reorder_domain) 
    107 #endif //__XIOS_CReduceScalarToScalar_ 
     107#endif //__XIOS_CReorderDomain_ 
     108 
     109#ifdef __XIOS_CExtractDomain__ 
     110   DECLARE_NODE(ExtractDomain, extract_domain) 
     111#endif //__XIOS_CExtractDomain__ 
    108112 
    109113#ifdef __XIOS_CContext__ 
  • XIOS/trunk/src/generate_fortran_interface.cpp

    r1492 r1549  
    3636  CExpandDomain expandDomain; 
    3737  CReorderDomain reorderDomain; 
     38  CExtractDomain extractDomain; 
    3839 
    3940  CInterpolateAxis interpolateAxis; 
     
    315316  reorderDomain.generateFortranInterface(file); 
    316317 
     318  file.open((path+"extract_domain_interface_attr.F90").c_str()); 
     319  extractDomain.generateFortran2003Interface(file); 
     320  file.close(); 
     321 
     322  file.open((path+"icextract_domain_attr.cpp").c_str()); 
     323  extractDomain.generateCInterface(file); 
     324  file.close(); 
     325 
     326  file.open((path+"iextract_domain_attr.F90").c_str()); 
     327  extractDomain.generateFortranInterface(file); 
     328 
    317329  file.close(); 
    318330   
  • XIOS/trunk/src/group_factory_decl.cpp

    r1542 r1549  
    4444  macro(CReduceScalarToScalarGroup) 
    4545  macro(CReorderDomainGroup) 
     46  macro(CExtractDomainGroup) 
    4647} 
  • XIOS/trunk/src/group_template_decl.cpp

    r1457 r1549  
    3333  macro(ReduceScalarToScalar) 
    3434  macro(ReorderDomain) 
     35  macro(ExtractDomain) 
    3536 
    3637} 
  • XIOS/trunk/src/node/domain.cpp

    r1542 r1549  
    7777     m["expand_domain"] = TRANS_EXPAND_DOMAIN; 
    7878     m["reorder_domain"] = TRANS_REORDER_DOMAIN; 
     79     m["extract_domain"] = TRANS_EXTRACT_DOMAIN; 
    7980   } 
    8081 
     
    12121213 
    12131214   /* 
    1214      Fill in longitude and latitude value from clients (or models) into internal values lonvalue, latvalue which 
    1215      will be used by XIOS. 
     1215     Fill in longitude, latitude, bounds, and area into internal values (lonvalue, latvalue, bounds_lonvalue, bounds_latvalue, areavalue) 
     1216     which will be used by XIOS. 
    12161217   */ 
    12171218   void CDomain::completeLonLatClient(void) 
     
    12191220     bool lonlatValueExisted = (0 != lonvalue.numElements()) || (0 != latvalue.numElements()); 
    12201221     checkBounds() ; 
     1222     checkArea() ; 
     1223 
    12211224     if (!lonvalue_2d.isEmpty() && !lonlatValueExisted) 
    12221225     { 
     
    13131316       } 
    13141317     } 
     1318 
     1319     if (!area.isEmpty() && areavalue.isEmpty()) 
     1320     { 
     1321        areavalue.resize(ni*nj); 
     1322       for (int j = 0; j < nj; ++j) 
     1323       { 
     1324         for (int i = 0; i < ni; ++i) 
     1325         { 
     1326           int k = j * ni + i; 
     1327           areavalue(k) = area(i,j); 
     1328         } 
     1329       } 
     1330     } 
    13151331   } 
    13161332 
     
    14551471               << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 
    14561472               << "'bounds_lon_1d' dimension is not compatible with 'nvertex'." << std::endl 
    1457                << "'bounds_lon_1d' dimension is " << bounds_lon_1d.extent(1) 
     1473               << "'bounds_lon_1d' dimension is " << bounds_lon_1d.extent(0) 
    14581474               << " but nvertex is " << nvertex.getValue() << "."); 
    14591475 
     
    14621478               << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 
    14631479               << "'bounds_lon_2d' dimension is not compatible with 'nvertex'." << std::endl 
    1464                << "'bounds_lon_2d' dimension is " << bounds_lon_2d.extent(2) 
     1480               << "'bounds_lon_2d' dimension is " << bounds_lon_2d.extent(0) 
    14651481               << " but nvertex is " << nvertex.getValue() << "."); 
    14661482 
     
    14791495               << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 
    14801496               << "'bounds_lat_1d' dimension is not compatible with 'nvertex'." << std::endl 
    1481                << "'bounds_lat_1d' dimension is " << bounds_lat_1d.extent(1) 
     1497               << "'bounds_lat_1d' dimension is " << bounds_lat_1d.extent(0) 
    14821498               << " but nvertex is " << nvertex.getValue() << "."); 
    14831499 
     
    14861502               << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 
    14871503               << "'bounds_lat_2d' dimension is not compatible with 'nvertex'." << std::endl 
    1488                << "'bounds_lat_2d' dimension is " << bounds_lat_2d.extent(2) 
     1504               << "'bounds_lat_2d' dimension is " << bounds_lat_2d.extent(0) 
    14891505               << " but nvertex is " << nvertex.getValue() << "."); 
    14901506 
     
    15251541               << "Area size is " << area.extent(0) << " x " << area.extent(1) << "."); 
    15261542       } 
    1527        if (areavalue.isEmpty()) 
    1528        { 
    1529           areavalue.resize(ni*nj); 
    1530          for (int j = 0; j < nj; ++j) 
    1531          { 
    1532            for (int i = 0; i < ni; ++i) 
    1533            { 
    1534              int k = j * ni + i; 
    1535              areavalue(k) = area(i,j); 
    1536            } 
    1537          } 
    1538        } 
     1543//       if (areavalue.isEmpty()) 
     1544//       { 
     1545//          areavalue.resize(ni*nj); 
     1546//         for (int j = 0; j < nj; ++j) 
     1547//         { 
     1548//           for (int i = 0; i < ni; ++i) 
     1549//           { 
     1550//             int k = j * ni + i; 
     1551//             areavalue(k) = area(i,j); 
     1552//           } 
     1553//         } 
     1554//       } 
    15391555     } 
    15401556   } 
  • XIOS/trunk/src/node/node_enum.hpp

    r1457 r1549  
    3838         eDuplicateScalarToAxis, 
    3939         eReduceScalarToScalar, 
    40          eReorderDomain 
     40         eReorderDomain, 
     41         eExtractDomain 
    4142       } ENodeType; 
    4243 
  • XIOS/trunk/src/node/node_type.hpp

    r1457 r1549  
    2929#include "reduce_scalar_to_scalar.hpp" 
    3030#include "reorder_domain.hpp" 
     31#include "extract_domain.hpp" 
    3132 
    3233 
  • XIOS/trunk/src/node/transformation_enum.hpp

    r1457 r1549  
    2424        TRANS_DUPLICATE_SCALAR_TO_AXIS = 15, 
    2525        TRANS_REDUCE_SCALAR_TO_SCALAR = 16, 
    26         TRANS_REORDER_DOMAIN = 17 
     26        TRANS_REORDER_DOMAIN = 17, 
     27        TRANS_EXTRACT_DOMAIN = 18 
    2728      } ETranformationType; 
    2829 
  • XIOS/trunk/src/object_factory_decl.cpp

    r1542 r1549  
    4545  macro(CReduceScalarToScalar) 
    4646  macro(CReorderDomain) 
     47  macro(CExtractDomain) 
    4748   
    4849  macro(CFieldGroup) 
     
    7273  macro(CReduceScalarToScalarGroup) 
    7374  macro(CReorderDomainGroup) 
     75  macro(CExtractDomainGroup) 
    7476} 
  • XIOS/trunk/src/object_template_decl.cpp

    r1457 r1549  
    3232  template class CObjectTemplate<CReduceScalarToScalar>; 
    3333  template class CObjectTemplate<CReorderDomain>; 
     34  template class CObjectTemplate<CExtractDomain>; 
    3435   
    3536  template class CObjectTemplate<CContextGroup>; 
     
    5960  template class CObjectTemplate<CReduceScalarToScalarGroup>; 
    6061  template class CObjectTemplate<CReorderDomainGroup>; 
     62  template class CObjectTemplate<CExtractDomainGroup>; 
    6163} 
  • XIOS/trunk/src/transformation/algo_types.hpp

    r1457 r1549  
    3030#include "scalar_algorithm_reduce_scalar.hpp" 
    3131#include "domain_algorithm_reorder.hpp" 
     32#include "domain_algorithm_extract.hpp" 
    3233 
    3334 
  • XIOS/trunk/src/transformation/grid_transformation_selector.cpp

    r1457 r1549  
    4040  CDomainAlgorithmExpand::registerTrans(); 
    4141  CDomainAlgorithmReorder::registerTrans(); 
     42  CDomainAlgorithmExtract::registerTrans(); 
    4243} 
    4344 
  • XIOS/trunk/src/type/type_util.hpp

    r1457 r1549  
    5858    class CReorderDomain; 
    5959    class CReorderDomainGroup; 
     60    class CExtractDomain; 
     61    class CExtractDomainGroup; 
    6062      
    6163  template <typename T> inline string getStrType(void); 
     
    132134  macro(CReorderDomain) 
    133135  macro(CReorderDomainGroup) 
     136  macro(CExtractDomain) 
     137  macro(CExtractDomainGroup) 
    134138   
    135139#undef macro 
  • XIOS/trunk/src/xml_parser_decl.cpp

    r1457 r1549  
    3838    macro( ReduceScalarToScalar ) 
    3939    macro( ReorderDomain ) 
     40    macro( ExtractDomain ) 
    4041  } 
    4142} 
Note: See TracChangeset for help on using the changeset viewer.