Changeset 802


Ignore:
Timestamp:
11/30/15 16:21:33 (6 years ago)
Author:
rlacroix
Message:

Add a new file attribute time_counter_name.

Users can now modify the name of the time counter dimension and axis name.

Location:
XIOS/trunk/src
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/config/file_attribute.conf

    r757 r802  
    1717DECLARE_ENUM2(mode,          read, write) 
    1818DECLARE_ENUM4(time_counter,  centered, instant, record, none) 
     19DECLARE_ATTRIBUTE(StdString, time_counter_name) 
    1920DECLARE_ATTRIBUTE(int,       record_offset) 
    2021 
  • XIOS/trunk/src/interface/c_attr/icfile_attr.cpp

    r779 r802  
    478478 
    479479 
     480  void cxios_set_file_time_counter_name(file_Ptr file_hdl, const char * time_counter_name, int time_counter_name_size) 
     481  { 
     482    std::string time_counter_name_str; 
     483    if (!cstr2string(time_counter_name, time_counter_name_size, time_counter_name_str)) return; 
     484    CTimer::get("XIOS").resume(); 
     485    file_hdl->time_counter_name.setValue(time_counter_name_str); 
     486    CTimer::get("XIOS").suspend(); 
     487  } 
     488 
     489  void cxios_get_file_time_counter_name(file_Ptr file_hdl, char * time_counter_name, int time_counter_name_size) 
     490  { 
     491    CTimer::get("XIOS").resume(); 
     492    if (!string_copy(file_hdl->time_counter_name.getInheritedValue(), time_counter_name, time_counter_name_size)) 
     493      ERROR("void cxios_get_file_time_counter_name(file_Ptr file_hdl, char * time_counter_name, int time_counter_name_size)", << "Input string is too short"); 
     494    CTimer::get("XIOS").suspend(); 
     495  } 
     496 
     497  bool cxios_is_defined_file_time_counter_name(file_Ptr file_hdl) 
     498  { 
     499     CTimer::get("XIOS").resume(); 
     500     bool isDefined = file_hdl->time_counter_name.hasInheritedValue(); 
     501     CTimer::get("XIOS").suspend(); 
     502     return isDefined; 
     503  } 
     504 
     505 
    480506  void cxios_set_file_timeseries(file_Ptr file_hdl, const char * timeseries, int timeseries_size) 
    481507  { 
  • XIOS/trunk/src/interface/c_attr/icfilegroup_attr.cpp

    r779 r802  
    504504 
    505505 
     506  void cxios_set_filegroup_time_counter_name(filegroup_Ptr filegroup_hdl, const char * time_counter_name, int time_counter_name_size) 
     507  { 
     508    std::string time_counter_name_str; 
     509    if (!cstr2string(time_counter_name, time_counter_name_size, time_counter_name_str)) return; 
     510    CTimer::get("XIOS").resume(); 
     511    filegroup_hdl->time_counter_name.setValue(time_counter_name_str); 
     512    CTimer::get("XIOS").suspend(); 
     513  } 
     514 
     515  void cxios_get_filegroup_time_counter_name(filegroup_Ptr filegroup_hdl, char * time_counter_name, int time_counter_name_size) 
     516  { 
     517    CTimer::get("XIOS").resume(); 
     518    if (!string_copy(filegroup_hdl->time_counter_name.getInheritedValue(), time_counter_name, time_counter_name_size)) 
     519      ERROR("void cxios_get_filegroup_time_counter_name(filegroup_Ptr filegroup_hdl, char * time_counter_name, int time_counter_name_size)", << "Input string is too short"); 
     520    CTimer::get("XIOS").suspend(); 
     521  } 
     522 
     523  bool cxios_is_defined_filegroup_time_counter_name(filegroup_Ptr filegroup_hdl) 
     524  { 
     525     CTimer::get("XIOS").resume(); 
     526     bool isDefined = filegroup_hdl->time_counter_name.hasInheritedValue(); 
     527     CTimer::get("XIOS").suspend(); 
     528     return isDefined; 
     529  } 
     530 
     531 
    506532  void cxios_set_filegroup_timeseries(filegroup_Ptr filegroup_hdl, const char * timeseries, int timeseries_size) 
    507533  { 
  • XIOS/trunk/src/interface/fortran_attr/file_interface_attr.F90

    r779 r802  
    355355 
    356356 
     357    SUBROUTINE cxios_set_file_time_counter_name(file_hdl, time_counter_name, time_counter_name_size) BIND(C) 
     358      USE ISO_C_BINDING 
     359      INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl 
     360      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: time_counter_name 
     361      INTEGER  (kind = C_INT)     , VALUE        :: time_counter_name_size 
     362    END SUBROUTINE cxios_set_file_time_counter_name 
     363 
     364    SUBROUTINE cxios_get_file_time_counter_name(file_hdl, time_counter_name, time_counter_name_size) BIND(C) 
     365      USE ISO_C_BINDING 
     366      INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl 
     367      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: time_counter_name 
     368      INTEGER  (kind = C_INT)     , VALUE        :: time_counter_name_size 
     369    END SUBROUTINE cxios_get_file_time_counter_name 
     370 
     371    FUNCTION cxios_is_defined_file_time_counter_name(file_hdl) BIND(C) 
     372      USE ISO_C_BINDING 
     373      LOGICAL(kind=C_BOOL) :: cxios_is_defined_file_time_counter_name 
     374      INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl 
     375    END FUNCTION cxios_is_defined_file_time_counter_name 
     376 
     377 
    357378    SUBROUTINE cxios_set_file_timeseries(file_hdl, timeseries, timeseries_size) BIND(C) 
    358379      USE ISO_C_BINDING 
  • XIOS/trunk/src/interface/fortran_attr/filegroup_interface_attr.F90

    r779 r802  
    376376 
    377377 
     378    SUBROUTINE cxios_set_filegroup_time_counter_name(filegroup_hdl, time_counter_name, time_counter_name_size) BIND(C) 
     379      USE ISO_C_BINDING 
     380      INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl 
     381      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: time_counter_name 
     382      INTEGER  (kind = C_INT)     , VALUE        :: time_counter_name_size 
     383    END SUBROUTINE cxios_set_filegroup_time_counter_name 
     384 
     385    SUBROUTINE cxios_get_filegroup_time_counter_name(filegroup_hdl, time_counter_name, time_counter_name_size) BIND(C) 
     386      USE ISO_C_BINDING 
     387      INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl 
     388      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: time_counter_name 
     389      INTEGER  (kind = C_INT)     , VALUE        :: time_counter_name_size 
     390    END SUBROUTINE cxios_get_filegroup_time_counter_name 
     391 
     392    FUNCTION cxios_is_defined_filegroup_time_counter_name(filegroup_hdl) BIND(C) 
     393      USE ISO_C_BINDING 
     394      LOGICAL(kind=C_BOOL) :: cxios_is_defined_filegroup_time_counter_name 
     395      INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl 
     396    END FUNCTION cxios_is_defined_filegroup_time_counter_name 
     397 
     398 
    378399    SUBROUTINE cxios_set_filegroup_timeseries(filegroup_hdl, timeseries, timeseries_size) BIND(C) 
    379400      USE ISO_C_BINDING 
  • XIOS/trunk/src/interface/fortran_attr/ifile_attr.F90

    r779 r802  
    1414    ( file_id, append, compression_level, description, enabled, format, min_digits, mode, name, name_suffix  & 
    1515    , output_freq, output_level, par_access, record_offset, split_freq, split_freq_format, sync_freq  & 
    16     , time_counter, timeseries, ts_prefix, type ) 
     16    , time_counter, time_counter_name, timeseries, ts_prefix, type ) 
    1717 
    1818    IMPLICIT NONE 
     
    3838      TYPE(txios(duration))  , OPTIONAL, INTENT(IN) :: sync_freq 
    3939      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_counter 
     40      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_counter_name 
    4041      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: timeseries 
    4142      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: ts_prefix 
     
    4647      ( file_hdl, append, compression_level, description, enabled, format, min_digits, mode, name  & 
    4748      , name_suffix, output_freq, output_level, par_access, record_offset, split_freq, split_freq_format  & 
    48       , sync_freq, time_counter, timeseries, ts_prefix, type ) 
     49      , sync_freq, time_counter, time_counter_name, timeseries, ts_prefix, type ) 
    4950 
    5051  END SUBROUTINE xios(set_file_attr) 
     
    5354    ( file_hdl, append, compression_level, description, enabled, format, min_digits, mode, name  & 
    5455    , name_suffix, output_freq, output_level, par_access, record_offset, split_freq, split_freq_format  & 
    55     , sync_freq, time_counter, timeseries, ts_prefix, type ) 
     56    , sync_freq, time_counter, time_counter_name, timeseries, ts_prefix, type ) 
    5657 
    5758    IMPLICIT NONE 
     
    7677      TYPE(txios(duration))  , OPTIONAL, INTENT(IN) :: sync_freq 
    7778      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_counter 
     79      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_counter_name 
    7880      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: timeseries 
    7981      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: ts_prefix 
     
    8385      ( file_hdl, append, compression_level, description, enabled, format, min_digits, mode, name  & 
    8486      , name_suffix, output_freq, output_level, par_access, record_offset, split_freq, split_freq_format  & 
    85       , sync_freq, time_counter, timeseries, ts_prefix, type ) 
     87      , sync_freq, time_counter, time_counter_name, timeseries, ts_prefix, type ) 
    8688 
    8789  END SUBROUTINE xios(set_file_attr_hdl) 
     
    9092    ( file_hdl, append_, compression_level_, description_, enabled_, format_, min_digits_, mode_  & 
    9193    , name_, name_suffix_, output_freq_, output_level_, par_access_, record_offset_, split_freq_  & 
    92     , split_freq_format_, sync_freq_, time_counter_, timeseries_, ts_prefix_, type_ ) 
     94    , split_freq_format_, sync_freq_, time_counter_, time_counter_name_, timeseries_, ts_prefix_  & 
     95    , type_ ) 
    9396 
    9497    IMPLICIT NONE 
     
    113116      TYPE(txios(duration))  , OPTIONAL, INTENT(IN) :: sync_freq_ 
    114117      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_counter_ 
     118      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_counter_name_ 
    115119      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: timeseries_ 
    116120      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: ts_prefix_ 
     
    187191      ENDIF 
    188192 
     193      IF (PRESENT(time_counter_name_)) THEN 
     194        CALL cxios_set_file_time_counter_name(file_hdl%daddr, time_counter_name_, len(time_counter_name_)) 
     195      ENDIF 
     196 
    189197      IF (PRESENT(timeseries_)) THEN 
    190198        CALL cxios_set_file_timeseries(file_hdl%daddr, timeseries_, len(timeseries_)) 
     
    204212    ( file_id, append, compression_level, description, enabled, format, min_digits, mode, name, name_suffix  & 
    205213    , output_freq, output_level, par_access, record_offset, split_freq, split_freq_format, sync_freq  & 
    206     , time_counter, timeseries, ts_prefix, type ) 
     214    , time_counter, time_counter_name, timeseries, ts_prefix, type ) 
    207215 
    208216    IMPLICIT NONE 
     
    228236      TYPE(txios(duration))  , OPTIONAL, INTENT(OUT) :: sync_freq 
    229237      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_counter 
     238      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_counter_name 
    230239      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: timeseries 
    231240      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: ts_prefix 
     
    236245      ( file_hdl, append, compression_level, description, enabled, format, min_digits, mode, name  & 
    237246      , name_suffix, output_freq, output_level, par_access, record_offset, split_freq, split_freq_format  & 
    238       , sync_freq, time_counter, timeseries, ts_prefix, type ) 
     247      , sync_freq, time_counter, time_counter_name, timeseries, ts_prefix, type ) 
    239248 
    240249  END SUBROUTINE xios(get_file_attr) 
     
    243252    ( file_hdl, append, compression_level, description, enabled, format, min_digits, mode, name  & 
    244253    , name_suffix, output_freq, output_level, par_access, record_offset, split_freq, split_freq_format  & 
    245     , sync_freq, time_counter, timeseries, ts_prefix, type ) 
     254    , sync_freq, time_counter, time_counter_name, timeseries, ts_prefix, type ) 
    246255 
    247256    IMPLICIT NONE 
     
    266275      TYPE(txios(duration))  , OPTIONAL, INTENT(OUT) :: sync_freq 
    267276      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_counter 
     277      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_counter_name 
    268278      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: timeseries 
    269279      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: ts_prefix 
     
    273283      ( file_hdl, append, compression_level, description, enabled, format, min_digits, mode, name  & 
    274284      , name_suffix, output_freq, output_level, par_access, record_offset, split_freq, split_freq_format  & 
    275       , sync_freq, time_counter, timeseries, ts_prefix, type ) 
     285      , sync_freq, time_counter, time_counter_name, timeseries, ts_prefix, type ) 
    276286 
    277287  END SUBROUTINE xios(get_file_attr_hdl) 
     
    280290    ( file_hdl, append_, compression_level_, description_, enabled_, format_, min_digits_, mode_  & 
    281291    , name_, name_suffix_, output_freq_, output_level_, par_access_, record_offset_, split_freq_  & 
    282     , split_freq_format_, sync_freq_, time_counter_, timeseries_, ts_prefix_, type_ ) 
     292    , split_freq_format_, sync_freq_, time_counter_, time_counter_name_, timeseries_, ts_prefix_  & 
     293    , type_ ) 
    283294 
    284295    IMPLICIT NONE 
     
    303314      TYPE(txios(duration))  , OPTIONAL, INTENT(OUT) :: sync_freq_ 
    304315      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_counter_ 
     316      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_counter_name_ 
    305317      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: timeseries_ 
    306318      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: ts_prefix_ 
     
    377389      ENDIF 
    378390 
     391      IF (PRESENT(time_counter_name_)) THEN 
     392        CALL cxios_get_file_time_counter_name(file_hdl%daddr, time_counter_name_, len(time_counter_name_)) 
     393      ENDIF 
     394 
    379395      IF (PRESENT(timeseries_)) THEN 
    380396        CALL cxios_get_file_timeseries(file_hdl%daddr, timeseries_, len(timeseries_)) 
     
    394410    ( file_id, append, compression_level, description, enabled, format, min_digits, mode, name, name_suffix  & 
    395411    , output_freq, output_level, par_access, record_offset, split_freq, split_freq_format, sync_freq  & 
    396     , time_counter, timeseries, ts_prefix, type ) 
     412    , time_counter, time_counter_name, timeseries, ts_prefix, type ) 
    397413 
    398414    IMPLICIT NONE 
     
    433449      LOGICAL, OPTIONAL, INTENT(OUT) :: time_counter 
    434450      LOGICAL(KIND=C_BOOL) :: time_counter_tmp 
     451      LOGICAL, OPTIONAL, INTENT(OUT) :: time_counter_name 
     452      LOGICAL(KIND=C_BOOL) :: time_counter_name_tmp 
    435453      LOGICAL, OPTIONAL, INTENT(OUT) :: timeseries 
    436454      LOGICAL(KIND=C_BOOL) :: timeseries_tmp 
     
    444462      ( file_hdl, append, compression_level, description, enabled, format, min_digits, mode, name  & 
    445463      , name_suffix, output_freq, output_level, par_access, record_offset, split_freq, split_freq_format  & 
    446       , sync_freq, time_counter, timeseries, ts_prefix, type ) 
     464      , sync_freq, time_counter, time_counter_name, timeseries, ts_prefix, type ) 
    447465 
    448466  END SUBROUTINE xios(is_defined_file_attr) 
     
    451469    ( file_hdl, append, compression_level, description, enabled, format, min_digits, mode, name  & 
    452470    , name_suffix, output_freq, output_level, par_access, record_offset, split_freq, split_freq_format  & 
    453     , sync_freq, time_counter, timeseries, ts_prefix, type ) 
     471    , sync_freq, time_counter, time_counter_name, timeseries, ts_prefix, type ) 
    454472 
    455473    IMPLICIT NONE 
     
    489507      LOGICAL, OPTIONAL, INTENT(OUT) :: time_counter 
    490508      LOGICAL(KIND=C_BOOL) :: time_counter_tmp 
     509      LOGICAL, OPTIONAL, INTENT(OUT) :: time_counter_name 
     510      LOGICAL(KIND=C_BOOL) :: time_counter_name_tmp 
    491511      LOGICAL, OPTIONAL, INTENT(OUT) :: timeseries 
    492512      LOGICAL(KIND=C_BOOL) :: timeseries_tmp 
     
    499519      ( file_hdl, append, compression_level, description, enabled, format, min_digits, mode, name  & 
    500520      , name_suffix, output_freq, output_level, par_access, record_offset, split_freq, split_freq_format  & 
    501       , sync_freq, time_counter, timeseries, ts_prefix, type ) 
     521      , sync_freq, time_counter, time_counter_name, timeseries, ts_prefix, type ) 
    502522 
    503523  END SUBROUTINE xios(is_defined_file_attr_hdl) 
     
    506526    ( file_hdl, append_, compression_level_, description_, enabled_, format_, min_digits_, mode_  & 
    507527    , name_, name_suffix_, output_freq_, output_level_, par_access_, record_offset_, split_freq_  & 
    508     , split_freq_format_, sync_freq_, time_counter_, timeseries_, ts_prefix_, type_ ) 
     528    , split_freq_format_, sync_freq_, time_counter_, time_counter_name_, timeseries_, ts_prefix_  & 
     529    , type_ ) 
    509530 
    510531    IMPLICIT NONE 
     
    544565      LOGICAL, OPTIONAL, INTENT(OUT) :: time_counter_ 
    545566      LOGICAL(KIND=C_BOOL) :: time_counter__tmp 
     567      LOGICAL, OPTIONAL, INTENT(OUT) :: time_counter_name_ 
     568      LOGICAL(KIND=C_BOOL) :: time_counter_name__tmp 
    546569      LOGICAL, OPTIONAL, INTENT(OUT) :: timeseries_ 
    547570      LOGICAL(KIND=C_BOOL) :: timeseries__tmp 
     
    636659      ENDIF 
    637660 
     661      IF (PRESENT(time_counter_name_)) THEN 
     662        time_counter_name__tmp = cxios_is_defined_file_time_counter_name(file_hdl%daddr) 
     663        time_counter_name_ = time_counter_name__tmp 
     664      ENDIF 
     665 
    638666      IF (PRESENT(timeseries_)) THEN 
    639667        timeseries__tmp = cxios_is_defined_file_timeseries(file_hdl%daddr) 
  • XIOS/trunk/src/interface/fortran_attr/ifilegroup_attr.F90

    r779 r802  
    1414    ( filegroup_id, append, compression_level, description, enabled, format, group_ref, min_digits  & 
    1515    , mode, name, name_suffix, output_freq, output_level, par_access, record_offset, split_freq  & 
    16     , split_freq_format, sync_freq, time_counter, timeseries, ts_prefix, type ) 
     16    , split_freq_format, sync_freq, time_counter, time_counter_name, timeseries, ts_prefix, type  & 
     17     ) 
    1718 
    1819    IMPLICIT NONE 
     
    3940      TYPE(txios(duration))  , OPTIONAL, INTENT(IN) :: sync_freq 
    4041      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_counter 
     42      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_counter_name 
    4143      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: timeseries 
    4244      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: ts_prefix 
     
    4749      ( filegroup_hdl, append, compression_level, description, enabled, format, group_ref, min_digits  & 
    4850      , mode, name, name_suffix, output_freq, output_level, par_access, record_offset, split_freq  & 
    49       , split_freq_format, sync_freq, time_counter, timeseries, ts_prefix, type ) 
     51      , split_freq_format, sync_freq, time_counter, time_counter_name, timeseries, ts_prefix, type  & 
     52       ) 
    5053 
    5154  END SUBROUTINE xios(set_filegroup_attr) 
     
    5457    ( filegroup_hdl, append, compression_level, description, enabled, format, group_ref, min_digits  & 
    5558    , mode, name, name_suffix, output_freq, output_level, par_access, record_offset, split_freq  & 
    56     , split_freq_format, sync_freq, time_counter, timeseries, ts_prefix, type ) 
     59    , split_freq_format, sync_freq, time_counter, time_counter_name, timeseries, ts_prefix, type  & 
     60     ) 
    5761 
    5862    IMPLICIT NONE 
     
    7882      TYPE(txios(duration))  , OPTIONAL, INTENT(IN) :: sync_freq 
    7983      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_counter 
     84      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_counter_name 
    8085      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: timeseries 
    8186      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: ts_prefix 
     
    8590      ( filegroup_hdl, append, compression_level, description, enabled, format, group_ref, min_digits  & 
    8691      , mode, name, name_suffix, output_freq, output_level, par_access, record_offset, split_freq  & 
    87       , split_freq_format, sync_freq, time_counter, timeseries, ts_prefix, type ) 
     92      , split_freq_format, sync_freq, time_counter, time_counter_name, timeseries, ts_prefix, type  & 
     93       ) 
    8894 
    8995  END SUBROUTINE xios(set_filegroup_attr_hdl) 
     
    9298    ( filegroup_hdl, append_, compression_level_, description_, enabled_, format_, group_ref_, min_digits_  & 
    9399    , mode_, name_, name_suffix_, output_freq_, output_level_, par_access_, record_offset_, split_freq_  & 
    94     , split_freq_format_, sync_freq_, time_counter_, timeseries_, ts_prefix_, type_ ) 
     100    , split_freq_format_, sync_freq_, time_counter_, time_counter_name_, timeseries_, ts_prefix_  & 
     101    , type_ ) 
    95102 
    96103    IMPLICIT NONE 
     
    116123      TYPE(txios(duration))  , OPTIONAL, INTENT(IN) :: sync_freq_ 
    117124      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_counter_ 
     125      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_counter_name_ 
    118126      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: timeseries_ 
    119127      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: ts_prefix_ 
     
    194202      ENDIF 
    195203 
     204      IF (PRESENT(time_counter_name_)) THEN 
     205        CALL cxios_set_filegroup_time_counter_name(filegroup_hdl%daddr, time_counter_name_, len(time_counter_name_)) 
     206      ENDIF 
     207 
    196208      IF (PRESENT(timeseries_)) THEN 
    197209        CALL cxios_set_filegroup_timeseries(filegroup_hdl%daddr, timeseries_, len(timeseries_)) 
     
    211223    ( filegroup_id, append, compression_level, description, enabled, format, group_ref, min_digits  & 
    212224    , mode, name, name_suffix, output_freq, output_level, par_access, record_offset, split_freq  & 
    213     , split_freq_format, sync_freq, time_counter, timeseries, ts_prefix, type ) 
     225    , split_freq_format, sync_freq, time_counter, time_counter_name, timeseries, ts_prefix, type  & 
     226     ) 
    214227 
    215228    IMPLICIT NONE 
     
    236249      TYPE(txios(duration))  , OPTIONAL, INTENT(OUT) :: sync_freq 
    237250      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_counter 
     251      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_counter_name 
    238252      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: timeseries 
    239253      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: ts_prefix 
     
    244258      ( filegroup_hdl, append, compression_level, description, enabled, format, group_ref, min_digits  & 
    245259      , mode, name, name_suffix, output_freq, output_level, par_access, record_offset, split_freq  & 
    246       , split_freq_format, sync_freq, time_counter, timeseries, ts_prefix, type ) 
     260      , split_freq_format, sync_freq, time_counter, time_counter_name, timeseries, ts_prefix, type  & 
     261       ) 
    247262 
    248263  END SUBROUTINE xios(get_filegroup_attr) 
     
    251266    ( filegroup_hdl, append, compression_level, description, enabled, format, group_ref, min_digits  & 
    252267    , mode, name, name_suffix, output_freq, output_level, par_access, record_offset, split_freq  & 
    253     , split_freq_format, sync_freq, time_counter, timeseries, ts_prefix, type ) 
     268    , split_freq_format, sync_freq, time_counter, time_counter_name, timeseries, ts_prefix, type  & 
     269     ) 
    254270 
    255271    IMPLICIT NONE 
     
    275291      TYPE(txios(duration))  , OPTIONAL, INTENT(OUT) :: sync_freq 
    276292      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_counter 
     293      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_counter_name 
    277294      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: timeseries 
    278295      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: ts_prefix 
     
    282299      ( filegroup_hdl, append, compression_level, description, enabled, format, group_ref, min_digits  & 
    283300      , mode, name, name_suffix, output_freq, output_level, par_access, record_offset, split_freq  & 
    284       , split_freq_format, sync_freq, time_counter, timeseries, ts_prefix, type ) 
     301      , split_freq_format, sync_freq, time_counter, time_counter_name, timeseries, ts_prefix, type  & 
     302       ) 
    285303 
    286304  END SUBROUTINE xios(get_filegroup_attr_hdl) 
     
    289307    ( filegroup_hdl, append_, compression_level_, description_, enabled_, format_, group_ref_, min_digits_  & 
    290308    , mode_, name_, name_suffix_, output_freq_, output_level_, par_access_, record_offset_, split_freq_  & 
    291     , split_freq_format_, sync_freq_, time_counter_, timeseries_, ts_prefix_, type_ ) 
     309    , split_freq_format_, sync_freq_, time_counter_, time_counter_name_, timeseries_, ts_prefix_  & 
     310    , type_ ) 
    292311 
    293312    IMPLICIT NONE 
     
    313332      TYPE(txios(duration))  , OPTIONAL, INTENT(OUT) :: sync_freq_ 
    314333      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_counter_ 
     334      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_counter_name_ 
    315335      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: timeseries_ 
    316336      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: ts_prefix_ 
     
    391411      ENDIF 
    392412 
     413      IF (PRESENT(time_counter_name_)) THEN 
     414        CALL cxios_get_filegroup_time_counter_name(filegroup_hdl%daddr, time_counter_name_, len(time_counter_name_)) 
     415      ENDIF 
     416 
    393417      IF (PRESENT(timeseries_)) THEN 
    394418        CALL cxios_get_filegroup_timeseries(filegroup_hdl%daddr, timeseries_, len(timeseries_)) 
     
    408432    ( filegroup_id, append, compression_level, description, enabled, format, group_ref, min_digits  & 
    409433    , mode, name, name_suffix, output_freq, output_level, par_access, record_offset, split_freq  & 
    410     , split_freq_format, sync_freq, time_counter, timeseries, ts_prefix, type ) 
     434    , split_freq_format, sync_freq, time_counter, time_counter_name, timeseries, ts_prefix, type  & 
     435     ) 
    411436 
    412437    IMPLICIT NONE 
     
    449474      LOGICAL, OPTIONAL, INTENT(OUT) :: time_counter 
    450475      LOGICAL(KIND=C_BOOL) :: time_counter_tmp 
     476      LOGICAL, OPTIONAL, INTENT(OUT) :: time_counter_name 
     477      LOGICAL(KIND=C_BOOL) :: time_counter_name_tmp 
    451478      LOGICAL, OPTIONAL, INTENT(OUT) :: timeseries 
    452479      LOGICAL(KIND=C_BOOL) :: timeseries_tmp 
     
    460487      ( filegroup_hdl, append, compression_level, description, enabled, format, group_ref, min_digits  & 
    461488      , mode, name, name_suffix, output_freq, output_level, par_access, record_offset, split_freq  & 
    462       , split_freq_format, sync_freq, time_counter, timeseries, ts_prefix, type ) 
     489      , split_freq_format, sync_freq, time_counter, time_counter_name, timeseries, ts_prefix, type  & 
     490       ) 
    463491 
    464492  END SUBROUTINE xios(is_defined_filegroup_attr) 
     
    467495    ( filegroup_hdl, append, compression_level, description, enabled, format, group_ref, min_digits  & 
    468496    , mode, name, name_suffix, output_freq, output_level, par_access, record_offset, split_freq  & 
    469     , split_freq_format, sync_freq, time_counter, timeseries, ts_prefix, type ) 
     497    , split_freq_format, sync_freq, time_counter, time_counter_name, timeseries, ts_prefix, type  & 
     498     ) 
    470499 
    471500    IMPLICIT NONE 
     
    507536      LOGICAL, OPTIONAL, INTENT(OUT) :: time_counter 
    508537      LOGICAL(KIND=C_BOOL) :: time_counter_tmp 
     538      LOGICAL, OPTIONAL, INTENT(OUT) :: time_counter_name 
     539      LOGICAL(KIND=C_BOOL) :: time_counter_name_tmp 
    509540      LOGICAL, OPTIONAL, INTENT(OUT) :: timeseries 
    510541      LOGICAL(KIND=C_BOOL) :: timeseries_tmp 
     
    517548      ( filegroup_hdl, append, compression_level, description, enabled, format, group_ref, min_digits  & 
    518549      , mode, name, name_suffix, output_freq, output_level, par_access, record_offset, split_freq  & 
    519       , split_freq_format, sync_freq, time_counter, timeseries, ts_prefix, type ) 
     550      , split_freq_format, sync_freq, time_counter, time_counter_name, timeseries, ts_prefix, type  & 
     551       ) 
    520552 
    521553  END SUBROUTINE xios(is_defined_filegroup_attr_hdl) 
     
    524556    ( filegroup_hdl, append_, compression_level_, description_, enabled_, format_, group_ref_, min_digits_  & 
    525557    , mode_, name_, name_suffix_, output_freq_, output_level_, par_access_, record_offset_, split_freq_  & 
    526     , split_freq_format_, sync_freq_, time_counter_, timeseries_, ts_prefix_, type_ ) 
     558    , split_freq_format_, sync_freq_, time_counter_, time_counter_name_, timeseries_, ts_prefix_  & 
     559    , type_ ) 
    527560 
    528561    IMPLICIT NONE 
     
    564597      LOGICAL, OPTIONAL, INTENT(OUT) :: time_counter_ 
    565598      LOGICAL(KIND=C_BOOL) :: time_counter__tmp 
     599      LOGICAL, OPTIONAL, INTENT(OUT) :: time_counter_name_ 
     600      LOGICAL(KIND=C_BOOL) :: time_counter_name__tmp 
    566601      LOGICAL, OPTIONAL, INTENT(OUT) :: timeseries_ 
    567602      LOGICAL(KIND=C_BOOL) :: timeseries__tmp 
     
    661696      ENDIF 
    662697 
     698      IF (PRESENT(time_counter_name_)) THEN 
     699        time_counter_name__tmp = cxios_is_defined_filegroup_time_counter_name(filegroup_hdl%daddr) 
     700        time_counter_name_ = time_counter_name__tmp 
     701      ENDIF 
     702 
    663703      IF (PRESENT(timeseries_)) THEN 
    664704        timeseries__tmp = cxios_is_defined_filegroup_timeseries(filegroup_hdl%daddr) 
  • XIOS/trunk/src/io/inetcdf4.cpp

    r783 r802  
    77namespace xios 
    88{ 
    9   CINetCDF4::CINetCDF4(const StdString& filename, const MPI_Comm* comm /*= NULL*/, bool multifile /*= true*/) 
     9  CINetCDF4::CINetCDF4(const StdString& filename, const MPI_Comm* comm /*= NULL*/, bool multifile /*= true*/, const StdString& timeCounterName /*= "time_counter"*/) 
    1010  { 
    1111    // Don't use parallel mode if there is only one process 
     
    2525    else 
    2626      CNetCdfInterface::open(filename, NC_NOWRITE, this->ncidp); 
     27 
     28    this->timeCounterName = timeCounterName; 
    2729  } 
    2830 
     
    359361  bool CINetCDF4::hasTemporalDim(const CVarPath* const path) 
    360362  { 
    361     return (this->getUnlimitedDimension(path) != -1); 
     363    std::list<StdString> dims = this->getDimensionsList(NULL, path); 
     364    return (std::find(dims.begin(), dims.end(), timeCounterName) != dims.end()); 
    362365  } 
    363366 
     
    563566  bool CINetCDF4::isTemporal(const StdString& name, const CVarPath* const path) 
    564567  { 
    565     if (!this->hasTemporalDim(path)) return false; 
    566     std::map<StdString, StdSize> dims = this->getDimensions(&name, path); 
    567     return (dims.find(this->getUnlimitedDimensionName(path)) != dims.end()); 
     568    std::list<StdString> dims = this->getDimensionsList(&name, path); 
     569    return (std::find(dims.begin(), dims.end(), timeCounterName) != dims.end()); 
    568570  } 
    569571 
  • XIOS/trunk/src/io/inetcdf4.hpp

    r782 r802  
    2222    public: 
    2323      /// Constructors /// 
    24       CINetCDF4(const StdString& filename, const MPI_Comm* comm = NULL, bool multifile = true); 
     24      CINetCDF4(const StdString& filename, const MPI_Comm* comm = NULL, bool multifile = true, 
     25                const StdString& timeCounterName = "time_counter"); 
    2526      CINetCDF4(const CINetCDF4& inetcdf4);       // Not implemented. 
    2627      CINetCDF4(const CINetCDF4* const inetcdf4); // Not implemented. 
     
    4142 
    4243      StdString getUnlimitedDimensionName(const CVarPath* const path = NULL); 
     44 
     45      const StdString& getTimeCounterName(void) const { return timeCounterName; }; 
    4346 
    4447      StdString getCoordinatesId(const StdString& name, const CVarPath* const path = NULL); 
     
    155158      int ncidp; //< Id of the NetCDF file 
    156159      bool mpi;  //< Whether parallel file access is used 
     160      StdString timeCounterName; 
    157161  }; // class CINetCDF4 
    158162} // namespace xios 
  • XIOS/trunk/src/io/nc4_data_input.cpp

    r785 r802  
    99namespace xios 
    1010{ 
    11   CNc4DataInput::CNc4DataInput(const StdString& filename, MPI_Comm comm_file, bool multifile, bool isCollective /*= true*/) 
     11  CNc4DataInput::CNc4DataInput(const StdString& filename, MPI_Comm comm_file, bool multifile, bool isCollective /*= true*/, const StdString& timeCounterName /*= "time_counter"*/) 
    1212    : SuperClass() 
    13     , SuperClassWriter(filename, &comm_file, multifile) 
     13    , SuperClassWriter(filename, &comm_file, multifile, timeCounterName) 
    1414    , comm_file(comm_file) 
    1515    , filename(filename) 
  • XIOS/trunk/src/io/nc4_data_input.hpp

    r783 r802  
    2222 
    2323    /// Constructors /// 
    24     CNc4DataInput(const StdString& filename, MPI_Comm comm_file, bool multifile, bool isCollective = true); 
     24    CNc4DataInput(const StdString& filename, MPI_Comm comm_file, bool multifile, bool isCollective = true, 
     25                  const StdString& timeCounterName = "time_counter"); 
    2526    CNc4DataInput(const CNc4DataInput& dataInput);       // Not implemented. 
    2627    CNc4DataInput(const CNc4DataInput* const dataInput); // Not implemented. 
  • XIOS/trunk/src/io/nc4_data_output.cpp

    r796 r802  
    2222            , filename(filename) 
    2323      { 
    24          StdString timeid = StdString("time_counter"); 
    2524         SuperClass::type = MULTI_FILE; 
    2625      } 
     
    2827      CNc4DataOutput::CNc4DataOutput 
    2928         (const StdString & filename, bool exist, bool useClassicFormat, 
    30           MPI_Comm comm_file,bool multifile, bool isCollective) 
     29          MPI_Comm comm_file,bool multifile, bool isCollective, const StdString& timeCounterName) 
    3130            : SuperClass() 
    32             , SuperClassWriter(filename, exist, useClassicFormat, &comm_file, multifile) 
     31            , SuperClassWriter(filename, exist, useClassicFormat, &comm_file, multifile, timeCounterName) 
    3332            , comm_file(comm_file) 
    3433            , filename(filename) 
    3534            , isCollective(isCollective) 
    3635      { 
    37          StdString timeid = StdString("time_counter"); 
    38  
    3936         SuperClass::type = (multifile) ? MULTI_FILE : ONE_FILE; 
    4037      } 
     
    952949       try 
    953950       { 
    954         SuperClassWriter::addDimension("time_counter"); 
     951        SuperClassWriter::addDimension(getTimeCounterName()); 
    955952       } 
    956953       catch (CNetCdfException& e) 
     
    982979         std::vector<StdString> axisList   = grid->getAxisList(); 
    983980 
    984          StdString timeid  = StdString("time_counter"); 
     981         StdString timeid  = getTimeCounterName(); 
    985982         StdString dimXid,dimYid; 
    986983         std::deque<StdString> dimIdList, dimCoordList; 
     
    13911388        else if (field->getOperationTimeType() == func::CFunctor::centered) timeAxisId = "time_centered"; 
    13921389 
    1393         StdString timeBoundId("time_counter_bounds"); 
     1390        StdString timeBoundId = getTimeCounterName() + "_bounds"; 
    13941391 
    13951392        StdString timeAxisBoundId; 
     
    14921489                   if (field->file->time_counter != CFile::time_counter_attr::none) 
    14931490                   { 
    1494                      SuperClassWriter::writeData(time_counter, string("time_counter"), isCollective, field->getNStep() - 1); 
     1491                     SuperClassWriter::writeData(time_counter, getTimeCounterName(), isCollective, field->getNStep() - 1); 
    14951492                     if (field->file->time_counter != CFile::time_counter_attr::record) 
    14961493                       SuperClassWriter::writeData(time_counter_bound, timeBoundId, isCollective, field->getNStep() - 1); 
     
    16191616                   if (field->file->time_counter != CFile::time_counter_attr::none) 
    16201617                   { 
    1621                      SuperClassWriter::writeTimeAxisData(time_counter, string("time_counter"), isCollective, field->getNStep() - 1, isRoot); 
     1618                     SuperClassWriter::writeTimeAxisData(time_counter, getTimeCounterName(), isCollective, field->getNStep() - 1, isRoot); 
    16221619                     if (field->file->time_counter != CFile::time_counter_attr::record) 
    16231620                       SuperClassWriter::writeTimeAxisData(time_counter_bound, timeBoundId, isCollective, field->getNStep() - 1, isRoot); 
     
    16591656         StdString axisid("time_centered") ; 
    16601657         StdString axisBoundId("time_centered_bounds"); 
    1661          StdString timeid("time_counter"); 
     1658         StdString timeid(getTimeCounterName()); 
    16621659         StdString timeBoundId("axis_nbounds"); 
    16631660 
     
    17011698           { 
    17021699             // Adding time_counter 
    1703              axisid = "time_counter"; 
    1704              axisBoundId = "time_counter_bounds"; 
     1700             axisid = getTimeCounterName(); 
     1701             axisBoundId = getTimeCounterName() + "_bounds"; 
    17051702             dims.clear(); 
    17061703             dims.push_back(timeid); 
     
    19551952        if (it == timeToRecordCache.end()) 
    19561953        { 
    1957           StdString timeAxisBoundsId("time_counter_bounds"); 
     1954          StdString timeAxisBoundsId(getTimeCounterName() + "_bounds"); 
    19581955          if (!SuperClassWriter::varExist(timeAxisBoundsId)) 
    19591956            timeAxisBoundsId = "time_instant_bounds"; 
  • XIOS/trunk/src/io/nc4_data_output.hpp

    r774 r802  
    2626            CNc4DataOutput 
    2727               (const StdString & filename, bool exist, bool useClassicFormat, 
    28                 MPI_Comm comm_file, bool multifile, bool isCollective=true); 
     28                MPI_Comm comm_file, bool multifile, bool isCollective = true, 
     29                const StdString& timeCounterName = "time_counter"); 
    2930 
    3031            CNc4DataOutput(const CNc4DataOutput & dataoutput);       // Not implemented. 
  • XIOS/trunk/src/io/onetcdf4.cpp

    r707 r802  
    1313 
    1414      CONetCDF4::CONetCDF4(const StdString& filename, bool append, bool useClassicFormat, 
    15                            const MPI_Comm* comm, bool multifile) 
     15                           const MPI_Comm* comm, bool multifile, const StdString& timeCounterName) 
    1616        : path() 
    1717        , wmpi(false) 
    1818        , useClassicFormat(useClassicFormat) 
    1919      { 
    20          this->initialize(filename, append, useClassicFormat, comm,multifile); 
     20         this->initialize(filename, append, useClassicFormat, comm, multifile, timeCounterName); 
    2121      } 
    2222 
     
    3030 
    3131      void CONetCDF4::initialize(const StdString& filename, bool append, bool useClassicFormat, 
    32                                  const MPI_Comm* comm, bool multifile) 
     32                                 const MPI_Comm* comm, bool multifile, const StdString& timeCounterName) 
    3333      { 
    3434         this->useClassicFormat = useClassicFormat; 
     
    7474         if (useClassicFormat) 
    7575            CNetCdfInterface::setFill(this->ncidp, false); 
     76 
     77         this->timeCounterName = timeCounterName; 
    7678      } 
    7779 
     
    444446         int i = 0; 
    445447 
    446          if (iddims.begin()->compare(this->getUnlimitedDimensionName()) == 0) 
     448         if (iddims.begin()->compare(timeCounterName) == 0) 
    447449         { 
    448450            sstart.push_back(record); 
  • XIOS/trunk/src/io/onetcdf4.hpp

    r707 r802  
    2727            /// Constructeurs /// 
    2828            CONetCDF4(const StdString& filename, bool append, bool useClassicFormat = false, 
    29                       const MPI_Comm* comm = NULL, bool multifile = true); 
     29                      const MPI_Comm* comm = NULL, bool multifile = true, 
     30                      const StdString& timeCounterName = "time_counter"); 
    3031 
    3132            CONetCDF4(const CONetCDF4& onetcdf4);       // Not implemented. 
     
    3536            /// Initialisation /// 
    3637            void initialize(const StdString& filename, bool append, bool useClassicFormat, 
    37                             const MPI_Comm* comm, bool multifile); 
     38                            const MPI_Comm* comm, bool multifile, const StdString& timeCounterName); 
    3839            void close(void); 
    3940            void sync(void); 
     
    9394            int       getUnlimitedDimension(void); 
    9495            StdString getUnlimitedDimensionName(void); 
     96            const StdString& getTimeCounterName(void) const { return timeCounterName; }; 
    9597 
    9698            void getTimeAxisBounds(CArray<double,2>& timeAxisBounds, const StdString& name, bool collective); 
     
    119121            bool wmpi; 
    120122            map<int,size_t> timeAxis; 
     123            StdString timeCounterName; 
    121124      }; // class CONetCDF4 
    122125 
  • XIOS/trunk/src/node/file.cpp

    r775 r802  
    274274 
    275275      if (time_counter.isEmpty()) time_counter.setValue(time_counter_attr::centered); 
     276      if (time_counter_name.isEmpty()) time_counter_name = "time_counter"; 
    276277    } 
    277278 
     
    425426 
    426427        data_out = shared_ptr<CDataOutput>(new CNc4DataOutput(oss.str(), append, useClassicFormat, 
    427                                                               fileComm, multifile, isCollective)); 
     428                                                              fileComm, multifile, isCollective, time_counter_name)); 
    428429        isOpen = true; 
    429430 
     
    525526      if (isOpen) data_out->closeFile(); 
    526527 
    527       data_in = shared_ptr<CDataInput>(new CNc4DataInput(oss.str(), fileComm, multifile, isCollective)); 
     528      data_in = shared_ptr<CDataInput>(new CNc4DataInput(oss.str(), fileComm, multifile, isCollective, time_counter_name)); 
    528529      isOpen = true; 
    529530    } 
Note: See TracChangeset for help on using the changeset viewer.