Index: branches/2014/dev_r4650_UKMO10_Tidally_Meaned_Diagnostics/NEMOGCM/TOOLS/SIREN/src/dimension.f90
===================================================================
--- branches/2014/dev_r4650_UKMO10_Tidally_Meaned_Diagnostics/NEMOGCM/TOOLS/SIREN/src/dimension.f90	(revision 4744)
+++ branches/2014/dev_r4650_UKMO10_Tidally_Meaned_Diagnostics/NEMOGCM/TOOLS/SIREN/src/dimension.f90	(revision 5260)
@@ -8,18 +8,35 @@
 !> @brief 
 !> This module manage dimension and how to change order of those dimension.
-!
+!>
 !> @details
 !>    define type TDIM:<br/>
-!>    TYPE(TDIM) :: tl_dim<br/>
-!>
-!>    to initialise a dimension structure:<br/>
-!>    - tl_dim=dim_init( cd_name, [id_len,] [ld_uld,] [cd_sname])
+!> @code
+!>    TYPE(TDIM) :: tl_dim
+!> @endcode
+!>
+!>    to initialize a dimension structure:<br/>
+!> @code
+!>    tl_dim=dim_init( cd_name, [id_len,] [ld_uld,] [cd_sname])
+!> @endcode
 !>       - cd_name is the dimension name
-!>       - id_len is the dimension size (optional)
-!>       - ld_uld is true if this dimension is the unlimited one (optional)
-!>       - cd_sname is the dimension short name (optional)
+!>       - id_len is the dimension size [optional]
+!>       - ld_uld is true if this dimension is the unlimited one [optional]
+!>       - cd_sname is the dimension short name ('x','y','z','t') [optional]
+!>
+!>    to clean dimension structure:<br/>
+!> @code
+!>    CALL dim_clean(tl_dim)
+!> @endcode
+!>       - tl_dim : dimension strucutre or array of dimension structure
 !>
 !>    to print information about dimension structure:<br/>
+!> @code
 !>    CALL dim_print(tl_dim)
+!> @endcode
+!>
+!>    to copy dimension structure in another one (using different memory cell):<br/>
+!> @code
+!>    tl_dim2=dim_copy(tl_dim1) 
+!> @endcode
 !>
 !>    to get dimension name:<br/>
@@ -35,8 +52,8 @@
 !>    - tl_dim\%l_uld
 !>
-!>    to get dimension id (use for variable or file dimension):<br/>
+!>    to get dimension id (for variable or file dimension):<br/>
 !>    - tl_dim\%i_id 
 !>
-!>    to know if dimension is used (use for variable or file dimension):<br/>
+!>    to know if dimension is used (for variable or file dimension):<br/>
 !>    - tl_dim\%l_use
 !>
@@ -44,55 +61,97 @@
 !>    variables as well as files use usually 4 dimensions.<br/>
 !>    To easily work with variable we want they will be all 4D and ordered as
-!>    follow: ('x','y','z','t').<br/>
+!>    following: ('x','y','z','t').<br/>
 !>    Functions and subroutines below, allow to reorder dimension of 
 !>    variable.<br/>
 !>    
-!>    Suppose we defined the table of dimension structure below:<br/>
-!>    TYPE(TDIM), DIMENSION(4) :: tl_dim
+!>    Suppose we defined the array of dimension structure below:<br/>
+!> @code
+!>    TYPE(TDIM), DIMENSION(4) :: tl_dim 
 !>    tl_dim(1)=dim_init( 'X', id_len=10)
 !>    tl_dim(2)=dim_init( 'T', id_len=3, ld_uld=.TRUE.)
-!>
-!>    to reorder dimension as we assume variable are defined
-!>    ('x','y','z','t'):<br/>
-!>    CALL dim_reorder(tl(dim(:))
+!> @endcode
+!>
+!>    to reorder dimension (default order: ('x','y','z','t')):<br/>
+!> @code
+!>    CALL dim_reorder(tl_dim(:))
+!> @endcode
 !>
 !>    This subroutine filled dimension structure with unused dimension, 
-!>    then switch from "unordered" dimension to "ordered" dimension
-!>    The dimension structure return will be:
-!>    tl_dim(1) => 'X', i_len=10, l_use=T, l_uld=F
-!>    tl_dim(2) => 'Y', i_len=0,  l_use=F, l_uld=F 
-!>    tl_dim(3) => 'Z', i_len=0,  l_use=F, l_uld=F
-!>    tl_dim(4) => 'T', i_len=3,  l_use=T, l_uld=T
-!>
-!>    After using dim_reorder subroutine you could use functions and subroutine
+!>    then switch from "unordered" dimension to "ordered" dimension.<br/>
+!>    The dimension structure return will be:<br/>
+!>    tl_dim(1) => 'X', i_len=10, l_use=T, l_uld=F<br/>
+!>    tl_dim(2) => 'Y', i_len=1,  l_use=F, l_uld=F<br/> 
+!>    tl_dim(3) => 'Z', i_len=1,  l_use=F, l_uld=F<br/>
+!>    tl_dim(4) => 'T', i_len=3,  l_use=T, l_uld=T<br/>
+!>
+!>    After using subroutine dim_reorder you could use functions and subroutine
 !>    below.<br/>
 !>
-!>    to reshape table of value in "ordered" dimension:<br/>
+!>    to use another dimension order.<br/>
+!> @code
+!>    CALL dim_reorder(tl(dim(:), cl_neworder)
+!> @endcode
+!>    - cl_neworder : character(len=4) (example: 'yxzt')
+!>
+!>    to switch dimension array from ordered dimension to unordered
+!> dimension:<br/>
+!> @code
+!>    CALL dim_unorder(tl_dim(:))
+!> @endcode
+!>
+!>    to fill unused dimension of an array of dimension structure.<br/>
+!> @code
+!>    tl_dimout(:)=dim_fill_unused(tl_dimin(:))
+!> @endcode
+!>    - tl_dimout(:) : 1D array (4elts) of dimension strcuture
+!>    - tl_dimin(:)  : 1D array (<=4elts) of dimension structure
+!>
+!>    to reshape array of value in "ordered" dimension:<br/>
+!> @code
 !>    CALL dim_reshape_2xyzt(tl_dim(:), value(:,:,:,:))
-!>       - value must be a 4D table of real(8) value "unordered"
-!>
-!>    to reshape table of value in "unordered" dimension:<br/>
+!> @endcode
+!>       - value must be a 4D array of real(8) value "unordered"
+!>
+!>    to reshape array of value in "unordered" dimension:<br/>
+!> @code
 !>    CALL dim_reshape_xyzt2(tl_dim(:), value(:,:,:,:))
-!>       - value must be a 4D table of real(8) value "ordered"
-!>
-!>    to reorder a 1D table of 4 elements in "ordered" dimension:<br/>
+!> @endcode
+!>       - value must be a 4D array of real(8) value "ordered"
+!>
+!>    to reorder a 1D array of 4 elements in "ordered" dimension:<br/>
+!> @code
 !>    CALL dim_reorder_2xyzt(tl_dim(:), tab(:))
-!>
-!>       - tab must be a 1D table with 4 elements "unordered".
+!> @endcode
+!>       - tab must be a 1D array with 4 elements "unordered".
 !>       It could be composed of character, integer(4), or logical
 !> 
-!>    to reorder a 1D table of 4 elements in "unordered" dimension:<br/>
+!>    to reorder a 1D array of 4 elements in "unordered" dimension:<br/>
+!> @code
 !>    CALL dim_reorder_2xyzt(tl_dim(:), tab(:))
-!>
-!>       - tab must be a 1D table with 4 elements "ordered".
+!> @endcode
+!>       - tab must be a 1D array with 4 elements "ordered".
 !>       It could be composed of character, integer(4), or logical
 !>
-!> @author
-!> J.Paul
+!>    to get dimension index from a array of dimension structure, 
+!>    given dimension name or short name :<br/>
+!> @code
+!>    index=dim_get_index( tl_dim(:), [cl_name, cl_sname] )
+!> @endcode
+!>       - tl_dim(:) : array of dimension structure
+!>       - cl_name : dimension name [optional]
+!>       - cl_sname: dimension short name [optional]
+!>
+!>    to get dimension id used in an array of dimension structure, 
+!>    given dimension name or short name :<br/>
+!> @code
+!>    id=dim_get_id( tl_dim(:), [cl_name, cl_sname] )
+!> @endcode
+!>       - tl_dim(:) : array of dimension structure
+!>       - cl_name : dimension name [optional]
+!>       - cl_sname: dimension short name [optional]
+!>
+!> @author J.Paul
 ! REVISION HISTORY:
-!> @date Nov, 2013 - Initial Version
-!
-!> @todo
-!> - add description generique de l'objet dim
+!> @date November, 2013 - Initial Version
 !>
 !> @note Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
@@ -104,11 +163,8 @@
    USE fct                             ! basic useful function
    IMPLICIT NONE
-   PRIVATE
    ! NOTE_avoid_public_variables_if_possible
 
    ! type and variable
    PUBLIC :: TDIM              !< dimension structure
-   PUBLIC :: ip_maxdim         !< number of dimension to be used
-   PUBLIC :: cp_dimorder       !< dimension order
 
    ! function and subroutine
@@ -116,94 +172,164 @@
    PUBLIC :: dim_clean         !< clean dimension structuree
    PUBLIC :: dim_print         !< print dimension information
-   PUBLIC :: dim_get_id        !< get dimension id in table of dimension structure
-   PUBLIC :: dim_get_void_id   !< get unused dimension id in table of dimension structure
-   PUBLIC :: dim_order         !< check if dimension are ordered or not
+   PUBLIC :: dim_copy          !< copy dimension structure
    PUBLIC :: dim_reorder       !< filled dimension structure to switch from unordered to ordered dimension
-   PUBLIC :: dim_unorder       !< switch dimension table from ordered to unordered dimension
-   PUBLIC :: dim_reshape_2xyzt !< reshape table dimension to ('x','y','z','t')
-   PUBLIC :: dim_reshape_xyzt2 !< reshape table dimension from ('x','y','z','t')
-   PUBLIC :: dim_reorder_2xyzt !< reorder 1D table to ('x','y','z','t')
-   PUBLIC :: dim_reorder_xyzt2 !< reorder 1D table from ('x','y','z','t')
-
-   PRIVATE :: dim__fill_unused      !< filled dimension structure with unused dimension 
-   PRIVATE :: dim__reshape_2xyzt_dp !< reshape real(8) 4D table to ('x','y','z','t')
-   PRIVATE :: dim__reshape_xyzt2_dp !< reshape real(8) 4D table from ('x','y','z','t')
-   PRIVATE :: dim__reorder_2xyzt_i4 !< reorder integer(4) 1D table to ('x','y','z','t')
-   PRIVATE :: dim__reorder_xyzt2_i4 !< reorder integer(4) 1D table from ('x','y','z','t')
-   PRIVATE :: dim__reorder_2xyzt_l  !< reorder logical 1D table to ('x','y','z','t')
-   PRIVATE :: dim__reorder_xyzt2_l  !< reorder logical 1D table from ('x','y','z','t')
-   PRIVATE :: dim__reorder_2xyzt_c  !< reorder string 1D table to ('x','y','z','t')
-   PRIVATE :: dim__reorder_xyzt2_c  !< reorder string 1D table from ('x','y','z','t')
-   PRIVATE :: dim__clean_unit       !< clean one dimension structure
-   PRIVATE :: dim__clean_tab        !< clean a table of dimension structure
-   PRIVATE :: dim__print_unit       !< print information on one dimension structure
-   PRIVATE :: dim__print_tab        !< print information on a table of dimension structure
-
-   !> @struct TDIM
-   TYPE TDIM
-      CHARACTER(LEN=lc) :: c_name = ''!< dimension name
+   PUBLIC :: dim_unorder       !< switch dimension array from ordered to unordered dimension
+   PUBLIC :: dim_fill_unused   !< filled dimension structure with unused dimension 
+   PUBLIC :: dim_reshape_2xyzt !< reshape array dimension to ('x','y','z','t')
+   PUBLIC :: dim_reshape_xyzt2 !< reshape array dimension from ('x','y','z','t')
+   PUBLIC :: dim_reorder_2xyzt !< reorder 1D array to ('x','y','z','t')
+   PUBLIC :: dim_reorder_xyzt2 !< reorder 1D array from ('x','y','z','t')
+   PUBLIC :: dim_get_index     !< get dimension index in array of dimension structure
+   PUBLIC :: dim_get_id        !< get dimension id in array of dimension structure
+
+   PRIVATE :: dim__reshape_2xyzt_dp ! reshape real(8) 4D array to ('x','y','z','t')
+   PRIVATE :: dim__reshape_xyzt2_dp ! reshape real(8) 4D array from ('x','y','z','t')
+   PRIVATE :: dim__reorder_2xyzt_i4 ! reorder integer(4) 1D array to ('x','y','z','t')
+   PRIVATE :: dim__reorder_xyzt2_i4 ! reorder integer(4) 1D array from ('x','y','z','t')
+   PRIVATE :: dim__reorder_2xyzt_l  ! reorder logical 1D array to ('x','y','z','t')
+   PRIVATE :: dim__reorder_xyzt2_l  ! reorder logical 1D array from ('x','y','z','t')
+   PRIVATE :: dim__reorder_2xyzt_c  ! reorder string 1D array to ('x','y','z','t')
+   PRIVATE :: dim__reorder_xyzt2_c  ! reorder string 1D array from ('x','y','z','t')
+   PRIVATE :: dim__clean_unit       ! clean one dimension structure
+   PRIVATE :: dim__clean_arr        ! clean a array of dimension structure
+   PRIVATE :: dim__print_unit       ! print information on one dimension structure
+   PRIVATE :: dim__print_arr        ! print information on a array of dimension structure
+   PRIVATE :: dim__copy_unit        ! copy dimension structure
+   PRIVATE :: dim__copy_arr         ! copy array of dimension structure
+
+   TYPE TDIM !< dimension structure
+      CHARACTER(LEN=lc) :: c_name = ''       !< dimension name
       CHARACTER(LEN=lc) :: c_sname = 'u'     !< dimension short name
-      INTEGER(i4)       :: i_id = 0          !< dimension id
+      INTEGER(i4)       :: i_id  = 0         !< dimension id
       INTEGER(i4)       :: i_len = 1         !< dimension length
       LOGICAL           :: l_uld = .FALSE.   !< dimension unlimited or not
       LOGICAL           :: l_use = .FALSE.   !< dimension used or not
-      INTEGER(i4)       :: i_2xyzt = 0       !< indices to reshape table to ('x','y','z','t')
-      INTEGER(i4)       :: i_xyzt2 = 0       !< indices to reshape table from ('x','y','z','t')
+      INTEGER(i4)       :: i_2xyzt = 0       !< indices to reshape array to ('x','y','z','t')
+      INTEGER(i4)       :: i_xyzt2 = 0       !< indices to reshape array from ('x','y','z','t')
    END TYPE
-
-   INTEGER(i4), PARAMETER :: ip_maxdim = 4  !< number of dimension to be used
-
-   !  module variable
-   CHARACTER(LEN=lc), PARAMETER :: cp_dimorder = 'xyzt' !< dimension order to output
 
    INTERFACE dim_print
       MODULE PROCEDURE dim__print_unit ! print information on one dimension
-      MODULE PROCEDURE dim__print_tab  ! print information on a table of dimension
+      MODULE PROCEDURE dim__print_arr  ! print information on a array of dimension
    END INTERFACE dim_print
 
    INTERFACE dim_clean
       MODULE PROCEDURE dim__clean_unit ! clean one dimension
-      MODULE PROCEDURE dim__clean_tab  ! clean a table of dimension
+      MODULE PROCEDURE dim__clean_arr  ! clean a array of dimension
    END INTERFACE dim_clean
 
+   INTERFACE dim_copy
+      MODULE PROCEDURE dim__copy_unit  ! copy dimension structure
+      MODULE PROCEDURE dim__copy_arr   ! copy array of dimension structure
+   END INTERFACE
+
    INTERFACE dim_reshape_2xyzt
-      MODULE PROCEDURE dim__reshape_2xyzt_dp   ! reshape real(8) 4D table to ('x','y','z','t')
+      MODULE PROCEDURE dim__reshape_2xyzt_dp   ! reshape real(8) 4D array to ('x','y','z','t')
    END INTERFACE dim_reshape_2xyzt
 
    INTERFACE dim_reshape_xyzt2
-      MODULE PROCEDURE dim__reshape_xyzt2_dp   ! reshape real(8) 4D table from ('x','y','z','t')
+      MODULE PROCEDURE dim__reshape_xyzt2_dp   ! reshape real(8) 4D array from ('x','y','z','t')
    END INTERFACE dim_reshape_xyzt2
 
    INTERFACE dim_reorder_2xyzt
-      MODULE PROCEDURE dim__reorder_2xyzt_i4   ! reorder integer(4) 1D table to ('x','y','z','t')
-      MODULE PROCEDURE dim__reorder_2xyzt_c    ! reorder string 1D table to ('x','y','z','t')
-      MODULE PROCEDURE dim__reorder_2xyzt_l    ! reorder logical 1D table to ('x','y','z','t')
+      MODULE PROCEDURE dim__reorder_2xyzt_i4   ! reorder integer(4) 1D array to ('x','y','z','t')
+      MODULE PROCEDURE dim__reorder_2xyzt_c    ! reorder string 1D array to ('x','y','z','t')
+      MODULE PROCEDURE dim__reorder_2xyzt_l    ! reorder logical 1D array to ('x','y','z','t')
    END INTERFACE dim_reorder_2xyzt
 
    INTERFACE dim_reorder_xyzt2
-      MODULE PROCEDURE dim__reorder_xyzt2_i4   ! reorder integer(4) 1D table from ('x','y','z','t')
-      MODULE PROCEDURE dim__reorder_xyzt2_c    ! reorder string 1D table from ('x','y','z','t')
-      MODULE PROCEDURE dim__reorder_xyzt2_l    ! reorder logical 1D table from ('x','y','z','t')  
+      MODULE PROCEDURE dim__reorder_xyzt2_i4   ! reorder integer(4) 1D array from ('x','y','z','t')
+      MODULE PROCEDURE dim__reorder_xyzt2_c    ! reorder string 1D array from ('x','y','z','t')
+      MODULE PROCEDURE dim__reorder_xyzt2_l    ! reorder logical 1D array from ('x','y','z','t')  
    END INTERFACE dim_reorder_xyzt2
 
 CONTAINS
    !-------------------------------------------------------------------
-   !> @brief This function returns dimension id, in a table of dimension structure,
-   !> given dimension name, or short name.
-   !> only dimension used are checked.
-   !>
-   !> @author J.Paul
-   !> - Nov, 2013- Initial Version
-   !
-   !> @param[in] td_dim   : dimension structure
-   !> @param[in] cd_name  : dimension name or short name
-   !> @param[in] cd_sname : dimension short name
-   !> @return dimension id
-   !-------------------------------------------------------------------
-   !> @code
-   INTEGER(i4) FUNCTION dim_get_id( td_dim, cd_name, cd_sname )
+   !> @brief
+   !> This subroutine copy a array of dimension structure in another one
+   !> @details 
+   !> see dim__copy_unit
+   !>
+   !> @warning do not use on the output of a function who create or read an
+   !> structure (ex: tl_dim=dim_copy(dim_init()) is forbidden).
+   !> This will create memory leaks.
+   !> @warning to avoid infinite loop, do not use any function inside 
+   !> this subroutine
+   !>
+   !> @author J.Paul
+   !> @date November, 2014 - Initial Version
+   !
+   !> @param[in] td_dim   array of dimension structure
+   !> @return copy of input array of dimension structure
+   !-------------------------------------------------------------------
+   FUNCTION dim__copy_arr( td_dim )
       IMPLICIT NONE
       ! Argument
-      TYPE(TDIM),       DIMENSION(:), INTENT(IN) :: td_dim
+      TYPE(TDIM), DIMENSION(:), INTENT(IN) :: td_dim
+      ! function
+      TYPE(TDIM), DIMENSION(SIZE(td_dim(:))) :: dim__copy_arr
+
+      ! local variable
+      ! loop indices
+      INTEGER(i4) :: ji
+      !----------------------------------------------------------------
+
+      DO ji=1,SIZE(td_dim(:))
+         dim__copy_arr(ji)=dim_copy(td_dim(ji))
+      ENDDO
+
+   END FUNCTION dim__copy_arr
+   !-------------------------------------------------------------------
+   !> @brief
+   !> This subroutine copy an dimension structure in another one
+   !> @details 
+   !> dummy function to get the same use for all structure
+   !>
+   !> @warning do not use on the output of a function who create or read an
+   !> structure (ex: tl_dim=dim_copy(dim_init()) is forbidden).
+   !> This will create memory leaks.
+   !> @warning to avoid infinite loop, do not use any function inside 
+   !> this subroutine
+   !>
+   !> @author J.Paul
+   !> @date November, 2014 - Initial Version
+   !>
+   !> @param[in] td_dim   dimension structure
+   !> @return copy of input dimension structure
+   !-------------------------------------------------------------------
+   FUNCTION dim__copy_unit( td_dim )
+      IMPLICIT NONE
+      ! Argument
+      TYPE(TDIM), INTENT(IN)  :: td_dim
+      ! function
+      TYPE(TDIM) :: dim__copy_unit
+
+      ! local variable
+      !----------------------------------------------------------------
+
+      dim__copy_unit=td_dim
+
+   END FUNCTION dim__copy_unit
+   !-------------------------------------------------------------------
+   !> @brief This function returns dimension index,
+   !> given dimension name or short name.
+   !>
+   !> @details
+   !> the function check dimension name, in the array of dimension structure.
+   !> dimension could be used or not.
+   !>
+   !> @author J.Paul
+   !> @date November, 2013 - Initial Version
+   !> @date September, 2014 - do not check if dimension used
+   !>
+   !> @param[in] td_dim    array of dimension structure
+   !> @param[in] cd_name   dimension name
+   !> @param[in] cd_sname  dimension short name
+   !> @return dimension index
+   !-------------------------------------------------------------------
+   INTEGER(i4) FUNCTION dim_get_index( td_dim, cd_name, cd_sname )
+      IMPLICIT NONE
+      ! Argument
+      TYPE(TDIM)      , DIMENSION(:), INTENT(IN) :: td_dim
       CHARACTER(LEN=*),               INTENT(IN) :: cd_name
       CHARACTER(LEN=*),               INTENT(IN), OPTIONAL :: cd_sname
@@ -222,5 +348,5 @@
       !----------------------------------------------------------------
       ! init
-      dim_get_id=0
+      dim_get_index=0
 
       il_ndim=SIZE(td_dim(:))
@@ -228,82 +354,71 @@
       ! look for dimension name
       cl_name=fct_lower(cd_name)
-      ! check if dimension is in table of dimension structure and used
+      ! check if dimension is in array of dimension structure
       jj=0
       DO ji=1,il_ndim
-         !IF( td_dim(ji)%l_use ) jj=jj+1
-
          cl_dim_name=fct_lower(td_dim(ji)%c_name)
-         IF( TRIM(cl_dim_name) == TRIM(cl_name) .AND. &
-         &   td_dim(ji)%l_use )THEN
-            dim_get_id=ji !jj
-            CALL logger_debug("GET ID: variable name "//&
-            &  TRIM(ADJUSTL(cd_name))//" already in file " )
-            EXIT
+         IF( TRIM(cl_dim_name) == TRIM(cl_name) )THEN
+             dim_get_index=ji
+             EXIT
          ENDIF
       ENDDO
 
       ! look for dimension short name
-      IF(  dim_get_id == 0 )THEN
+      IF(  dim_get_index == 0 )THEN
 
          cl_sname=fct_lower(cd_name)
-         ! check if dimension is in table of dimension structure and used
+         ! check if dimension is in array of dimension structure
          jj=0
          DO ji=1,il_ndim
-            IF( td_dim(ji)%l_use ) jj=jj+1
-            
             cl_dim_sname=fct_lower(td_dim(ji)%c_sname)
-            IF( (TRIM(cl_dim_sname) == TRIM(cl_sname) ).AND.&
-            &   td_dim(ji)%l_use )THEN
-               CALL logger_debug("GET ID: variable short name "//&
+            IF( (TRIM(cl_dim_sname) == TRIM(cl_sname) ) )THEN
+               CALL logger_debug("DIM GET INDEX: variable short name "//&
                &  TRIM(ADJUSTL(cd_name))//" already in file")
-               dim_get_id=jj
+               dim_get_index=ji
                EXIT
             ENDIF
          ENDDO
+
       ENDIF
 
       ! look for dimension short name
       IF( PRESENT(cd_sname) )THEN
-         IF(  dim_get_id == 0 )THEN
+         IF(  dim_get_index == 0 )THEN
 
             cl_sname=fct_lower(cd_sname)
-            ! check if dimension is in table of dimension structure and used
+            ! check if dimension is in array of dimension structure
             jj=0
             DO ji=1,il_ndim
-               IF( td_dim(ji)%l_use ) jj=jj+1
-               
                cl_dim_sname=fct_lower(td_dim(ji)%c_sname)
-               IF( (TRIM(cl_dim_sname) == TRIM(cl_sname) ).AND.&
-               &   td_dim(ji)%l_use )THEN
-                  CALL logger_debug("GET ID: variable short name "//&
+               IF( (TRIM(cl_dim_sname) == TRIM(cl_sname) ) )THEN
+                  CALL logger_debug("DIM GET INDEX: variable short name "//&
                   &  TRIM(ADJUSTL(cd_sname))//" already in file")
-                  dim_get_id=jj
+                  dim_get_index=ji
                   EXIT
                ENDIF
             ENDDO
+
          ENDIF
       ENDIF
 
-   END FUNCTION dim_get_id
-   !> @endcode
-   !-------------------------------------------------------------------
-   !> @brief This function returns dimension id, in a table of dimension structure,
-   !> given dimension name, or short name.
-   !> only dimension used are checked.
-   !>
-   !> @author J.Paul
-   !> - Nov, 2013- Initial Version
-   !
-   !> @param[in] td_dim   : dimension structure
-   !> @param[in] cd_name  : dimension name or short name
-   !> @param[in] cd_sname : dimension short name
+   END FUNCTION dim_get_index
+   !-------------------------------------------------------------------
+   !> @brief This function returns dimension id, in a array of dimension structure,
+   !> given dimension name, or short name. 
+   !> @note only dimension used are checked.
+   !>
+   !> @author J.Paul
+   !> @date November, 2013 - Initial Version
+   !
+   !> @param[in] td_dim    dimension structure
+   !> @param[in] cd_name   dimension name or short name
+   !> @param[in] cd_sname  dimension short name
    !> @return dimension id
    !-------------------------------------------------------------------
-   !> @code
-   INTEGER(i4) FUNCTION dim_get_void_id( td_dim, cd_name, cd_sname )
+   INTEGER(i4) FUNCTION dim_get_id( td_dim, cd_name, cd_sname )
       IMPLICIT NONE
       ! Argument
       TYPE(TDIM),       DIMENSION(:), INTENT(IN) :: td_dim
-      CHARACTER(LEN=*),               INTENT(IN), OPTIONAL :: cd_name
+      CHARACTER(LEN=*),               INTENT(IN) :: cd_name
       CHARACTER(LEN=*),               INTENT(IN), OPTIONAL :: cd_sname
 
@@ -318,7 +433,8 @@
       ! loop indices
       INTEGER(i4) :: ji
+      INTEGER(i4) :: jj
       !----------------------------------------------------------------
       ! init
-      dim_get_void_id=0
+      dim_get_id=0
 
       il_ndim=SIZE(td_dim(:))
@@ -326,72 +442,75 @@
       ! look for dimension name
       cl_name=fct_lower(cd_name)
-      ! check if dimension is in table of dimension structure and used
+      ! check if dimension is in array of dimension structure and used
+      jj=0
       DO ji=1,il_ndim
-
          cl_dim_name=fct_lower(td_dim(ji)%c_name)
          IF( TRIM(cl_dim_name) == TRIM(cl_name) .AND. &
-         &   .NOT. td_dim(ji)%l_use )THEN
-            dim_get_void_id=ji
-            EXIT
+         &   td_dim(ji)%l_use )THEN
+            IF( td_dim(ji)%i_id /= 0 )THEN
+               dim_get_id=td_dim(ji)%i_id
+               EXIT
+            ENDIF
          ENDIF
       ENDDO
 
       ! look for dimension short name
-      IF(  dim_get_void_id == 0 )THEN
+      IF(  dim_get_id == 0 )THEN
 
          cl_sname=fct_lower(cd_name)
-         ! check if dimension is in table of dimension structure and used
+         ! check if dimension is in array of dimension structure and used
+         jj=0
          DO ji=1,il_ndim
-            
             cl_dim_sname=fct_lower(td_dim(ji)%c_sname)
             IF( (TRIM(cl_dim_sname) == TRIM(cl_sname) ).AND.&
-            &   .NOT. td_dim(ji)%l_use )THEN
-               dim_get_void_id=ji
-               EXIT
+            &   td_dim(ji)%l_use )THEN
+               IF( td_dim(ji)%i_id /= 0 )THEN
+                  dim_get_id=td_dim(ji)%i_id
+                  EXIT
+               ENDIF
             ENDIF
          ENDDO
+
       ENDIF
 
       ! look for dimension short name
       IF( PRESENT(cd_sname) )THEN
-         IF(  dim_get_void_id == 0 )THEN
+         IF(  dim_get_id == 0 )THEN
 
             cl_sname=fct_lower(cd_sname)
-            ! check if dimension is in table of dimension structure and used
+            ! check if dimension is in array of dimension structure and used
+            jj=0
             DO ji=1,il_ndim
-               
                cl_dim_sname=fct_lower(td_dim(ji)%c_sname)
                IF( (TRIM(cl_dim_sname) == TRIM(cl_sname) ).AND.&
-               &   .NOT. td_dim(ji)%l_use )THEN
-                  dim_get_void_id=ji
-                  EXIT
+               &   td_dim(ji)%l_use )THEN
+                  IF( td_dim(ji)%i_id /= 0 )THEN
+                     dim_get_id=td_dim(ji)%i_id
+                     EXIT
+                  ENDIF
                ENDIF
             ENDDO
+
          ENDIF
       ENDIF
 
-      IF( dim_get_void_id == 0 )THEN
-         DO ji=1,il_ndim
-            IF( .NOT. td_dim(ji)%l_use ) dim_get_void_id=ji
-         ENDDO
-      ENDIF
-
-   END FUNCTION dim_get_void_id
-   !> @endcode
-   !-------------------------------------------------------------------
-   !> @brief This routine initialise a dimension structure with given 
-   !> arguments (name, length, etc).<br/> 
+   END FUNCTION dim_get_id
+   !-------------------------------------------------------------------
+   !> @brief This function initialize a dimension structure with given
+   !> name.<br/>
+   !> @details
+   !> Optionally length could be inform, as well as short name and if dimension
+   !> is unlimited or not.<br/>
    !> define dimension is supposed to be used.
    !>
    !> @author J.Paul
-   !> - Nov, 2013- Initial Version
-   !
-   !> @param[in] cd_name : dimension name
-   !> @param[in] id_len : dimension length
-   !> @param[in] ld_uld : dimension unlimited
-   !> @param[in] cd_sname : dimension short name
+   !> @date November, 2013 - Initial Version
+   !
+   !> @param[in] cd_name   dimension name
+   !> @param[in] id_len    dimension length
+   !> @param[in] ld_uld    dimension unlimited
+   !> @param[in] cd_sname  dimension short name
    !> @return dimension structure
    !-------------------------------------------------------------------
-   !> @code
    TYPE(TDIM) FUNCTION dim_init( cd_name, id_len, ld_uld, cd_sname)
       IMPLICIT NONE
@@ -413,10 +532,10 @@
       cl_name=fct_upper(cd_name)
 
-      CALL logger_info( &
+      CALL logger_debug( &
       &  " DIM INIT: dimension name: "//TRIM(cl_name) )
       dim_init%c_name=TRIM(ADJUSTL(cd_name))
 
       IF( PRESENT(id_len) )THEN
-         CALL logger_info( &
+         CALL logger_debug( &
          &  " DIM INIT: dimension length: "//fct_str(id_len) )
          dim_init%i_len=id_len
@@ -434,5 +553,5 @@
          &   TRIM(cl_sname) == 'z' .OR. & 
          &   TRIM(cl_sname) == 't' )THEN
-            CALL logger_info( &
+            CALL logger_debug( &
             &  " DIM INIT: dimension short name: "//TRIM(cd_sname) )
             dim_init%c_sname=TRIM(cd_sname)
@@ -452,8 +571,8 @@
             dim_init%c_sname='y'
          ELSEIF( TRIM(cl_name)== 'z' .OR. &
-         &   INDEX(cl_name,'depth')/=0 )THEN
+         &       INDEX(cl_name,'depth')/=0 )THEN
             dim_init%c_sname='z'
          ELSEIF( TRIM(cl_name)== 't' .OR. &
-         &   INDEX(cl_name,'time')/=0 )THEN
+         &       INDEX(cl_name,'time')/=0 )THEN
             dim_init%c_sname='t'
          ENDIF      
@@ -462,5 +581,5 @@
 
       IF( PRESENT(ld_uld) )THEN
-         CALL logger_info( &
+         CALL logger_debug( &
          &  " DIM INIT: unlimited dimension: "//fct_str(ld_uld) )
          dim_init%l_uld=ld_uld
@@ -471,16 +590,17 @@
       ENDIF
       
+      ! get dimension orderer index
+      dim_init%i_2xyzt=SCAN(TRIM(cp_dimorder),TRIM(dim_init%c_sname))
+
    END FUNCTION dim_init
-   !> @endcode
-   !-------------------------------------------------------------------
-   !> @brief This subrtoutine print dimension information 
-   !>
-   !> @author J.Paul
-   !> - Nov, 2013- Initial Version
-   !
-   !> @param[in] td_dim : table of dimension structure
-   !-------------------------------------------------------------------
-   !> @code
-   SUBROUTINE dim__print_tab(td_dim)
+   !-------------------------------------------------------------------
+   !> @brief This subroutine print informations of an array of dimension. 
+   !>
+   !> @author J.Paul
+   !> @date November, 2013 - Initial Version
+   !
+   !> @param[in] td_dim array of dimension structure
+   !-------------------------------------------------------------------
+   SUBROUTINE dim__print_arr(td_dim)
       IMPLICIT NONE
 
@@ -496,15 +616,13 @@
       ENDDO
 
-   END SUBROUTINE dim__print_tab
-   !> @endcode
-   !-------------------------------------------------------------------
-   !> @brief This subrtoutine print dimension information 
-   !>
-   !> @author J.Paul
-   !> - Nov, 2013- Initial Version
-   !
-   !> @param[in] td_dim : dimension structure
-   !-------------------------------------------------------------------
-   !> @code
+   END SUBROUTINE dim__print_arr
+   !-------------------------------------------------------------------
+   !> @brief This subrtoutine print dimension information. 
+   !>
+   !> @author J.Paul
+   !> @date November, 2013 - Initial Version
+   !
+   !> @param[in] td_dim dimension structure
+   !-------------------------------------------------------------------
    SUBROUTINE dim__print_unit(td_dim)
       IMPLICIT NONE
@@ -512,5 +630,4 @@
       ! Argument      
       TYPE(TDIM), INTENT(IN) :: td_dim
-
       !----------------------------------------------------------------
 
@@ -526,100 +643,124 @@
 
    END SUBROUTINE dim__print_unit
-   !> @endcode
+   !-------------------------------------------------------------------
+   !> @brief This function fill unused dimension of an array of dimension
+   !> and return a 4 elts array of dimension structure. 
+   !> @details
+   !> output dimensions 'x','y','z' and 't' are all informed.
+   !>
+   !> @note without input array of dimension, return 
+   !> a 4 elts array of dimension structure all unused
+   !> (case variable 0d)
+   !>
+   !> @author J.Paul
+   !> @date November, 2013 - Initial Version
+   !>
+   !> @param[in] td_dim array of dimension structure
+   !> @return  4elts array of dimension structure
+   !-------------------------------------------------------------------
+   FUNCTION dim_fill_unused(td_dim)
+      IMPLICIT NONE
+      ! Argument      
+      TYPE(TDIM), DIMENSION(:), INTENT(IN), OPTIONAL :: td_dim
+
+      ! function
+      TYPE(TDIM), DIMENSION(ip_maxdim) :: dim_fill_unused
+
+      ! local variable
+      CHARACTER(LEN=lc)                       :: cl_dimin
+      INTEGER(i4)      , DIMENSION(1)         :: il_ind  ! index
+      
+      TYPE(TDIM),        DIMENSION(ip_maxdim) :: tl_dim
+
+      ! loop indices
+      INTEGER(i4) :: ji
+      !----------------------------------------------------------------
+
+      IF( PRESENT(td_dim) )THEN
+         tl_dim(1:SIZE(td_dim(:)))=td_dim(:)
+      ENDIF
+      ! concatenate short nem dimension in a character string
+      cl_dimin=fct_lower(fct_concat(tl_dim(:)%c_sname))
+      DO ji = 1, ip_maxdim
+
+         ! search missing dimension
+         IF( INDEX(cl_dimin,TRIM(fct_lower(cp_dimorder(ji:ji)))) == 0 )THEN
+            ! search first empty dimension
+            il_ind(:)=MINLOC( tl_dim(:)%i_2xyzt, tl_dim(:)%i_2xyzt == 0 )
+
+            ! put missing dimension instead of empty one
+            tl_dim(il_ind(1))%c_sname=fct_lower(cp_dimorder(ji:ji))
+            ! update output structure
+            tl_dim(il_ind(1))%c_name=fct_lower(cp_dimorder(ji:ji))
+            tl_dim(il_ind(1))%i_2xyzt=ji
+            tl_dim(il_ind(1))%i_len=1
+            tl_dim(il_ind(1))%l_use=.FALSE.
+         ENDIF
+
+      ENDDO
+         
+      ! save result
+      dim_fill_unused(:)=tl_dim(:)
+
+      ! clean
+      CALL dim_clean(tl_dim(:))
+
+   END FUNCTION dim_fill_unused
    !-------------------------------------------------------------------
    !> @brief 
-   !> This subroutine check if dimension are ordered or not 
-   !
-   !> @author J.Paul
-   !> - 2013- Initial Version
-   !
-   !> @param[in] td_dim : table of dimension structure
-   !> @return dimension are ordered or not 
-   !-------------------------------------------------------------------
-   !> @code
-   FUNCTION dim_order(td_dim)
+   !> This subroutine switch element of an array (4 elts) of dimension 
+   !> structure 
+   !> from unordered dimension to ordered dimension <br/>
+   !>
+   !> @details
+   !> Optionally you could specify dimension order to output
+   !> (default 'xyzt')
+   !> Example: (/'z','x','t','y'/) => (/'x','y','z','t'/)
+   !>
+   !> @warning this subroutine change dimension order 
+   !
+   !> @author J.Paul
+   !> @date November, 2013 - Initial Version
+   !> @date September, 2014 - allow to choose ordered dimension to be output
+   !>
+   !> @param[inout] td_dim    array of dimension structure
+   !> @param[in] cd_dimorder  dimension order to be output 
+   !-------------------------------------------------------------------
+   SUBROUTINE dim_reorder(td_dim, cd_dimorder)
       IMPLICIT NONE
       ! Argument      
-      TYPE(TDIM), DIMENSION(:), INTENT(IN) :: td_dim
-
-      ! function
-      LOGICAL :: dim_order
+      TYPE(TDIM)              , DIMENSION(:), INTENT(INOUT) :: td_dim
+      CHARACTER(LEN=ip_maxdim)              , INTENT(IN   ), OPTIONAL :: cd_dimorder
 
       ! local variable
-      CHARACTER(LEN=lc) :: cl_dimin
-
-      ! loop indices
-      !----------------------------------------------------------------
-      ! init
-      dim_order=.FALSE.
+      INTEGER(i4)                             :: il_ind
+
+      CHARACTER(LEN=lc)                       :: cl_dimin
+      CHARACTER(LEN=lc)                       :: cl_dimorder
+
+      TYPE(TDIM)       , DIMENSION(ip_maxdim) :: tl_dim
+
+      ! loop indices
+      INTEGER(i4) :: ji
+      !----------------------------------------------------------------
 
       IF( SIZE(td_dim(:)) /= ip_maxdim )THEN
-         CALL logger_error("DIM ORDER: invalid dimension of table dimension.")
+         CALL logger_error("DIM REORDER: invalid dimension of array dimension.")
       ELSE
 
-         cl_dimin=fct_concat(td_dim(:)%c_sname)
-
-         IF( TRIM(cp_dimorder) == TRIM(cl_dimin) )THEN
-            dim_order=.TRUE.
-         ENDIF
-
-      ENDIF
-   END FUNCTION dim_order
-   !> @endcode
-   !-------------------------------------------------------------------
-   !> @brief 
-   !> This subroutine switch element of a table (4 elts) of dimension 
-   !> structure 
-   !> from unordered dimension to ordered dimension ('x','y','z','t')
-   !> Example: (/'z','x','t','y'/) => (/'x','y','z','t'/)
-   !> @warning this subroutine change dimension order 
-   !
-   !> @author J.Paul
-   !> - Nov, 2013- Initial Version
-   !
-   !> @param[inout] td_dim : table of dimension structure
-   !> @return dimension structure completed and reordered 
-   !>
-   !> @todo
-   !> -check input dimension order and stop if already ordered
-   !> - 
-   !-------------------------------------------------------------------
-   !> @code
-   SUBROUTINE dim_reorder(td_dim)
-      IMPLICIT NONE
-      ! Argument      
-      TYPE(TDIM), DIMENSION(:), INTENT(INOUT) :: td_dim
-
-      ! local variable
-      INTEGER(i4)                             :: il_id
-      CHARACTER(LEN=lc)                       :: cl_dimin
-      TYPE(TDIM)       , DIMENSION(ip_maxdim) :: tl_dim
-
-      ! loop indices
-      INTEGER(i4) :: ji
-      INTEGER(i4) :: jj
-      !----------------------------------------------------------------
-
-      IF( SIZE(td_dim(:)) /= ip_maxdim )THEN
-         CALL logger_error("DIM ORDER: invalid dimension of table dimension.")
-      ELSE
-
-         ! copy and rename dimension in local variable
-         tl_dim(:)=td_dim(:)
-         jj=0
+         cl_dimorder=TRIM(cp_dimorder)
+         IF( PRESENT(cd_dimorder) ) cl_dimorder=TRIM(ADJUSTL(cd_dimorder))
+
+         ! add id if dimension used and no id
          DO ji=1, ip_maxdim
 
-         CALL logger_debug( "DIM REORDER : jj "//TRIM(fct_str(jj))//&
-         &  " "//TRIM(fct_str(td_dim(ji)%l_use)))
             IF( td_dim(ji)%l_use )THEN
-               jj=jj+1
-            !IF( td_dim(ji)%l_use .AND. td_dim(ji)%i_id == 0 )THEN
-               ! add id if dimension used and no id
-               CALL logger_debug( "DIM REORDER : add id "//TRIM(fct_str(jj))//&
-               &  " to dimension "//TRIM(td_dim(ji)%c_name) )
-               tl_dim(ji)%i_id=jj
+               IF( td_dim(ji)%i_id == 0 )THEN
+                  td_dim(ji)%i_id=MAXVAL(td_dim(:)%i_id)+1
+               ENDIF
             ELSE
                td_dim(ji)%i_id=0
                td_dim(ji)%i_xyzt2=0
+               td_dim(ji)%i_2xyzt=0
                td_dim(ji)%c_sname='u'
                td_dim(ji)%c_name=''
@@ -629,20 +770,14 @@
          ENDDO
 
-         print *,">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
-         CALL dim_print(tl_dim(:))
-
-
          ! fill unused dimension
-         CALL dim__fill_unused(tl_dim(:))
+         tl_dim(:)=dim_fill_unused(td_dim(:))
          cl_dimin=fct_lower(fct_concat(tl_dim(:)%c_sname))
 
-         print *,">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
-         CALL dim_print(tl_dim(:))
          ! compute input id from output id (xyzt) 
          DO ji = 1, ip_maxdim
              
-            il_id=SCAN(TRIM(cp_dimorder),TRIM(cl_dimin(ji:ji)))
-            IF( il_id /= 0 )THEN
-               tl_dim(ji)%i_xyzt2=il_id
+            il_ind=SCAN(TRIM(cl_dimorder),TRIM(cl_dimin(ji:ji)))
+            IF( il_ind /= 0 )THEN
+               tl_dim(ji)%i_xyzt2=il_ind
             ENDIF
             
@@ -652,7 +787,7 @@
          DO ji = 1, ip_maxdim
              
-            il_id=SCAN(TRIM(cl_dimin),TRIM(cp_dimorder(ji:ji)))
-            IF( il_id /= 0 )THEN
-               tl_dim(ji)%i_2xyzt=il_id
+            il_ind=SCAN(TRIM(cl_dimin),TRIM(cl_dimorder(ji:ji)))
+            IF( il_ind /= 0 )THEN
+               tl_dim(ji)%i_2xyzt=il_ind
             ENDIF
             
@@ -669,24 +804,22 @@
          td_dim(:)%i_xyzt2 = tl_dim(:)%i_xyzt2
 
+         ! clean
+         CALL dim_clean(tl_dim(:))
       ENDIF
 
    END SUBROUTINE dim_reorder
-   !> @endcode
-   !-------------------------------------------------------------------
-   !> @brief 
-   !> This subroutine switch dimension table from ordered dimension ('x','y','z','t')
-   !> to unordered dimension.<br/>
+   !-------------------------------------------------------------------
+   !> @brief This subroutine switch dimension array from ordered dimension ('x','y','z','t')
+   !> to unordered dimension. <br/>
+   !> @details
    !> Example: (/'x','y','z','t'/) => (/'z','x','t','y'/)<br/>
-   !> This is useful to add dimension in a variable or file
-   !
+   !  This is useful to add dimension in a variable or file.
    !> @warning this subroutine change dimension order 
    !
    !> @author J.Paul
-   !> - Nov, 2013- Initial Version
-   !
-   !> @param[inout] td_dim : table of dimension structure
-   !> @return dimension structure unordered 
-   !-------------------------------------------------------------------
-   !> @code
+   !> @date November, 2013 - Initial Version
+   !
+   !> @param[inout] td_dim array of dimension structure
+   !-------------------------------------------------------------------
    SUBROUTINE dim_unorder(td_dim)
       IMPLICIT NONE
@@ -702,7 +835,7 @@
 
       IF( SIZE(td_dim(:)) /= ip_maxdim )THEN
-         CALL logger_error("DIM ORDER: invalid dimension of table dimension.")
+         CALL logger_error("DIM UNORDER: invalid dimension of array dimension.")
       ELSE      
-         ! add dummy xyzt2 id to removed dimension
+         ! add dummy xyzt2 id to unused dimension
          jj=1
          DO ji = 1, ip_maxdim
@@ -729,6 +862,4 @@
                td_dim(ji)%i_xyzt2=0
                td_dim(ji)%c_sname='u'
-               !td_dim(ji)%c_name='unknown'
-               !td_dim(ji)%c_sname=''
                td_dim(ji)%c_name=''
                td_dim(ji)%l_uld=.FALSE.
@@ -738,79 +869,21 @@
 
    END SUBROUTINE dim_unorder
-   !> @endcode   
-   !-------------------------------------------------------------------
-   !> @brief This subroutine filled dimension structure with unused 
-   !> dimension in order that all dimensions 'x','y','z' and 't' be
-   !> informed, even if void 
-   !
-   !> @author J.Paul
-   !> - Nov, 2013- Initial Version
-   !
-   !> @param[inout] td_dim : table of dimension structure
-   !> @return td_dim with unused dimension
-   !-------------------------------------------------------------------
-   !> @code
-   SUBROUTINE dim__fill_unused(td_dim)
-      IMPLICIT NONE
-      ! Argument      
-      TYPE(TDIM), DIMENSION(:), INTENT(INOUT) :: td_dim
-
-      ! local variable
-      CHARACTER(LEN=lc)               :: cl_dimin
-      INTEGER(i4)      , DIMENSION(1) :: il_ind  ! index
-      
-      ! loop indices
-      INTEGER(i4) :: ji
-      !----------------------------------------------------------------
-
-      IF( SIZE(td_dim(:)) /= ip_maxdim )THEN
-         CALL logger_error("DIM ORDER: invalid dimension of table dimension.")
-      ELSE      
-         ! concatenate dimension used in a character string
-         cl_dimin=fct_lower(fct_concat(td_dim(:)%c_sname))
-         DO ji = 1, ip_maxdim
-
-            ! search missing dimension
-            IF( INDEX(cl_dimin,TRIM(fct_lower(cp_dimorder(ji:ji)))) == 0 )THEN
-               ! search first empty dimension
-               il_ind(:)=MINLOC( td_dim(:)%i_id, td_dim(:)%i_id == 0 )
-
-               ! put missing dimension instead of empty one
-               td_dim(il_ind(1))%c_sname=fct_lower(cp_dimorder(ji:ji))
-               ! update output structure
-               td_dim(il_ind(1))%c_name=fct_lower(cp_dimorder(ji:ji))
-               td_dim(il_ind(1))%i_id=il_ind(1)
-               td_dim(il_ind(1))%i_len=1
-               td_dim(il_ind(1))%l_use=.FALSE.
-
-            ENDIF
-
-         ENDDO
-
-         ! remove id of unused dimension
-         DO ji = 1, ip_maxdim
-            IF( .NOT. td_dim(ji)%l_use ) td_dim(ji)%i_id=0
-         ENDDO
-      ENDIF
-
-   END SUBROUTINE dim__fill_unused
-   !> @endcode   
-   !-------------------------------------------------------------------
-   !> @brief This subroutine reshape real(8) 4D table   
-   !> to an ordered table with dimension (/'x','y','z','t'/).<br/>
+   !-------------------------------------------------------------------
+   !> @brief This function reshape real(8) 4D array   
+   !> to an ordered array, as defined by dim_reorder.<br/>
+   !> @details
    !> Example: (/'z','x','t','y'/) => (/'x','y','z','t'/)
    !
    !> @note you must have run dim_reorder before use this subroutine
    !
-   !> @warning output table dimension differ from input table dimension
-   !
-   !> @author J.Paul
-   !> - Nov, 2013- Initial Version
-   !
-   !> @param[in] td_dim : table of dimension structure
-   !> @param[in] dd_value : table of value to reshape
-   !> @return table of value reshaped 
-   !-------------------------------------------------------------------
-   !> @code
+   !> @warning output array dimension differ from input array dimension
+   !
+   !> @author J.Paul
+   !> @date November, 2013 - Initial Version
+   !
+   !> @param[in] td_dim    array of dimension structure
+   !> @param[in] dd_value  array of value to reshape
+   !> @return array of value reshaped 
+   !-------------------------------------------------------------------
    FUNCTION dim__reshape_2xyzt_dp(td_dim, dd_value)
       IMPLICIT NONE
@@ -835,5 +908,5 @@
 
       IF( SIZE(td_dim(:)) /= ip_maxdim )THEN
-         CALL logger_error("DIM ORDER: invalid dimension of table dimension.")
+         CALL logger_error("DIM RESHAPE 2 XYZT: invalid dimension of array dimension.")
       ELSE      
 
@@ -841,5 +914,5 @@
 
             CALL logger_fatal( &
-            &  "  RESHAPE to XYZT: you should have run dim_reorder &
+            &  "  DIM RESHAPE 2 XYZT: you should have run dim_reorder &
             &     before running RESHAPE" )
 
@@ -854,10 +927,10 @@
 
             DO ji=1,ip_maxdim
-               CALL logger_debug(" RESHAPE to XYZT: dim "//&
+               CALL logger_debug(" DIM RESHAPE 2 XYZT: dim "//&
                &     TRIM(td_dim(td_dim(ji)%i_xyzt2)%c_name)//" "//&
                &     TRIM(fct_str(td_dim(td_dim(ji)%i_xyzt2)%i_len))//" vs "//&
                &     TRIM(fct_str(il_shape(ji))) )
             ENDDO
-            CALL logger_fatal(" RESHAPE to XYZT: wrong input dimensions " )
+            CALL logger_fatal(" DIM RESHAPE 2 XYZT: wrong input dimensions " )
 
          ELSE
@@ -870,5 +943,5 @@
             cl_dim=TRIM(cl_dim)//TRIM(fct_str(il_shape(ip_maxdim)))//"/)"
 
-            CALL logger_info(" RESHAPE to XYZT: input dimensions are "//&
+            CALL logger_debug(" DIM RESHAPE 2 XYZT: input dimensions are "//&
             &  TRIM(cl_dim) )
 
@@ -879,5 +952,5 @@
             cl_dim=TRIM(cl_dim)//TRIM(fct_str(td_dim(ip_maxdim)%i_len))//"/)"
 
-            CALL logger_info(" RESHAPE to XYZT: ouput dimensions should be "//&
+            CALL logger_debug(" DIM RESHAPE 2 XYZT: ouput dimensions should be "//&
             &  TRIM(cl_dim) )
 
@@ -897,22 +970,21 @@
 
    END FUNCTION dim__reshape_2xyzt_dp
-   !> @endcode   
-   !-------------------------------------------------------------------
-   !> @brief This subroutine reshape ordered real(8) 4D table with dimension 
-   !> (/'x','y','z','t'/) to a table ordered as file variable.<br/>
+   !-------------------------------------------------------------------
+   !> @brief This function reshape ordered real(8) 4D array with dimension 
+   !> (/'x','y','z','t'/) to an "unordered" array.<br/>
+   !> @details
    !> Example: (/'x','y','z','t'/) => (/'z','x','t','y'/)
    !
    !> @note you must have run dim_reorder before use this subroutine
    !
-   !> @warning output table dimension differ from input table dimension
-   !
-   !> @author J.Paul
-   !> - Nov, 2013- Initial Version
-   !
-   !> @param[in] td_dim : table of dimension structure
-   !> @param[in] dd_value : table of value to reshape
-   !> @return table of value reshaped 
-   !-------------------------------------------------------------------
-   !> @code
+   !> @warning output array dimension differ from input array dimension
+   !
+   !> @author J.Paul
+   !> @date November, 2013 - Initial Version
+   !
+   !> @param[in] td_dim    array of dimension structure
+   !> @param[in] dd_value  array of value to reshape
+   !> @return array of value reshaped 
+   !-------------------------------------------------------------------
    FUNCTION dim__reshape_xyzt2_dp(td_dim, dd_value)
       IMPLICIT NONE
@@ -937,5 +1009,5 @@
 
       IF( SIZE(td_dim(:)) /= ip_maxdim )THEN
-         CALL logger_error("DIM ORDER: invalid dimension of table dimension.")
+         CALL logger_error("DIM RESHAPE XYZT 2: invalid dimension of array dimension.")
       ELSE
 
@@ -943,5 +1015,5 @@
 
             CALL logger_fatal( &
-            &  "  RESHAPE from XYZT: you should have run dim_reorder &
+            &  "  DIM RESHAPE XYZT 2: you should have run dim_reorder &
             &     before running RESHAPE" )
 
@@ -953,10 +1025,10 @@
 
             DO ji=1,ip_maxdim
-               CALL logger_debug(" RESHAPE from XYZT: dim "//&
+               CALL logger_trace(" DIM RESHAPE XYZT 2: dim "//&
                &              TRIM(td_dim(ji)%c_name)//" "//&
                &              TRIM(fct_str(td_dim(ji)%i_len))//" vs "//&
                &              TRIM(fct_str(il_shape(ji))) )
             ENDDO
-            CALL logger_fatal( "RESHAPE from XYZT: wrong input dimensions ")
+            CALL logger_fatal( "DIM RESHAPE XYZT 2: wrong input dimensions ")
 
          ELSE      
@@ -969,5 +1041,5 @@
             cl_dim=TRIM(cl_dim)//TRIM(fct_str(il_shape(ip_maxdim)))//"/)"
 
-            CALL logger_info(" RESHAPE from XYZT: input dimensions are "//&
+            CALL logger_debug(" DIM RESHAPE XYZT 2: input dimensions are "//&
             &  TRIM(cl_dim) )
 
@@ -980,8 +1052,8 @@
             &      TRIM(fct_str(td_dim(td_dim(ip_maxdim)%i_xyzt2)%i_len))//"/)"
 
-            CALL logger_info(" RESHAPE from XYZT: ouput dimensions should be "//&
+            CALL logger_debug(" DIM RESHAPE XYZT 2: ouput dimensions should be "//&
             &  TRIM(cl_dim) )
 
-            ! reshape table
+            ! reshape array
             dim__reshape_xyzt2_dp(:,:,:,:)=RESHAPE(SOURCE=dd_value,  &
             &           SHAPE = (/ td_dim(td_dim(1)%i_xyzt2)%i_len,   &
@@ -994,29 +1066,26 @@
             &                             td_dim(4)%i_xyzt2        /))
 
-
          ENDIF      
       ENDIF      
 
    END FUNCTION dim__reshape_xyzt2_dp
-   !> @endcode    
-   !-------------------------------------------------------------------
-   !> @brief  This subroutine reordered integer(4) 1D table to be suitable 
-   !> with dimension ordered as (/'x','y','z','t'/)
+   !-------------------------------------------------------------------
+   !> @brief  This function reordered integer(4) 1D array to be suitable 
+   !> with dimension ordered as defined in dim_reorder.
    !> @note you must have run dim_reorder before use this subroutine
    !
    !> @author J.Paul
-   !> - Nov, 2013- Initial Version
-   !
-   !> @param[in] td_dim : table of dimension structure
-   !> @param[in] id_tab : table of value to reshape
-   !> @return table of value reshaped 
-   !-------------------------------------------------------------------
-   !> @code
-   FUNCTION dim__reorder_2xyzt_i4(td_dim, id_tab)
+   !> @date November, 2013 - Initial Version
+   !
+   !> @param[in] td_dim array of dimension structure
+   !> @param[in] id_arr array of value to reshape
+   !> @return array of value reshaped 
+   !-------------------------------------------------------------------
+   FUNCTION dim__reorder_2xyzt_i4(td_dim, id_arr)
       IMPLICIT NONE
 
       ! Argument      
       TYPE(TDIM) , DIMENSION(:), INTENT(IN) :: td_dim
-      INTEGER(i4), DIMENSION(:), INTENT(IN) :: id_tab
+      INTEGER(i4), DIMENSION(:), INTENT(IN) :: id_arr
       
       ! function
@@ -1028,12 +1097,12 @@
 
       IF( SIZE(td_dim(:)) /= ip_maxdim .OR. &
-      &   SIZE(id_tab(:)) /= ip_maxdim )THEN
-         CALL logger_error("DIM ORDER: invalid dimension of table dimension"//&
-         &              " or of table of value.")
+      &   SIZE(id_arr(:)) /= ip_maxdim )THEN
+         CALL logger_error("DIM REORDER 2 XYZT: invalid dimension of array dimension"//&
+         &              " or of array of value.")
       ELSE      
          IF( ANY(td_dim(:)%i_2xyzt==0) )THEN
 
             CALL logger_error( &
-            &  "  REORDER to XYZT: you should have run dim_reorder &
+            &  "  DIM REORDER 2 XYZT: you should have run dim_reorder &
             &     before running REORDER" )
 
@@ -1041,29 +1110,27 @@
 
          DO ji=1,ip_maxdim
-            dim__reorder_2xyzt_i4(ji)=id_tab(td_dim(ji)%i_2xyzt)
+            dim__reorder_2xyzt_i4(ji)=id_arr(td_dim(ji)%i_2xyzt)
          ENDDO
       ENDIF
 
    END FUNCTION dim__reorder_2xyzt_i4
-   !> @endcode   
-   !-------------------------------------------------------------------
-   !> @brief This subroutine reordered integer(4) 1D table to be suitable with
-   !> dimension read in the file.
+   !-------------------------------------------------------------------
+   !> @brief This function unordered integer(4) 1D array to be suitable with
+   !> initial dimension order (ex: dimension read in file).
    !> @note you must have run dim_reorder before use this subroutine
    !
    !> @author J.Paul
-   !> - Nov, 2013- Initial Version
-   !
-   !> @param[in] td_dim : table of dimension structure
-   !> @param[in] id_tab : table of value to reshape
-   !> @return table of value reshaped 
-   !-------------------------------------------------------------------
-   !> @code
-   FUNCTION dim__reorder_xyzt2_i4(td_dim, id_tab)
+   !> @date November, 2013 - Initial Version
+   !
+   !> @param[in] td_dim array of dimension structure
+   !> @param[in] id_arr array of value to reshape
+   !> @return array of value reshaped 
+   !-------------------------------------------------------------------
+   FUNCTION dim__reorder_xyzt2_i4(td_dim, id_arr)
       IMPLICIT NONE
 
       ! Argument      
       TYPE(TDIM) , DIMENSION(:), INTENT(IN) :: td_dim
-      INTEGER(i4), DIMENSION(:), INTENT(IN) :: id_tab
+      INTEGER(i4), DIMENSION(:), INTENT(IN) :: id_arr
       
       ! function
@@ -1075,12 +1142,12 @@
 
       IF( SIZE(td_dim(:)) /= ip_maxdim .OR. &
-      &   SIZE(id_tab(:)) /= ip_maxdim )THEN
-         CALL logger_error("DIM ORDER: invalid dimension of table dimension"//&
-         &              " or of table of value.")
+      &   SIZE(id_arr(:)) /= ip_maxdim )THEN
+         CALL logger_error("DIM REORDER XYZT 2: invalid dimension of array dimension"//&
+         &              " or of array of value.")
       ELSE      
          IF( ANY(td_dim(:)%i_xyzt2==0) )THEN
 
             CALL logger_error( &
-            &  "  REORDER from XYZT: you should have run dim_reorder &
+            &  "  DIM REORDER XYZT 2: you should have run dim_reorder &
             &     before running REORDER" )
 
@@ -1088,28 +1155,26 @@
 
          DO ji=1,ip_maxdim
-            dim__reorder_xyzt2_i4(ji)=id_tab(td_dim(ji)%i_xyzt2)
+            dim__reorder_xyzt2_i4(ji)=id_arr(td_dim(ji)%i_xyzt2)
          ENDDO
       ENDIF
 
    END FUNCTION dim__reorder_xyzt2_i4
-   !> @endcode    
-   !-------------------------------------------------------------------
-   !> @brief  This subroutine reordered logical 1D table to be suitable 
-   !> with dimension ordered as (/'x','y','z','t'/)
+   !-------------------------------------------------------------------
+   !> @brief  This function reordered logical 1D array to be suitable 
+   !> with dimension ordered as defined in dim_reorder.
    !> @note you must have run dim_reorder before use this subroutine
    !
    !> @author J.Paul
-   !> - Nov, 2013- Initial Version
-   !
-   !> @param[in] td_dim : table of dimension structure
-   !> @param[in] ld_tab : table of value to reordered
-   !> @return table of value reordered 
-   !-------------------------------------------------------------------
-   !> @code
-   FUNCTION dim__reorder_2xyzt_l(td_dim, ld_tab)
+   !> @date Nov, 2013 - Initial Version
+   !
+   !> @param[in] td_dim array of dimension structure
+   !> @param[in] ld_arr array of value to reordered
+   !> @return array of value reordered 
+   !-------------------------------------------------------------------
+   FUNCTION dim__reorder_2xyzt_l(td_dim, ld_arr)
       IMPLICIT NONE
       ! Argument      
       TYPE(TDIM) , DIMENSION(:), INTENT(IN) :: td_dim
-      LOGICAL    , DIMENSION(:), INTENT(IN) :: ld_tab
+      LOGICAL    , DIMENSION(:), INTENT(IN) :: ld_arr
       
       ! function
@@ -1121,12 +1186,12 @@
 
       IF( SIZE(td_dim(:)) /= ip_maxdim .OR. &
-      &   SIZE(ld_tab(:)) /= ip_maxdim )THEN
-         CALL logger_error("DIM ORDER: invalid dimension of table dimension"//&
-         &              " or of table of value.")
+      &   SIZE(ld_arr(:)) /= ip_maxdim )THEN
+         CALL logger_error("DIM REORDER 2 XYZT: invalid dimension of array dimension"//&
+         &              " or of array of value.")
       ELSE      
          IF( ANY(td_dim(:)%i_2xyzt==0) )THEN
 
             CALL logger_error( &
-            &  "  REORDER to XYZT: you should have run dim_reorder &
+            &  "  DIM REORDER 2 XYZT: you should have run dim_reorder &
             &     before running REORDER" )
 
@@ -1134,29 +1199,27 @@
 
          DO ji=1,ip_maxdim
-            dim__reorder_2xyzt_l(ji)=ld_tab(td_dim(ji)%i_2xyzt)
+            dim__reorder_2xyzt_l(ji)=ld_arr(td_dim(ji)%i_2xyzt)
          ENDDO
       ENDIF
 
    END FUNCTION dim__reorder_2xyzt_l
-   !> @endcode   
-   !-------------------------------------------------------------------
-   !> @brief This subroutine reordered logical 1D table to be suitable with
-   !> dimension read in the file.
+   !-------------------------------------------------------------------
+   !> @brief This function unordered logical 1D array to be suitable with
+   !> initial dimension order (ex: dimension read in file).
    !> @note you must have run dim_reorder before use this subroutine
    !
    !> @author J.Paul
-   !> - Nov, 2013- Initial Version
-   !
-   !> @param[in] td_dim : table of dimension structure
-   !> @param[in] ld_tab : table of value to reordered
-   !> @return table of value reordered 
-   !-------------------------------------------------------------------
-   !> @code
-   FUNCTION dim__reorder_xyzt2_l(td_dim, ld_tab)
+   !> @date November, 2013 - Initial Version
+   !
+   !> @param[in] td_dim array of dimension structure
+   !> @param[in] ld_arr array of value to reordered
+   !> @return array of value reordered 
+   !-------------------------------------------------------------------
+   FUNCTION dim__reorder_xyzt2_l(td_dim, ld_arr)
       IMPLICIT NONE
 
       ! Argument      
       TYPE(TDIM) , DIMENSION(:), INTENT(IN) :: td_dim
-      LOGICAL    , DIMENSION(:), INTENT(IN) :: ld_tab
+      LOGICAL    , DIMENSION(:), INTENT(IN) :: ld_arr
       
       ! function
@@ -1168,12 +1231,12 @@
 
       IF( SIZE(td_dim(:)) /= ip_maxdim .OR. &
-      &   SIZE(ld_tab(:)) /= ip_maxdim )THEN
-         CALL logger_error("DIM ORDER: invalid dimension of table dimension"//&
-         &              " or of table of value.")
+      &   SIZE(ld_arr(:)) /= ip_maxdim )THEN
+         CALL logger_error("DIM REORDER XYZT 2: invalid dimension of array dimension"//&
+         &              " or of array of value.")
       ELSE
          IF( ANY(td_dim(:)%i_xyzt2==0) )THEN
 
             CALL logger_error( &
-            &  "  REORDER from XYZT: you should have run dim_reorder &
+            &  "  DIM REORDER XYZT 2: you should have run dim_reorder &
             &     before running REORDER" )
 
@@ -1181,28 +1244,26 @@
 
          DO ji=1,ip_maxdim
-            dim__reorder_xyzt2_l(ji)=ld_tab(td_dim(ji)%i_xyzt2)
+            dim__reorder_xyzt2_l(ji)=ld_arr(td_dim(ji)%i_xyzt2)
          ENDDO
       ENDIF
 
    END FUNCTION dim__reorder_xyzt2_l
-   !> @endcode
-   !-------------------------------------------------------------------
-   !> @brief  This subroutine reordered string 1D table to be suitable 
-   !> with dimension ordered as (/'x','y','z','t'/)
+   !-------------------------------------------------------------------
+   !> @brief  This function reordered string 1D array to be suitable 
+   !> with dimension ordered as defined in dim_reorder.
    !> @note you must have run dim_reorder before use this subroutine
    !
    !> @author J.Paul
-   !> - Nov, 2013- Initial Version
-   !
-   !> @param[in] td_dim : table of dimension structure
-   !> @param[in] cd_tab : table of value to reordered
-   !> @return table of value reordered 
-   !-------------------------------------------------------------------
-   !> @code
-   FUNCTION dim__reorder_2xyzt_c(td_dim, cd_tab)
+   !> @date November, 2013 - Initial Version
+   !
+   !> @param[in] td_dim array of dimension structure
+   !> @param[in] cd_arr array of value to reordered
+   !> @return array of value reordered 
+   !-------------------------------------------------------------------
+   FUNCTION dim__reorder_2xyzt_c(td_dim, cd_arr)
       IMPLICIT NONE
       ! Argument      
       TYPE(TDIM),       DIMENSION(:), INTENT(IN) :: td_dim
-      CHARACTER(LEN=*), DIMENSION(:), INTENT(IN) :: cd_tab
+      CHARACTER(LEN=*), DIMENSION(:), INTENT(IN) :: cd_arr
       
       ! function
@@ -1214,12 +1275,12 @@
 
       IF( SIZE(td_dim(:)) /= ip_maxdim .OR. &
-      &   SIZE(cd_tab(:)) /= ip_maxdim )THEN
-         CALL logger_error("DIM ORDER: invalid dimension of table dimension"//&
-         &              " or of table of value.")
+      &   SIZE(cd_arr(:)) /= ip_maxdim )THEN
+         CALL logger_error("DIM REORDER 2 XYZT: invalid dimension of array dimension"//&
+         &              " or of array of value.")
       ELSE      
          IF( ANY(td_dim(:)%i_2xyzt==0) )THEN
 
             CALL logger_error( &
-            &  "  REORDER to XYZT: you should have run dim_reorder"//&
+            &  "  DIM REORDER 2 XYZT: you should have run dim_reorder"//&
             &  " before running REORDER" )
 
@@ -1227,29 +1288,27 @@
 
          DO ji=1,ip_maxdim
-            dim__reorder_2xyzt_c(ji)=TRIM(cd_tab(td_dim(ji)%i_2xyzt))
+            dim__reorder_2xyzt_c(ji)=TRIM(cd_arr(td_dim(ji)%i_2xyzt))
          ENDDO
       ENDIF
 
    END FUNCTION dim__reorder_2xyzt_c
-   !> @endcode   
-   !-------------------------------------------------------------------
-   !> @brief This subroutine reordered string 1D table to be suitable with
-   !> dimension read in the file.
+   !-------------------------------------------------------------------
+   !> @brief This function unordered string 1D array to be suitable with
+   !> initial dimension order (ex: dimension read in file).
    !> @note you must have run dim_reorder before use this subroutine
    !
    !> @author J.Paul
-   !> - Nov, 2013- Initial Version
-   !
-   !> @param[in] td_dim : table of dimension structure
-   !> @param[in] cd_tab : table of value to reordered
-   !> @return table of value reordered 
-   !-------------------------------------------------------------------
-   !> @code
-   FUNCTION dim__reorder_xyzt2_c(td_dim, cd_tab)
+   !> @date Nov, 2013 - Initial Version
+   !
+   !> @param[in] td_dim array of dimension structure
+   !> @param[in] cd_arr array of value to reordered
+   !> @return array of value reordered 
+   !-------------------------------------------------------------------
+   FUNCTION dim__reorder_xyzt2_c(td_dim, cd_arr)
       IMPLICIT NONE
 
       ! Argument      
       TYPE(TDIM),       DIMENSION(:), INTENT(IN) :: td_dim
-      CHARACTER(LEN=*), DIMENSION(:), INTENT(IN) :: cd_tab
+      CHARACTER(LEN=*), DIMENSION(:), INTENT(IN) :: cd_arr
       
       ! function
@@ -1261,11 +1320,11 @@
 
       IF( SIZE(td_dim(:)) /= ip_maxdim .OR. &
-      &   SIZE(cd_tab(:)) /= ip_maxdim )THEN
-         CALL logger_error("DIM ORDER: invalid dimension of table dimension"//&
-         &              " or of table of value.")
+      &   SIZE(cd_arr(:)) /= ip_maxdim )THEN
+         CALL logger_error("DIM REORDER XYZT 2: invalid dimension of array dimension"//&
+         &              " or of array of value.")
       ELSE
          IF( ANY(td_dim(:)%i_xyzt2==0) )THEN
             CALL logger_error( &
-            &  "  REORDER from XYZT: you should have run dim_reorder &
+            &  "  DIM REORDER XYZT 2: you should have run dim_reorder &
             &     before running REORDER" )
 
@@ -1273,19 +1332,17 @@
 
          DO ji=1,ip_maxdim
-            dim__reorder_xyzt2_c(ji)=TRIM(cd_tab(td_dim(ji)%i_xyzt2))
+            dim__reorder_xyzt2_c(ji)=TRIM(cd_arr(td_dim(ji)%i_xyzt2))
          ENDDO
       ENDIF
 
    END FUNCTION dim__reorder_xyzt2_c
-   !> @endcode    
-   !-------------------------------------------------------------------
-   !> @brief This subroutine clean dimension structure
-   !
-   !> @author J.Paul
-   !> - Nov, 2013- Initial Version
-   !
-   !> @param[in] td_dim : dimension strucutre
-   !-------------------------------------------------------------------
-   !> @code
+   !-------------------------------------------------------------------
+   !> @brief This subroutine clean dimension structure.
+   !
+   !> @author J.Paul
+   !> @date November, 2013 - Initial Version
+   !
+   !> @param[in] td_dim dimension strucutre
+   !-------------------------------------------------------------------
    SUBROUTINE dim__clean_unit( td_dim )
       IMPLICIT NONE
@@ -1297,6 +1354,6 @@
       !----------------------------------------------------------------
 
-      CALL logger_info( &
-      &  " CLEAN: reset dimension "//TRIM(td_dim%c_name) )
+      CALL logger_trace( &
+      &  " DIM CLEAN: reset dimension "//TRIM(td_dim%c_name) )
 
       ! replace by empty structure
@@ -1304,15 +1361,13 @@
 
    END SUBROUTINE dim__clean_unit
-   !> @endcode
-   !-------------------------------------------------------------------
-   !> @brief This subroutine clean table of dimension structure
-   !
-   !> @author J.Paul
-   !> - Nov, 2013- Initial Version
-   !
-   !> @param[in] td_dim : table of dimension strucutre
-   !-------------------------------------------------------------------
-   !> @code
-   SUBROUTINE dim__clean_tab( td_dim )
+   !-------------------------------------------------------------------
+   !> @brief This subroutine clean array of dimension structure
+   !
+   !> @author J.Paul
+   !> @date November, 2013 - Initial Version
+   !
+   !> @param[in] td_dim array of dimension strucutre
+   !-------------------------------------------------------------------
+   SUBROUTINE dim__clean_arr( td_dim )
       IMPLICIT NONE
       ! Argument
@@ -1327,6 +1382,5 @@
       ENDDO
 
-   END SUBROUTINE dim__clean_tab
-   !> @endcode
+   END SUBROUTINE dim__clean_arr
 END MODULE dim
 
