Ignore:
Timestamp:
09/29/15 14:17:42 (9 years ago)
Author:
rlacroix
Message:

Support creating the timeseries automatically.

Fields which should be outputted as timeseries must have the ts_enabled attribute set to true.

Files have a new attribute timeseries which must be one of:

  • none: no timeseries are outputted, only the regular file (default behavior when the attribute is ommited).
  • only: only the timeseries are outputted, the regular file is not created.
  • both: both the timeseries and the regular files are outputted.
  • exclusive: the timeseries are outputted and a regular file is created with only the fields which were not marked for output as a timeserie (if any).

The name of the files created for the timeseries is composed of a prefix followed by the name of the variable. The file attribute ts_prefix can be used to control the prefix used (by default, the name of the regular file is used).

All the attributes of the regular file are inherited by the files created for the timeseries. The field attribute ts_split_freq can be used to configure the splitting for each timeseries (by default, the splitting frequency of the regular file is used).

File:
1 edited

Legend:

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

    r699 r711  
    481481 
    482482 
     483  void cxios_set_filegroup_timeseries(filegroup_Ptr filegroup_hdl, const char * timeseries, int timeseries_size) 
     484  { 
     485    std::string timeseries_str; 
     486    if (!cstr2string(timeseries, timeseries_size, timeseries_str)) return; 
     487    CTimer::get("XIOS").resume(); 
     488    filegroup_hdl->timeseries.fromString(timeseries_str); 
     489    CTimer::get("XIOS").suspend(); 
     490  } 
     491 
     492  void cxios_get_filegroup_timeseries(filegroup_Ptr filegroup_hdl, char * timeseries, int timeseries_size) 
     493  { 
     494    CTimer::get("XIOS").resume(); 
     495    if (!string_copy(filegroup_hdl->timeseries.getInheritedStringValue(), timeseries, timeseries_size)) 
     496      ERROR("void cxios_get_filegroup_timeseries(filegroup_Ptr filegroup_hdl, char * timeseries, int timeseries_size)", << "Input string is too short"); 
     497    CTimer::get("XIOS").suspend(); 
     498  } 
     499 
     500  bool cxios_is_defined_filegroup_timeseries(filegroup_Ptr filegroup_hdl) 
     501  { 
     502     CTimer::get("XIOS").resume(); 
     503     bool isDefined = filegroup_hdl->timeseries.hasInheritedValue(); 
     504     CTimer::get("XIOS").suspend(); 
     505     return isDefined; 
     506  } 
     507 
     508 
     509  void cxios_set_filegroup_ts_prefix(filegroup_Ptr filegroup_hdl, const char * ts_prefix, int ts_prefix_size) 
     510  { 
     511    std::string ts_prefix_str; 
     512    if (!cstr2string(ts_prefix, ts_prefix_size, ts_prefix_str)) return; 
     513    CTimer::get("XIOS").resume(); 
     514    filegroup_hdl->ts_prefix.setValue(ts_prefix_str); 
     515    CTimer::get("XIOS").suspend(); 
     516  } 
     517 
     518  void cxios_get_filegroup_ts_prefix(filegroup_Ptr filegroup_hdl, char * ts_prefix, int ts_prefix_size) 
     519  { 
     520    CTimer::get("XIOS").resume(); 
     521    if (!string_copy(filegroup_hdl->ts_prefix.getInheritedValue(), ts_prefix, ts_prefix_size)) 
     522      ERROR("void cxios_get_filegroup_ts_prefix(filegroup_Ptr filegroup_hdl, char * ts_prefix, int ts_prefix_size)", << "Input string is too short"); 
     523    CTimer::get("XIOS").suspend(); 
     524  } 
     525 
     526  bool cxios_is_defined_filegroup_ts_prefix(filegroup_Ptr filegroup_hdl) 
     527  { 
     528     CTimer::get("XIOS").resume(); 
     529     bool isDefined = filegroup_hdl->ts_prefix.hasInheritedValue(); 
     530     CTimer::get("XIOS").suspend(); 
     531     return isDefined; 
     532  } 
     533 
     534 
    483535  void cxios_set_filegroup_type(filegroup_Ptr filegroup_hdl, const char * type, int type_size) 
    484536  { 
Note: See TracChangeset for help on using the changeset viewer.