Changeset 551


Ignore:
Timestamp:
02/11/15 16:23:02 (9 years ago)
Author:
mhnguyen
Message:

Redesigning grid structure

+) Add an intermediate class to calculate distribution on client and servers
+) Change all index of attributes to zero (0), instead of one(1)

Test
+) On Curie
+) Test new features passes but some data are still shifted

Location:
XIOS/trunk
Files:
6 added
14 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/inputs/Version2/iodef.xml

    r549 r551  
    2020 
    2121   <axis_definition> 
    22      <axis id="axis_A" zoom_size="2" zoom_end="3" /> 
     22     <axis id="axis_A" /> 
    2323     <axis id="axis_B" zoom_size="2" zoom_end="3" /> 
    2424   </axis_definition> 
  • XIOS/trunk/src/attribute_array_decl.cpp

    r501 r551  
    99  template class CAttributeArray<int,1> ; 
    1010  template class CAttributeArray<int,2> ; 
     11  template class CAttributeArray<bool,1> ; 
    1112  template class CAttributeArray<bool,2> ; 
    1213  template class CAttributeArray<bool,3> ; 
  • XIOS/trunk/src/config/axis_attribute.conf

    r540 r551  
    1414DECLARE_ATTRIBUTE(StdString, axis_ref) 
    1515 
     16/* LOCAL */ 
     17DECLARE_ATTRIBUTE(int,       data_n) 
     18DECLARE_ATTRIBUTE(int,       data_begin) 
     19DECLARE_ARRAY(int, 1 , data_index) 
    1620 
     21/*LOCAL */ 
     22DECLARE_ATTRIBUTE(int,       ibegin) 
     23DECLARE_ATTRIBUTE(int,       ni) 
     24 
     25/* LOCAL */ 
     26DECLARE_ARRAY(bool, 1 , mask) 
  • XIOS/trunk/src/config/grid_attribute.conf

    r541 r551  
    44//DECLARE_ATTRIBUTE(StdString, axis_ref) 
    55DECLARE_ARRAY(bool, 3 , mask) 
     6//DECLARE_ARRAY(bool, 4 , mask4) 
     7//DECLARE_ARRAY(bool, 5 , mask5) 
     8//DECLARE_ARRAY(bool, 6 , mask6) 
     9//DECLARE_ARRAY(bool, 7 , mask7) 
     10 
    611 
    712// These attributes should be used privately 
    813// An array contains order of axis and domains composing of the grid 
    9 DECLARE_ARRAY(int, 1 , axisDomOrder) 
     14DECLARE_ARRAY(bool, 1 , axisDomainOrder) 
  • XIOS/trunk/src/interface/c_attr/icgrid_attr.cpp

    r541 r551  
    1717{ 
    1818  typedef xios::CGrid*  grid_Ptr; 
    19    
    20   void cxios_set_grid_axisDomOrder(grid_Ptr grid_hdl, int* axisDomOrder, int extent1) 
     19 
     20  void cxios_set_grid_axisDomOrder(grid_Ptr grid_hdl, bool* axisDomainOrder, int extent1) 
    2121  { 
    2222    CTimer::get("XIOS").resume(); 
    23     CArray<int,1> tmp(axisDomOrder,shape(extent1),neverDeleteData) ; 
    24     grid_hdl->axisDomOrder.reference(tmp.copy()); 
     23    CArray<bool,1> tmp(axisDomainOrder,shape(extent1),neverDeleteData) ; 
     24    grid_hdl->axisDomainOrder.reference(tmp.copy()); 
    2525     CTimer::get("XIOS").suspend(); 
    2626  } 
    27    
    28   void cxios_get_grid_axisDomOrder(grid_Ptr grid_hdl, int* axisDomOrder, int extent1) 
     27 
     28  void cxios_get_grid_axisDomOrder(grid_Ptr grid_hdl, bool* axisDomainOrder, int extent1) 
    2929  { 
    3030    CTimer::get("XIOS").resume(); 
    31     CArray<int,1> tmp(axisDomOrder,shape(extent1),neverDeleteData) ; 
    32     tmp=grid_hdl->axisDomOrder.getInheritedValue() ; 
     31    CArray<bool,1> tmp(axisDomainOrder,shape(extent1),neverDeleteData) ; 
     32    tmp=grid_hdl->axisDomainOrder.getInheritedValue() ; 
    3333     CTimer::get("XIOS").suspend(); 
    3434  } 
    35    
     35 
    3636  bool cxios_is_defined_grid_axisDomOrder(grid_Ptr grid_hdl ) 
    3737  { 
    3838     CTimer::get("XIOS").resume(); 
    39     return grid_hdl->axisDomOrder.hasInheritedValue(); 
     39    return grid_hdl->axisDomainOrder.hasInheritedValue(); 
    4040     CTimer::get("XIOS").suspend(); 
    4141  } 
    42    
    43    
    44    
     42 
     43 
     44 
    4545  void cxios_set_grid_description(grid_Ptr grid_hdl, const char * description, int description_size) 
    4646  { 
     
    5151     CTimer::get("XIOS").suspend(); 
    5252  } 
    53    
     53 
    5454  void cxios_get_grid_description(grid_Ptr grid_hdl, char * description, int description_size) 
    5555  { 
     
    5959     CTimer::get("XIOS").suspend(); 
    6060  } 
    61    
     61 
    6262  bool cxios_is_defined_grid_description(grid_Ptr grid_hdl ) 
    6363  { 
     
    6666     CTimer::get("XIOS").suspend(); 
    6767  } 
    68    
    69    
    70    
     68 
     69 
     70 
    7171  void cxios_set_grid_mask(grid_Ptr grid_hdl, bool* mask, int extent1, int extent2, int extent3) 
    7272  { 
     
    7676     CTimer::get("XIOS").suspend(); 
    7777  } 
    78    
     78 
    7979  void cxios_get_grid_mask(grid_Ptr grid_hdl, bool* mask, int extent1, int extent2, int extent3) 
    8080  { 
     
    8484     CTimer::get("XIOS").suspend(); 
    8585  } 
    86    
     86 
    8787  bool cxios_is_defined_grid_mask(grid_Ptr grid_hdl ) 
    8888  { 
     
    9191     CTimer::get("XIOS").suspend(); 
    9292  } 
    93    
    94    
    95    
     93 
     94 
     95 
    9696  void cxios_set_grid_name(grid_Ptr grid_hdl, const char * name, int name_size) 
    9797  { 
     
    102102     CTimer::get("XIOS").suspend(); 
    103103  } 
    104    
     104 
    105105  void cxios_get_grid_name(grid_Ptr grid_hdl, char * name, int name_size) 
    106106  { 
     
    110110     CTimer::get("XIOS").suspend(); 
    111111  } 
    112    
     112 
    113113  bool cxios_is_defined_grid_name(grid_Ptr grid_hdl ) 
    114114  { 
     
    117117     CTimer::get("XIOS").suspend(); 
    118118  } 
    119    
    120    
    121    
    122    
     119 
     120 
     121 
     122 
    123123} 
  • XIOS/trunk/src/interface/c_attr/icgridgroup_attr.cpp

    r541 r551  
    1717{ 
    1818  typedef xios::CGridGroup*  gridgroup_Ptr; 
    19    
    20   void cxios_set_gridgroup_axisDomOrder(gridgroup_Ptr gridgroup_hdl, int* axisDomOrder, int extent1) 
     19 
     20  void cxios_set_gridgroup_axisDomOrder(gridgroup_Ptr gridgroup_hdl, bool* axisDomainOrder, int extent1) 
    2121  { 
    2222    CTimer::get("XIOS").resume(); 
    23     CArray<int,1> tmp(axisDomOrder,shape(extent1),neverDeleteData) ; 
    24     gridgroup_hdl->axisDomOrder.reference(tmp.copy()); 
     23    CArray<bool,1> tmp(axisDomainOrder,shape(extent1),neverDeleteData) ; 
     24    gridgroup_hdl->axisDomainOrder.reference(tmp.copy()); 
    2525     CTimer::get("XIOS").suspend(); 
    2626  } 
    27    
    28   void cxios_get_gridgroup_axisDomOrder(gridgroup_Ptr gridgroup_hdl, int* axisDomOrder, int extent1) 
     27 
     28  void cxios_get_gridgroup_axisDomOrder(gridgroup_Ptr gridgroup_hdl, bool* axisDomainOrder, int extent1) 
    2929  { 
    3030    CTimer::get("XIOS").resume(); 
    31     CArray<int,1> tmp(axisDomOrder,shape(extent1),neverDeleteData) ; 
    32     tmp=gridgroup_hdl->axisDomOrder.getInheritedValue() ; 
     31    CArray<bool,1> tmp(axisDomainOrder,shape(extent1),neverDeleteData) ; 
     32    tmp=gridgroup_hdl->axisDomainOrder.getInheritedValue() ; 
    3333     CTimer::get("XIOS").suspend(); 
    3434  } 
    35    
     35 
    3636  bool cxios_is_defined_gridgroup_axisDomOrder(gridgroup_Ptr gridgroup_hdl ) 
    3737  { 
    3838     CTimer::get("XIOS").resume(); 
    39     return gridgroup_hdl->axisDomOrder.hasInheritedValue(); 
     39    return gridgroup_hdl->axisDomainOrder.hasInheritedValue(); 
    4040     CTimer::get("XIOS").suspend(); 
    4141  } 
    42    
    43    
    44    
     42 
     43 
     44 
    4545  void cxios_set_gridgroup_description(gridgroup_Ptr gridgroup_hdl, const char * description, int description_size) 
    4646  { 
     
    5151     CTimer::get("XIOS").suspend(); 
    5252  } 
    53    
     53 
    5454  void cxios_get_gridgroup_description(gridgroup_Ptr gridgroup_hdl, char * description, int description_size) 
    5555  { 
     
    5959     CTimer::get("XIOS").suspend(); 
    6060  } 
    61    
     61 
    6262  bool cxios_is_defined_gridgroup_description(gridgroup_Ptr gridgroup_hdl ) 
    6363  { 
     
    6666     CTimer::get("XIOS").suspend(); 
    6767  } 
    68    
    69    
    70    
     68 
     69 
     70 
    7171  void cxios_set_gridgroup_group_ref(gridgroup_Ptr gridgroup_hdl, const char * group_ref, int group_ref_size) 
    7272  { 
     
    7777     CTimer::get("XIOS").suspend(); 
    7878  } 
    79    
     79 
    8080  void cxios_get_gridgroup_group_ref(gridgroup_Ptr gridgroup_hdl, char * group_ref, int group_ref_size) 
    8181  { 
     
    8585     CTimer::get("XIOS").suspend(); 
    8686  } 
    87    
     87 
    8888  bool cxios_is_defined_gridgroup_group_ref(gridgroup_Ptr gridgroup_hdl ) 
    8989  { 
     
    9292     CTimer::get("XIOS").suspend(); 
    9393  } 
    94    
    95    
    96    
     94 
     95 
     96 
    9797  void cxios_set_gridgroup_mask(gridgroup_Ptr gridgroup_hdl, bool* mask, int extent1, int extent2, int extent3) 
    9898  { 
     
    102102     CTimer::get("XIOS").suspend(); 
    103103  } 
    104    
     104 
    105105  void cxios_get_gridgroup_mask(gridgroup_Ptr gridgroup_hdl, bool* mask, int extent1, int extent2, int extent3) 
    106106  { 
     
    110110     CTimer::get("XIOS").suspend(); 
    111111  } 
    112    
     112 
    113113  bool cxios_is_defined_gridgroup_mask(gridgroup_Ptr gridgroup_hdl ) 
    114114  { 
     
    117117     CTimer::get("XIOS").suspend(); 
    118118  } 
    119    
    120    
    121    
     119 
     120 
     121 
    122122  void cxios_set_gridgroup_name(gridgroup_Ptr gridgroup_hdl, const char * name, int name_size) 
    123123  { 
     
    128128     CTimer::get("XIOS").suspend(); 
    129129  } 
    130    
     130 
    131131  void cxios_get_gridgroup_name(gridgroup_Ptr gridgroup_hdl, char * name, int name_size) 
    132132  { 
     
    136136     CTimer::get("XIOS").suspend(); 
    137137  } 
    138    
     138 
    139139  bool cxios_is_defined_gridgroup_name(gridgroup_Ptr gridgroup_hdl ) 
    140140  { 
     
    143143     CTimer::get("XIOS").suspend(); 
    144144  } 
    145    
    146    
    147    
    148    
     145 
     146 
     147 
     148 
    149149} 
  • XIOS/trunk/src/node/axis.cpp

    r540 r551  
    5757      StdSize size = this->size.getValue(); 
    5858 
     59      if (!this->ibegin.isEmpty()) 
     60      { 
     61        StdSize ibegin = this->ibegin.getValue(); 
     62        if ((ibegin < 0) || (ibegin > size-1)) 
     63          ERROR("CAxis::checkAttributes(void)",<< "Attribut <ibegin> of the axis must be non-negative and smaller than size-1") ; 
     64      } 
     65      else this->ibegin.setValue(0); 
     66 
     67      if (!this->ni.isEmpty()) 
     68      { 
     69        StdSize ni = this->ni.getValue(); 
     70        if ((ni < 0) || (ni > size)) 
     71          ERROR("CAxis::checkAttributes(void)",<< "Attribut <ni> of the axis must be non-negative and smaller than size") ; 
     72      } 
     73      else this->ni.setValue(size); 
     74 
    5975      StdSize zoom_begin,zoom_end, zoom_size ; 
    6076 
    61       zoom_begin = (this->zoom_begin.isEmpty()) ?  1 : this->zoom_begin.getValue() ; 
    62       zoom_end = (this->zoom_end.isEmpty()) ?  size : this->zoom_end.getValue() ; 
     77//      zoom_begin = (this->zoom_begin.isEmpty()) ?  1 : this->zoom_begin.getValue() ; 
     78//      zoom_end = (this->zoom_end.isEmpty()) ?  size : this->zoom_end.getValue() ; 
     79//      zoom_size = (this->zoom_size.isEmpty()) ?  size : this->zoom_size.getValue() ; 
     80 
     81      // Maybe index begins at 0 (zero) 
     82      zoom_begin = (this->zoom_begin.isEmpty()) ?  0 : this->zoom_begin.getValue() ; 
     83      zoom_end = (this->zoom_end.isEmpty()) ?  size-1 : this->zoom_end.getValue() ; 
    6384      zoom_size = (this->zoom_size.isEmpty()) ?  size : this->zoom_size.getValue() ; 
    6485 
     
    6687      if (this->zoom_end.isEmpty()) zoom_end=zoom_begin+zoom_size-1 ; 
    6788      if (this->zoom_size.isEmpty()) zoom_size=zoom_end-zoom_begin+1 ; 
     89// 
     90//      if ( (zoom_begin < 1) || (zoom_begin > size) || (zoom_end<1) || (zoom_end>size) || (zoom_size<1) || (zoom_size>size) || (zoom_begin>zoom_end)) 
     91//        ERROR("CAxis::checkAttributes(void)",<< "One or more attribut of <zoom_begin>, <zoom_end>, <zoom_size>, are not well specified") ; 
    6892 
    69       if ( (zoom_begin < 1) || (zoom_begin > size) || (zoom_end<1) || (zoom_end>size) || (zoom_size<1) || (zoom_size>size) || (zoom_begin>zoom_end)) 
     93      if ( (zoom_begin < 0) || (zoom_begin > size-1) || (zoom_end<1) || (zoom_end>size-1) || (zoom_size<1) || (zoom_size>size) || (zoom_begin>zoom_end)) 
    7094        ERROR("CAxis::checkAttributes(void)",<< "One or more attribut of <zoom_begin>, <zoom_end>, <zoom_size>, are not well specified") ; 
     95 
    7196      this->zoom_begin.setValue(zoom_begin) ; 
    7297      this->zoom_end.setValue(zoom_end) ; 
     
    78103               << "The array \'value\' has a different size that the one defined by the \'size\' attribut") 
    79104 
     105      this->checkData(); 
     106      this->checkMask(); 
    80107      this->isChecked = true; 
     108   } 
     109 
     110   void CAxis::checkData() 
     111   { 
     112      if (data_begin.isEmpty()) data_begin.setValue(0); 
     113      if (!data_n.isEmpty() && data_n.getValue() <= 0) 
     114      { 
     115        ERROR("CAxis::checkData(void)", 
     116              << "Data dimension is negative (data_n).") ; 
     117      } 
     118      else if (data_n.isEmpty()) 
     119        data_n.setValue(zoom_size.getValue()); 
     120 
     121      if (data_index.isEmpty()) 
     122      { 
     123        int dn = data_n.getValue(); 
     124        data_index.resize(dn); 
     125        for (int i = 0; i < dn; ++i) data_index(i) = (i+1); 
     126      } 
     127   } 
     128 
     129   void CAxis::checkMask() 
     130   { 
     131      int begin_mask = 0, 
     132          end_mask = ni.getValue()-1; 
     133 
     134      if (!zoom_begin.isEmpty()) 
     135      { 
     136         int zoom_end = zoom_begin.getValue() + zoom_size.getValue() - 1; 
     137 
     138         begin_mask = std::max(ibegin.getValue(), zoom_begin.getValue()); 
     139         end_mask   = std::min(ibegin.getValue() + ni.getValue()-1, zoom_end); 
     140 
     141         begin_mask -= ibegin.getValue(); 
     142         end_mask   -= ibegin.getValue(); 
     143      } 
     144 
     145 
     146      if (!mask.isEmpty()) 
     147      { 
     148         if (mask.extent(0) != ni) 
     149            ERROR("CAxis::checkMask(void)", 
     150                  <<"the mask has not the same size than the local axis"<<endl 
     151                  <<"Local size is "<<ni<<"x"<<endl 
     152                  <<"Mask size is "<<mask.extent(0)<<"x"); 
     153         for (int i = 0; i < ni; ++i) 
     154         { 
     155           if (i < begin_mask && i > end_mask)  mask(i) = false; 
     156         } 
     157      } 
     158      else // (!mask.hasValue()) 
     159      { // Si aucun masque n'est défini, 
     160        // on en crée un nouveau qui valide l'intégralité du domaine. 
     161         mask.resize(ni) ; 
     162         for (int i = 0; i < ni.getValue(); ++i) 
     163         { 
     164               if (i >= begin_mask && i <= end_mask) 
     165                 mask(i) = true; 
     166               else  mask(i) = false; 
     167         } 
     168      } 
    81169   } 
    82170 
  • XIOS/trunk/src/node/axis.hpp

    r540 r551  
    7070 
    7171      private : 
    72  
     72         void checkData(); 
     73         void checkMask(); 
    7374         bool isChecked; 
    7475         std::set<StdString> relFiles; 
  • XIOS/trunk/src/node/domain.cpp

    r540 r551  
    109109         } 
    110110         ni=1 ; 
    111          ibegin=1 ; 
    112          iend=1 ; 
     111         ibegin=0 ; 
     112         iend=0 ; 
    113113 
    114114      } 
     
    169169 
    170170      if (ni.getValue() < 0 || ibegin.getValue() > iend.getValue() || 
    171           ibegin.getValue() < 1 || iend.getValue() > ni_glo.getValue()) 
     171          ibegin.getValue() < 0 || iend.getValue() > (ni_glo.getValue()-1)) 
    172172          { 
    173173 
     
    207207 
    208208      if (nj.getValue() < 0 || jbegin.getValue() > jend.getValue() || 
    209           jbegin.getValue() < 1 || jend.getValue() > nj_glo.getValue()) 
     209          jbegin.getValue() < 0 || jend.getValue() > (nj_glo.getValue()-1)) 
    210210         ERROR("CDomain::checkAttributes(void)", 
    211211               << "Domain is wrong defined," 
     
    488488            int zoom_jend = zoom_jbegin + zoom_nj - 1; 
    489489 
    490             if (zoom_ibegin < 1  || zoom_jbegin < 1 || zoom_iend > ni_glo || zoom_jend > nj_glo) 
     490            if (zoom_ibegin < 0  || zoom_jbegin < 0 || zoom_iend > (ni_glo-1) || zoom_jend > (nj_glo-1)) 
    491491               ERROR("CDomain::checkZoom(void)", 
    492492                     << "Zoom is wrong defined," 
     
    498498         zoom_ni = ni_glo; 
    499499         zoom_nj = nj_glo; 
    500          zoom_ibegin = 1; 
    501          zoom_jbegin = 1; 
     500         zoom_ibegin = 0; 
     501         zoom_jbegin = 0; 
    502502      } 
    503503 
     
    613613  { 
    614614    int ni_srv=ni_glo.getValue() ; 
    615     int ibegin_srv=1 ; 
     615    int ibegin_srv=0 ; 
    616616    int iend_srv=ni_glo.getValue() ; 
    617617 
     
    625625    int serverRank=client->getServerLeader() ; 
    626626 
    627     jend_srv=0 ; 
     627//    jend_srv=0 ; 
     628    jend_srv= -1 ; 
    628629    for(int i=0;i<=serverRank;i++) 
    629630    { 
     
    664665    int ns=nj_glo%nbServer ; 
    665666    int pos=ns*(blockSize+1) ; 
     667//    int pos=ns*(blockSize) ; 
    666668    int serverNum ; 
    667669 
     
    674676      for(i=0;i<ni;i++) 
    675677      { 
    676         i_ind=ibegin+i_index(i,j)-1 ; 
    677         j_ind=jbegin+j_index(i,j)-1 ; 
     678        i_ind=ibegin+i_index(i,j) ; 
     679        j_ind=jbegin+j_index(i,j) ; 
    678680 
    679681        if (j_ind<pos) serverNum=j_ind/(blockSize+1) ; 
     
    681683        IsConnected[serverNum]=true ; 
    682684 
    683         if (i_ind >= zoom_ibegin-1 && i_ind <= zoom_iend-1 && j_ind >= zoom_jbegin-1 && j_ind <= zoom_jend-1) 
     685        if (i_ind >= zoom_ibegin && i_ind <= zoom_iend && j_ind >= zoom_jbegin && j_ind <= zoom_jend) 
    684686        { 
    685687          mapConnectedServer(i,j)=serverNum ; 
     
    709711          ns=indServer[mapConnectedServer(i,j)] ; 
    710712          mapConnectedServer(i,j)= ns ; 
    711           i_indSrv[ns].push_back(i+ibegin-1) ; 
    712           j_indSrv[ns].push_back(j+jbegin-1) ; 
     713          i_indSrv[ns].push_back(i+ibegin) ; 
     714          j_indSrv[ns].push_back(j+jbegin) ; 
    713715        } 
    714716      } 
     
    743745  } 
    744746 
     747 
     748//  void CDomain::sendLonLat(void) 
     749//  { 
     750//    int ns,n,i,j,ind,nv ; 
     751//    CContext* context = CContext::getCurrent() ; 
     752//    CContextClient* client=context->client ; 
     753//    // send lon lat for each connected server 
     754// 
     755//    CEventClient eventLon(getType(),EVENT_ID_LON) ; 
     756//    CEventClient eventLat(getType(),EVENT_ID_LAT) ; 
     757// 
     758//    list<shared_ptr<CMessage> > list_msgLon ; 
     759//    list<shared_ptr<CMessage> > list_msgLat ; 
     760//    list< CArray<int,1>* > list_indi,list_indj ; 
     761//    list< CArray<double,1>* >list_lon,list_lat ; 
     762//    list< CArray<double,2>* >list_boundslon,list_boundslat ; 
     763// 
     764//    for(int ns=0;ns<connectedServer.size();ns++) 
     765//    { 
     766//      int nbData = nbDataSrv[ns] ; 
     767//      CArray<int,1> indi(nbData) ; 
     768//      CArray<int,1> indj(nbData) ; 
     769//      CArray<double,1> lon(nbData) ; 
     770//      CArray<double,1> lat(nbData) ; 
     771//      CArray<double,2> boundslon(nvertex,nbData) ; 
     772//      CArray<double,2> boundslat(nvertex,nbData) ; 
     773// 
     774//      for(n=0;n<nbData;n++) 
     775//      { 
     776//        i=i_indSrv[ns][n] ; 
     777//        j=j_indSrv[ns][n] ; 
     778//        ind=(i-(zoom_ibegin_client-1))+(j-(zoom_jbegin_client-1))*zoom_ni_client ; 
     779// 
     780//        lon(n)=lonvalue(ind) ; 
     781//        lat(n)=latvalue(ind) ; 
     782//        if (hasBounds) 
     783//        { 
     784//          for(nv=0;nv<nvertex;nv++) 
     785//          { 
     786//            boundslon(nv,n)=bounds_lon(nv,ind); 
     787//            boundslat(nv,n)=bounds_lat(nv,ind); 
     788//          } 
     789//        } 
     790//        indi(n)=ibegin+i_index(i-ibegin+1,j-jbegin+1)-1  ; 
     791//        indj(n)=jbegin+j_index(i-ibegin+1,j-jbegin+1)-1  ; 
     792//      } 
     793// 
     794//      list_indi.push_back(new CArray<int,1>(indi.copy())) ; 
     795//      list_indj.push_back(new CArray<int,1>(indj.copy())) ; 
     796//      list_lon.push_back(new CArray<double,1>(lon.copy())) ; 
     797//      list_lat.push_back(new CArray<double,1>(lat.copy())) ; 
     798//      if (hasBounds) list_boundslon.push_back(new CArray<double,2>(boundslon.copy())) ; 
     799//      if (hasBounds) list_boundslat.push_back(new CArray<double,2>(boundslat.copy())) ; 
     800// 
     801//      list_msgLon.push_back(shared_ptr<CMessage>(new CMessage)) ; 
     802//      list_msgLat.push_back(shared_ptr<CMessage>(new CMessage)) ; 
     803// 
     804//      *list_msgLon.back()<<this->getId()<<(int)type ; // enum ne fonctionne pour les message => ToFix 
     805//      *list_msgLat.back()<<this->getId()<<(int)type ; 
     806//      *list_msgLon.back()<<isCurvilinear ; 
     807//      *list_msgLat.back()<<isCurvilinear ; 
     808//      *list_msgLon.back()<<*list_indi.back()<<*list_indj.back()<<*list_lon.back() ; 
     809//      *list_msgLat.back()<<*list_indi.back()<<*list_indj.back()<<*list_lat.back() ; 
     810// 
     811//      if (hasBounds) 
     812//      { 
     813//        *list_msgLon.back()<<*list_boundslon.back(); 
     814//        *list_msgLat.back()<<*list_boundslat.back(); 
     815//      } 
     816//      eventLon.push(connectedServer[ns],nbSenders[ns],*list_msgLon.back()) ; 
     817//      eventLat.push(connectedServer[ns],nbSenders[ns],*list_msgLat.back()) ; 
     818//    } 
     819// 
     820//    client->sendEvent(eventLon) ; 
     821//    client->sendEvent(eventLat) ; 
     822// 
     823// 
     824//    for(list<CArray<int,1>* >::iterator it=list_indi.begin();it!=list_indi.end();it++) delete *it; 
     825//    for(list<CArray<int,1>* >::iterator it=list_indj.begin();it!=list_indj.end();it++) delete *it; 
     826//    for(list<CArray<double,1>* >::iterator it=list_lon.begin();it!=list_lon.end();it++)   delete *it; 
     827//    for(list<CArray<double,1>* >::iterator it=list_lat.begin();it!=list_lat.end();it++)   delete *it; 
     828//    if (hasBounds) for(list<CArray<double,2>* >::iterator it=list_boundslon.begin();it!=list_boundslon.end();it++)   delete *it; 
     829//    if (hasBounds) for(list<CArray<double,2>* >::iterator it=list_boundslat.begin();it!=list_boundslat.end();it++)   delete *it; 
     830// 
     831//  } 
    745832 
    746833  void CDomain::sendLonLat(void) 
     
    774861        i=i_indSrv[ns][n] ; 
    775862        j=j_indSrv[ns][n] ; 
    776         ind=(i-(zoom_ibegin_client-1))+(j-(zoom_jbegin_client-1))*zoom_ni_client ; 
     863//        ind=(i-(zoom_ibegin_client))+(j-(zoom_jbegin_client-1))*zoom_ni_client ; 
     864        ind=(i-(zoom_ibegin_client))+(j-(zoom_jbegin_client))*zoom_ni_client ; 
    777865 
    778866        lon(n)=lonvalue(ind) ; 
     
    786874          } 
    787875        } 
    788         indi(n)=ibegin+i_index(i-ibegin+1,j-jbegin+1)-1  ; 
    789         indj(n)=jbegin+j_index(i-ibegin+1,j-jbegin+1)-1  ; 
     876        indi(n)=ibegin+i_index(i-ibegin,j-jbegin)  ; 
     877        indj(n)=jbegin+j_index(i-ibegin,j-jbegin)  ; 
     878//        indi(n)=ibegin+i_index(i-ibegin+1,j-jbegin+1)-1  ; 
     879//        indj(n)=jbegin+j_index(i-ibegin+1,j-jbegin+1)-1  ; 
    790880      } 
    791881 
     
    828918 
    829919  } 
    830  
    831920 
    832921  bool CDomain::dispatchEvent(CEventServer& event) 
     
    884973    if (zoom_ni_srv<=0 || zoom_nj_srv<=0) 
    885974    { 
    886       zoom_ibegin_srv=1 ; zoom_iend_srv=0 ; zoom_ni_srv=0 ; 
    887       zoom_jbegin_srv=1 ; zoom_jend_srv=0 ; zoom_nj_srv=0 ; 
     975      zoom_ibegin_srv=0 ; zoom_iend_srv=0 ; zoom_ni_srv=0 ; 
     976      zoom_jbegin_srv=0 ; zoom_jend_srv=0 ; zoom_nj_srv=0 ; 
    888977    } 
    889978    lonvalue_srv.resize(zoom_ni_srv*zoom_nj_srv) ; 
     
    9281017    { 
    9291018      i=indi(ind) ; j=indj(ind) ; 
    930       ind_srv=(i-(zoom_ibegin_srv-1))+(j-(zoom_jbegin_srv-1))*zoom_ni_srv ; 
     1019      ind_srv=(i-(zoom_ibegin_srv))+(j-(zoom_jbegin_srv))*zoom_ni_srv ; 
    9311020      lonvalue_srv(ind_srv)=lon(ind) ; 
    9321021      if (hasBounds) 
     
    9681057    { 
    9691058      i=indi(ind) ; j=indj(ind) ; 
    970       ind_srv=(i-(zoom_ibegin_srv-1))+(j-(zoom_jbegin_srv-1))*zoom_ni_srv ; 
     1059      ind_srv=(i-(zoom_ibegin_srv))+(j-(zoom_jbegin_srv))*zoom_ni_srv ; 
    9711060      latvalue_srv(ind_srv)=lat(ind) ; 
    9721061      if (hasBounds) 
  • XIOS/trunk/src/node/domain.hpp

    r540 r551  
    151151         bool isChecked; 
    152152         std::set<StdString> relFiles; 
    153          bool isClientChecked; // Verify whether all attributes of domain on the client side is good 
     153         bool isClientChecked; // Verify whether all attributes of domain on the client side are good 
    154154 
    155155         DECLARE_REF_FUNC(Domain,domain) 
  • XIOS/trunk/src/node/field.cpp

    r542 r551  
    152152    list< CArray<double,1>* > list_data ; 
    153153 
    154     for(it=grid->storeIndex_toSrv.begin();it!=grid->storeIndex_toSrv.end();it++) 
     154     for(it=grid->storeIndex_toSrv.begin();it!=grid->storeIndex_toSrv.end();it++) 
    155155    { 
    156156      int rank=(*it).first ; 
    157157      CArray<int,1>& index = *(it->second) ; 
    158158      CArray<double,1> data_tmp(index.numElements()) ; 
    159  
    160159      for(int n=0;n<data_tmp.numElements();n++) data_tmp(n)=data(index(n)) ; 
    161160      list_msg.push_back(shared_ptr<CMessage>(new CMessage)) ; 
     
    193192    if (data_srv.empty()) 
    194193    { 
    195       for(map<int, CArray<int, 1>* >::iterator it=grid->out_i_fromClient.begin();it!=grid->out_i_fromClient.end();it++) 
     194//      for(map<int, CArray<int, 1>* >::iterator it=grid->out_i_fromClient.begin();it!=grid->out_i_fromClient.end();it++) 
     195      for(map<int, CArray<size_t, 1>* >::iterator it=grid->outIndexFromClient.begin();it!=grid->outIndexFromClient.end();++it) 
    196196      { 
    197197        int rank=it->first ; 
     
    683683      map<int, CArray<double,1>* >::iterator it; 
    684684      for(it=data_srv.begin();it!=data_srv.end();it++) 
     685      { 
     686        grid->outputField(it->first,*it->second, fieldOut.dataFirst()) ; 
     687      } 
     688 
     689//         grid->outputField(it->first,*it->second, fieldOut.) ; 
     690 
     691   } 
     692 
     693   void CField::outputField(CArray<double,2>& fieldOut) 
     694   { 
     695      map<int, CArray<double,1>* >::iterator it; 
     696 
     697      for(it=data_srv.begin();it!=data_srv.end();it++) 
     698      { 
    685699         grid->outputField(it->first,*it->second, fieldOut) ; 
    686  
    687    } 
    688  
    689    void CField::outputField(CArray<double,2>& fieldOut) 
    690    { 
    691       map<int, CArray<double,1>* >::iterator it; 
    692  
    693       for(it=data_srv.begin();it!=data_srv.end();it++) 
    694       { 
    695          grid->outputField(it->first,*it->second, fieldOut) ; 
    696       } 
    697    } 
     700      } 
     701   } 
     702 
    698703   ///------------------------------------------------------------------- 
    699704 
  • XIOS/trunk/src/node/grid.cpp

    r540 r551  
    2121      , withAxis(false), isChecked(false), isDomainAxisChecked(false), axis(), domain() 
    2222      , storeIndex(1), out_i_index(1), out_j_index(1), out_l_index(1), isDomConServerComputed_(false) 
    23       , vDomainGroup_(), vAxisGroup_(), axisOrder_(), axisList_(), isAxisListSet(false), isDomListSet(false) 
     23      , vDomainGroup_(), vAxisGroup_(), axisList_(), isAxisListSet(false), isDomListSet(false), clientDistribution_(0), isIndexSent(false) 
    2424   { 
    2525     setVirtualDomainGroup(); 
     
    3131      , withAxis(false), isChecked(false), isDomainAxisChecked(false), axis(), domain() 
    3232      , storeIndex(1), out_i_index(1), out_j_index(1), out_l_index(1), isDomConServerComputed_(false) 
    33       , vDomainGroup_(), vAxisGroup_(), axisOrder_(), axisList_(), isAxisListSet(false), isDomListSet(false) 
     33      , vDomainGroup_(), vAxisGroup_(), axisList_(), isAxisListSet(false), isDomListSet(false), clientDistribution_(0), isIndexSent(false) 
    3434   { 
    3535     setVirtualDomainGroup(); 
     
    5151    for(map<int,CArray<int,1>* >::iterator it=out_j_fromClient.begin();it!=out_j_fromClient.end();it++) delete it->second ; 
    5252    for(map<int,CArray<int,1>* >::iterator it=out_l_fromClient.begin();it!=out_l_fromClient.end();it++) delete it->second ; 
     53 
     54    for(map<int,CArray<size_t,1>* >::iterator it=outIndexFromClient.begin();it!=outIndexFromClient.end();++it) delete (it->second); 
     55 
     56    if (0 != clientDistribution_) delete clientDistribution_; 
    5357 
    5458   } 
     
    176180   std::map<int, StdSize> CGrid::getConnectedServerDataSize() 
    177181   { 
     182     double secureFactor = 2.5 * sizeof(double) * CXios::bufferServerFactorSize; 
     183     StdSize retVal; 
    178184     std::map<int, StdSize> ret; 
    179      std::map<int, int>::const_iterator it = domConnectedServerSide_.begin(), 
    180                                        itE = domConnectedServerSide_.end(); 
    181      std::vector<int> nData = domain->nbDataSrv; 
    182      std::vector<int>::const_iterator itData = nData.begin(); 
    183      StdSize retVal = StdSize(0.0); 
    184      for (; it != itE; ++it, ++itData) 
     185     const std::map<int, std::vector<int> >& distribution = clientDistribution_->getLocalIndexSendToServer(); 
     186     std::map<int, std::vector<int> >::const_iterator it = distribution.begin(), itE = distribution.end(); 
     187     for (; it != itE; ++it) 
    185188     { 
    186        retVal = (it->second < *itData) ? *itData : it->second; 
    187        if (this->withAxis) retVal *= this->axis->size.getValue(); 
    188        retVal *= sizeof(double); 
    189        retVal *= 2.5 * CXios::bufferServerFactorSize; // Secure factor, myterious number 
    190        ret.insert(make_pair(it->first, retVal)); 
     189        retVal = it->second.size(); 
     190        retVal *= secureFactor; 
     191        ret.insert(std::make_pair<int,StdSize>(it->first, retVal)); 
    191192     } 
     193 
    192194     return ret; 
    193195   } 
     
    235237 
    236238     if (context->hasClient) 
    237       if (this->isChecked && doSendingIndex) sendIndex(); 
     239      if (this->isChecked && doSendingIndex && !isIndexSent) { sendIndex(); this->isIndexSent = true; } 
    238240 
    239241     if (this->isChecked) return; 
     
    397399   void CGrid::computeIndex(void) 
    398400   { 
    399  
     401     CContext* context = CContext::getCurrent() ; 
     402     CContextClient* client=context->client ; 
     403     clientDistribution_ = new CDistributionClient(client->clientRank, this); 
     404     clientDistribution_->computeServerIndexMapping(client->serverSize); 
     405     nbSenders = clientDistribution_->computeConnectedClients(client->serverSize, client->clientSize, client->intraComm); 
     406 
     407     storeIndex_client.resize(clientDistribution_->getLocalDataIndexOnClient().numElements()); 
     408     storeIndex_client = (clientDistribution_->getLocalDataIndexOnClient()); 
     409 
     410/* 
    400411      const int ni   = domain->ni.getValue() , 
    401412                nj   = domain->nj.getValue() , 
     
    476487         } 
    477488      } 
    478       computeDomConServer(); 
     489*/ 
     490//      computeDomConServer(); 
    479491//      sendIndex() ; 
    480492 
     
    520532      grid->setDomainList(domains); 
    521533      grid->setAxisList(axis); 
     534 
     535      //By default, domains are always the first ones of a grid 
     536      if (grid->axisDomainOrder.isEmpty()) 
     537      { 
     538        int size = domains.size()+axis.size(); 
     539        grid->axisDomainOrder.resize(size); 
     540        for (int i = 0; i < size; ++i) 
     541        { 
     542          if (i < domains.size()) grid->axisDomainOrder(i) = true; 
     543          else grid->axisDomainOrder(i) = false; 
     544        } 
     545      } 
     546 
    522547      return (grid); 
    523548   } 
     
    561586      for(StdSize n = 0; n < stored.numElements(); n++) 
    562587         field(out_i(n)) = stored(n) ; 
     588   } 
     589 
     590   void CGrid::outputField(int rank, const CArray<double, 1>& stored, double* field) 
     591   { 
     592     CArray<size_t,1>& out_i=*outIndexFromClient[rank]; 
     593     StdSize numElements = stored.numElements(); 
     594     for (StdSize n = 0; n < numElements; ++n) 
     595     { 
     596       *(field+out_i(n)) = stored(n); 
     597     } 
    563598   } 
    564599 
     
    599634//         if (domain->mapConnectedServer(i,j)==ns)  nb++ ; 
    600635//       } 
    601 // 
    602636//       CArray<int,1> storeIndex(nb) ; 
    603637//       CArray<int,1> out_i(nb) ; 
     
    676710    int rank ; 
    677711    list<shared_ptr<CMessage> > list_msg ; 
    678     list< CArray<int,1>* > list_out_i,list_out_j,list_out_l ; 
    679  
     712    list< CArray<size_t,1>* > listOutIndex; 
     713 
     714    const std::map<int, std::vector<size_t> >& globalIndexOnServer = clientDistribution_->getGlobalIndexOnServer(); 
     715    const std::map<int, std::vector<int> >& localIndexSendToServer  = clientDistribution_->getLocalIndexSendToServer(); 
     716 
     717    std::map<int, std::vector<size_t> >::const_iterator iteMap, itbMap, itGlobal; 
     718    std::map<int, std::vector<int> >::const_iterator itLocal; 
     719    itbMap = itGlobal = globalIndexOnServer.begin(); 
     720    iteMap = globalIndexOnServer.end(); 
     721    itLocal = localIndexSendToServer.begin(); 
     722 
     723 
     724    for (int ns = 0; itGlobal != iteMap; ++itGlobal, ++itLocal, ++ns) 
     725    { 
     726      rank = itGlobal->first; 
     727      int nb = (itGlobal->second).size(); 
     728 
     729      CArray<size_t, 1> outGlobalIndexOnServer(nb); 
     730      CArray<int, 1> outLocalIndexToServer(nb); 
     731      for (int k = 0; k < nb; ++k) 
     732      { 
     733        outGlobalIndexOnServer(k) = itGlobal->second.at(k); 
     734        outLocalIndexToServer(k)  = itLocal->second.at(k); 
     735      } 
     736 
     737      storeIndex_toSrv.insert( pair<int,CArray<int,1>* >(rank,new CArray<int,1>(outLocalIndexToServer) )); 
     738      listOutIndex.push_back(new CArray<size_t,1>(outGlobalIndexOnServer)); 
     739 
     740      list_msg.push_back(shared_ptr<CMessage>(new CMessage)); 
     741      *list_msg.back()<<getId()<<*listOutIndex.back(); 
     742      event.push(rank, nbSenders[rank], *list_msg.back()); 
     743    } 
     744    client->sendEvent(event); 
     745    for(list<CArray<size_t,1>* >::iterator it=listOutIndex.begin();it!=listOutIndex.end();++it) delete *it ; 
     746 
     747/* 
    680748    if (!isDomConServerComputed_) computeDomConServer(); 
    681749 
     
    721789    for(list<CArray<int,1>* >::iterator it=list_out_j.begin();it!=list_out_j.end();it++) delete *it ; 
    722790    for(list<CArray<int,1>* >::iterator it=list_out_l.begin();it!=list_out_l.end();it++) delete *it ; 
    723  
     791*/ 
    724792  } 
    725793 
     
    731799      int rank=it->rank; 
    732800      CBufferIn* buffer=it->buffer; 
    733       string domainId ; 
    734       *buffer>>domainId ; 
    735       get(domainId)->recvIndex(rank,*buffer) ; 
     801      string gridId ; 
     802      *buffer>>gridId ; 
     803      get(gridId)->recvIndex(rank,*buffer) ; 
    736804    } 
    737805  } 
     
    739807  void CGrid::recvIndex(int rank, CBufferIn& buffer) 
    740808  { 
     809     CArray<size_t,1> outIndex; 
     810     buffer>>outIndex; 
     811     outIndexFromClient.insert(std::pair<int, CArray<size_t,1>* >(rank, new CArray<size_t,1>(outIndex))); 
     812 
     813    /* 
    741814    CArray<int,1> out_i ; 
    742815    CArray<int,1> out_j ; 
     
    751824    out_j_fromClient.insert(pair< int,CArray<int,1>* >(rank,new CArray<int,1>(out_j) )) ; 
    752825    out_l_fromClient.insert(pair< int,CArray<int,1>* >(rank,new CArray<int,1>(out_l) )) ; 
     826    */ 
    753827  } 
    754828 
     
    9471021   } 
    9481022 
     1023  /*! 
     1024  \brief Solve domain and axis references 
     1025  As field, domain and axis can refer to other domains or axis. In order to inherit correctly 
     1026  all attributes from their parents, they should be processed with this function 
     1027  \param[in] apply inherit all attributes of parents (true) 
     1028  */ 
    9491029  void CGrid::solveDomainAxisRefInheritance(bool apply) 
    9501030  { 
     
    9631043        if ((!pDom->domain_ref.isEmpty()) && (pDom->name.isEmpty())) 
    9641044          pDom->name.setValue(pDom->getBaseDomainReference()->getId()); 
    965  
    9661045      } 
    9671046    } 
     
    9821061  } 
    9831062 
     1063  /*! 
     1064  \brief Get the list of domain pointers 
     1065  \return list of domain pointers 
     1066  */ 
    9841067  std::vector<CDomain*> CGrid::getDomains() 
    9851068  { 
     
    9921075  } 
    9931076 
     1077  /*! 
     1078  \brief Get the list of  axis pointers 
     1079  \return list of axis pointers 
     1080  */ 
    9941081  std::vector<CAxis*> CGrid::getAxis() 
    9951082  { 
     
    10011088  } 
    10021089 
     1090  /*! 
     1091  \brief Set domain(s) of a grid from a list 
     1092  \param[in] domains list of domains 
     1093  */ 
    10031094  void CGrid::setDomainList(const std::vector<CDomain*> domains) 
    10041095  { 
     
    10191110  } 
    10201111 
     1112  /*! 
     1113  \brief Set axis(s) of a grid from a list 
     1114  \param[in] axis list of axis 
     1115  */ 
    10211116  void CGrid::setAxisList(const std::vector<CAxis*> axis) 
    10221117  { 
     
    10361131  } 
    10371132 
     1133  /*! 
     1134  \brief Get list of id of domains 
     1135  \return id list of domains 
     1136  */ 
    10381137  std::vector<StdString> CGrid::getDomainList() 
    10391138  { 
     
    10421141  } 
    10431142 
     1143  /*! 
     1144  \brief Get list of id of axis 
     1145  \return id list of axis 
     1146  */ 
    10441147  std::vector<StdString> CGrid::getAxisList() 
    10451148  { 
     
    10741177  { 
    10751178    SuperClass::parse(node); 
     1179    // List order of axis and domain in a grid, if there is a domain, it will take value 1 (true), axis 0 (false) 
     1180//    std::vector<int> axisOrder; 
     1181    std::vector<bool> order; 
    10761182 
    10771183    if (node.goToChildElement()) 
    10781184    { 
    1079       int domainIdx = -1; 
    1080       int posAxis = 0; 
    10811185      StdString domainName("domain"); 
    10821186      StdString axisName("axis"); 
     
    10841188      { 
    10851189        if (node.getElementName() == domainName) { 
    1086           axisOrder_.push_back(domainIdx); 
     1190          order.push_back(true); 
    10871191          this->getVirtualDomainGroup()->parseChild(node); 
    10881192        } 
    10891193        if (node.getElementName() == axisName) { 
    1090           axisOrder_.push_back(posAxis); 
    1091           ++posAxis; 
     1194          order.push_back(false); 
    10921195          this->getVirtualAxisGroup()->parseChild(node); 
    10931196        } 
     
    10961199    } 
    10971200 
    1098     if (!axisOrder_.empty()) 
    1099     { 
    1100       int sizeOrd = axisOrder_.size(); 
    1101       axisDomOrder.resize(sizeOrd); 
     1201    if (!order.empty()) 
     1202    { 
     1203      int sizeOrd = order.size(); 
     1204      axisDomainOrder.resize(sizeOrd); 
    11021205      for (int i = 0; i < sizeOrd; ++i) 
    11031206      { 
    1104         axisDomOrder(i) = axisOrder_[i]; 
     1207        axisDomainOrder(i) = order[i]; 
    11051208      } 
    11061209    } 
  • XIOS/trunk/src/node/grid.hpp

    r540 r551  
    1111#include "array_new.hpp" 
    1212#include "attribute_array.hpp" 
     13#include "distribution_client.hpp" 
    1314 
    1415namespace xios { 
     
    2122   class CAxisGroup; 
    2223   class CGrid; 
     24   class CDistributionClient; 
    2325 
    2426   ///-------------------------------------------------------------- 
     
    9799         void outputField(int rank, const CArray<double,1>& stored,  CArray<double,2>& field)  ; 
    98100         void outputField(int rank, const CArray<double,1>& stored,  CArray<double,1>& field)  ; 
     101         void outputField(int rank, const CArray<double,1>& stored,  double* field); 
    99102 
    100103         virtual void parse(xml::CXMLNode & node); 
     
    154157         std::vector<CDomain*> getDomains(); 
    155158         std::vector<CAxis*> getAxis(); 
     159         std::vector<int> getAxisOrder(); 
    156160 
    157161      public: 
     
    161165         bool isChecked; 
    162166         bool isDomainAxisChecked; 
     167         bool isIndexSent; 
    163168 
    164169         CAxis*   axis ; 
     
    184189         map<int, CArray<int, 1>* > out_j_fromClient ; 
    185190         map<int, CArray<int, 1>* > out_l_fromClient ; 
     191 
     192         map<int, CArray<size_t, 1>* > outIndexFromClient; 
    186193         void checkMask(void) ; 
    187194 
     
    209216        std::vector<std::string> axisList_, domList_; 
    210217        bool isAxisListSet, isDomListSet; 
    211  
    212         // List order of axis in a grid, if there is a domain, it will take value -1 
    213         std::vector<int> axisOrder_; 
     218        CDistributionClient* clientDistribution_; 
    214219   }; // class CGrid 
    215220 
  • XIOS/trunk/src/test/test_new_features.f90

    r549 r551  
    5656    ENDDO 
    5757  ENDDO 
    58   ni=ni_glo ; ibegin=1 
     58  ni=ni_glo ; ibegin=0 
    5959 
    60   jbegin=1 
     60  jbegin=0 
    6161  DO n=0,size-1 
    6262    nj=nj_glo/size 
     
    7272  lon(:,:)=lon_glo(ibegin:iend,jbegin:jend) 
    7373  lat(:,:)=lat_glo(ibegin:iend,jbegin:jend) 
    74   field_A(1:ni,1:nj,:)=field_A_glo(ibegin:iend,jbegin:jend,:) 
     74  field_A(1:ni,1:nj,:)=field_A_glo(ibegin+1:iend+1,jbegin+1:jend+1,:) 
    7575 
    7676  CALL xios_context_initialize("test",comm) 
Note: See TracChangeset for help on using the changeset viewer.