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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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   } 
Note: See TracChangeset for help on using the changeset viewer.