Changeset 541
- Timestamp:
- 12/16/14 12:55:59 (10 years ago)
- Location:
- XIOS/trunk/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/config/grid_attribute.conf
r540 r541 1 1 DECLARE_ATTRIBUTE(StdString, name) 2 2 DECLARE_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) 5 5 DECLARE_ARRAY(bool, 3 , mask) 6 6 … … 8 8 // An array contains order of axis and domains composing of the grid 9 9 DECLARE_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 18 18 typedef xios::CGrid* grid_Ptr; 19 19 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) 21 21 { 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()); 26 25 CTimer::get("XIOS").suspend(); 27 26 } 28 27 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) 30 29 { 31 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() ; 34 33 CTimer::get("XIOS").suspend(); 35 34 } 36 35 37 bool cxios_is_defined_grid_axis _ref(grid_Ptr grid_hdl )36 bool cxios_is_defined_grid_axisDomOrder(grid_Ptr grid_hdl ) 38 37 { 39 38 CTimer::get("XIOS").resume(); 40 return grid_hdl->axis _ref.hasInheritedValue();39 return grid_hdl->axisDomOrder.hasInheritedValue(); 41 40 CTimer::get("XIOS").suspend(); 42 41 } … … 65 64 CTimer::get("XIOS").resume(); 66 65 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();93 66 CTimer::get("XIOS").suspend(); 94 67 } -
XIOS/trunk/src/interface/c_attr/icgridgroup_attr.cpp
r532 r541 18 18 typedef xios::CGridGroup* gridgroup_Ptr; 19 19 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) 21 21 { 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()); 26 25 CTimer::get("XIOS").suspend(); 27 26 } 28 27 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) 30 29 { 31 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() ; 34 33 CTimer::get("XIOS").suspend(); 35 34 } 36 35 37 bool cxios_is_defined_gridgroup_axis _ref(gridgroup_Ptr gridgroup_hdl )36 bool cxios_is_defined_gridgroup_axisDomOrder(gridgroup_Ptr gridgroup_hdl ) 38 37 { 39 38 CTimer::get("XIOS").resume(); 40 return gridgroup_hdl->axis _ref.hasInheritedValue();39 return gridgroup_hdl->axisDomOrder.hasInheritedValue(); 41 40 CTimer::get("XIOS").suspend(); 42 41 } … … 65 64 CTimer::get("XIOS").resume(); 66 65 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();93 66 CTimer::get("XIOS").suspend(); 94 67 } -
XIOS/trunk/src/node/context.cpp
r540 r541 356 356 if (hasClient) 357 357 { 358 std::cout << "Current context " << *this << std::endl;358 // std::cout << "Current context " << *this << std::endl; 359 359 // After xml is parsed, there are some more works with post processing 360 360 postProcessing(); … … 715 715 { 716 716 postProcessing(); 717 std::cout << "server context " << *this << std::endl;717 // std::cout << "server context " << *this << std::endl; 718 718 } 719 719 -
XIOS/trunk/src/node/field.cpp
r540 r541 506 506 CDomain* domain; 507 507 CAxis* axis; 508 std::vector<CDomain*> vecDom; 509 std::vector<CAxis*> vecAxis; 510 std::vector<std::string> domList, axisList; 508 511 509 512 if (!domain_ref.isEmpty()) 510 513 { 511 514 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 } 513 519 else 514 520 ERROR("CField::solveGridReference(void)", … … 520 526 { 521 527 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 } 523 532 else 524 533 ERROR("CField::solveGridReference(void)", … … 530 539 { 531 540 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 } 533 546 else 534 547 ERROR("CField::solveGridReference(void)", … … 562 575 // CArray<std::string,1> axisListTmp = grid->axisList.getValue(); 563 576 564 std::vector<std::string> domList, axisList;565 if (0 != grid)566 {567 domList = grid->getDomainList();568 axisList = grid->getAxisList();569 }570 571 577 if (domList.empty() && axisList.empty()) 572 578 { 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);577 579 this->grid = CGrid::createGrid(vecDom, vecAxis); 578 580 } -
XIOS/trunk/src/test/test_new_features.f90
r540 r541 13 13 TYPE(xios_time) :: dtime 14 14 TYPE(xios_context) :: ctx_hdl 15 INTEGER,PARAMETER :: ni_glo= 516 INTEGER,PARAMETER :: nj_glo= 515 INTEGER,PARAMETER :: ni_glo=100 16 INTEGER,PARAMETER :: nj_glo=100 17 17 INTEGER,PARAMETER :: llm=5 18 18 DOUBLE PRECISION :: lval(llm)=1 … … 80 80 CALL xios_set_context_attr("test",calendar_type="Gregorian") 81 81 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) ; 83 83 CALL xios_set_domain_attr("domain_A",ni_glo=ni_glo, nj_glo=nj_glo, ibegin=ibegin, ni=ni,jbegin=jbegin,nj=nj) 84 84 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.