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

    r676 r711  
    532532 
    533533 
     534  void cxios_set_field_ts_enabled(field_Ptr field_hdl, bool ts_enabled) 
     535  { 
     536    CTimer::get("XIOS").resume(); 
     537    field_hdl->ts_enabled.setValue(ts_enabled); 
     538    CTimer::get("XIOS").suspend(); 
     539  } 
     540 
     541  void cxios_get_field_ts_enabled(field_Ptr field_hdl, bool* ts_enabled) 
     542  { 
     543    CTimer::get("XIOS").resume(); 
     544    *ts_enabled = field_hdl->ts_enabled.getInheritedValue(); 
     545    CTimer::get("XIOS").suspend(); 
     546  } 
     547 
     548  bool cxios_is_defined_field_ts_enabled(field_Ptr field_hdl) 
     549  { 
     550     CTimer::get("XIOS").resume(); 
     551     bool isDefined = field_hdl->ts_enabled.hasInheritedValue(); 
     552     CTimer::get("XIOS").suspend(); 
     553     return isDefined; 
     554  } 
     555 
     556 
     557  void cxios_set_field_ts_split_freq(field_Ptr field_hdl, cxios_duration ts_split_freq_c) 
     558  { 
     559    CTimer::get("XIOS").resume(); 
     560    field_hdl->ts_split_freq.allocate(); 
     561    CDuration& ts_split_freq = field_hdl->ts_split_freq.get(); 
     562    ts_split_freq.year = ts_split_freq_c.year; 
     563    ts_split_freq.month = ts_split_freq_c.month; 
     564    ts_split_freq.day = ts_split_freq_c.day; 
     565    ts_split_freq.hour = ts_split_freq_c.hour; 
     566    ts_split_freq.minute = ts_split_freq_c.minute; 
     567    ts_split_freq.second = ts_split_freq_c.second; 
     568    ts_split_freq.timestep = ts_split_freq_c.timestep; 
     569    CTimer::get("XIOS").suspend(); 
     570  } 
     571 
     572  void cxios_get_field_ts_split_freq(field_Ptr field_hdl, cxios_duration* ts_split_freq_c) 
     573  { 
     574    CTimer::get("XIOS").resume(); 
     575    CDuration ts_split_freq = field_hdl->ts_split_freq.getInheritedValue(); 
     576    ts_split_freq_c->year = ts_split_freq.year; 
     577    ts_split_freq_c->month = ts_split_freq.month; 
     578    ts_split_freq_c->day = ts_split_freq.day; 
     579    ts_split_freq_c->hour = ts_split_freq.hour; 
     580    ts_split_freq_c->minute = ts_split_freq.minute; 
     581    ts_split_freq_c->second = ts_split_freq.second; 
     582    ts_split_freq_c->timestep = ts_split_freq.timestep; 
     583    CTimer::get("XIOS").suspend(); 
     584  } 
     585 
     586  bool cxios_is_defined_field_ts_split_freq(field_Ptr field_hdl) 
     587  { 
     588     CTimer::get("XIOS").resume(); 
     589     bool isDefined = field_hdl->ts_split_freq.hasInheritedValue(); 
     590     CTimer::get("XIOS").suspend(); 
     591     return isDefined; 
     592  } 
     593 
     594 
    534595  void cxios_set_field_unit(field_Ptr field_hdl, const char * unit, int unit_size) 
    535596  { 
Note: See TracChangeset for help on using the changeset viewer.