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/fortran_attr/ifieldgroup_attr.F90

    r676 r711  
    1414    ( fieldgroup_id, add_offset, axis_ref, compression_level, default_value, detect_missing_value  & 
    1515    , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_ref, group_ref, indexed_output  & 
    16     , level, long_name, name, operation, prec, read_access, scale_factor, standard_name, unit, valid_max  & 
    17     , valid_min ) 
     16    , level, long_name, name, operation, prec, read_access, scale_factor, standard_name, ts_enabled  & 
     17    , ts_split_freq, unit, valid_max, valid_min ) 
    1818 
    1919    IMPLICIT NONE 
     
    4545      REAL (KIND=8) , OPTIONAL, INTENT(IN) :: scale_factor 
    4646      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: standard_name 
     47      LOGICAL  , OPTIONAL, INTENT(IN) :: ts_enabled 
     48      LOGICAL (KIND=C_BOOL) :: ts_enabled_tmp 
     49      TYPE(txios(duration))  , OPTIONAL, INTENT(IN) :: ts_split_freq 
    4750      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: unit 
    4851      REAL (KIND=8) , OPTIONAL, INTENT(IN) :: valid_max 
     
    5356      ( fieldgroup_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value  & 
    5457      , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_ref, group_ref, indexed_output  & 
    55       , level, long_name, name, operation, prec, read_access, scale_factor, standard_name, unit, valid_max  & 
    56       , valid_min ) 
     58      , level, long_name, name, operation, prec, read_access, scale_factor, standard_name, ts_enabled  & 
     59      , ts_split_freq, unit, valid_max, valid_min ) 
    5760 
    5861  END SUBROUTINE xios(set_fieldgroup_attr) 
     
    6164    ( fieldgroup_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value  & 
    6265    , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_ref, group_ref, indexed_output  & 
    63     , level, long_name, name, operation, prec, read_access, scale_factor, standard_name, unit, valid_max  & 
    64     , valid_min ) 
     66    , level, long_name, name, operation, prec, read_access, scale_factor, standard_name, ts_enabled  & 
     67    , ts_split_freq, unit, valid_max, valid_min ) 
    6568 
    6669    IMPLICIT NONE 
     
    9194      REAL (KIND=8) , OPTIONAL, INTENT(IN) :: scale_factor 
    9295      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: standard_name 
     96      LOGICAL  , OPTIONAL, INTENT(IN) :: ts_enabled 
     97      LOGICAL (KIND=C_BOOL) :: ts_enabled_tmp 
     98      TYPE(txios(duration))  , OPTIONAL, INTENT(IN) :: ts_split_freq 
    9399      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: unit 
    94100      REAL (KIND=8) , OPTIONAL, INTENT(IN) :: valid_max 
     
    98104      ( fieldgroup_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value  & 
    99105      , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_ref, group_ref, indexed_output  & 
    100       , level, long_name, name, operation, prec, read_access, scale_factor, standard_name, unit, valid_max  & 
    101       , valid_min ) 
     106      , level, long_name, name, operation, prec, read_access, scale_factor, standard_name, ts_enabled  & 
     107      , ts_split_freq, unit, valid_max, valid_min ) 
    102108 
    103109  END SUBROUTINE xios(set_fieldgroup_attr_hdl) 
     
    107113    , domain_ref_, enabled_, field_ref_, freq_offset_, freq_op_, grid_ref_, group_ref_, indexed_output_  & 
    108114    , level_, long_name_, name_, operation_, prec_, read_access_, scale_factor_, standard_name_  & 
    109     , unit_, valid_max_, valid_min_ ) 
     115    , ts_enabled_, ts_split_freq_, unit_, valid_max_, valid_min_ ) 
    110116 
    111117    IMPLICIT NONE 
     
    136142      REAL (KIND=8) , OPTIONAL, INTENT(IN) :: scale_factor_ 
    137143      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: standard_name_ 
     144      LOGICAL  , OPTIONAL, INTENT(IN) :: ts_enabled_ 
     145      LOGICAL (KIND=C_BOOL) :: ts_enabled__tmp 
     146      TYPE(txios(duration))  , OPTIONAL, INTENT(IN) :: ts_split_freq_ 
    138147      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: unit_ 
    139148      REAL (KIND=8) , OPTIONAL, INTENT(IN) :: valid_max_ 
     
    228237      ENDIF 
    229238 
     239      IF (PRESENT(ts_enabled_)) THEN 
     240        ts_enabled__tmp = ts_enabled_ 
     241        CALL cxios_set_fieldgroup_ts_enabled(fieldgroup_hdl%daddr, ts_enabled__tmp) 
     242      ENDIF 
     243 
     244      IF (PRESENT(ts_split_freq_)) THEN 
     245        CALL cxios_set_fieldgroup_ts_split_freq(fieldgroup_hdl%daddr, ts_split_freq_) 
     246      ENDIF 
     247 
    230248      IF (PRESENT(unit_)) THEN 
    231249        CALL cxios_set_fieldgroup_unit(fieldgroup_hdl%daddr, unit_, len(unit_)) 
     
    245263    ( fieldgroup_id, add_offset, axis_ref, compression_level, default_value, detect_missing_value  & 
    246264    , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_ref, group_ref, indexed_output  & 
    247     , level, long_name, name, operation, prec, read_access, scale_factor, standard_name, unit, valid_max  & 
    248     , valid_min ) 
     265    , level, long_name, name, operation, prec, read_access, scale_factor, standard_name, ts_enabled  & 
     266    , ts_split_freq, unit, valid_max, valid_min ) 
    249267 
    250268    IMPLICIT NONE 
     
    276294      REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: scale_factor 
    277295      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: standard_name 
     296      LOGICAL  , OPTIONAL, INTENT(OUT) :: ts_enabled 
     297      LOGICAL (KIND=C_BOOL) :: ts_enabled_tmp 
     298      TYPE(txios(duration))  , OPTIONAL, INTENT(OUT) :: ts_split_freq 
    278299      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: unit 
    279300      REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: valid_max 
     
    284305      ( fieldgroup_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value  & 
    285306      , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_ref, group_ref, indexed_output  & 
    286       , level, long_name, name, operation, prec, read_access, scale_factor, standard_name, unit, valid_max  & 
    287       , valid_min ) 
     307      , level, long_name, name, operation, prec, read_access, scale_factor, standard_name, ts_enabled  & 
     308      , ts_split_freq, unit, valid_max, valid_min ) 
    288309 
    289310  END SUBROUTINE xios(get_fieldgroup_attr) 
     
    292313    ( fieldgroup_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value  & 
    293314    , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_ref, group_ref, indexed_output  & 
    294     , level, long_name, name, operation, prec, read_access, scale_factor, standard_name, unit, valid_max  & 
    295     , valid_min ) 
     315    , level, long_name, name, operation, prec, read_access, scale_factor, standard_name, ts_enabled  & 
     316    , ts_split_freq, unit, valid_max, valid_min ) 
    296317 
    297318    IMPLICIT NONE 
     
    322343      REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: scale_factor 
    323344      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: standard_name 
     345      LOGICAL  , OPTIONAL, INTENT(OUT) :: ts_enabled 
     346      LOGICAL (KIND=C_BOOL) :: ts_enabled_tmp 
     347      TYPE(txios(duration))  , OPTIONAL, INTENT(OUT) :: ts_split_freq 
    324348      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: unit 
    325349      REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: valid_max 
     
    329353      ( fieldgroup_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value  & 
    330354      , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_ref, group_ref, indexed_output  & 
    331       , level, long_name, name, operation, prec, read_access, scale_factor, standard_name, unit, valid_max  & 
    332       , valid_min ) 
     355      , level, long_name, name, operation, prec, read_access, scale_factor, standard_name, ts_enabled  & 
     356      , ts_split_freq, unit, valid_max, valid_min ) 
    333357 
    334358  END SUBROUTINE xios(get_fieldgroup_attr_hdl) 
     
    338362    , domain_ref_, enabled_, field_ref_, freq_offset_, freq_op_, grid_ref_, group_ref_, indexed_output_  & 
    339363    , level_, long_name_, name_, operation_, prec_, read_access_, scale_factor_, standard_name_  & 
    340     , unit_, valid_max_, valid_min_ ) 
     364    , ts_enabled_, ts_split_freq_, unit_, valid_max_, valid_min_ ) 
    341365 
    342366    IMPLICIT NONE 
     
    367391      REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: scale_factor_ 
    368392      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: standard_name_ 
     393      LOGICAL  , OPTIONAL, INTENT(OUT) :: ts_enabled_ 
     394      LOGICAL (KIND=C_BOOL) :: ts_enabled__tmp 
     395      TYPE(txios(duration))  , OPTIONAL, INTENT(OUT) :: ts_split_freq_ 
    369396      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: unit_ 
    370397      REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: valid_max_ 
     
    459486      ENDIF 
    460487 
     488      IF (PRESENT(ts_enabled_)) THEN 
     489        CALL cxios_get_fieldgroup_ts_enabled(fieldgroup_hdl%daddr, ts_enabled__tmp) 
     490        ts_enabled_ = ts_enabled__tmp 
     491      ENDIF 
     492 
     493      IF (PRESENT(ts_split_freq_)) THEN 
     494        CALL cxios_get_fieldgroup_ts_split_freq(fieldgroup_hdl%daddr, ts_split_freq_) 
     495      ENDIF 
     496 
    461497      IF (PRESENT(unit_)) THEN 
    462498        CALL cxios_get_fieldgroup_unit(fieldgroup_hdl%daddr, unit_, len(unit_)) 
     
    476512    ( fieldgroup_id, add_offset, axis_ref, compression_level, default_value, detect_missing_value  & 
    477513    , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_ref, group_ref, indexed_output  & 
    478     , level, long_name, name, operation, prec, read_access, scale_factor, standard_name, unit, valid_max  & 
    479     , valid_min ) 
     514    , level, long_name, name, operation, prec, read_access, scale_factor, standard_name, ts_enabled  & 
     515    , ts_split_freq, unit, valid_max, valid_min ) 
    480516 
    481517    IMPLICIT NONE 
     
    524560      LOGICAL, OPTIONAL, INTENT(OUT) :: standard_name 
    525561      LOGICAL(KIND=C_BOOL) :: standard_name_tmp 
     562      LOGICAL, OPTIONAL, INTENT(OUT) :: ts_enabled 
     563      LOGICAL(KIND=C_BOOL) :: ts_enabled_tmp 
     564      LOGICAL, OPTIONAL, INTENT(OUT) :: ts_split_freq 
     565      LOGICAL(KIND=C_BOOL) :: ts_split_freq_tmp 
    526566      LOGICAL, OPTIONAL, INTENT(OUT) :: unit 
    527567      LOGICAL(KIND=C_BOOL) :: unit_tmp 
     
    535575      ( fieldgroup_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value  & 
    536576      , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_ref, group_ref, indexed_output  & 
    537       , level, long_name, name, operation, prec, read_access, scale_factor, standard_name, unit, valid_max  & 
    538       , valid_min ) 
     577      , level, long_name, name, operation, prec, read_access, scale_factor, standard_name, ts_enabled  & 
     578      , ts_split_freq, unit, valid_max, valid_min ) 
    539579 
    540580  END SUBROUTINE xios(is_defined_fieldgroup_attr) 
     
    543583    ( fieldgroup_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value  & 
    544584    , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_ref, group_ref, indexed_output  & 
    545     , level, long_name, name, operation, prec, read_access, scale_factor, standard_name, unit, valid_max  & 
    546     , valid_min ) 
     585    , level, long_name, name, operation, prec, read_access, scale_factor, standard_name, ts_enabled  & 
     586    , ts_split_freq, unit, valid_max, valid_min ) 
    547587 
    548588    IMPLICIT NONE 
     
    590630      LOGICAL, OPTIONAL, INTENT(OUT) :: standard_name 
    591631      LOGICAL(KIND=C_BOOL) :: standard_name_tmp 
     632      LOGICAL, OPTIONAL, INTENT(OUT) :: ts_enabled 
     633      LOGICAL(KIND=C_BOOL) :: ts_enabled_tmp 
     634      LOGICAL, OPTIONAL, INTENT(OUT) :: ts_split_freq 
     635      LOGICAL(KIND=C_BOOL) :: ts_split_freq_tmp 
    592636      LOGICAL, OPTIONAL, INTENT(OUT) :: unit 
    593637      LOGICAL(KIND=C_BOOL) :: unit_tmp 
     
    600644      ( fieldgroup_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value  & 
    601645      , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_ref, group_ref, indexed_output  & 
    602       , level, long_name, name, operation, prec, read_access, scale_factor, standard_name, unit, valid_max  & 
    603       , valid_min ) 
     646      , level, long_name, name, operation, prec, read_access, scale_factor, standard_name, ts_enabled  & 
     647      , ts_split_freq, unit, valid_max, valid_min ) 
    604648 
    605649  END SUBROUTINE xios(is_defined_fieldgroup_attr_hdl) 
     
    609653    , domain_ref_, enabled_, field_ref_, freq_offset_, freq_op_, grid_ref_, group_ref_, indexed_output_  & 
    610654    , level_, long_name_, name_, operation_, prec_, read_access_, scale_factor_, standard_name_  & 
    611     , unit_, valid_max_, valid_min_ ) 
     655    , ts_enabled_, ts_split_freq_, unit_, valid_max_, valid_min_ ) 
    612656 
    613657    IMPLICIT NONE 
     
    655699      LOGICAL, OPTIONAL, INTENT(OUT) :: standard_name_ 
    656700      LOGICAL(KIND=C_BOOL) :: standard_name__tmp 
     701      LOGICAL, OPTIONAL, INTENT(OUT) :: ts_enabled_ 
     702      LOGICAL(KIND=C_BOOL) :: ts_enabled__tmp 
     703      LOGICAL, OPTIONAL, INTENT(OUT) :: ts_split_freq_ 
     704      LOGICAL(KIND=C_BOOL) :: ts_split_freq__tmp 
    657705      LOGICAL, OPTIONAL, INTENT(OUT) :: unit_ 
    658706      LOGICAL(KIND=C_BOOL) :: unit__tmp 
     
    767815      ENDIF 
    768816 
     817      IF (PRESENT(ts_enabled_)) THEN 
     818        ts_enabled__tmp = cxios_is_defined_fieldgroup_ts_enabled(fieldgroup_hdl%daddr) 
     819        ts_enabled_ = ts_enabled__tmp 
     820      ENDIF 
     821 
     822      IF (PRESENT(ts_split_freq_)) THEN 
     823        ts_split_freq__tmp = cxios_is_defined_fieldgroup_ts_split_freq(fieldgroup_hdl%daddr) 
     824        ts_split_freq_ = ts_split_freq__tmp 
     825      ENDIF 
     826 
    769827      IF (PRESENT(unit_)) THEN 
    770828        unit__tmp = cxios_is_defined_fieldgroup_unit(fieldgroup_hdl%daddr) 
Note: See TracChangeset for help on using the changeset viewer.