Ignore:
Timestamp:
01/26/16 18:19:09 (8 years ago)
Author:
mhnguyen
Message:

Adding some attributes for axis and grid (ticket 71, 78)

+) Add index attribute for axis
+) Change mask?d to mask_?d for grid

Test
+) On Curie
+) Test passes

File:
1 edited

Legend:

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

    r779 r817  
    1212 
    1313  SUBROUTINE xios(set_axis_attr)  & 
    14     ( axis_id, axis_ref, begin, bounds, data_begin, data_index, data_n, long_name, mask, n, n_distributed_partition  & 
    15     , n_glo, name, positive, standard_name, unit, value ) 
     14    ( axis_id, axis_ref, begin, bounds, data_begin, data_index, data_n, index, long_name, mask, n  & 
     15    , n_distributed_partition, n_glo, name, positive, standard_name, unit, value ) 
    1616 
    1717    IMPLICIT NONE 
     
    2424      INTEGER  , OPTIONAL, INTENT(IN) :: data_index(:) 
    2525      INTEGER  , OPTIONAL, INTENT(IN) :: data_n 
     26      INTEGER  , OPTIONAL, INTENT(IN) :: index(:) 
    2627      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: long_name 
    2728      LOGICAL  , OPTIONAL, INTENT(IN) :: mask(:) 
     
    3839      CALL xios(get_axis_handle)(axis_id,axis_hdl) 
    3940      CALL xios(set_axis_attr_hdl_)   & 
    40       ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, long_name, mask, n, n_distributed_partition  & 
    41       , n_glo, name, positive, standard_name, unit, value ) 
     41      ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, index, long_name, mask  & 
     42      , n, n_distributed_partition, n_glo, name, positive, standard_name, unit, value ) 
    4243 
    4344  END SUBROUTINE xios(set_axis_attr) 
    4445 
    4546  SUBROUTINE xios(set_axis_attr_hdl)  & 
    46     ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, long_name, mask, n, n_distributed_partition  & 
    47     , n_glo, name, positive, standard_name, unit, value ) 
     47    ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, index, long_name, mask  & 
     48    , n, n_distributed_partition, n_glo, name, positive, standard_name, unit, value ) 
    4849 
    4950    IMPLICIT NONE 
     
    5556      INTEGER  , OPTIONAL, INTENT(IN) :: data_index(:) 
    5657      INTEGER  , OPTIONAL, INTENT(IN) :: data_n 
     58      INTEGER  , OPTIONAL, INTENT(IN) :: index(:) 
    5759      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: long_name 
    5860      LOGICAL  , OPTIONAL, INTENT(IN) :: mask(:) 
     
    6870 
    6971      CALL xios(set_axis_attr_hdl_)  & 
    70       ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, long_name, mask, n, n_distributed_partition  & 
    71       , n_glo, name, positive, standard_name, unit, value ) 
     72      ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, index, long_name, mask  & 
     73      , n, n_distributed_partition, n_glo, name, positive, standard_name, unit, value ) 
    7274 
    7375  END SUBROUTINE xios(set_axis_attr_hdl) 
    7476 
    7577  SUBROUTINE xios(set_axis_attr_hdl_)   & 
    76     ( axis_hdl, axis_ref_, begin_, bounds_, data_begin_, data_index_, data_n_, long_name_, mask_  & 
    77     , n_, n_distributed_partition_, n_glo_, name_, positive_, standard_name_, unit_, value_ ) 
     78    ( axis_hdl, axis_ref_, begin_, bounds_, data_begin_, data_index_, data_n_, index_, long_name_  & 
     79    , mask_, n_, n_distributed_partition_, n_glo_, name_, positive_, standard_name_, unit_, value_  & 
     80     ) 
    7881 
    7982    IMPLICIT NONE 
     
    8588      INTEGER  , OPTIONAL, INTENT(IN) :: data_index_(:) 
    8689      INTEGER  , OPTIONAL, INTENT(IN) :: data_n_ 
     90      INTEGER  , OPTIONAL, INTENT(IN) :: index_(:) 
    8791      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: long_name_ 
    8892      LOGICAL  , OPTIONAL, INTENT(IN) :: mask_(:) 
     
    121125      ENDIF 
    122126 
     127      IF (PRESENT(index_)) THEN 
     128        CALL cxios_set_axis_index(axis_hdl%daddr, index_, SHAPE(index_)) 
     129      ENDIF 
     130 
    123131      IF (PRESENT(long_name_)) THEN 
    124132        CALL cxios_set_axis_long_name(axis_hdl%daddr, long_name_, len(long_name_)) 
     
    166174 
    167175  SUBROUTINE xios(get_axis_attr)  & 
    168     ( axis_id, axis_ref, begin, bounds, data_begin, data_index, data_n, long_name, mask, n, n_distributed_partition  & 
    169     , n_glo, name, positive, standard_name, unit, value ) 
     176    ( axis_id, axis_ref, begin, bounds, data_begin, data_index, data_n, index, long_name, mask, n  & 
     177    , n_distributed_partition, n_glo, name, positive, standard_name, unit, value ) 
    170178 
    171179    IMPLICIT NONE 
     
    178186      INTEGER  , OPTIONAL, INTENT(OUT) :: data_index(:) 
    179187      INTEGER  , OPTIONAL, INTENT(OUT) :: data_n 
     188      INTEGER  , OPTIONAL, INTENT(OUT) :: index(:) 
    180189      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: long_name 
    181190      LOGICAL  , OPTIONAL, INTENT(OUT) :: mask(:) 
     
    192201      CALL xios(get_axis_handle)(axis_id,axis_hdl) 
    193202      CALL xios(get_axis_attr_hdl_)   & 
    194       ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, long_name, mask, n, n_distributed_partition  & 
    195       , n_glo, name, positive, standard_name, unit, value ) 
     203      ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, index, long_name, mask  & 
     204      , n, n_distributed_partition, n_glo, name, positive, standard_name, unit, value ) 
    196205 
    197206  END SUBROUTINE xios(get_axis_attr) 
    198207 
    199208  SUBROUTINE xios(get_axis_attr_hdl)  & 
    200     ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, long_name, mask, n, n_distributed_partition  & 
    201     , n_glo, name, positive, standard_name, unit, value ) 
     209    ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, index, long_name, mask  & 
     210    , n, n_distributed_partition, n_glo, name, positive, standard_name, unit, value ) 
    202211 
    203212    IMPLICIT NONE 
     
    209218      INTEGER  , OPTIONAL, INTENT(OUT) :: data_index(:) 
    210219      INTEGER  , OPTIONAL, INTENT(OUT) :: data_n 
     220      INTEGER  , OPTIONAL, INTENT(OUT) :: index(:) 
    211221      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: long_name 
    212222      LOGICAL  , OPTIONAL, INTENT(OUT) :: mask(:) 
     
    222232 
    223233      CALL xios(get_axis_attr_hdl_)  & 
    224       ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, long_name, mask, n, n_distributed_partition  & 
    225       , n_glo, name, positive, standard_name, unit, value ) 
     234      ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, index, long_name, mask  & 
     235      , n, n_distributed_partition, n_glo, name, positive, standard_name, unit, value ) 
    226236 
    227237  END SUBROUTINE xios(get_axis_attr_hdl) 
    228238 
    229239  SUBROUTINE xios(get_axis_attr_hdl_)   & 
    230     ( axis_hdl, axis_ref_, begin_, bounds_, data_begin_, data_index_, data_n_, long_name_, mask_  & 
    231     , n_, n_distributed_partition_, n_glo_, name_, positive_, standard_name_, unit_, value_ ) 
     240    ( axis_hdl, axis_ref_, begin_, bounds_, data_begin_, data_index_, data_n_, index_, long_name_  & 
     241    , mask_, n_, n_distributed_partition_, n_glo_, name_, positive_, standard_name_, unit_, value_  & 
     242     ) 
    232243 
    233244    IMPLICIT NONE 
     
    239250      INTEGER  , OPTIONAL, INTENT(OUT) :: data_index_(:) 
    240251      INTEGER  , OPTIONAL, INTENT(OUT) :: data_n_ 
     252      INTEGER  , OPTIONAL, INTENT(OUT) :: index_(:) 
    241253      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: long_name_ 
    242254      LOGICAL  , OPTIONAL, INTENT(OUT) :: mask_(:) 
     
    275287      ENDIF 
    276288 
     289      IF (PRESENT(index_)) THEN 
     290        CALL cxios_get_axis_index(axis_hdl%daddr, index_, SHAPE(index_)) 
     291      ENDIF 
     292 
    277293      IF (PRESENT(long_name_)) THEN 
    278294        CALL cxios_get_axis_long_name(axis_hdl%daddr, long_name_, len(long_name_)) 
     
    320336 
    321337  SUBROUTINE xios(is_defined_axis_attr)  & 
    322     ( axis_id, axis_ref, begin, bounds, data_begin, data_index, data_n, long_name, mask, n, n_distributed_partition  & 
    323     , n_glo, name, positive, standard_name, unit, value ) 
     338    ( axis_id, axis_ref, begin, bounds, data_begin, data_index, data_n, index, long_name, mask, n  & 
     339    , n_distributed_partition, n_glo, name, positive, standard_name, unit, value ) 
    324340 
    325341    IMPLICIT NONE 
     
    338354      LOGICAL, OPTIONAL, INTENT(OUT) :: data_n 
    339355      LOGICAL(KIND=C_BOOL) :: data_n_tmp 
     356      LOGICAL, OPTIONAL, INTENT(OUT) :: index 
     357      LOGICAL(KIND=C_BOOL) :: index_tmp 
    340358      LOGICAL, OPTIONAL, INTENT(OUT) :: long_name 
    341359      LOGICAL(KIND=C_BOOL) :: long_name_tmp 
     
    361379      CALL xios(get_axis_handle)(axis_id,axis_hdl) 
    362380      CALL xios(is_defined_axis_attr_hdl_)   & 
    363       ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, long_name, mask, n, n_distributed_partition  & 
    364       , n_glo, name, positive, standard_name, unit, value ) 
     381      ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, index, long_name, mask  & 
     382      , n, n_distributed_partition, n_glo, name, positive, standard_name, unit, value ) 
    365383 
    366384  END SUBROUTINE xios(is_defined_axis_attr) 
    367385 
    368386  SUBROUTINE xios(is_defined_axis_attr_hdl)  & 
    369     ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, long_name, mask, n, n_distributed_partition  & 
    370     , n_glo, name, positive, standard_name, unit, value ) 
     387    ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, index, long_name, mask  & 
     388    , n, n_distributed_partition, n_glo, name, positive, standard_name, unit, value ) 
    371389 
    372390    IMPLICIT NONE 
     
    384402      LOGICAL, OPTIONAL, INTENT(OUT) :: data_n 
    385403      LOGICAL(KIND=C_BOOL) :: data_n_tmp 
     404      LOGICAL, OPTIONAL, INTENT(OUT) :: index 
     405      LOGICAL(KIND=C_BOOL) :: index_tmp 
    386406      LOGICAL, OPTIONAL, INTENT(OUT) :: long_name 
    387407      LOGICAL(KIND=C_BOOL) :: long_name_tmp 
     
    406426 
    407427      CALL xios(is_defined_axis_attr_hdl_)  & 
    408       ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, long_name, mask, n, n_distributed_partition  & 
    409       , n_glo, name, positive, standard_name, unit, value ) 
     428      ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, index, long_name, mask  & 
     429      , n, n_distributed_partition, n_glo, name, positive, standard_name, unit, value ) 
    410430 
    411431  END SUBROUTINE xios(is_defined_axis_attr_hdl) 
    412432 
    413433  SUBROUTINE xios(is_defined_axis_attr_hdl_)   & 
    414     ( axis_hdl, axis_ref_, begin_, bounds_, data_begin_, data_index_, data_n_, long_name_, mask_  & 
    415     , n_, n_distributed_partition_, n_glo_, name_, positive_, standard_name_, unit_, value_ ) 
     434    ( axis_hdl, axis_ref_, begin_, bounds_, data_begin_, data_index_, data_n_, index_, long_name_  & 
     435    , mask_, n_, n_distributed_partition_, n_glo_, name_, positive_, standard_name_, unit_, value_  & 
     436     ) 
    416437 
    417438    IMPLICIT NONE 
     
    429450      LOGICAL, OPTIONAL, INTENT(OUT) :: data_n_ 
    430451      LOGICAL(KIND=C_BOOL) :: data_n__tmp 
     452      LOGICAL, OPTIONAL, INTENT(OUT) :: index_ 
     453      LOGICAL(KIND=C_BOOL) :: index__tmp 
    431454      LOGICAL, OPTIONAL, INTENT(OUT) :: long_name_ 
    432455      LOGICAL(KIND=C_BOOL) :: long_name__tmp 
     
    480503      ENDIF 
    481504 
     505      IF (PRESENT(index_)) THEN 
     506        index__tmp = cxios_is_defined_axis_index(axis_hdl%daddr) 
     507        index_ = index__tmp 
     508      ENDIF 
     509 
    482510      IF (PRESENT(long_name_)) THEN 
    483511        long_name__tmp = cxios_is_defined_axis_long_name(axis_hdl%daddr) 
Note: See TracChangeset for help on using the changeset viewer.