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

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

Reading of cfsites has been tested.

File:
1 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 
Note: See TracChangeset for help on using the changeset viewer.