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/icvariablegroup_attr.cpp

    r591 r1041  
    7070 
    7171 
     72  void cxios_set_variablegroup_ts_target(variablegroup_Ptr variablegroup_hdl, const char * ts_target, int ts_target_size) 
     73  { 
     74    std::string ts_target_str; 
     75    if (!cstr2string(ts_target, ts_target_size, ts_target_str)) return; 
     76    CTimer::get("XIOS").resume(); 
     77    variablegroup_hdl->ts_target.fromString(ts_target_str); 
     78    CTimer::get("XIOS").suspend(); 
     79  } 
     80 
     81  void cxios_get_variablegroup_ts_target(variablegroup_Ptr variablegroup_hdl, char * ts_target, int ts_target_size) 
     82  { 
     83    CTimer::get("XIOS").resume(); 
     84    if (!string_copy(variablegroup_hdl->ts_target.getInheritedStringValue(), ts_target, ts_target_size)) 
     85      ERROR("void cxios_get_variablegroup_ts_target(variablegroup_Ptr variablegroup_hdl, char * ts_target, int ts_target_size)", << "Input string is too short"); 
     86    CTimer::get("XIOS").suspend(); 
     87  } 
     88 
     89  bool cxios_is_defined_variablegroup_ts_target(variablegroup_Ptr variablegroup_hdl) 
     90  { 
     91     CTimer::get("XIOS").resume(); 
     92     bool isDefined = variablegroup_hdl->ts_target.hasInheritedValue(); 
     93     CTimer::get("XIOS").suspend(); 
     94     return isDefined; 
     95  } 
     96 
     97 
    7298  void cxios_set_variablegroup_type(variablegroup_Ptr variablegroup_hdl, const char * type, int type_size) 
    7399  { 
Note: See TracChangeset for help on using the changeset viewer.