Changeset 541


Ignore:
Timestamp:
12/16/14 12:55:59 (10 years ago)
Author:
mhnguyen
Message:

Replacing some attribute files with new ones

Location:
XIOS/trunk/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/config/grid_attribute.conf

    r540 r541  
    11DECLARE_ATTRIBUTE(StdString, name) 
    22DECLARE_ATTRIBUTE(StdString, description) 
    3 DECLARE_ATTRIBUTE(StdString, domain_ref) 
    4 DECLARE_ATTRIBUTE(StdString, axis_ref) 
     3//DECLARE_ATTRIBUTE(StdString, domain_ref) 
     4//DECLARE_ATTRIBUTE(StdString, axis_ref) 
    55DECLARE_ARRAY(bool, 3 , mask) 
    66 
     
    88// An array contains order of axis and domains composing of the grid 
    99DECLARE_ARRAY(int, 1 , axisDomOrder) 
    10 //DECLARE_ARRAY(StdString, 1 , axisList) 
    11 //DECLARE_ARRAY(StdString, 1 , domainList) 
  • XIOS/trunk/src/interface/c_attr/icgrid_attr.cpp

    r532 r541  
    1818  typedef xios::CGrid*  grid_Ptr; 
    1919   
    20   void cxios_set_grid_axis_ref(grid_Ptr grid_hdl, const char * axis_ref, int axis_ref_size) 
     20  void cxios_set_grid_axisDomOrder(grid_Ptr grid_hdl, int* axisDomOrder, int extent1) 
    2121  { 
    22     std::string axis_ref_str; 
    23     if(!cstr2string(axis_ref, axis_ref_size, axis_ref_str)) return; 
    24      CTimer::get("XIOS").resume(); 
    25     grid_hdl->axis_ref.setValue(axis_ref_str); 
     22    CTimer::get("XIOS").resume(); 
     23    CArray<int,1> tmp(axisDomOrder,shape(extent1),neverDeleteData) ; 
     24    grid_hdl->axisDomOrder.reference(tmp.copy()); 
    2625     CTimer::get("XIOS").suspend(); 
    2726  } 
    2827   
    29   void cxios_get_grid_axis_ref(grid_Ptr grid_hdl, char * axis_ref, int axis_ref_size) 
     28  void cxios_get_grid_axisDomOrder(grid_Ptr grid_hdl, int* axisDomOrder, int extent1) 
    3029  { 
    31      CTimer::get("XIOS").resume(); 
    32     if(!string_copy(grid_hdl->axis_ref.getInheritedValue(),axis_ref , axis_ref_size)) 
    33       ERROR("void cxios_get_grid_axis_ref(grid_Ptr grid_hdl, char * axis_ref, int axis_ref_size)", <<"Input string is to short"); 
     30    CTimer::get("XIOS").resume(); 
     31    CArray<int,1> tmp(axisDomOrder,shape(extent1),neverDeleteData) ; 
     32    tmp=grid_hdl->axisDomOrder.getInheritedValue() ; 
    3433     CTimer::get("XIOS").suspend(); 
    3534  } 
    3635   
    37   bool cxios_is_defined_grid_axis_ref(grid_Ptr grid_hdl ) 
     36  bool cxios_is_defined_grid_axisDomOrder(grid_Ptr grid_hdl ) 
    3837  { 
    3938     CTimer::get("XIOS").resume(); 
    40     return grid_hdl->axis_ref.hasInheritedValue(); 
     39    return grid_hdl->axisDomOrder.hasInheritedValue(); 
    4140     CTimer::get("XIOS").suspend(); 
    4241  } 
     
    6564     CTimer::get("XIOS").resume(); 
    6665    return grid_hdl->description.hasInheritedValue(); 
    67      CTimer::get("XIOS").suspend(); 
    68   } 
    69    
    70    
    71    
    72   void cxios_set_grid_domain_ref(grid_Ptr grid_hdl, const char * domain_ref, int domain_ref_size) 
    73   { 
    74     std::string domain_ref_str; 
    75     if(!cstr2string(domain_ref, domain_ref_size, domain_ref_str)) return; 
    76      CTimer::get("XIOS").resume(); 
    77     grid_hdl->domain_ref.setValue(domain_ref_str); 
    78      CTimer::get("XIOS").suspend(); 
    79   } 
    80    
    81   void cxios_get_grid_domain_ref(grid_Ptr grid_hdl, char * domain_ref, int domain_ref_size) 
    82   { 
    83      CTimer::get("XIOS").resume(); 
    84     if(!string_copy(grid_hdl->domain_ref.getInheritedValue(),domain_ref , domain_ref_size)) 
    85       ERROR("void cxios_get_grid_domain_ref(grid_Ptr grid_hdl, char * domain_ref, int domain_ref_size)", <<"Input string is to short"); 
    86      CTimer::get("XIOS").suspend(); 
    87   } 
    88    
    89   bool cxios_is_defined_grid_domain_ref(grid_Ptr grid_hdl ) 
    90   { 
    91      CTimer::get("XIOS").resume(); 
    92     return grid_hdl->domain_ref.hasInheritedValue(); 
    9366     CTimer::get("XIOS").suspend(); 
    9467  } 
  • XIOS/trunk/src/interface/c_attr/icgridgroup_attr.cpp

    r532 r541  
    1818  typedef xios::CGridGroup*  gridgroup_Ptr; 
    1919   
    20   void cxios_set_gridgroup_axis_ref(gridgroup_Ptr gridgroup_hdl, const char * axis_ref, int axis_ref_size) 
     20  void cxios_set_gridgroup_axisDomOrder(gridgroup_Ptr gridgroup_hdl, int* axisDomOrder, int extent1) 
    2121  { 
    22     std::string axis_ref_str; 
    23     if(!cstr2string(axis_ref, axis_ref_size, axis_ref_str)) return; 
    24      CTimer::get("XIOS").resume(); 
    25     gridgroup_hdl->axis_ref.setValue(axis_ref_str); 
     22    CTimer::get("XIOS").resume(); 
     23    CArray<int,1> tmp(axisDomOrder,shape(extent1),neverDeleteData) ; 
     24    gridgroup_hdl->axisDomOrder.reference(tmp.copy()); 
    2625     CTimer::get("XIOS").suspend(); 
    2726  } 
    2827   
    29   void cxios_get_gridgroup_axis_ref(gridgroup_Ptr gridgroup_hdl, char * axis_ref, int axis_ref_size) 
     28  void cxios_get_gridgroup_axisDomOrder(gridgroup_Ptr gridgroup_hdl, int* axisDomOrder, int extent1) 
    3029  { 
    31      CTimer::get("XIOS").resume(); 
    32     if(!string_copy(gridgroup_hdl->axis_ref.getInheritedValue(),axis_ref , axis_ref_size)) 
    33       ERROR("void cxios_get_gridgroup_axis_ref(gridgroup_Ptr gridgroup_hdl, char * axis_ref, int axis_ref_size)", <<"Input string is to short"); 
     30    CTimer::get("XIOS").resume(); 
     31    CArray<int,1> tmp(axisDomOrder,shape(extent1),neverDeleteData) ; 
     32    tmp=gridgroup_hdl->axisDomOrder.getInheritedValue() ; 
    3433     CTimer::get("XIOS").suspend(); 
    3534  } 
    3635   
    37   bool cxios_is_defined_gridgroup_axis_ref(gridgroup_Ptr gridgroup_hdl ) 
     36  bool cxios_is_defined_gridgroup_axisDomOrder(gridgroup_Ptr gridgroup_hdl ) 
    3837  { 
    3938     CTimer::get("XIOS").resume(); 
    40     return gridgroup_hdl->axis_ref.hasInheritedValue(); 
     39    return gridgroup_hdl->axisDomOrder.hasInheritedValue(); 
    4140     CTimer::get("XIOS").suspend(); 
    4241  } 
     
    6564     CTimer::get("XIOS").resume(); 
    6665    return gridgroup_hdl->description.hasInheritedValue(); 
    67      CTimer::get("XIOS").suspend(); 
    68   } 
    69    
    70    
    71    
    72   void cxios_set_gridgroup_domain_ref(gridgroup_Ptr gridgroup_hdl, const char * domain_ref, int domain_ref_size) 
    73   { 
    74     std::string domain_ref_str; 
    75     if(!cstr2string(domain_ref, domain_ref_size, domain_ref_str)) return; 
    76      CTimer::get("XIOS").resume(); 
    77     gridgroup_hdl->domain_ref.setValue(domain_ref_str); 
    78      CTimer::get("XIOS").suspend(); 
    79   } 
    80    
    81   void cxios_get_gridgroup_domain_ref(gridgroup_Ptr gridgroup_hdl, char * domain_ref, int domain_ref_size) 
    82   { 
    83      CTimer::get("XIOS").resume(); 
    84     if(!string_copy(gridgroup_hdl->domain_ref.getInheritedValue(),domain_ref , domain_ref_size)) 
    85       ERROR("void cxios_get_gridgroup_domain_ref(gridgroup_Ptr gridgroup_hdl, char * domain_ref, int domain_ref_size)", <<"Input string is to short"); 
    86      CTimer::get("XIOS").suspend(); 
    87   } 
    88    
    89   bool cxios_is_defined_gridgroup_domain_ref(gridgroup_Ptr gridgroup_hdl ) 
    90   { 
    91      CTimer::get("XIOS").resume(); 
    92     return gridgroup_hdl->domain_ref.hasInheritedValue(); 
    9366     CTimer::get("XIOS").suspend(); 
    9467  } 
  • XIOS/trunk/src/node/context.cpp

    r540 r541  
    356356     if (hasClient) 
    357357     { 
    358        std::cout << "Current context " << *this << std::endl; 
     358//       std::cout << "Current context " << *this << std::endl; 
    359359       // After xml is parsed, there are some more works with post processing 
    360360       postProcessing(); 
     
    715715   { 
    716716      postProcessing(); 
    717       std::cout << "server context " << *this << std::endl; 
     717//      std::cout << "server context " << *this << std::endl; 
    718718   } 
    719719 
  • XIOS/trunk/src/node/field.cpp

    r540 r541  
    506506      CDomain* domain; 
    507507      CAxis* axis; 
     508      std::vector<CDomain*> vecDom; 
     509      std::vector<CAxis*> vecAxis; 
     510     std::vector<std::string> domList, axisList; 
    508511 
    509512      if (!domain_ref.isEmpty()) 
    510513      { 
    511514         if (CDomain::has(domain_ref.getValue())) 
    512             domain = CDomain::get(domain_ref.getValue()) ; 
     515         { 
     516           domain = CDomain::get(domain_ref.getValue()) ; 
     517           vecDom.push_back(domain); 
     518         } 
    513519         else 
    514520            ERROR("CField::solveGridReference(void)", 
     
    520526      { 
    521527         if (CAxis::has(axis_ref.getValue())) 
    522             axis = CAxis::get(axis_ref.getValue()) ; 
     528         { 
     529           axis = CAxis::get(axis_ref.getValue()) ; 
     530           vecAxis.push_back(axis); 
     531         } 
    523532         else 
    524533            ERROR("CField::solveGridReference(void)", 
     
    530539      { 
    531540         if (CGrid::has(grid_ref.getValue())) 
    532             this->grid = CGrid::get(grid_ref.getValue()) ; 
     541         { 
     542           this->grid = CGrid::get(grid_ref.getValue()) ; 
     543           domList = grid->getDomainList(); 
     544           axisList = grid->getAxisList(); 
     545         } 
    533546         else 
    534547            ERROR("CField::solveGridReference(void)", 
     
    562575//     CArray<std::string,1> axisListTmp = grid->axisList.getValue(); 
    563576 
    564      std::vector<std::string> domList, axisList; 
    565      if (0 != grid) 
    566      { 
    567        domList = grid->getDomainList(); 
    568        axisList = grid->getAxisList(); 
    569      } 
    570  
    571577     if (domList.empty() && axisList.empty()) 
    572578     { 
    573        std::vector<CDomain*> vecDom; 
    574        if (0 != domain) vecDom.push_back(domain); 
    575        std::vector<CAxis*> vecAxis; 
    576        if (0 != axis) vecAxis.push_back(axis); 
    577579       this->grid = CGrid::createGrid(vecDom, vecAxis); 
    578580     } 
  • XIOS/trunk/src/test/test_new_features.f90

    r540 r541  
    1313  TYPE(xios_time)      :: dtime 
    1414  TYPE(xios_context) :: ctx_hdl 
    15   INTEGER,PARAMETER :: ni_glo=5 
    16   INTEGER,PARAMETER :: nj_glo=5 
     15  INTEGER,PARAMETER :: ni_glo=100 
     16  INTEGER,PARAMETER :: nj_glo=100 
    1717  INTEGER,PARAMETER :: llm=5 
    1818  DOUBLE PRECISION  :: lval(llm)=1 
     
    8080  CALL xios_set_context_attr("test",calendar_type="Gregorian") 
    8181  CALL xios_set_axis_attr("axis_A",size=llm ,value=lval) ; 
    82   CALL xios_set_axis_attr("axis_B",size=llm ,value=lval2) ; 
     82!  CALL xios_set_axis_attr("axis_B",size=llm ,value=lval2) ; 
    8383  CALL xios_set_domain_attr("domain_A",ni_glo=ni_glo, nj_glo=nj_glo, ibegin=ibegin, ni=ni,jbegin=jbegin,nj=nj) 
    8484  CALL xios_set_domain_attr("domain_A",data_dim=2, data_ibegin=-1, data_ni=ni+2, data_jbegin=-2, data_nj=nj+4) 
Note: See TracChangeset for help on using the changeset viewer.