Ignore:
Timestamp:
01/24/18 18:45:14 (4 years ago)
Author:
oabramkina
Message:

Improving protocol for reading : grid attributes such longitude, latitude, etc are read by clients locally.
It concerns only curvilinear and unstructured domains. Local attributes such as ni/nj, ibegin/jbegin are mandatory as before.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/XIOS_DEV_CMIP6/src/node/domain.cpp

    r1390 r1410  
    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) 
     
    531531   void CDomain::fillInCurvilinearLonLat() 
    532532   { 
     533 
    533534     if (!lonvalue_curvilinear_read_from_file.isEmpty() && lonvalue_2d.isEmpty()) 
    534535     { 
     
    536537       for (int jdx = 0; jdx < nj; ++jdx) 
    537538        for (int idx = 0; idx < ni; ++idx) 
    538          lonvalue_2d(idx,jdx) = lonvalue_curvilinear_read_from_file(idx+ibegin, jdx+jbegin); 
     539            lonvalue_2d(idx,jdx) = lonvalue_curvilinear_read_from_file(idx, jdx); 
     540//            lonvalue_2d(idx,jdx) = lonvalue_curvilinear_read_from_file(idx+ibegin, jdx+jbegin); 
    539541 
    540542       lonvalue_curvilinear_read_from_file.free(); 
     
    546548       for (int jdx = 0; jdx < nj; ++jdx) 
    547549        for (int idx = 0; idx < ni; ++idx) 
    548          latvalue_2d(idx,jdx) = latvalue_curvilinear_read_from_file(idx+ibegin, jdx+jbegin); 
     550            latvalue_2d(idx,jdx) = latvalue_curvilinear_read_from_file(idx, jdx); 
     551//            latvalue_2d(idx,jdx) = latvalue_curvilinear_read_from_file(idx+ibegin, jdx+jbegin); 
    549552 
    550553       latvalue_curvilinear_read_from_file.free(); 
     
    557560        for (int idx = 0; idx < ni; ++idx) 
    558561          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); 
     562              bounds_lon_2d(ndx,idx,jdx) = bounds_lonvalue_curvilinear_read_from_file(ndx,idx, jdx); 
     563//              bounds_lon_2d(ndx,idx,jdx) = bounds_lonvalue_curvilinear_read_from_file(ndx,idx+ibegin, jdx+jbegin); 
    560564 
    561565       bounds_lonvalue_curvilinear_read_from_file.free(); 
     
    568572        for (int idx = 0; idx < ni; ++idx) 
    569573          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); 
     574              bounds_lat_2d(ndx,idx,jdx) = bounds_latvalue_curvilinear_read_from_file(ndx,idx, jdx); 
     575//              bounds_lat_2d(ndx,idx,jdx) = bounds_latvalue_curvilinear_read_from_file(ndx,idx+ibegin, jdx+jbegin); 
    571576 
    572577       bounds_latvalue_curvilinear_read_from_file.free(); 
     
    584589     { 
    585590       i_index.resize(ni); 
    586        for(int idx = 0; idx < ni; ++idx) i_index(idx)=ibegin+idx; 
     591//       for(int idx = 0; idx < ni; ++idx) i_index(idx)=ibegin+idx; 
    587592     } 
    588593 
     
    591596        lonvalue_1d.resize(ni); 
    592597        for (int idx = 0; idx < ni; ++idx) 
    593           lonvalue_1d(idx) = lonvalue_unstructured_read_from_file(i_index(idx)); 
     598//          lonvalue_1d(idx) = lonvalue_unstructured_read_from_file(i_index(idx)); 
     599          lonvalue_1d(idx) = lonvalue_unstructured_read_from_file(idx); 
    594600 
    595601        // We dont need these values anymore, so just delete them 
     
    601607        latvalue_1d.resize(ni); 
    602608        for (int idx = 0; idx < ni; ++idx) 
    603           latvalue_1d(idx) =  latvalue_unstructured_read_from_file(i_index(idx)); 
     609//          latvalue_1d(idx) =  latvalue_unstructured_read_from_file(i_index(idx)); 
     610          latvalue_1d(idx) =  latvalue_unstructured_read_from_file(idx); 
    604611 
    605612        // We dont need these values anymore, so just delete them 
     
    613620        for (int idx = 0; idx < ni; ++idx) 
    614621          for (int jdx = 0; jdx < nbVertex; ++jdx) 
    615             bounds_lon_1d(jdx,idx) = bounds_lonvalue_unstructured_read_from_file(jdx, i_index(idx)); 
     622//            bounds_lon_1d(jdx,idx) = bounds_lonvalue_unstructured_read_from_file(jdx, i_index(idx)); 
     623            bounds_lon_1d(jdx,idx) = bounds_lonvalue_unstructured_read_from_file(jdx, idx); 
    616624 
    617625        // We dont need these values anymore, so just delete them 
     
    625633        for (int idx = 0; idx < ni; ++idx) 
    626634          for (int jdx = 0; jdx < nbVertex; ++jdx) 
    627             bounds_lat_1d(jdx,idx) = bounds_latvalue_unstructured_read_from_file(jdx, i_index(idx)); 
     635//            bounds_lat_1d(jdx,idx) = bounds_latvalue_unstructured_read_from_file(jdx, i_index(idx)); 
     636            bounds_lat_1d(jdx,idx) = bounds_latvalue_unstructured_read_from_file(jdx, idx); 
    628637 
    629638        // We dont need these values anymore, so just delete them 
Note: See TracChangeset for help on using the changeset viewer.