Ignore:
Timestamp:
02/01/17 10:10:40 (7 years ago)
Author:
rlacroix
Message:

Add a new attribute "ts_target" for variables.

It allows choosing the target of the variable when using timeseries. Possible values are:

  • field
  • file
  • both
  • none.

If no value is set then the default behavior is used, that is "field" for field variables and "file" for file variables.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/interface/c_attr/icvariable_attr.cpp

    r591 r1041  
    4444 
    4545 
     46  void cxios_set_variable_ts_target(variable_Ptr variable_hdl, const char * ts_target, int ts_target_size) 
     47  { 
     48    std::string ts_target_str; 
     49    if (!cstr2string(ts_target, ts_target_size, ts_target_str)) return; 
     50    CTimer::get("XIOS").resume(); 
     51    variable_hdl->ts_target.fromString(ts_target_str); 
     52    CTimer::get("XIOS").suspend(); 
     53  } 
     54 
     55  void cxios_get_variable_ts_target(variable_Ptr variable_hdl, char * ts_target, int ts_target_size) 
     56  { 
     57    CTimer::get("XIOS").resume(); 
     58    if (!string_copy(variable_hdl->ts_target.getInheritedStringValue(), ts_target, ts_target_size)) 
     59      ERROR("void cxios_get_variable_ts_target(variable_Ptr variable_hdl, char * ts_target, int ts_target_size)", << "Input string is too short"); 
     60    CTimer::get("XIOS").suspend(); 
     61  } 
     62 
     63  bool cxios_is_defined_variable_ts_target(variable_Ptr variable_hdl) 
     64  { 
     65     CTimer::get("XIOS").resume(); 
     66     bool isDefined = variable_hdl->ts_target.hasInheritedValue(); 
     67     CTimer::get("XIOS").suspend(); 
     68     return isDefined; 
     69  } 
     70 
     71 
    4672  void cxios_set_variable_type(variable_Ptr variable_hdl, const char * type, int type_size) 
    4773  { 
Note: See TracChangeset for help on using the changeset viewer.