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

    r676 r711  
    558558 
    559559 
     560  void cxios_set_fieldgroup_ts_enabled(fieldgroup_Ptr fieldgroup_hdl, bool ts_enabled) 
     561  { 
     562    CTimer::get("XIOS").resume(); 
     563    fieldgroup_hdl->ts_enabled.setValue(ts_enabled); 
     564    CTimer::get("XIOS").suspend(); 
     565  } 
     566 
     567  void cxios_get_fieldgroup_ts_enabled(fieldgroup_Ptr fieldgroup_hdl, bool* ts_enabled) 
     568  { 
     569    CTimer::get("XIOS").resume(); 
     570    *ts_enabled = fieldgroup_hdl->ts_enabled.getInheritedValue(); 
     571    CTimer::get("XIOS").suspend(); 
     572  } 
     573 
     574  bool cxios_is_defined_fieldgroup_ts_enabled(fieldgroup_Ptr fieldgroup_hdl) 
     575  { 
     576     CTimer::get("XIOS").resume(); 
     577     bool isDefined = fieldgroup_hdl->ts_enabled.hasInheritedValue(); 
     578     CTimer::get("XIOS").suspend(); 
     579     return isDefined; 
     580  } 
     581 
     582 
     583  void cxios_set_fieldgroup_ts_split_freq(fieldgroup_Ptr fieldgroup_hdl, cxios_duration ts_split_freq_c) 
     584  { 
     585    CTimer::get("XIOS").resume(); 
     586    fieldgroup_hdl->ts_split_freq.allocate(); 
     587    CDuration& ts_split_freq = fieldgroup_hdl->ts_split_freq.get(); 
     588    ts_split_freq.year = ts_split_freq_c.year; 
     589    ts_split_freq.month = ts_split_freq_c.month; 
     590    ts_split_freq.day = ts_split_freq_c.day; 
     591    ts_split_freq.hour = ts_split_freq_c.hour; 
     592    ts_split_freq.minute = ts_split_freq_c.minute; 
     593    ts_split_freq.second = ts_split_freq_c.second; 
     594    ts_split_freq.timestep = ts_split_freq_c.timestep; 
     595    CTimer::get("XIOS").suspend(); 
     596  } 
     597 
     598  void cxios_get_fieldgroup_ts_split_freq(fieldgroup_Ptr fieldgroup_hdl, cxios_duration* ts_split_freq_c) 
     599  { 
     600    CTimer::get("XIOS").resume(); 
     601    CDuration ts_split_freq = fieldgroup_hdl->ts_split_freq.getInheritedValue(); 
     602    ts_split_freq_c->year = ts_split_freq.year; 
     603    ts_split_freq_c->month = ts_split_freq.month; 
     604    ts_split_freq_c->day = ts_split_freq.day; 
     605    ts_split_freq_c->hour = ts_split_freq.hour; 
     606    ts_split_freq_c->minute = ts_split_freq.minute; 
     607    ts_split_freq_c->second = ts_split_freq.second; 
     608    ts_split_freq_c->timestep = ts_split_freq.timestep; 
     609    CTimer::get("XIOS").suspend(); 
     610  } 
     611 
     612  bool cxios_is_defined_fieldgroup_ts_split_freq(fieldgroup_Ptr fieldgroup_hdl) 
     613  { 
     614     CTimer::get("XIOS").resume(); 
     615     bool isDefined = fieldgroup_hdl->ts_split_freq.hasInheritedValue(); 
     616     CTimer::get("XIOS").suspend(); 
     617     return isDefined; 
     618  } 
     619 
     620 
    560621  void cxios_set_fieldgroup_unit(fieldgroup_Ptr fieldgroup_hdl, const char * unit, int unit_size) 
    561622  { 
Note: See TracChangeset for help on using the changeset viewer.