Ignore:
Timestamp:
05/26/15 16:13:47 (9 years ago)
Author:
rlacroix
Message:

Add the infrastructure to request fields from the server.

This will be used to read input files so add a new file attribute mode to define whether data is written or read from a file.

Currently the data is not actually read and random data is transfered for those fields in read mode.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/interface/fortran_attr/ifile_attr.F90

    r581 r598  
    1212 
    1313  SUBROUTINE xios(set_file_attr)  & 
    14     ( file_id, append, description, enabled, format, min_digits, name, name_suffix, output_freq  & 
     14    ( file_id, append, description, enabled, format, min_digits, mode, name, name_suffix, output_freq  & 
    1515    , output_level, par_access, split_freq, split_freq_format, sync_freq, type ) 
    1616 
     
    2525      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: format 
    2626      INTEGER  , OPTIONAL, INTENT(IN) :: min_digits 
     27      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: mode 
    2728      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name 
    2829      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name_suffix 
     
    3738      CALL xios(get_file_handle)(file_id,file_hdl) 
    3839      CALL xios(set_file_attr_hdl_)   & 
    39       ( file_hdl, append, description, enabled, format, min_digits, name, name_suffix, output_freq  & 
     40      ( file_hdl, append, description, enabled, format, min_digits, mode, name, name_suffix, output_freq  & 
    4041      , output_level, par_access, split_freq, split_freq_format, sync_freq, type ) 
    4142 
     
    4344 
    4445  SUBROUTINE xios(set_file_attr_hdl)  & 
    45     ( file_hdl, append, description, enabled, format, min_digits, name, name_suffix, output_freq  & 
     46    ( file_hdl, append, description, enabled, format, min_digits, mode, name, name_suffix, output_freq  & 
    4647    , output_level, par_access, split_freq, split_freq_format, sync_freq, type ) 
    4748 
     
    5556      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: format 
    5657      INTEGER  , OPTIONAL, INTENT(IN) :: min_digits 
     58      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: mode 
    5759      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name 
    5860      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name_suffix 
     
    6668 
    6769      CALL xios(set_file_attr_hdl_)  & 
    68       ( file_hdl, append, description, enabled, format, min_digits, name, name_suffix, output_freq  & 
     70      ( file_hdl, append, description, enabled, format, min_digits, mode, name, name_suffix, output_freq  & 
    6971      , output_level, par_access, split_freq, split_freq_format, sync_freq, type ) 
    7072 
     
    7274 
    7375  SUBROUTINE xios(set_file_attr_hdl_)   & 
    74     ( file_hdl, append_, description_, enabled_, format_, min_digits_, name_, name_suffix_, output_freq_  & 
    75     , output_level_, par_access_, split_freq_, split_freq_format_, sync_freq_, type_ ) 
     76    ( file_hdl, append_, description_, enabled_, format_, min_digits_, mode_, name_, name_suffix_  & 
     77    , output_freq_, output_level_, par_access_, split_freq_, split_freq_format_, sync_freq_, type_  & 
     78     ) 
    7679 
    7780    IMPLICIT NONE 
     
    8487      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: format_ 
    8588      INTEGER  , OPTIONAL, INTENT(IN) :: min_digits_ 
     89      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: mode_ 
    8690      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name_ 
    8791      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name_suffix_ 
     
    116120      ENDIF 
    117121 
     122      IF (PRESENT(mode_)) THEN 
     123        CALL cxios_set_file_mode(file_hdl%daddr, mode_, len(mode_)) 
     124      ENDIF 
     125 
    118126      IF (PRESENT(name_)) THEN 
    119127        CALL cxios_set_file_name(file_hdl%daddr, name_, len(name_)) 
     
    155163 
    156164  SUBROUTINE xios(get_file_attr)  & 
    157     ( file_id, append, description, enabled, format, min_digits, name, name_suffix, output_freq  & 
     165    ( file_id, append, description, enabled, format, min_digits, mode, name, name_suffix, output_freq  & 
    158166    , output_level, par_access, split_freq, split_freq_format, sync_freq, type ) 
    159167 
     
    168176      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: format 
    169177      INTEGER  , OPTIONAL, INTENT(OUT) :: min_digits 
     178      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: mode 
    170179      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name 
    171180      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name_suffix 
     
    180189      CALL xios(get_file_handle)(file_id,file_hdl) 
    181190      CALL xios(get_file_attr_hdl_)   & 
    182       ( file_hdl, append, description, enabled, format, min_digits, name, name_suffix, output_freq  & 
     191      ( file_hdl, append, description, enabled, format, min_digits, mode, name, name_suffix, output_freq  & 
    183192      , output_level, par_access, split_freq, split_freq_format, sync_freq, type ) 
    184193 
     
    186195 
    187196  SUBROUTINE xios(get_file_attr_hdl)  & 
    188     ( file_hdl, append, description, enabled, format, min_digits, name, name_suffix, output_freq  & 
     197    ( file_hdl, append, description, enabled, format, min_digits, mode, name, name_suffix, output_freq  & 
    189198    , output_level, par_access, split_freq, split_freq_format, sync_freq, type ) 
    190199 
     
    198207      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: format 
    199208      INTEGER  , OPTIONAL, INTENT(OUT) :: min_digits 
     209      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: mode 
    200210      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name 
    201211      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name_suffix 
     
    209219 
    210220      CALL xios(get_file_attr_hdl_)  & 
    211       ( file_hdl, append, description, enabled, format, min_digits, name, name_suffix, output_freq  & 
     221      ( file_hdl, append, description, enabled, format, min_digits, mode, name, name_suffix, output_freq  & 
    212222      , output_level, par_access, split_freq, split_freq_format, sync_freq, type ) 
    213223 
     
    215225 
    216226  SUBROUTINE xios(get_file_attr_hdl_)   & 
    217     ( file_hdl, append_, description_, enabled_, format_, min_digits_, name_, name_suffix_, output_freq_  & 
    218     , output_level_, par_access_, split_freq_, split_freq_format_, sync_freq_, type_ ) 
     227    ( file_hdl, append_, description_, enabled_, format_, min_digits_, mode_, name_, name_suffix_  & 
     228    , output_freq_, output_level_, par_access_, split_freq_, split_freq_format_, sync_freq_, type_  & 
     229     ) 
    219230 
    220231    IMPLICIT NONE 
     
    227238      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: format_ 
    228239      INTEGER  , OPTIONAL, INTENT(OUT) :: min_digits_ 
     240      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: mode_ 
    229241      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name_ 
    230242      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name_suffix_ 
     
    259271      ENDIF 
    260272 
     273      IF (PRESENT(mode_)) THEN 
     274        CALL cxios_get_file_mode(file_hdl%daddr, mode_, len(mode_)) 
     275      ENDIF 
     276 
    261277      IF (PRESENT(name_)) THEN 
    262278        CALL cxios_get_file_name(file_hdl%daddr, name_, len(name_)) 
     
    298314 
    299315  SUBROUTINE xios(is_defined_file_attr)  & 
    300     ( file_id, append, description, enabled, format, min_digits, name, name_suffix, output_freq  & 
     316    ( file_id, append, description, enabled, format, min_digits, mode, name, name_suffix, output_freq  & 
    301317    , output_level, par_access, split_freq, split_freq_format, sync_freq, type ) 
    302318 
     
    314330      LOGICAL, OPTIONAL, INTENT(OUT) :: min_digits 
    315331      LOGICAL(KIND=C_BOOL) :: min_digits_tmp 
     332      LOGICAL, OPTIONAL, INTENT(OUT) :: mode 
     333      LOGICAL(KIND=C_BOOL) :: mode_tmp 
    316334      LOGICAL, OPTIONAL, INTENT(OUT) :: name 
    317335      LOGICAL(KIND=C_BOOL) :: name_tmp 
     
    335353      CALL xios(get_file_handle)(file_id,file_hdl) 
    336354      CALL xios(is_defined_file_attr_hdl_)   & 
    337       ( file_hdl, append, description, enabled, format, min_digits, name, name_suffix, output_freq  & 
     355      ( file_hdl, append, description, enabled, format, min_digits, mode, name, name_suffix, output_freq  & 
    338356      , output_level, par_access, split_freq, split_freq_format, sync_freq, type ) 
    339357 
     
    341359 
    342360  SUBROUTINE xios(is_defined_file_attr_hdl)  & 
    343     ( file_hdl, append, description, enabled, format, min_digits, name, name_suffix, output_freq  & 
     361    ( file_hdl, append, description, enabled, format, min_digits, mode, name, name_suffix, output_freq  & 
    344362    , output_level, par_access, split_freq, split_freq_format, sync_freq, type ) 
    345363 
     
    356374      LOGICAL, OPTIONAL, INTENT(OUT) :: min_digits 
    357375      LOGICAL(KIND=C_BOOL) :: min_digits_tmp 
     376      LOGICAL, OPTIONAL, INTENT(OUT) :: mode 
     377      LOGICAL(KIND=C_BOOL) :: mode_tmp 
    358378      LOGICAL, OPTIONAL, INTENT(OUT) :: name 
    359379      LOGICAL(KIND=C_BOOL) :: name_tmp 
     
    376396 
    377397      CALL xios(is_defined_file_attr_hdl_)  & 
    378       ( file_hdl, append, description, enabled, format, min_digits, name, name_suffix, output_freq  & 
     398      ( file_hdl, append, description, enabled, format, min_digits, mode, name, name_suffix, output_freq  & 
    379399      , output_level, par_access, split_freq, split_freq_format, sync_freq, type ) 
    380400 
     
    382402 
    383403  SUBROUTINE xios(is_defined_file_attr_hdl_)   & 
    384     ( file_hdl, append_, description_, enabled_, format_, min_digits_, name_, name_suffix_, output_freq_  & 
    385     , output_level_, par_access_, split_freq_, split_freq_format_, sync_freq_, type_ ) 
     404    ( file_hdl, append_, description_, enabled_, format_, min_digits_, mode_, name_, name_suffix_  & 
     405    , output_freq_, output_level_, par_access_, split_freq_, split_freq_format_, sync_freq_, type_  & 
     406     ) 
    386407 
    387408    IMPLICIT NONE 
     
    397418      LOGICAL, OPTIONAL, INTENT(OUT) :: min_digits_ 
    398419      LOGICAL(KIND=C_BOOL) :: min_digits__tmp 
     420      LOGICAL, OPTIONAL, INTENT(OUT) :: mode_ 
     421      LOGICAL(KIND=C_BOOL) :: mode__tmp 
    399422      LOGICAL, OPTIONAL, INTENT(OUT) :: name_ 
    400423      LOGICAL(KIND=C_BOOL) :: name__tmp 
     
    441464      ENDIF 
    442465 
     466      IF (PRESENT(mode_)) THEN 
     467        mode__tmp = cxios_is_defined_file_mode(file_hdl%daddr) 
     468        mode_ = mode__tmp 
     469      ENDIF 
     470 
    443471      IF (PRESENT(name_)) THEN 
    444472        name__tmp = cxios_is_defined_file_name(file_hdl%daddr) 
Note: See TracChangeset for help on using the changeset viewer.