Changeset 1419


Ignore:
Timestamp:
02/02/18 16:26:29 (7 years ago)
Author:
oabramkina
Message:

Reading of curvilinear and unstructured domains locally by clients is back.

Reading of cfsites has been tested.

Location:
XIOS/dev/XIOS_DEV_CMIP6/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/XIOS_DEV_CMIP6/src/io/nc4_data_input.cpp

    r1413 r1419  
    264264    if ((CDomain::type_attr::rectilinear == domain->type)) 
    265265    { 
    266       // Ok, try to read some f.. attributes such as longitude and latitude 
     266      // Ok, try to read some attributes such as longitude and latitude 
    267267      bool hasLat = SuperClassWriter::hasVariable(itMapNj->first); 
    268268      if (hasLat) 
     
    286286      int nj = domain->nj; 
    287287      std::vector<StdSize> nBeginLatLon(2), nSizeLatLon(2); 
    288       nBeginLatLon[0] = 0; nBeginLatLon[1] = 0; 
    289       nSizeLatLon[0]  = domain->nj_glo.getValue(); nSizeLatLon[1] = domain->ni_glo.getValue(); 
     288      nBeginLatLon[0] = domain->jbegin.getValue(); nBeginLatLon[1] = domain->ibegin.getValue(); 
     289      nSizeLatLon[0]  = domain->nj.getValue(); nSizeLatLon[1] = domain->ni.getValue(); 
    290290 
    291291      StdString latName = this->getLatCoordName(fieldId); 
    292292      if (SuperClassWriter::hasVariable(latName)) 
    293293      { 
    294         domain->latvalue_curvilinear_read_from_file.resize(domain->ni_glo,domain->nj_glo); 
     294        domain->latvalue_curvilinear_read_from_file.resize(domain->ni,domain->nj); 
    295295        readFieldVariableValue(domain->latvalue_curvilinear_read_from_file, latName, nBeginLatLon, nSizeLatLon); 
    296296      } 
     
    298298      if (SuperClassWriter::hasVariable(lonName)) 
    299299      { 
    300         domain->lonvalue_curvilinear_read_from_file.resize(domain->ni_glo,domain->nj_glo); 
     300        domain->lonvalue_curvilinear_read_from_file.resize(domain->ni,domain->nj); 
    301301        readFieldVariableValue(domain->lonvalue_curvilinear_read_from_file, lonName, nBeginLatLon, nSizeLatLon); 
    302302      } 
     
    320320 
    321321      std::vector<StdSize> nBeginBndsLatLon(3), nSizeBndsLatLon(3); 
    322       nBeginBndsLatLon[0] = 0; nSizeBndsLatLon[0] = domain->nj_glo.getValue(); 
    323       nBeginBndsLatLon[1] = 0; nSizeBndsLatLon[1] = domain->ni_glo.getValue(); 
     322      nBeginBndsLatLon[0] = domain->jbegin.getValue(); nSizeBndsLatLon[0] = domain->nj.getValue(); 
     323      nBeginBndsLatLon[1] = domain->ibegin.getValue(); nSizeBndsLatLon[1] = domain->ni.getValue(); 
    324324      nBeginBndsLatLon[2] = 0; nSizeBndsLatLon[2] = nbVertex; 
    325325 
    326326      if (SuperClassWriter::hasVariable(boundsLatName)) 
    327327      { 
    328         domain->bounds_latvalue_curvilinear_read_from_file.resize(nbVertex,domain->ni_glo,domain->nj_glo); 
     328        domain->bounds_latvalue_curvilinear_read_from_file.resize(nbVertex,domain->ni,domain->nj); 
    329329        readFieldVariableValue(domain->bounds_latvalue_curvilinear_read_from_file, boundsLatName, nBeginBndsLatLon, nSizeBndsLatLon); 
    330330 
     
    332332      if (SuperClassWriter::hasVariable(boundsLonName))  
    333333      { 
    334         domain->bounds_lonvalue_curvilinear_read_from_file.resize(nbVertex,domain->ni_glo,domain->nj_glo); 
     334        domain->bounds_lonvalue_curvilinear_read_from_file.resize(nbVertex,domain->ni,domain->nj); 
    335335        readFieldVariableValue(domain->bounds_lonvalue_curvilinear_read_from_file, boundsLonName, nBeginBndsLatLon, nSizeBndsLatLon); 
    336336      }       
     
    339339    { 
    340340      std::vector<StdSize> nBeginLatLon(1,0), nSizeLatLon(1,0); 
    341       nSizeLatLon[0]  = domain->ni_glo.getValue(); 
    342       CArray<double,1> globalLonLat(domain->ni_glo.getValue()); 
     341      nBeginLatLon[0] = domain->ibegin; 
     342      nSizeLatLon[0]  = domain->ni.getValue(); 
    343343 
    344344      StdString latName = this->getLatCoordName(fieldId); 
    345345      if (SuperClassWriter::hasVariable(latName)) 
    346346      { 
    347         domain->latvalue_unstructured_read_from_file.resize(domain->ni_glo); 
     347        domain->latvalue_unstructured_read_from_file.resize(domain->ni); 
    348348        readFieldVariableValue(domain->latvalue_unstructured_read_from_file, latName, nBeginLatLon, nSizeLatLon);   
    349349      } 
     
    352352      if (SuperClassWriter::hasVariable(lonName)) //(0 != lonName.compare("")) 
    353353      { 
    354         // readFieldVariableValue(globalLonLat, lonName, nBeginLatLon, nSizeLatLon); 
    355         domain->lonvalue_unstructured_read_from_file.resize(domain->ni_glo); 
     354        domain->lonvalue_unstructured_read_from_file.resize(domain->ni); 
    356355        readFieldVariableValue(domain->lonvalue_unstructured_read_from_file, lonName, nBeginLatLon, nSizeLatLon); 
    357356      } 
     
    375374 
    376375      std::vector<StdSize> nBeginBndsLatLon(2), nSizeBndsLatLon(2); 
    377       nBeginBndsLatLon[0] = 0; nSizeBndsLatLon[0] = domain->ni_glo.getValue(); 
     376      nBeginBndsLatLon[0] = domain->ibegin; nSizeBndsLatLon[0] = domain->ni.getValue(); 
    378377      nBeginBndsLatLon[1] = 0; nSizeBndsLatLon[1] = nbVertex; 
    379378 
  • XIOS/dev/XIOS_DEV_CMIP6/src/node/domain.cpp

    r1413 r1419  
    256256 
    257257   /*! 
    258      Redistribute RECTILINEAR domain with a number of local domains. 
     258     Redistribute RECTILINEAR or CURVILINEAR domain with a number of local domains. 
    259259   All attributes ni,nj,ibegin,jbegin (if defined) will be rewritten 
    260260   The optional attributes lonvalue, latvalue will be added. Because this function only serves (for now) 
     
    536536       for (int jdx = 0; jdx < nj; ++jdx) 
    537537        for (int idx = 0; idx < ni; ++idx) 
    538          lonvalue_2d(idx,jdx) = lonvalue_curvilinear_read_from_file(idx+ibegin, jdx+jbegin); 
     538         lonvalue_2d(idx,jdx) = lonvalue_curvilinear_read_from_file(idx, jdx); 
    539539 
    540540       lonvalue_curvilinear_read_from_file.free(); 
     
    546546       for (int jdx = 0; jdx < nj; ++jdx) 
    547547        for (int idx = 0; idx < ni; ++idx) 
    548          latvalue_2d(idx,jdx) = latvalue_curvilinear_read_from_file(idx+ibegin, jdx+jbegin); 
     548           latvalue_2d(idx,jdx) = latvalue_curvilinear_read_from_file(idx, jdx); 
    549549 
    550550       latvalue_curvilinear_read_from_file.free(); 
     
    557557        for (int idx = 0; idx < ni; ++idx) 
    558558          for (int ndx = 0; ndx < nvertex; ++ndx) 
    559          bounds_lon_2d(ndx,idx,jdx) = bounds_lonvalue_curvilinear_read_from_file(ndx,idx+ibegin, jdx+jbegin); 
     559            bounds_lon_2d(ndx,idx,jdx) = bounds_lonvalue_curvilinear_read_from_file(ndx,idx, jdx); 
    560560 
    561561       bounds_lonvalue_curvilinear_read_from_file.free(); 
     
    568568        for (int idx = 0; idx < ni; ++idx) 
    569569          for (int ndx = 0; ndx < nvertex; ++ndx) 
    570             bounds_lat_2d(ndx,idx,jdx) = bounds_latvalue_curvilinear_read_from_file(ndx,idx+ibegin, jdx+jbegin); 
     570            bounds_lat_2d(ndx,idx,jdx) = bounds_latvalue_curvilinear_read_from_file(ndx,idx, jdx); 
    571571 
    572572       bounds_latvalue_curvilinear_read_from_file.free(); 
     
    591591        lonvalue_1d.resize(ni); 
    592592        for (int idx = 0; idx < ni; ++idx) 
    593           lonvalue_1d(idx) = lonvalue_unstructured_read_from_file(i_index(idx)); 
     593          lonvalue_1d(idx) = lonvalue_unstructured_read_from_file(idx); 
    594594 
    595595        // We dont need these values anymore, so just delete them 
     
    601601        latvalue_1d.resize(ni); 
    602602        for (int idx = 0; idx < ni; ++idx) 
    603           latvalue_1d(idx) =  latvalue_unstructured_read_from_file(i_index(idx)); 
     603          latvalue_1d(idx) =  latvalue_unstructured_read_from_file(idx); 
    604604 
    605605        // We dont need these values anymore, so just delete them 
     
    613613        for (int idx = 0; idx < ni; ++idx) 
    614614          for (int jdx = 0; jdx < nbVertex; ++jdx) 
    615             bounds_lon_1d(jdx,idx) = bounds_lonvalue_unstructured_read_from_file(jdx, i_index(idx)); 
     615            bounds_lon_1d(jdx,idx) = bounds_lonvalue_unstructured_read_from_file(jdx, idx); 
    616616 
    617617        // We dont need these values anymore, so just delete them 
     
    625625        for (int idx = 0; idx < ni; ++idx) 
    626626          for (int jdx = 0; jdx < nbVertex; ++jdx) 
    627             bounds_lat_1d(jdx,idx) = bounds_latvalue_unstructured_read_from_file(jdx, i_index(idx)); 
     627            bounds_lat_1d(jdx,idx) = bounds_latvalue_unstructured_read_from_file(jdx, idx); 
    628628 
    629629        // We dont need these values anymore, so just delete them 
Note: See TracChangeset for help on using the changeset viewer.