Index: branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/README
===================================================================
--- branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/README	(revision 8655)
+++ branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/README	(revision 8862)
@@ -3,5 +3,5 @@
 (http://www.stack.nl/~dimitri/doxygen/index.html version 1.8.3.1 or upper)
 then
-   open ./TOOLS/SIREN/doc/html/index.html in your web browser 
+   open ./TOOLS/SIREN/doc/html/index.html in your web browser
 or 
-   run ./TOOLS/SIREN/doc/latex/gmake and open ./TOOLS/SIREN/doc/latex/refman.pdf 
+   run gmake in ./TOOLS/SIREN/doc/latex directory and open ./TOOLS/SIREN/doc/latex/refman.pdf 
Index: branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/cfg/dimension.cfg
===================================================================
--- branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/cfg/dimension.cfg	(revision 8862)
+++ branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/cfg/dimension.cfg	(revision 8862)
@@ -0,0 +1,6 @@
+&namdim
+   cn_dimX="x","xaxis"
+   cn_dimY="y","yaxis"
+   cn_dimZ="z","deptht","depthu","depthv","depthw","ncatice"
+   cn_dimT="t","time","time_counter"
+/
Index: branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/cfg/dummy.cfg
===================================================================
--- branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/cfg/dummy.cfg	(revision 8655)
+++ branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/cfg/dummy.cfg	(revision 8862)
@@ -1,4 +1,4 @@
 &namdum
-   cn_dumvar=""
+   cn_dumvar="orca_lon", "orca_lat", "time_instant", "time_centered"
    cn_dumdim=""
    cn_dumatt="history"
Index: branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/cfg/variable.cfg
===================================================================
--- branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/cfg/variable.cfg	(revision 8655)
+++ branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/cfg/variable.cfg	(revision 8862)
@@ -8,4 +8,5 @@
 nav_lev      | model_levels   | Z    | T | cubic           | Model levels                          |                                  
 deptht       | m              | Z    | T |                 | Vertical T levels                     | depth                            
+ncatice      | 1              | Z    | T |                 | Ice category                          | num_icecat_coordinate
 time_counter |                | T    |   |                 | Time axis                             | time                             
 Bathymetry   | m              | XY   | T | cubic           | Bathymetry                            | bathymetry                       
@@ -108,4 +109,9 @@
 kz           |                | XYZT | T |                 |                                       |                                  
 irondep      |                | XYZT | T |                 |                                       |                                  
+sivelu       | m/s            | XYT  | T |                 | Ice velocity along i-axis at I-point  | sea_ice_x_velocity
+sivelv       | m/s            | XYT  | T |                 | Ice velocity along j-axis at I-point  | sea_ice_y_velocity
+siconcat     | %              | XYZT | T |                 | Ice concentration for categories      | sea_ice_cat_concentration
+sithicat     | m              | XYZT | T |                 | Ice thickness for categories          | sea_ice_cat_icethickness
+snthicat     | m              | XYZT | T |                 | Snow thickness for categories         | sea_ice_cat_snowthickness
 kt_ice       |                |      |   |                 |                                       |                                  
 hicif        |                |      |   |                 |                                       |                                  
Index: branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/attribute.f90
===================================================================
--- branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/attribute.f90	(revision 8655)
+++ branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/attribute.f90	(revision 8862)
@@ -141,5 +141,5 @@
    END TYPE TATT
 
-   CHARACTER(LEN=lc), DIMENSION(ip_maxdum), SAVE :: cm_dumatt !< dummy attribute
+   CHARACTER(LEN=lc), DIMENSION(ip_maxdumcfg), SAVE :: cm_dumatt !< dummy attribute
 
    INTERFACE att_init
@@ -1282,7 +1282,7 @@
       ! loop indices
       ! namelist
-      CHARACTER(LEN=lc), DIMENSION(ip_maxdum) :: cn_dumvar
-      CHARACTER(LEN=lc), DIMENSION(ip_maxdum) :: cn_dumdim
-      CHARACTER(LEN=lc), DIMENSION(ip_maxdum) :: cn_dumatt
+      CHARACTER(LEN=lc), DIMENSION(ip_maxdumcfg) :: cn_dumvar
+      CHARACTER(LEN=lc), DIMENSION(ip_maxdumcfg) :: cn_dumdim
+      CHARACTER(LEN=lc), DIMENSION(ip_maxdumcfg) :: cn_dumatt
 
       !----------------------------------------------------------------
@@ -1345,5 +1345,5 @@
 
       att_is_dummy=.FALSE.
-      DO ji=1,ip_maxdum
+      DO ji=1,ip_maxdumcfg
          IF( fct_lower(td_att%c_name) == fct_lower(cm_dumatt(ji)) )THEN
             att_is_dummy=.TRUE.
Index: branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/create_bathy.f90
===================================================================
--- branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/create_bathy.f90	(revision 8655)
+++ branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/create_bathy.f90	(revision 8862)
@@ -22,5 +22,6 @@
 !> <br/>    
 !> \image html  bathy_40.png 
-!> \image latex bathy_30.png
+!> <center>\image latex bathy_30.png
+!> </center>
 !>
 !> @note 
@@ -45,4 +46,6 @@
 !>       - cn_varcfg : variable configuration file 
 !> (see ./SIREN/cfg/variable.cfg)
+!>       - cn_dimcfg : dimension configuration file. defines dimension allowed
+!> (see ./SIREN/cfg/dimension.cfg).
 !>       - cn_dumcfg : useless (dummy) configuration file, for useless 
 !> dimension or variable (see ./SIREN/cfg/dummy.cfg).
@@ -133,4 +136,6 @@
 !> @date February, 2016
 !> - do not closed sea for east-west cyclic domain
+!> @date October, 2016
+!> - dimension to be used select from configuration file
 !
 !> @todo
@@ -218,4 +223,5 @@
    ! namcfg
    CHARACTER(LEN=lc)                       :: cn_varcfg = './cfg/variable.cfg' 
+   CHARACTER(LEN=lc)                       :: cn_dimcfg = './cfg/dimension.cfg' 
    CHARACTER(LEN=lc)                       :: cn_dumcfg = './cfg/dummy.cfg' 
 
@@ -248,4 +254,5 @@
    NAMELIST /namcfg/ &   !< configuration namelist
    &  cn_varcfg, &       !< variable configuration file
+   &  cn_dimcfg, &       !< dimension configuration file
    &  cn_dumcfg          !< dummy configuration file
 
@@ -307,4 +314,7 @@
       ! get variable extra information
       CALL var_def_extra(TRIM(cn_varcfg))
+
+      ! get dimension allowed
+      CALL dim_def_extra(TRIM(cn_dimcfg))
 
       ! get dummy variable
@@ -614,4 +624,5 @@
    CALL mpp_clean(tl_coord1)
    CALL mpp_clean(tl_coord0)
+   CALL var_clean_extra()
 
    ! close log file
Index: branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/create_boundary.F90
===================================================================
--- branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/create_boundary.F90	(revision 8655)
+++ branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/create_boundary.F90	(revision 8862)
@@ -26,5 +26,6 @@
 !>  <br/> 
 !> \image html  boundary_NEATL36_70.png 
-!> \image latex boundary_NEATL36_70.png
+!> <center>\image latex boundary_NEATL36_70.png
+!> </center>
 !>
 !> @note 
@@ -51,4 +52,6 @@
 !>       - cn_varcfg : variable configuration file
 !> (see ./SIREN/cfg/variable.cfg)
+!>       - cn_dimcfg : dimension configuration file. define dimensions allowed
+!> (see ./SIREN/cfg/dimension.cfg).
 !>       - cn_dumcfg : useless (dummy) configuration file, for useless 
 !> dimension or variable (see ./SIREN/cfg/dummy.cfg).
@@ -161,5 +164,6 @@
 !>             - cn_north='index1(width),first1:last1|index2,first2:last2'
 !>             \image html  boundary_50.png 
-!>             \image latex boundary_50.png
+!>             <center>\image latex boundary_50.png
+!>             </center>
 !>       - cn_south  : south boundary indices on fine grid
 !>       - cn_east   : east  boundary indices on fine grid
@@ -198,4 +202,9 @@
 !> @date January, 2016
 !> - same process use for variable extracted or interpolated from input file.
+!> @date October, 2016
+!> - dimension to be used select from configuration file
+!>
+!> @todo
+!> - rewitre using meshmask instead of bathymetry and coordinates files.
 !>
 !> @note Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
@@ -383,6 +392,7 @@
 
    ! namcfg
-   CHARACTER(LEN=lc)                       :: cn_varcfg = 'variable.cfg' 
-   CHARACTER(LEN=lc)                       :: cn_dumcfg = 'dummy.cfg'
+   CHARACTER(LEN=lc)                       :: cn_varcfg = './cfg/variable.cfg' 
+   CHARACTER(LEN=lc)                       :: cn_dimcfg = './cfg/dimension.cfg'
+   CHARACTER(LEN=lc)                       :: cn_dumcfg = './cfg/dummy.cfg'
 
    ! namcrs
@@ -445,4 +455,5 @@
    NAMELIST /namcfg/ &  !< config namelist
    &  cn_varcfg, &       !< variable configuration file
+   &  cn_dimcfg, &       !< dimension configuration file
    &  cn_dumcfg          !< dummy configuration file
 
@@ -527,4 +538,7 @@
       CALL var_def_extra(TRIM(cn_varcfg))
 
+      ! get dimension allowed
+      CALL dim_def_extra(TRIM(cn_dimcfg))
+
       ! get dummy variable
       CALL var_get_dummy(TRIM(cn_dumcfg))
@@ -761,5 +775,5 @@
                   ENDIF
                ENDDO
-               
+
                ! clean
                CALL var_clean(tl_var1)
@@ -879,4 +893,5 @@
                         CALL dom_del_extra( tl_segvar1(jvar+jj,jk,jl), &
                         &                   tl_dom1 )
+
                         ! clean extra point information on coarse grid domain
                         CALL dom_clean_extra( tl_dom0 )
@@ -1151,4 +1166,5 @@
    CALL mpp_clean(tl_coord1)
    CALL mpp_clean(tl_coord0)
+   CALL var_clean_extra()
 
    CALL multi_clean(tl_multi)
@@ -1382,5 +1398,5 @@
       CALL extrap_fill_value( td_var )
 
-      ! interpolate Bathymetry
+      ! interpolate variable
       CALL interp_fill_value( td_var, id_rho(:), &
       &                       id_offset=id_offset(:,:) )
Index: branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/create_coord.f90
===================================================================
--- branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/create_coord.f90	(revision 8655)
+++ branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/create_coord.f90	(revision 8862)
@@ -44,4 +44,6 @@
 !>       - cn_varcfg : variable configuration file 
 !> (see ./SIREN/cfg/variable.cfg)
+!>       - cn_dimcfg : dimension configuration file. define dimensions allowed 
+!> (see ./SIREN/cfg/dimension.cfg).
 !>       - cn_dumcfg : useless (dummy) configuration file, for useless 
 !> dimension or variable (see ./SIREN/cfg/dummy.cfg).
@@ -76,4 +78,7 @@
 !>
 !>    * _nesting namelist (namnst)_:<br/>
+!>       you could define sub domain with coarse grid indices or with coordinates.
+!>       @note if coordinates defined, SIREN does not take into account indices.
+!>
 !>       - in_imin0 : i-direction lower left  point indice 
 !> of coarse grid subdomain to be used
@@ -84,9 +89,14 @@
 !>       - in_jmax0 : j-direction upper right point indice
 !> of coarse grid subdomain to be used
+!>       - rn_lonmin0 : lower left  longitude of coarse grid subdomain to be used
+!>       - rn_lonmax0 : upper right longitude of coarse grid subdomain to be used
+!>       - rn_latmin0 : lower left  latitude  of coarse grid subdomain to be used
+!>       - rn_latmax0 : upper right latitude  of coarse grid subdomain to be used
 !>       - in_rhoi  : refinement factor in i-direction
 !>       - in_rhoj  : refinement factor in j-direction<br/>
 !>
 !>       \image html  grid_zoom_40.png 
-!>       \image latex grid_zoom_40.png
+!>       <center> \image latex grid_zoom_40.png 
+!>       </center>
 !>
 !>    * _output namelist (namout)_:
@@ -102,4 +112,8 @@
 !> @date September, 2015
 !> - manage useless (dummy) variable, attributes, and dimension
+!> @date September, 2016
+!> - allow to use coordinate to define subdomain
+!> @date October, 2016
+!> - dimension to be used select from configuration file
 !>
 !> @note Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
@@ -139,5 +153,11 @@
    INTEGER(i4)                                          :: il_nvar
    INTEGER(i4)                                          :: il_ew
+   INTEGER(i4)                                          :: il_imin0
+   INTEGER(i4)                                          :: il_imax0
+   INTEGER(i4)                                          :: il_jmin0
+   INTEGER(i4)                                          :: il_jmax0
+
    INTEGER(i4)      , DIMENSION(ip_maxdim)              :: il_rho
+   INTEGER(i4)      , DIMENSION(2)                      :: il_index
    INTEGER(i4)      , DIMENSION(2,2,ip_npoint)          :: il_offset
 
@@ -167,4 +187,5 @@
    ! namcfg
    CHARACTER(LEN=lc) :: cn_varcfg = './cfg/variable.cfg' 
+   CHARACTER(LEN=lc) :: cn_dimcfg = './cfg/dimension.cfg' 
    CHARACTER(LEN=lc) :: cn_dumcfg = './cfg/dummy.cfg'
 
@@ -177,4 +198,8 @@
 
    !namnst
+   REAL(sp)          :: rn_lonmin0 = -360.
+   REAL(sp)          :: rn_lonmax0 = -360.
+   REAL(sp)          :: rn_latmin0 = -360.
+   REAL(sp)          :: rn_latmax0 = -360.
    INTEGER(i4)       :: in_imin0 = 0
    INTEGER(i4)       :: in_imax0 = 0
@@ -195,4 +220,5 @@
    NAMELIST /namcfg/ &  !  config namelist
    &  cn_varcfg, &       !< variable configuration file
+   &  cn_dimcfg, &       !< dimension configuration file
    &  cn_dumcfg          !< dummy configuration file
 
@@ -207,4 +233,8 @@
    
    NAMELIST /namnst/ &  !  nesting namelist
+   &  rn_lonmin0, &     !< lower left  coarse grid longitude
+   &  rn_lonmax0, &     !< upper right coarse grid longitude
+   &  rn_latmin0, &     !< lower left  coarse grid latitude
+   &  rn_latmax0, &     !< upper right coarse grid latitude
    &  in_imin0,   &     !< i-direction lower left  point indice 
    &  in_imax0,   &     !< i-direction upper right point indice
@@ -255,4 +285,7 @@
       CALL var_def_extra(TRIM(cn_varcfg))
 
+      ! get dimension allowed
+      CALL dim_def_extra(TRIM(cn_dimcfg))
+
       ! get dummy variable
       CALL var_get_dummy(TRIM(cn_dumcfg))
@@ -301,5 +334,40 @@
 
    ! check nesting parameters
-   IF( in_imin0 < 0 .OR. in_imax0 < 0 .OR. in_jmin0 < 0 .OR. in_jmax0 < 0)THEN
+   il_index(:)=0
+   IF( rn_lonmin0 >= -180. .AND. rn_lonmin0 <= 360 .AND. &
+     & rn_latmin0 >= -90.  .AND. rn_latmin0 <= 90. )THEN
+
+      il_index(:)=grid_get_closest(tl_coord0, &
+         &                         REAL(rn_lonmin0,dp), REAL(rn_latmin0,dp), &
+         &                         cd_pos='ll') 
+      il_imin0=il_index(1)
+      il_jmin0=il_index(2)
+   ELSE
+      il_imin0=in_imin0
+      il_jmin0=in_jmin0
+   ENDIF
+
+   il_index(:)=0
+   IF( rn_lonmax0 >= -180. .AND. rn_lonmax0 <= 360 .AND. &
+     & rn_latmax0 >= -90.  .AND. rn_latmax0 <= 90. )THEN
+
+      il_index(:)=grid_get_closest(tl_coord0, &
+         &                         REAL(rn_lonmax0,dp), REAL(rn_latmax0,dp), &
+         &                         cd_pos='ur') 
+      il_imax0=il_index(1)
+      il_jmax0=il_index(2)
+   ELSE
+      il_imax0=in_imax0
+      il_jmax0=in_jmax0
+   ENDIF
+
+   ! forced indices for east west cyclic domain
+   IF( rn_lonmin0 == rn_lonmax0 .AND. &
+     & rn_lonmin0 /= -360. )THEN
+      il_imin0=0
+      il_imax0=0
+   ENDIF
+
+   IF( il_imin0 < 0 .OR. il_imax0 < 0 .OR. il_jmin0 < 0 .OR. il_jmax0 < 0)THEN
       CALL logger_fatal("CREATE COORD: invalid points indices."//&
       &  " check namelist "//TRIM(cl_namelist))
@@ -318,10 +386,10 @@
 
    ! check domain validity
-   CALL grid_check_dom(tl_coord0, in_imin0, in_imax0, in_jmin0, in_jmax0 )
+   CALL grid_check_dom(tl_coord0, il_imin0, il_imax0, il_jmin0, il_jmax0 )
 
    ! compute domain
    tl_dom=dom_init( tl_coord0,         &
-   &                in_imin0, in_imax0,&
-   &                in_jmin0, in_jmax0 )
+   &                il_imin0, il_imax0,&
+   &                il_jmin0, il_jmax0 )
 
    ! add extra band (if need be) to compute interpolation
@@ -425,4 +493,7 @@
    IF( il_attid == 0 )THEN
       il_ind=var_get_index(tl_fileout%t_var(:),'longitude')
+      IF( il_ind == 0 )THEN
+         il_ind=var_get_index(tl_fileout%t_var(:),'longitude_T')
+      ENDIF
       il_ew=grid_get_ew_overlap(tl_fileout%t_var(il_ind))
       IF( il_ew >= 0 )THEN
@@ -447,4 +518,5 @@
 
    CALL file_clean(tl_fileout)
+   CALL var_clean_extra()
 
    ! close log file
Index: branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/create_restart.f90
===================================================================
--- branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/create_restart.f90	(revision 8655)
+++ branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/create_restart.f90	(revision 8862)
@@ -48,4 +48,6 @@
 !>       - cn_varcfg : variable configuration file
 !> (see ./SIREN/cfg/variable.cfg)
+!>       - cn_dimcfg : dimension configuration file. define dimensions allowed
+!> (see ./SIREN/cfg/dimension.cfg).
 !>       - cn_dumcfg : useless (dummy) configuration file, for useless 
 !> dimension or variable (see ./SIREN/cfg/dummy.cfg).
@@ -63,19 +65,19 @@
 !>    * _vertical grid namelist (namzgr)_:<br/>
 !>       - dn_pp_to_be_computed  :
-!>       - dn_ppsur              :
-!>       - dn_ppa0               :
-!>       - dn_ppa1               :
-!>       - dn_ppa2               : 
-!>       - dn_ppkth              :
-!>       - dn_ppkth2             :
-!>       - dn_ppacr              :
-!>       - dn_ppacr2             :
-!>       - dn_ppdzmin            :
-!>       - dn_pphmax             :
+!>       - dn_ppsur              : coefficient to compute vertical grid
+!>       - dn_ppa0               : coefficient to compute vertical grid
+!>       - dn_ppa1               : coefficient to compute vertical grid
+!>       - dn_ppa2               : double tanh function parameter
+!>       - dn_ppkth              : coefficient to compute vertical grid
+!>       - dn_ppkth2             : double tanh function parameter
+!>       - dn_ppacr              : coefficient to compute vertical grid
+!>       - dn_ppacr2             : double tanh function parameter
+!>       - dn_ppdzmin            : minimum vertical spacing
+!>       - dn_pphmax             : maximum depth
 !>       - in_nlevel             : number of vertical level
 !>
 !>    * _partial step namelist (namzps)_:<br/>
-!>       - dn_e3zps_min          :
-!>       - dn_e3zps_rat          : 
+!>       - dn_e3zps_min          : minimum thickness of partial step level (meters)
+!>       - dn_e3zps_rat          : minimum thickness ratio of partial step level
 !>
 !>    * _variable namelist (namvar)_:<br/>
@@ -158,4 +160,6 @@
 !> @date September, 2015
 !> - manage useless (dummy) variable, attributes, and dimension
+!> @date October, 2016
+!> - dimension to be used select from configuration file
 !>
 !> @note Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
@@ -196,6 +200,6 @@
    INTEGER(i4)                                        :: il_status
    INTEGER(i4)                                        :: il_fileid
+   INTEGER(i4)                                        :: il_attid
    INTEGER(i4)                                        :: il_nvar
-   INTEGER(i4)                                        :: il_attid
    INTEGER(i4)                                        :: il_imin1
    INTEGER(i4)                                        :: il_imax1
@@ -249,6 +253,7 @@
 
    ! namcfg
-   CHARACTER(LEN=lc)                       :: cn_varcfg = 'variable.cfg' 
-   CHARACTER(LEN=lc)                       :: cn_dumcfg = 'dummy.cfg'
+   CHARACTER(LEN=lc)                       :: cn_varcfg = './cfg/variable.cfg' 
+   CHARACTER(LEN=lc)                       :: cn_dimcfg = './cfg/dimension.cfg'
+   CHARACTER(LEN=lc)                       :: cn_dumcfg = './cfg/dummy.cfg'
 
    ! namcrs
@@ -304,4 +309,5 @@
    NAMELIST /namcfg/ &  !< configuration namelist
    &  cn_varcfg, &      !< variable configuration file
+   &  cn_dimcfg, &      !< dimension configuration file
    &  cn_dumcfg         !< dummy configuration file
 
@@ -309,5 +315,5 @@
    &  cn_coord0,  &     !< coordinate file
    &  in_perio0         !< periodicity index
-   
+
    NAMELIST /namfin/ &  !< fine grid namelist
    &  cn_coord1,   &    !< coordinate file
@@ -336,5 +342,5 @@
    &  cn_varfile, &     !< list of variable file
    &  cn_varinfo        !< list of variable and interpolation method to be used.
-   
+
    NAMELIST /namnst/ &  !< nesting namelist
    &  in_rhoi,    &     !< refinement factor in i-direction
@@ -387,4 +393,7 @@
       CALL var_def_extra(TRIM(cn_varcfg))
 
+      ! get dimension allowed
+      CALL dim_def_extra(TRIM(cn_dimcfg))
+
       ! get dummy variable
       CALL var_get_dummy(TRIM(cn_dumcfg))
@@ -402,5 +411,5 @@
       ! match variable with file
       tl_multi=multi_init(cn_varfile)
-      
+ 
       READ( il_fileid, NML = namnst )
       READ( il_fileid, NML = namout )
@@ -592,4 +601,5 @@
                !- check grid coincidence
                IF( ll_sameGrid )THEN
+                  il_rho(:)=1
                   CALL grid_check_coincidence( tl_mpp, tl_coord1, &
                   &                            il_imin1, il_imax1, &
@@ -896,4 +906,5 @@
    CALL mpp_clean(tl_mppout)
    CALL mpp_clean(tl_coord1)
+   CALL var_clean_extra()
 
    ! close log file
@@ -1200,5 +1211,5 @@
             &        tl_depth%d_value(:,:,:,:) ) )THEN
 
-               CALL logger_warn("CREATE BOUNDARY: depth value from "//&
+               CALL logger_warn("CREATE RESTART: depth value from "//&
                &  TRIM(td_mpp%c_name)//" not conform "//&
                &  " to those from former file(s).")
Index: branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/dimension.f90
===================================================================
--- branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/dimension.f90	(revision 8655)
+++ branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/dimension.f90	(revision 8862)
@@ -156,4 +156,6 @@
 !> @date Spetember, 2015
 !> - manage useless (dummy) dimension
+!> @date October, 2016
+!> - dimension allowed read in configuration file
 !>
 !> @note Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
@@ -171,4 +173,8 @@
 
    PRIVATE :: cm_dumdim        !< dummy dimension array
+   PRIVATE :: cm_dimX          !< x dimension array
+   PRIVATE :: cm_dimY          !< y dimension array
+   PRIVATE :: cm_dimZ          !< z dimension array
+   PRIVATE :: cm_dimT          !< t dimension array
 
    ! function and subroutine
@@ -188,4 +194,5 @@
    PUBLIC :: dim_get_dummy     !< fill dummy dimension array
    PUBLIC :: dim_is_dummy      !< check if dimension is defined as dummy dimension
+   PUBLIC :: dim_def_extra     !< read dimension configuration file, and save dimension allowed.
 
    PRIVATE :: dim__reshape_2xyzt_dp ! reshape real(8) 4D array to ('x','y','z','t')
@@ -203,4 +210,5 @@
    PRIVATE :: dim__copy_unit        ! copy dimension structure
    PRIVATE :: dim__copy_arr         ! copy array of dimension structure
+   PRIVATE :: dim__is_allowed
 
    TYPE TDIM !< dimension structure
@@ -215,5 +223,9 @@
    END TYPE
 
-   CHARACTER(LEN=lc), DIMENSION(ip_maxdum), SAVE :: cm_dumdim !< dummy dimension
+   CHARACTER(LEN=lc), DIMENSION(ip_maxdumcfg), SAVE :: cm_dumdim !< dummy dimension
+   CHARACTER(LEN=lc), DIMENSION(ip_maxdimcfg), SAVE :: cm_dimX   !< x dimension
+   CHARACTER(LEN=lc), DIMENSION(ip_maxdimcfg), SAVE :: cm_dimY   !< y dimension
+   CHARACTER(LEN=lc), DIMENSION(ip_maxdimcfg), SAVE :: cm_dimZ   !< z dimension
+   CHARACTER(LEN=lc), DIMENSION(ip_maxdimcfg), SAVE :: cm_dimT   !< t dimension
 
    INTERFACE dim_print
@@ -587,15 +599,16 @@
          cl_name=fct_lower(cd_name)
 
-         IF( TRIM(cl_name) == 'x' )THEN
+         IF(     dim__is_allowed(TRIM(cl_name), cm_dimX(:)) )THEN
             dim_init%c_sname='x'
-         ELSEIF( TRIM(cl_name) == 'y' )THEN
+         ELSEIF( dim__is_allowed(TRIM(cl_name), cm_dimY(:)) )THEN
             dim_init%c_sname='y'
-         ELSEIF( TRIM(cl_name)== 'z' .OR. &
-         &       INDEX(cl_name,'depth')/=0 )THEN
+         ELSEIF( dim__is_allowed(TRIM(cl_name), cm_dimZ(:)) )THEN
             dim_init%c_sname='z'
-         ELSEIF( TRIM(cl_name)== 't' .OR. &
-         &       INDEX(cl_name,'time')/=0 )THEN
+         ELSEIF( dim__is_allowed(TRIM(cl_name), cm_dimT(:)) )THEN
             dim_init%c_sname='t'
-         ENDIF      
+         ELSE
+            CALL logger_warn("DIM INIT: "//TRIM(cd_name)//&
+            " not allowed.")
+         ENDIF
 
       ENDIF
@@ -1430,7 +1443,7 @@
       ! loop indices
       ! namelist
-      CHARACTER(LEN=lc), DIMENSION(ip_maxdum) :: cn_dumvar
-      CHARACTER(LEN=lc), DIMENSION(ip_maxdum) :: cn_dumdim
-      CHARACTER(LEN=lc), DIMENSION(ip_maxdum) :: cn_dumatt
+      CHARACTER(LEN=lc), DIMENSION(ip_maxdumcfg) :: cn_dumvar
+      CHARACTER(LEN=lc), DIMENSION(ip_maxdumcfg) :: cn_dumdim
+      CHARACTER(LEN=lc), DIMENSION(ip_maxdumcfg) :: cn_dumatt
 
       !----------------------------------------------------------------
@@ -1493,5 +1506,5 @@
 
       dim_is_dummy=.FALSE.
-      DO ji=1,ip_maxdum
+      DO ji=1,ip_maxdumcfg
          IF( fct_lower(td_dim%c_name) == fct_lower(cm_dumdim(ji)) )THEN
             dim_is_dummy=.TRUE.
@@ -1501,4 +1514,117 @@
 
    END FUNCTION dim_is_dummy
+   !-------------------------------------------------------------------
+   !> @brief This subroutine read dimension configuration file, 
+   !> and fill array of dimension allowed.
+   !>
+   !> @author J.Paul
+   !> @date Ocotber, 2016 - Initial Version
+   !
+   !> @param[in] cd_file input file (dimension configuration file)
+   !-------------------------------------------------------------------
+   SUBROUTINE dim_def_extra( cd_file )
+      IMPLICIT NONE
+
+      ! Argument      
+      CHARACTER(LEN=*), INTENT(IN) :: cd_file
+
+      ! local variable
+      INTEGER(i4)   :: il_fileid
+      INTEGER(i4)   :: il_status
+
+      LOGICAL       :: ll_exist
+      
+      ! loop indices
+      ! namelist
+      CHARACTER(LEN=lc), DIMENSION(ip_maxdimcfg) :: cn_dimX = '' 
+      CHARACTER(LEN=lc), DIMENSION(ip_maxdimcfg) :: cn_dimY = ''
+      CHARACTER(LEN=lc), DIMENSION(ip_maxdimcfg) :: cn_dimZ = ''
+      CHARACTER(LEN=lc), DIMENSION(ip_maxdimcfg) :: cn_dimT = ''
+
+      !----------------------------------------------------------------
+      NAMELIST /namdim/ &   !< dimension namelist
+      &  cn_dimX, &       !< x dimension name allowed
+      &  cn_dimY, &       !< y dimension name allowed
+      &  cn_dimZ, &       !< z dimension name allowed
+      &  cn_dimT          !< t dimension name allowed
+
+      !----------------------------------------------------------------
+
+      ! init
+      cm_dimX(:)=''
+      cm_dimY(:)=''
+      cm_dimZ(:)=''
+      cm_dimT(:)=''
+
+      ! read config variable file
+      INQUIRE(FILE=TRIM(cd_file), EXIST=ll_exist)
+      IF( ll_exist )THEN
+
+         il_fileid=fct_getunit()
+   
+         OPEN( il_fileid, FILE=TRIM(cd_file), &
+         &                FORM='FORMATTED',       &
+         &                ACCESS='SEQUENTIAL',    &
+         &                STATUS='OLD',           &
+         &                ACTION='READ',          &
+         &                IOSTAT=il_status)
+         CALL fct_err(il_status)
+         IF( il_status /= 0 )THEN
+            CALL logger_fatal("DIM GET DUMMY: opening "//TRIM(cd_file))
+         ENDIF
+   
+         READ( il_fileid, NML = namdim )
+         cm_dimX(:)=cn_dimX(:)
+         cm_dimY(:)=cn_dimY(:)
+         cm_dimZ(:)=cn_dimZ(:)
+         cm_dimT(:)=cn_dimT(:)
+
+         CLOSE( il_fileid )
+
+      ELSE
+
+         CALL logger_fatal("DIM DEF EXTRA: can't find configuration"//&
+            &              " file "//TRIM(cd_file))
+
+      ENDIF         
+
+   END SUBROUTINE dim_def_extra
+   !-------------------------------------------------------------------
+   !> @brief This function check if dimension is allowed, i.e defined 
+   !> in dimension configuraton file
+   !>
+   !> @author J.Paul
+   !> @date OCTOber, 2016 - Initial Version
+   !
+   !> @param[in] cd_name dimension name
+   !> @param[in] cd_dim  array dimension name allowed
+   !> @return true if dimension is allowed 
+   !-------------------------------------------------------------------
+   FUNCTION dim__is_allowed(cd_name, cd_dim)
+      IMPLICIT NONE
+
+      ! Argument
+      CHARACTER(LEN=*),               INTENT(IN) :: cd_name
+      CHARACTER(LEN=*), DIMENSION(:), INTENT(IN) :: cd_dim
+      
+      ! function
+      LOGICAL :: dim__is_allowed
+      
+      ! loop indices
+      INTEGER(i4) :: ji
+      !----------------------------------------------------------------
+
+      dim__is_allowed=.FALSE.
+      ji=1
+      DO WHILE( TRIM(cd_dim(ji)) /= '' )
+         IF( TRIM(fct_lower(cd_name)) == TRIM(fct_lower(cd_dim(ji))) )THEN
+            dim__is_allowed=.TRUE.
+            EXIT
+         ENDIF
+         ji=ji+1
+      ENDDO
+
+   END FUNCTION dim__is_allowed
+
 END MODULE dim
 
Index: branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/docsrc/2_quickstart.md
===================================================================
--- branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/docsrc/2_quickstart.md	(revision 8655)
+++ branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/docsrc/2_quickstart.md	(revision 8862)
@@ -59,4 +59,5 @@
 &namcfg
    cn_varcfg = "PATH/NEMOGCM/TOOLS/SIREN/cfg/variable.cfg"
+   cn_dimcfg = "PATH/NEMOGCM/TOOLS/SIREN/cfg/dimension.cfg"
 /
 
@@ -83,4 +84,6 @@
 /
 ~~~~~~~~~~~
+
+@note you could define sub domain with coarse grid indices or with coordinates.
 
 Let's get describe this namelist.<br/>
@@ -90,13 +93,14 @@
 empty, as done here.<br/> This will create a log file named *create_coord.log*
 
-The **namcfg** sub-namelist defines where found SIREN configuration file.<br/>
-This configuration file defines standard name, default interpolation method,
+The **namcfg** sub-namelist defines where found SIREN configuration files.<br/>
+- The variable configuration file defines standard name, default interpolation method,
 axis,... to be used for some known variables.<br/>
 Obviously, you could add other variables to those already list, in this file.
-
-@note You could find the generic version of *variable.cfg* in the directory *NEMOGCM/TOOLS/SIREN/cfg*.
+- The dimension configuration file defines dimensions allowed.
+
+@note You could find the generic version of those configuration files in the directory *NEMOGCM/TOOLS/SIREN/cfg*.
 
 The **namcrs** sub-namelist set parameters of the wide
-coordinates file,<br/> as path to find it, and NEMO periodicity of the wide grid.<br/>
+coordinates file, as path to find it, and NEMO periodicity of the wide grid.<br/>
 
 @note the NEMO periodicity could be choose between 0 to 6:
@@ -130,16 +134,37 @@
 
 The **namnst** sub-namelist defines the subdomain to be used as well as refinment factor.<br/>
-@note Subdomain is defined by indices of the coarse/wide grid.<br/>
 
 <ul>
-<li>you can select area quite every where (excepted too close from the North
-pole), and use the refinment factor you want.</li>
-
-~~~~~~~~~~~
-&namvar
+<li> you could define sub domain with coarse grid indices</li> 
+
+~~~~~~~~~~~
+&namnst
    in_imin0 = 1070
    in_imax0 = 1072
    in_jmin0 = 607
    in_jmax0 = 609
+/
+~~~~~~~~~~~
+
+<li>or with coordinates</li>
+
+~~~~~~~~~~~
+&namnst
+   rn_lonmin0 = -97.9 
+   rn_lonmax0 = -62.3 
+   rn_latmin0 =   7.7
+   rn_latmax0 =  30.8
+/
+~~~~~~~~~~~
+
+<li>you can select area quite every where (excepted too close from the North
+pole), and use the refinment factor you want.</li>
+
+~~~~~~~~~~~
+&namnst
+   in_imin0 = 1070
+   in_imax0 = 1072
+   in_jmin0 = 607
+   in_jmax0 = 609
 
    in_rhoi = 2
@@ -148,11 +173,14 @@
 ~~~~~~~~~~~
 @image html grid_zoom_60.png
-@image latex grid_zoom_40.png
+<center>@image latex grid_zoom_40.png
+</center>
 <!-- @note ghost cells all around the grid are not shown here. -->
 
+
+
 <li>you can select area crossing the east-west overlap of the global ORCA grid.</li>
 
 ~~~~~~~~~~~
-&namvar          
+&namnst          
    in_imin0 = 1402 
    in_imax0 = 62
@@ -165,5 +193,6 @@
 ~~~~~~~~~~~
 @image html grid_glob_over_30.png
-@image latex grid_glob_over_20.png
+<center>@image latex grid_glob_over_20.png
+</center>
 <!-- @note in blue, the east-west overlap band of ORCA grid. -->
 
@@ -171,5 +200,5 @@
 
 ~~~~~~~~~~~
-&namvar
+&namnst
    in_imin0 = 0
    in_imax0 = 0
@@ -182,5 +211,6 @@
 ~~~~~~~~~~~
 @image html grid_glob_band_30.png
-@image latex grid_glob_band_20.png
+<center>@image latex grid_glob_band_20.png
+</center>
 
 </ul>
@@ -215,4 +245,5 @@
 &namcfg
    cn_varcfg = "PATH/NEMOGCM/TOOLS/SIREN/cfg/variable.cfg"
+   cn_dimcfg = "PATH/NEMOGCM/TOOLS/SIREN/cfg/dimension.cfg"
 /
 
@@ -249,12 +280,12 @@
 coordinates file.<br/>
 @note in all SIREN namelist: <br/>
-0 referred to the coarse/wide grid.<br/>
-1 referred to the fine grid.
+**0** referred to the coarse/wide grid.<br/>
+**1** referred to the fine grid.
 
 In the same way, the **namfin** sub-namelist  set parameters of the fine
 coordinates file.<br/>
 @note in this namelist example, there is no need to set the variable *in_perio1* to define the NEMO
-periodicity of the fine grid.<br/> Indeed, if this variable is not inform, SIREN tries to read it in the attributes of the file.<br/> 
-So if you created the fine coordinates with SIREN, you do not have to
+periodicity of the fine grid. Indeed, if this variable is not inform, SIREN tries to read it 
+in the global attributes of the file. So if you created the fine coordinates with SIREN, you do not have to
 fill it. In other case, you should add it to the namelist.
 
@@ -296,5 +327,5 @@
 # Merge bathymetry file # {#merge}
 
-The Bathymetry you build differs from the wider one.<br/>
+The Bathymetry you build, may differ from the wider one.<br/>
 To avoid issue with boundaries forcing fields, you should merge fine and coarse Bathymetry on boundaries.<br/>
 SIREN allows you to do this.<br/>
@@ -312,4 +343,5 @@
 &namcfg
    cn_varcfg = "PATH/NEMOGCM/TOOLS/SIREN/cfg/variable.cfg"
+   cn_dimcfg = "PATH/NEMOGCM/TOOLS/SIREN/cfg/dimension.cfg"
 /
 
@@ -348,7 +380,5 @@
 
 The **nambdy** sub-namelist defines the subdomain boundaries.<br/>
-By default SIREN tries to create boundaries for each side. Boundary exist if there is at least one sea point on the second row of each side.<br/>
-So you could let this namelist empty.
-
+By default SIREN tries to create boundaries for each side. Boundary exist if there is at least one sea point on the second row of each side. So you could let this namelist empty.
 @sa For more information about boundaries, see @ref boundary
 
@@ -365,5 +395,5 @@
 time step). Or you could start from "partial" information about ocean state (Temperature and Salinity for example).
 
-Siren allows you to create both of those initial state.<br/>
+SIREN allows you to create both of those initial state.<br/>
 To create the initial state, you have to run:<br/>
 ~~~~~~~~~~~~~~~~~~
@@ -372,5 +402,5 @@
 
 Here after is an example of namelist for *create_restart.exe*.<br/>
-In this example, you create an initial state split on 81 "processors", and named restar_out.nc.<br/>
+In this example, you create an initial state split on 81 "processors", and named restart_out.nc.<br/>
 The initial state is composed of temperature and salinity refined from an extraction of GLORYS fields.
 ~~~~~~~~~~~~~~~~~~
@@ -380,4 +410,5 @@
 &namcfg
    cn_varcfg = "PATH/NEMOGCM/TOOLS/SIREN/cfg/variable.cfg"
+   cn_dimcfg = "PATH/NEMOGCM/TOOLS/SIREN/cfg/dimension.cfg"
 /
 
@@ -479,4 +510,5 @@
 &namcfg
    cn_varcfg = "PATH/NEMOGCM/TOOLS/SIREN/cfg/variable.cfg"
+   cn_dimcfg = "PATH/NEMOGCM/TOOLS/SIREN/cfg/dimension.cfg"
 /
 
Index: branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/docsrc/5_changeLog.md
===================================================================
--- branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/docsrc/5_changeLog.md	(revision 8655)
+++ branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/docsrc/5_changeLog.md	(revision 8862)
@@ -3,13 +3,27 @@
 @tableofcontents
 
-# Release 2016-11-28
+# Release $Date:: 2016-11-16 #$ ($Revision: 7235 $)
 
+## New Features
+- merge_bathy.f90: allow to choose the number of boundary point with coarse grid value.
+- dimension.f90: dimension allowed read in configuration file.
+- variable.f90: allow to add scalar value.
 ## Changes
-## New Features
+- create_coord.f90: allow to define sub domain with coarse grid indices or coordinates.
+- grid.f90:grid__get_closest_str: add function to get closest grid point using coarse grid coordinates strucutre.
+- iom_cdf.f90:iom_cdf__get_info: define cdf4 as cdf.
+- variable.f90: add subroutine to clean global array of extra information, and define logical for variable to be used.
+- create_coord.f90: dimension to be used select from configuration file.
+- create_bathy.f90: dimension to be used select from configuration file.
+- merge_bathy.f90: dimension to be used select from configuration file.
+- create_boundary.f90: dimension to be used select from configuration file.
+- create_restart.f90: dimension to be used select from configuration file.
 ## Bug fixes
- - boundary.f90: take into account that boundaries are compute on T point, but expressed on U,V point
- - iom_cdf.f90: define type cdf4 as cdf
+- boundary.f90:boundary_check: take into account that boundaries are compute on T point, but expressed on U,V point.
+- grid.f90:grid__get_closest_str: use max of zero and east-west overlap instead of east-west overlap.
+- mpp.f90: compare index to td_lay number of proc instead of td_mpp (bug fix) .
+- iom_cdf.f90 : check if attribute cl_value is not bug (in read file)
 
-release (2016-07-01)
+# Release 2016-07-01
 
 ## Changes
@@ -18,6 +32,5 @@
  - correct check of boundary indices
 
-# Release
-Initial release (2016-04-11)
+# Initial Release 2016-04-11
 
  <HR>
Index: branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/docsrc/6_perio.md
===================================================================
--- branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/docsrc/6_perio.md	(revision 8655)
+++ branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/docsrc/6_perio.md	(revision 8862)
@@ -6,58 +6,36 @@
 <dd>ghost cells (solid walls) are imposed at all model boundaries.</dd> 
 @image html perio0_20.png 
-@latexonly
-\begin{center}
-\includegraphics{perio0_20.png}
-\end{center}
-@endlatexonly
+<center>@image latex perio0_20.png 
+</center>
 <dt>cyclic east-west boundary (in_perio=1)</dt>
 <dd>first and last rows are closed, whilst the first column is set to the value of the last-but-one column and the last column to the value of the second one.</dd>  
 @image html perio1_20.png 
-@latexonly
-\begin{center}
-\includegraphics{perio1_20.png}
-\end{center}
-@endlatexonly
+<center>@image latex perio1_20.png 
+</center>
 <dt>symmetric boundary condition across the equator. (in_perio=2)</dt>
 <dd>last row, and first and last columns are closed. </dd> 
 @image html perio2_20.png 
-@latexonly
-\begin{center}
-\includegraphics{perio2_20.png}
-\end{center}
-@endlatexonly
+<center>@image latex perio2_20.png 
+</center>
 <dt>North fold boundary with a T -point pivot (in_perio=3)</dt>
 <dd>first row, and first and last columns are closed. </dd> 
 @image html perio3_20.png 
-@latexonly
-\begin{center}
-\includegraphics{perio3_20.png}
-\end{center}
-@endlatexonly
+<center>@image latex perio3_20.png 
+</center>
 <dt>North fold boundary with a T -point pivot and cyclic east-west boundary (in_perio=4)</dt>
 <dd>first row is closed. The first column is set to the value of the last-but-one column and the last column to the value of the second one. </dd> 
 @image html perio4_20.png 
-@latexonly
-\begin{center}
-\includegraphics{perio4_20.png}
-\end{center}
-@endlatexonly
+<center>@image latex perio4_20.png 
+</center>
 <dt>North fold boundary with a F -point pivot (in_perio=5)</dt>
 <dd>first row, and first and last columns are closed. </dd> 
 @image html perio5_20.png 
-@latexonly
-\begin{center}
-\includegraphics{perio5_20.png}
-\end{center}
-@endlatexonly
+<center>@image latex perio5_20.png 
+</center>
 <dt>North fold boundary with a F -point pivot and cyclic east-west boundary (in_perio=6)</dt>
 <dd>first row is closed. The first column is set to the value of the last-but-one column and the last column to the value of the second one.</dd> 
 @image html perio6_20.png 
-@image html perio5_20.png 
-@latexonly
-\begin{center}
-\includegraphics{perio6_20.png}
-\end{center}
-@endlatexonly
+<center>@image latex perio6_20.png 
+</center>
 </dl>
 @sa For more information about NEMO periodicity, see _Model Boundary Condition_ chapter in [NEMO documentation](http://www.nemo-ocean.eu/About-NEMO/Reference-manuals))
Index: branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/global.f90
===================================================================
--- branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/global.f90	(revision 8655)
+++ branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/global.f90	(revision 8862)
@@ -67,6 +67,6 @@
 
    INTEGER(i4)                             , PARAMETER :: ip_maxvar =200   !< maximum number of variable
-   INTEGER(i4)                             , PARAMETER :: ip_maxmtx =100   !< matrix variable maximum dimension (cf create_bathy)
-   INTEGER(i4)                             , PARAMETER :: ip_maxseg =50    !< maximum number of segment for each boundary
+   INTEGER(i4)                             , PARAMETER :: ip_maxmtx =50    !< matrix variable maximum dimension (cf create_bathy)
+   INTEGER(i4)                             , PARAMETER :: ip_maxseg =10    !< maximum number of segment for each boundary
 
    INTEGER(i4)                             , PARAMETER :: ip_nsep=2        !< number of separator listed
@@ -101,5 +101,5 @@
    REAL(dp)                                , PARAMETER :: dp_fill_i4=NF90_FILL_INT    !< INT fill value
    REAL(dp)                                , PARAMETER :: dp_fill_sp=NF90_FILL_FLOAT  !< real fill value
-   REAL(dp)                                , PARAMETER :: dp_fill=NF90_FILL_DOUBLE !< double fill value
+   REAL(dp)                                , PARAMETER :: dp_fill=NF90_FILL_DOUBLE    !< double fill value
 
    INTEGER(i4)                             , PARAMETER :: ip_npoint=4
@@ -112,4 +112,5 @@
 
 
+   INTEGER(i4)                             , PARAMETER :: ip_maxdimcfg=10 !< maximum allowed dimension in configuration file
    INTEGER(i4)                             , PARAMETER :: ip_maxdim=4
    INTEGER(i4)                             , PARAMETER :: jp_I=1
@@ -131,5 +132,6 @@
    INTEGER(i4), PARAMETER :: jp_west =4
 
-   INTEGER(i4)                             , PARAMETER :: ip_maxdum = 10 !< maximum dummy variable, dimension, attribute
+   INTEGER(i4)                             , PARAMETER :: ip_maxdumcfg = 10 !< maximum dummy variable, dimension, or attribute 
+                                                                            !< in configuration file
 
 END MODULE global
Index: branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/grid.f90
===================================================================
--- branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/grid.f90	(revision 8655)
+++ branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/grid.f90	(revision 8862)
@@ -218,7 +218,9 @@
 !> @date February, 2015
 !> - add function grid_fill_small_msk to fill small domain inside bigger one
-!> @February, 2016
+!> @date February, 2016
 !> - improve way to check coincidence (bug fix)
 !> - manage grid cases for T,U,V or F point, with even or odd refinment (bug fix)
+!> @date April, 2016
+!> - add function to get closest grid point using coarse grid coordinates strucutre 
 !
 !> @note Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
@@ -271,4 +273,8 @@
    PRIVATE :: grid__get_coarse_index_cc ! - using coarse and fine grid array of lon,lat
 
+                                     ! return closest coarse grid point from another point
+   PRIVATE :: grid__get_closest_str    ! - using coarse grid coordinates strucutre
+   PRIVATE :: grid__get_closest_arr    ! - using coarse grid array of lon,lat
+
                                      ! get offset between fine and coarse grid
    PRIVATE :: grid__get_fine_offset_ff ! - using coarse and fine grid coordinates files
@@ -333,4 +339,9 @@
       MODULE PROCEDURE grid__get_ghost_mpp
    END INTERFACE  grid_get_ghost
+
+   INTERFACE  grid_get_closest
+      MODULE PROCEDURE grid__get_closest_str
+      MODULE PROCEDURE grid__get_closest_arr
+   END INTERFACE  grid_get_closest
 
    INTERFACE  grid_get_coarse_index
@@ -467,5 +478,5 @@
    !-------------------------------------------------------------------
    !> @brief This subroutine get information about global domain, given mpp
-   !> strucutre.
+   !> structure.
    !>
    !> @details
@@ -536,10 +547,10 @@
 
       SELECT CASE(il_perio)
-      CASE(3,4)
-         il_pivot=1
-      CASE(5,6)
-         il_pivot=0
-      CASE(0,1,2)
-         il_pivot=1
+         CASE(3,4)
+            il_pivot=1
+         CASE(5,6)
+            il_pivot=0
+         CASE(0,1,2)
+            il_pivot=1
       END SELECT
 
@@ -1365,4 +1376,5 @@
             END SELECT
          ELSE
+            il_perio=-1
             ! check periodicity
             IF(ANY(td_var%d_value(   1     ,:,1,1)/=td_var%d_fill).OR.&
@@ -1656,5 +1668,5 @@
    !> else return the size of the ovarlap band.
    !> East-West overlap is computed comparing longitude value of the  
-   !> South" part of the domain, to avoid  north fold boundary.
+   !> South part of the domain, to avoid  north fold boundary.
    !>
    !
@@ -1663,4 +1675,6 @@
    !> @date October, 2014
    !> - work on mpp file structure instead of file structure
+   !> @date October, 2016
+   !> - check longitude as longname
    !>
    !> @param[in] td_lon longitude variable structure 
@@ -1712,12 +1726,13 @@
             ALLOCATE( dl_vare(il_jmax-il_jmin+1) )
             ALLOCATE( dl_varw(il_jmax-il_jmin+1) )
-            
+
             dl_vare(:)=dl_value(il_east,il_jmin:il_jmax)
             dl_varw(:)=dl_value(il_west,il_jmin:il_jmax)
-            
-            IF( .NOT.(  ALL(dl_vare(:)==td_var%d_fill) .AND. &
-            &           ALL(dl_varw(:)==td_var%d_fill) ) )THEN
-         
-               IF( TRIM(td_var%c_stdname) == 'longitude' )THEN
+
+            IF( .NOT.( ALL(dl_vare(:)==td_var%d_fill) .AND. &
+            &          ALL(dl_varw(:)==td_var%d_fill) ) )THEN
+
+               IF( TRIM(td_var%c_stdname) == 'longitude' .OR. &
+                 & SCAN( TRIM(td_var%c_longname), 'longitude') == 0 )THEN
                   WHERE( dl_value(:,:) > 180._dp .AND. &
                   &      dl_value(:,:) /= td_var%d_fill ) 
@@ -1743,5 +1758,5 @@
                      ELSE
                         dl_vare(:)=dl_value(il_east-ji,il_jmin:il_jmax)
-                        
+
                         IF( ALL( dl_varw(:) == dl_vare(:) ) )THEN
                            grid__get_ew_overlap_var=ji+1
@@ -1769,8 +1784,10 @@
    !> else return the size of the ovarlap band.
    !> East-West overlap is computed comparing longitude value of the  
-   !> South" part of the domain, to avoid  north fold boundary.
+   !> South part of the domain, to avoid  north fold boundary.
    !>
    !> @author J.Paul
    !> @date October, 2014 - Initial Version
+   !> @date October, 2016
+   !> - check varid for longitude_T
    !>
    !> @param[in] td_file file structure 
@@ -1793,8 +1810,8 @@
       !----------------------------------------------------------------
 
-      il_varid=var_get_index(td_file%t_var(:), 'longitude')
+      il_varid=var_get_id(td_file%t_var(:), 'longitude', 'longitude_T')
       IF( il_varid /= 0 )THEN
          ! read longitude on boundary
-         tl_var=iom_read_var(td_file, 'longitude')
+         tl_var=iom_read_var(td_file, il_varid)
       ELSE
          DO ji=1,td_file%i_nvar
@@ -1819,5 +1836,5 @@
    !> else return the size of the ovarlap band.
    !> East-West overlap is computed comparing longitude value of the  
-   !> South" part of the domain, to avoid  north fold boundary.
+   !> South part of the domain, to avoid  north fold boundary.
    !>
    !
@@ -1826,4 +1843,6 @@
    !> @date October, 2014
    !> - work on mpp file structure instead of file structure
+   !> @date October, 2016
+   !> - check varid for longitude_T
    !>
    !> @param[in] td_mpp mpp structure 
@@ -1850,7 +1869,7 @@
 
       ! read longitude on boundary
-      il_varid=var_get_index(td_mpp%t_proc(1)%t_var(:),'longitude')
+      il_varid=var_get_id(td_mpp%t_proc(1)%t_var(:),'longitude', 'longitude_T')
       IF( il_varid /= 0 )THEN
-         tl_var=iom_mpp_read_var(td_mpp, 'longitude')
+         tl_var=iom_mpp_read_var(td_mpp, il_varid)
       ELSE
          DO ji=1,td_mpp%t_proc(1)%i_nvar
@@ -1866,5 +1885,4 @@
          grid__get_ew_overlap_mpp=il_ew
       ENDIF
-
 
       ! clean
@@ -3020,4 +3038,123 @@
    !>
    !> @author J.Paul
+   !> @date April, 2016 - Initial Version
+   !> @date October, 2016
+   !> - use max of zero and east-west overlap instead of east-west overlap
+   !>
+   !> @param[in] td_coord0 coarse grid coordinate mpp structure
+   !> @param[in] dd_lon1   fine   grid longitude
+   !> @param[in] dd_lat1   fine   grid latitude
+   !> @param[in] cd_pos    relative position of grid point from point 
+   !> @param[in] dd_fill   fill value
+   !> @return coarse grid indices of closest point of fine grid point
+   !-------------------------------------------------------------------
+   FUNCTION grid__get_closest_str( td_coord0, dd_lon1, dd_lat1, cd_pos, dd_fill ) &
+   &  RESULT(id_res)
+
+      IMPLICIT NONE
+      ! Argument
+      TYPE(TMPP )     , INTENT(IN) :: td_coord0
+      REAL(dp),         INTENT(IN) :: dd_lon1
+      REAL(dp),         INTENT(IN) :: dd_lat1
+      CHARACTER(LEN=*), INTENT(IN), OPTIONAL :: cd_pos
+      REAL(dp),         INTENT(IN), OPTIONAL :: dd_fill
+
+      ! function
+      INTEGER(i4), DIMENSION(2) :: id_res
+
+      ! local variable
+      CHARACTER(LEN=lc)                        :: cl_point
+      CHARACTER(LEN=lc)                        :: cl_name
+
+      INTEGER(i4)                              :: il_ind
+      INTEGER(i4)                              :: il_ew
+
+      REAL(dp)   , DIMENSION(:,:), ALLOCATABLE :: dl_lon0
+      REAL(dp)   , DIMENSION(:,:), ALLOCATABLE :: dl_lat0
+
+      TYPE(TVAR)                               :: tl_lon0
+      TYPE(TVAR)                               :: tl_lat0
+      TYPE(TMPP)                               :: tl_coord0
+      !----------------------------------------------------------------
+
+      id_res(:)=-1
+      cl_point='T'
+
+      ! copy structure
+      tl_coord0=mpp_copy(td_coord0)
+
+      IF( .NOT. ASSOCIATED(tl_coord0%t_proc) )THEN
+
+         CALL logger_error("GRID GET CLOSEST: decompsition of mpp "//&
+         &  "file "//TRIM(tl_coord0%c_name)//" not defined." )
+
+      ELSE
+
+         ! open mpp files
+         CALL iom_mpp_open(tl_coord0)
+ 
+         ! read coarse longitue and latitude
+         WRITE(cl_name,*) 'longitude_'//TRIM(cl_point)
+         il_ind=var_get_id(tl_coord0%t_proc(1)%t_var(:), cl_name)
+         IF( il_ind == 0 )THEN
+            CALL logger_warn("GRID GET CLOSEST: no variable "//&
+            &  TRIM(cl_name)//"in file "//TRIM(tl_coord0%c_name)//". &
+            &  try to use longitude.")
+            WRITE(cl_name,*) 'longitude'
+         ENDIF
+         tl_lon0=iom_mpp_read_var(tl_coord0, TRIM(cl_name))
+ 
+         WRITE(cl_name,*) 'latitude_'//TRIM(cl_point)
+         il_ind=var_get_id(tl_coord0%t_proc(1)%t_var(:), cl_name)
+         IF( il_ind == 0 )THEN
+            CALL logger_warn("GRID GET CLOSEST: no variable "//&
+            &  TRIM(cl_name)//"in file "//TRIM(tl_coord0%c_name)//". &
+            &  try to use latitude.")
+            WRITE(cl_name,*) 'latitude'
+         ENDIF
+         tl_lat0=iom_mpp_read_var(tl_coord0, TRIM(cl_name))
+
+         ! close mpp files
+         CALL iom_mpp_close(tl_coord0)
+
+         il_ew=MAX(0,tl_coord0%i_ew)
+         ALLOCATE(dl_lon0(tl_coord0%t_dim(jp_I)%i_len-il_ew, &
+            &             tl_coord0%t_dim(jp_J)%i_len) )             
+         ALLOCATE(dl_lat0(tl_coord0%t_dim(jp_I)%i_len-il_ew, &
+            &             tl_coord0%t_dim(jp_J)%i_len) )
+
+         dl_lon0(:,:)=tl_lon0%d_value(il_ew+1:,:,1,1)
+         dl_lat0(:,:)=tl_lat0%d_value(il_ew+1:,:,1,1)
+
+         id_res(:)=grid_get_closest( dl_lon0, dl_lat0, dd_lon1, dd_lat1, cd_pos, dd_fill )
+
+         DEALLOCATE(dl_lon0, dl_lat0)
+         CALL var_clean(tl_lon0)
+         CALL var_clean(tl_lat0)
+         CALL mpp_clean(tl_coord0)
+
+      ENDIF
+
+   END FUNCTION  grid__get_closest_str
+   !-------------------------------------------------------------------
+   !> @brief This function return grid indices of the closest point
+   !> from point (lon1,lat1) 
+   !> 
+   !> @details
+   !>
+   !> @note overlap band should have been already removed from coarse grid array 
+   !> of longitude and latitude, before running this function
+   !>
+   !> if you add cd_pos argument, you could choice to return closest point at
+   !> - lower left  (ll) of the point
+   !> - lower right (lr) of the point
+   !> - upper left  (ul) of the point
+   !> - upper right (ur) of the point
+   !> - lower       (lo) of the point
+   !> - upper       (up) of the point
+   !> -       left  (le) of the point
+   !> -       right (ri) of the point
+   !>
+   !> @author J.Paul
    !> @date November, 2013 - Initial Version
    !> @date February, 2015
@@ -3034,5 +3171,5 @@
    !> @return coarse grid indices of closest point of fine grid point
    !-------------------------------------------------------------------
-   FUNCTION grid_get_closest( dd_lon0, dd_lat0, dd_lon1, dd_lat1, cd_pos, dd_fill )
+   FUNCTION grid__get_closest_arr( dd_lon0, dd_lat0, dd_lon1, dd_lat1, cd_pos, dd_fill )
       IMPLICIT NONE
       ! Argument
@@ -3045,5 +3182,5 @@
 
       ! function
-      INTEGER(i4), DIMENSION(2) :: grid_get_closest
+      INTEGER(i4), DIMENSION(2) :: grid__get_closest_arr
 
       ! local variable
@@ -3261,13 +3398,13 @@
          END SELECT
       ENDIF
-      grid_get_closest(:)=MINLOC(dl_dist(:,:),dl_dist(:,:)/=NF90_FILL_DOUBLE)
-
-      grid_get_closest(1)=grid_get_closest(1)+il_iinf-1
-      grid_get_closest(2)=grid_get_closest(2)+il_jinf-1
+      grid__get_closest_arr(:)=MINLOC(dl_dist(:,:),dl_dist(:,:)/=NF90_FILL_DOUBLE)
+
+      grid__get_closest_arr(1)=grid__get_closest_arr(1)+il_iinf-1
+      grid__get_closest_arr(2)=grid__get_closest_arr(2)+il_jinf-1
 
       DEALLOCATE( dl_dist )
       DEALLOCATE( dl_lon0 )
 
-   END FUNCTION grid_get_closest
+   END FUNCTION grid__get_closest_arr
    !-------------------------------------------------------------------
    !> @brief This function compute the distance between a point A and grid points.  
@@ -3475,5 +3612,5 @@
          ENDIF
          tl_lat0=iom_mpp_read_var(tl_coord0, TRIM(cl_name))
-         
+
          ! close mpp files
          CALL iom_mpp_close(tl_coord0)
@@ -4647,4 +4784,5 @@
 
       IF( ll_even )THEN
+
          ! look for variable value on domain for F point
          il_ind=var_get_index(tl_coord0%t_proc(1)%t_var(:), 'longitude_F')
@@ -5112,5 +5250,4 @@
       dl_lon1 = dd_lon1(il_imin1, il_jmax1)
       dl_lat1 = dd_lat1(il_imin1, il_jmax1)
-
 
       IF( (ABS(dl_lon1-dl_lon0)>dp_delta) .AND. (dl_lon1 < dl_lon0) .OR. &
Index: branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/iom.f90
===================================================================
--- branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/iom.f90	(revision 8655)
+++ branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/iom.f90	(revision 8862)
@@ -157,5 +157,5 @@
    !> @author J.Paul
    !> @date November, 2013 - Initial Version
-   !
+   !>
    !> @param[inout] td_file file structure
    !-------------------------------------------------------------------
Index: branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/iom_cdf.f90
===================================================================
--- branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/iom_cdf.f90	(revision 8655)
+++ branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/iom_cdf.f90	(revision 8862)
@@ -316,4 +316,6 @@
    !> @author J.Paul
    !> @date November, 2013 - Initial Version
+   !> @date October, 2016
+   !> - define cdf4 as cdf.
    !
    !> @param[inout] td_file   file structure
@@ -340,6 +342,6 @@
             td_file%c_type='cdf'
          CASE(nf90_format_netcdf4, nf90_format_netcdf4_classic)
+            !td_file%c_type='cdf4'
             td_file%c_type='cdf'
-            !td_file%c_type='cdf4'
       END SELECT
       CALL logger_debug("IOM CDF GET INFO: type "//TRIM(td_file%c_type)) 
@@ -353,8 +355,10 @@
    !> reorder dimension to ('x', 'y', 'z', 't').
    !> The dimension structure inside file structure is then completed.
-   !
-   !> @author J.Paul
-   !> @date November, 2013 - Initial Version
-   !
+   !>
+   !> @author J.Paul
+   !> @date November, 2013 - Initial Version
+   !> @date October, 2016
+   !> - check unknown dimension
+   !>
    !> @param[inout] td_file   file structure
    !-------------------------------------------------------------------
@@ -377,12 +381,14 @@
 
       IF( td_file%i_ndim > 0 )THEN
+
          ii=1
          DO ji = 1, td_file%i_ndim
             ! read dimension information
             tl_dim=iom_cdf_read_dim( td_file, ji)
-            IF( .NOT. dim_is_dummy(tl_dim) )THEN
+            ! sname == 'u' if dimension is unknown (not to be used)
+            IF( TRIM(tl_dim%c_sname) /= 'u' )THEN
                IF( ii > ip_maxdim )THEN
                   CALL logger_fatal("IOM CDF OPEN: too much dimension "//&
-                  & "to be read. you should remove dummy dimension using "//&
+                  & "to be read. you could choose dimension to be used. see "//&
                   & " configuration file")
                ENDIF
@@ -397,6 +403,6 @@
             &  " IOM CDF GET FILE DIM: there is no unlimited dimension in file "//&
             &  TRIM(td_file%c_name))
-         ELSE
-            td_file%t_dim( td_file%i_uldid )%l_uld=.TRUE.
+         !ELSE
+         !   td_file%t_dim( td_file%i_uldid )%l_uld=.TRUE.
          ENDIF
 
@@ -468,5 +474,5 @@
    !> The variable structure inside file structure is then completed.
    !> @note variable value are not read !
-   !
+   !>
    !> @author J.Paul
    !> @date November, 2013 - Initial Version
@@ -475,5 +481,8 @@
    !> @date January, 2016
    !> - increment n3d for 4D variable
-   !
+   !> @date October, 2016
+   !> - check variable to be used (variable's dimension allowed and variable
+   !> not "dummy")
+   !>
    !> @param[inout] td_file   file structure
    !-------------------------------------------------------------------
@@ -503,15 +512,11 @@
          il_nvar=td_file%i_nvar
          ALLOCATE(tl_var(il_nvar))
-         ii=0
          DO ji = 1, il_nvar
            ! read variable information
            tl_var(ji)=iom_cdf__read_var_meta( td_file, ji) 
-           IF( .NOT. var_is_dummy(tl_var(ji)) )THEN
-              ii=ii+1
-           ENDIF
          ENDDO
 
          ! update number of variable used
-         td_file%i_nvar=ii
+         td_file%i_nvar=COUNT(tl_var(:)%l_use)
 
          ALLOCATE(td_file%t_var(td_file%i_nvar))
@@ -519,5 +524,5 @@
          ii=0
          DO ji = 1, il_nvar
-            IF( .NOT. var_is_dummy(tl_var(ji)) )THEN
+            IF( tl_var(ji)%l_use )THEN
                ii=ii+1
                td_file%t_var(ii)=var_copy(tl_var(ji))
@@ -554,4 +559,11 @@
                      td_file%i_timeid=ji
                   ELSE
+                     IF( td_file%i_timeid /= ji )THEN
+                        CALL logger_warn("IOM CDF GET FILE VAR: find more "//&
+                        &                 "than one time variable in file "//&
+                        &                 TRIM(td_file%c_name)//". see "//&
+                        &                 "dummy.cfg configuration file to"//&
+                        &                 " not used dummy variables.")
+                     ENDIF
                      il_attid=0
                      IF( ASSOCIATED(td_file%t_var(ii)%t_att) )THEN
@@ -560,8 +572,4 @@
                      IF( il_attid /= 0 )THEN
                         td_file%i_timeid=ji
-                     !ELSE
-                     !   CALL logger_error("IOM CDF GET FILE VAR: find more "//&
-                     !   &                 "than one time variable in file "//&
-                     !   &                 TRIM(td_file%c_name) )
                      ENDIF
                   ENDIF
@@ -654,5 +662,5 @@
          &  " IOM CDF READ DIM: no id associated to file "//TRIM(td_file%c_name))
 
-      ELSE      
+      ELSE
 
          CALL logger_trace( &
@@ -725,4 +733,6 @@
    !> @author J.Paul
    !> @date November, 2013 - Initial Version
+   !> @date November 2017
+   !> - check if cl_value is not bug 
    !
    !> @param[in] td_file   file structure
@@ -795,4 +805,5 @@
 
             CASE(NF90_CHAR)
+               CALL logger_debug( " IOM CDF READ ATT: get NF90_CHAR ")
 
                ! check string lengths
@@ -811,4 +822,6 @@
                   CALL iom_cdf__check(il_status,"IOM CDF READ ATT: ")
 
+                  ! check cl_value
+                  IF( LLT(cl_value,'') ) cl_value = ''
                   iom_cdf__read_att_name=att_init(cl_name, cl_value)
 
@@ -816,4 +829,5 @@
          
             CASE(NF90_BYTE)
+               CALL logger_debug( " IOM CDF READ ATT: get NF90_BYTE ")
 
                ALLOCATE( bl_value( il_len), &
@@ -839,4 +853,5 @@
 
             CASE(NF90_SHORT)
+               CALL logger_debug( " IOM CDF READ ATT: get NF90_SHORT ")
 
                ALLOCATE( sl_value( il_len), &
@@ -863,4 +878,5 @@
 
             CASE(NF90_INT)
+               CALL logger_debug( " IOM CDF READ ATT: get NF90_INT ")
 
                ALLOCATE( il_value( il_len), &
@@ -886,4 +902,5 @@
 
             CASE(NF90_FLOAT)
+               CALL logger_debug( " IOM CDF READ ATT: get NF90_FLOAT ")
 
                ALLOCATE( fl_value( il_len), &
@@ -910,4 +927,5 @@
 
             CASE(NF90_DOUBLE)
+               CALL logger_debug( " IOM CDF READ ATT: get NF90_DOUBLE ")
 
                ALLOCATE( dl_value( il_len), &
@@ -1415,4 +1433,16 @@
          ENDDO
 
+         !! check if variable is dummy
+         IF( var_is_dummy(iom_cdf__read_var_meta) )THEN
+            iom_cdf__read_var_meta%l_use=.FALSE.
+         ENDIF
+
+         !! check if all dimensions are allowed
+         DO ji=1,il_ndim
+            IF( ALL(td_file%t_dim(:)%i_id /= il_dimid(ji)) )THEN
+               iom_cdf__read_var_meta%l_use=.FALSE.
+            ENDIF
+         ENDDO
+
          ! clean
          CALL dim_clean(tl_dim(:))
@@ -1486,9 +1516,8 @@
       ELSE IF( id_ndim > 0 )THEN
 
-
          ii=1
          DO ji = 1, id_ndim
 
-            !!! check no dummy dimension to be used
+            ! check if dimension to be used, is allowed
             IF( ANY(td_file%t_dim(:)%i_id == id_dimid(ji)) )THEN
                IF( ii > ip_maxdim )THEN
@@ -1506,5 +1535,5 @@
                tl_dim(ii) = dim_init( td_file%t_dim(il_xyzt2(ii))%c_name, &
                &                      td_file%t_dim(il_xyzt2(ii))%i_len )
-            
+
                ii=ii+1
             ELSE
@@ -2082,5 +2111,5 @@
                   & 'gcost','gcosu','gcosv','gcosf', &
                   & 'gsint','gsinu','gsinv','gsinf', &
-                  & 'mbathy','misf','isf_draft',     &
+                  & 'mbathy','misf','isf_draft','isfdraft',     &
                   & 'hbatt','hbatu','hbatv','hbatf', &
                   & 'gsigt','gsigu','gsigv','gsigf', &
@@ -2191,4 +2220,5 @@
          CALL iom_cdf__check(il_status,"IOM CDF WRITE VAR DEF: ")
       ENDIF
+      CALL logger_debug("IOM CDF WRITE VAR DEF: type = "//TRIM(fct_str(tl_var%i_type)))
 
       ! remove unuseful attribute
Index: branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/iom_mpp.f90
===================================================================
--- branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/iom_mpp.f90	(revision 8655)
+++ branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/iom_mpp.f90	(revision 8862)
@@ -385,5 +385,5 @@
       CHARACTER(LEN=*),          INTENT(IN) :: cd_name
       INTEGER(i4), DIMENSION(:), INTENT(IN), OPTIONAL :: id_start
-      INTEGER(i4), DIMENSION(:), INTENT(IN), OPTIONAL :: id_count      
+      INTEGER(i4), DIMENSION(:), INTENT(IN), OPTIONAL :: id_count  
 
       ! local variable
Index: branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/merge_bathy.f90
===================================================================
--- branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/merge_bathy.f90	(revision 8655)
+++ branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/merge_bathy.f90	(revision 8862)
@@ -51,4 +51,6 @@
 !>       - cn_varcfg : variable configuration file 
 !> (see ./SIREN/cfg/variable.cfg)
+!>       - cn_dimcfg : dimension configuration file. define dimensions allowed
+!> (see ./SIREN/cfg/dimension.cfg).
 !>       - cn_dumcfg : useless (dummy) configuration file, for useless 
 !> dimension or variable (see ./SIREN/cfg/dummy.cfg).
@@ -115,4 +117,5 @@
 !>       - cn_east  : east  boundary indices on fine grid<br/>
 !>       - cn_west  : west  boundary indices on fine grid<br/>
+!>       - in_ncrs  : number of point(s) with coarse value save at boundaries<br/>
 !>       - ln_oneseg: use only one segment for each boundary or not
 !>
@@ -130,4 +133,7 @@
 !> @date September, 2015
 !> - manage useless (dummy) variable, attributes, and dimension
+!> @date October, 2016
+!> - allow to choose the number of boundary point with coarse grid value.
+!> - dimension to be used select from configuration file
 !>
 !> @note Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
@@ -208,6 +214,7 @@
 
    ! namcfg
-   CHARACTER(LEN=lc)                       :: cn_varcfg = 'variable.cfg' 
-   CHARACTER(LEN=lc)                       :: cn_dumcfg = 'dummy.cfg'
+   CHARACTER(LEN=lc)                       :: cn_varcfg = './cfg/variable.cfg' 
+   CHARACTER(LEN=lc)                       :: cn_dimcfg = './cfg/dimension.cfg'
+   CHARACTER(LEN=lc)                       :: cn_dumcfg = './cfg/dummy.cfg'
 
    ! namcrs
@@ -231,9 +238,10 @@
    LOGICAL                                 :: ln_east  = .TRUE.
    LOGICAL                                 :: ln_west  = .TRUE.
-   LOGICAL                                 :: ln_oneseg= .TRUE.
    CHARACTER(LEN=lc)                       :: cn_north = ''
    CHARACTER(LEN=lc)                       :: cn_south = ''
    CHARACTER(LEN=lc)                       :: cn_east  = ''
    CHARACTER(LEN=lc)                       :: cn_west  = ''
+   INTEGER(i4)                             :: in_ncrs  = 2
+   LOGICAL                                 :: ln_oneseg= .TRUE.
 
    ! namout
@@ -248,4 +256,5 @@
    NAMELIST /namcfg/ &  !< config namelist
    &  cn_varcfg, &       !< variable configuration file
+   &  cn_dimcfg, &       !< dimension configuration file
    &  cn_dumcfg          !< dummy configuration file
 
@@ -276,4 +285,5 @@
    &  cn_east ,   &     !< east  boundary indices on fine grid
    &  cn_west ,   &     !< west  boundary indices on fine grid
+   &  in_ncrs,    &     !< number of point with coarse value save at boundaries 
    &  ln_oneseg         !< use only one segment for each boundary or not
 
@@ -319,4 +329,7 @@
       CALL var_def_extra(TRIM(cn_varcfg))
 
+      ! get dimension allowed
+      CALL dim_def_extra(TRIM(cn_dimcfg))
+
       ! get dummy variable
       CALL var_get_dummy(TRIM(cn_dumcfg))
@@ -435,5 +448,5 @@
    DO jk=1,ip_ncard
       CALL merge_bathy_get_boundary(tl_bathy0, tl_bathy1, tl_bdy(jk), &
-      &                             il_rho(:),                        &
+      &                             il_rho(:), in_ncrs,                      &
       &                             dl_refined(:,:,:,:), dl_weight(:,:,:,:), &
       &                             dl_fill)
@@ -621,4 +634,5 @@
    DEALLOCATE(dl_weight)
    CALL boundary_clean(tl_bdy(:))
+   CALL var_clean_extra()
 
    ! close log file
@@ -638,12 +652,12 @@
    !> @param[in] td_bdy          boundary structure
    !> @param[in] id_rho          array of refinement factor
+   !> @param[in] id_ncrs         number of point with coarse value save at boundaries
    !> @param[inout] dd_refined   array of refined bathymetry 
    !> @param[inout] dd_weight    array of weight
    !> @param[in] dd_fill         fillValue
    !>
-   !> @todo improve boundary weight function
    !-------------------------------------------------------------------
    SUBROUTINE merge_bathy_get_boundary( td_bathy0, td_bathy1, td_bdy, &
-   &                                    id_rho,                       &
+   &                                    id_rho, id_ncrs,              &
    &                                    dd_refined, dd_weight, dd_fill )
 
@@ -655,4 +669,5 @@
       TYPE(TBDY)                     , INTENT(IN   ) :: td_bdy
       INTEGER(i4), DIMENSION(:)      , INTENT(IN   ) :: id_rho
+      INTEGER(i4)                    , INTENT(IN   ) :: id_ncrs
       REAL(dp)   , DIMENSION(:,:,:,:), INTENT(INOUT) :: dd_refined
       REAL(dp)   , DIMENSION(:,:,:,:), INTENT(INOUT) :: dd_weight
@@ -670,4 +685,6 @@
       INTEGER(i4) :: il_jmax0
 
+      INTEGER(i4) :: il_width
+
       INTEGER(i4), DIMENSION(2,2)         :: il_offset
       INTEGER(i4), DIMENSION(2,2)         :: il_ind
@@ -838,18 +855,14 @@
             CASE('north')
 
-!               ! npoint coarse
-!               il_width=td_bdy%t_seg(jl)%i_width-id_npoint
-!               ! compute "distance"
-!               dl_tmp1d(:)=(/(ji,ji=il_width-1,1,-1),(0,ji=1,id_npoint)/)
-!               ! compute weight on segment
-!               dl_tmp1d(:)= 0.5 + 0.5*COS( (dp_pi*dl_tmp1d(:)) / &
-!               &                           (il_width) )
-
+
+               ! save n coarse point
+               il_width=td_bdy%t_seg(jl)%i_width-id_ncrs
                ! compute "distance"
-               dl_tmp1d(:)=(/(ji-1,ji=td_bdy%t_seg(jl)%i_width-1,1,-1),0/)
+               dl_tmp1d(:)=(/(ji,ji=il_width,1,-1),(0,ji=1,id_ncrs)/)
 
                ! compute weight on segment
                dl_tmp1d(:)= 0.5 + 0.5*COS( (dp_pi*dl_tmp1d(:)) / &
-               &                           (td_bdy%t_seg(jl)%i_width) )
+               &                           (il_width) )
+
 
                ALLOCATE( dl_wseg(tl_dom1%t_dim(1)%i_len, &
@@ -862,10 +875,13 @@
             CASE('south')
 
+               ! save n coarse point
+               il_width=td_bdy%t_seg(jl)%i_width-id_ncrs
                ! compute "distance"
-               dl_tmp1d(:)=(/0,(ji-1,ji=1,td_bdy%t_seg(jl)%i_width-1)/)               
+               dl_tmp1d(:)=(/(0,ji=1,id_ncrs),(ji,ji=1,il_width)/)
 
                ! compute weight on segment
                dl_tmp1d(:)= 0.5 + 0.5*COS( (dp_pi*dl_tmp1d(:)) / &
-               &                           (td_bdy%t_seg(jl)%i_width) )
+               &                           (il_width) )
+
 
                ALLOCATE( dl_wseg(tl_dom1%t_dim(1)%i_len, &
@@ -878,10 +894,13 @@
             CASE('east')
 
+               ! save n coarse point
+               il_width=td_bdy%t_seg(jl)%i_width-id_ncrs
                ! compute "distance"
-               dl_tmp1d(:)=(/(ji-1,ji=td_bdy%t_seg(jl)%i_width-1,1,-1),0/)
+               dl_tmp1d(:)=(/(ji,ji=il_width,1,-1),(0,ji=1,id_ncrs)/)
 
                ! compute weight on segment
                dl_tmp1d(:)= 0.5 + 0.5*COS( (dp_pi*dl_tmp1d(:)) / &
-               &                           (td_bdy%t_seg(jl)%i_width) )
+               &                           (il_width) )
+
 
                ALLOCATE( dl_wseg(tl_dom1%t_dim(1)%i_len, &
@@ -894,10 +913,13 @@
             CASE('west')
 
+               ! save n coarse point
+               il_width=td_bdy%t_seg(jl)%i_width-id_ncrs
                ! compute "distance"
-               dl_tmp1d(:)=(/0,(ji-1,ji=1,td_bdy%t_seg(jl)%i_width-1)/)               
+               dl_tmp1d(:)=(/(0,ji=1,id_ncrs),(ji,ji=1,il_width)/)
 
                ! compute weight on segment
                dl_tmp1d(:)= 0.5 + 0.5*COS( (dp_pi*dl_tmp1d(:)) / &
-               &                           (td_bdy%t_seg(jl)%i_width) )
+               &                           (il_width) )
+
 
                ALLOCATE( dl_wseg(tl_dom1%t_dim(1)%i_len, &
Index: branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/mpp.f90
===================================================================
--- branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/mpp.f90	(revision 8655)
+++ branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/mpp.f90	(revision 8862)
@@ -266,5 +266,5 @@
    PRIVATE :: mpp__copy_arr            ! copy array of mpp structure
    PRIVATE :: mpp__get_use_unit        ! get sub domains to be used (which cover "zoom domain")
-   PRIVATE :: mpp__init_mask           ! initialise mpp structure, given file name
+   PRIVATE :: mpp__init_mask           ! initialise mpp structure, given mask array
    PRIVATE :: mpp__init_var            ! initialise mpp structure, given variable strcuture
    PRIVATE :: mpp__init_file           ! initialise a mpp structure, given file structure 
@@ -586,5 +586,5 @@
                WRITE(*,'(/a)') " Variable(s) used : "
                DO ji=1,td_mpp%t_proc(1)%i_nvar
-                  WRITE(*,'(3x,a)') TRIM(td_mpp%t_proc(1)%t_var(ji)%c_name) 
+                  WRITE(*,'(3x,a)') TRIM(td_mpp%t_proc(1)%t_var(ji)%c_name)
                ENDDO
             ENDIF
@@ -2550,8 +2550,10 @@
    !> and the number of processors following I and J.
    !> Then the number of sea/land processors is compute with mask
-   !
+   !>
    !> @author J.Paul
    !> @date October, 2015 - Initial version
-   !
+   !> @date October, 2016
+   !> - compare index to td_lay number of proc instead of td_mpp (bug fix)
+   !>
    !> @param[in] td_mpp mpp strcuture
    !> @param[in] id_mask   sub domain mask (sea=1, land=0)
@@ -2670,5 +2672,5 @@
 
             ! east boundary
-            IF( ji == td_mpp%i_niproc )THEN
+            IF( ji == td_lay%i_niproc )THEN
                il_lei = td_lay%i_lci(ji,jj)
             ELSE
@@ -2677,5 +2679,5 @@
 
             ! north boundary
-            IF( jj == td_mpp%i_njproc )THEN
+            IF( jj == td_lay%i_njproc )THEN
                il_lej = td_lay%i_lcj(ji,jj)
             ELSE
Index: branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/phycst.f90
===================================================================
--- branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/phycst.f90	(revision 8655)
+++ branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/phycst.f90	(revision 8862)
@@ -34,10 +34,10 @@
    PUBLIC :: dp_siday   !< sideral day                        [s]
 
-   REAL(wp), PUBLIC ::   rday = 24.*60.*60.     !: day                                [s]
-   REAL(wp), PUBLIC ::   rsiyea                 !: sideral year                       [s]
-   REAL(wp), PUBLIC ::   rsiday                 !: sideral day                        [s]
+   REAL(dp), PUBLIC ::   rday = 24.*60.*60.     !: day                                [s]
+   REAL(dp), PUBLIC ::   rsiyea                 !: sideral year                       [s]
+   REAL(dp), PUBLIC ::   rsiday                 !: sideral day                        [s]
 
    REAL(dp), PARAMETER :: dp_pi = 3.14159274101257_dp
-   REAL(dp), PARAMETER :: dp_eps = EPSILON(1._dp)
+   REAL(dp), PARAMETER :: dp_eps = 0.5 * EPSILON(1._dp)
    REAL(dp), PARAMETER :: dp_rearth = 6371229._dp
    REAL(dp), PARAMETER :: dp_deg2rad = dp_pi/180.0
@@ -45,9 +45,9 @@
 
    REAL(dp), PARAMETER :: dp_day = 24.*60.*60.     
-   REAL(dp), PARAMETER :: dp_siyea = 365.25_wp * dp_day * &
-      &  2._wp * dp_pi / 6.283076_dp
-   REAL(dp), PARAMETER :: dp_siday = dp_day / ( 1._wp + dp_day / dp_siyea )
+   REAL(dp), PARAMETER :: dp_siyea = 365.25_dp * dp_day * &
+      &  2._dp * dp_pi / 6.283076_dp
+   REAL(dp), PARAMETER :: dp_siday = dp_day / ( 1._dp + dp_day / dp_siyea )
 
-   REAL(dp), PARAMETER :: dp_delta=1.e-6
+   REAL(dp), PARAMETER :: dp_delta=1.e-5
    REAL(dp), PARAMETER :: dp_omega= 2._dp * dp_pi / dp_siday
 END MODULE phycst
Index: branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/variable.f90
===================================================================
--- branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/variable.f90	(revision 8655)
+++ branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/variable.f90	(revision 8862)
@@ -34,5 +34,5 @@
 !>    Note:<br/>
 !>       - others optionals arguments could be added, see var_init.
-!>       - to put variable 0D, use td_dim with all dimension unused
+!>       - to put scalar variable (OD), use td_dim with all dimension unused
 !> (td_dim(:)%l_use=.FALSE.)
 !>    
@@ -267,4 +267,9 @@
 !>    - cd_varinfo is variable information from namelist
 !>
+!>    to clean global array of variable structure:<br/>
+!>@code
+!>    CALL var_clean_extra( )
+!>@endcode
+!>
 !>    to check variable dimension expected, as defined in file 'variable.cfg':<br/>
 !>@code
@@ -287,5 +292,8 @@
 !> @date Spetember, 2015
 !> - manage useless (dummy) variable
-!
+!> @date October, 2016
+!> - add subroutine to clean global array of extra information.
+!> - define logical for variable to be used
+!>
 !> @note Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
 !----------------------------------------------------------------------
@@ -337,4 +345,5 @@
    PUBLIC :: var_def_extra     !< read variable configuration file, and save extra information.
    PUBLIC :: var_chg_extra     !< read variable namelist information, and modify extra information.
+   PUBLIC :: var_clean_extra   !< clean gloabl array of extra information.
    PUBLIC :: var_check_dim     !< check variable dimension expected
    PUBLIC :: var_get_dummy     !< fill dummy variable array
@@ -416,5 +425,6 @@
       TYPE(TDIM), DIMENSION(ip_maxdim)  :: t_dim           !< variable dimension
  
-      LOGICAL           :: l_file = .FALSE.  !< variable read in a file
+      LOGICAL           :: l_file = .FALSE. !< variable read in a file
+      LOGICAL           :: l_use  = .TRUE.  !< variable to be used
 
       ! highlight some attributes
@@ -451,5 +461,5 @@
                                                         !< fill when running var_def_extra() 
 
-   CHARACTER(LEN=lc), DIMENSION(ip_maxdum), SAVE :: cm_dumvar !< dummy variable
+   CHARACTER(LEN=lc), DIMENSION(ip_maxdumcfg), SAVE :: cm_dumvar !< dummy variable
 
    INTERFACE var_init
@@ -593,4 +603,7 @@
          CALL att_clean(tl_att)
       ENDIF
+
+      var__copy_unit%l_file     = td_var%l_file
+      var__copy_unit%l_use      = td_var%l_use
 
       ! copy highlight attribute
@@ -1126,4 +1139,6 @@
    !> @date July, 2015
    !> - add unit factor (to change unit)
+   !> @date November, 2016
+   !> - allow to add scalar value
    !>
    !> @param[in] cd_name         variable name
@@ -1279,6 +1294,13 @@
          dl_value(1,1,1,:) = dd_value(:)
       ELSE
-         CALL logger_fatal("VAR INIT: can not add value from variable "//&
-         &  TRIM(cd_name)//". invalid dimension to be used")
+         IF( SIZE(dd_value(:)) > 1 )THEN
+            CALL logger_fatal("VAR INIT: can not add value from variable "//&
+            &  TRIM(cd_name)//". invalid dimension to be used")
+         ELSE
+            dl_value(1,1,1,1) = dd_value(1)
+            CALL logger_warn("VAR INIT: add scalar value for variable "//&
+            &  TRIM(cd_name))
+
+         ENDIF
       ENDIF
 
@@ -6669,4 +6691,5 @@
       ! check if variable is in array of variable structure
       DO ji=1,il_size
+
          ! look for variable name
          IF( fct_lower(td_var(ji)%c_name) == fct_lower(cd_name) )THEN
@@ -6683,4 +6706,5 @@
 
          ELSE IF( PRESENT(cd_stdname) )THEN 
+
             IF( fct_lower(td_var(ji)%c_stdname) == fct_lower(cd_stdname) .AND.&
             &    TRIM(fct_lower(td_var(ji)%c_stdname)) /= '' )THEN
@@ -6690,10 +6714,21 @@
             ENDIF
 
+         ENDIF
+
          ! look for variable longname
-         ELSE IF( fct_lower(td_var(ji)%c_longname) == fct_lower(cd_name) .AND.&
-         &    TRIM(fct_lower(td_var(ji)%c_longname)) /= '' )THEN
+         IF( fct_lower(td_var(ji)%c_longname) == fct_lower(cd_name) .AND.&
+         &   TRIM(fct_lower(td_var(ji)%c_longname)) /= '' )THEN
             
             var_get_index=ji
             EXIT
+
+         ELSE IF( PRESENT(cd_stdname) )THEN
+
+            IF( fct_lower(td_var(ji)%c_longname) == fct_lower(cd_stdname) .AND.&
+            &    TRIM(fct_lower(td_var(ji)%c_longname)) /= '' )THEN
+            
+               var_get_index=ji
+               EXIT
+            ENDIF
 
          ENDIF
@@ -6734,4 +6769,5 @@
       ! check if variable is in array of variable structure
       DO ji=1,il_size
+      
          ! look for variable name
          IF( fct_lower(td_var(ji)%c_name) == fct_lower(cd_name) )THEN
@@ -6747,12 +6783,6 @@
             EXIT
 
-         ! look for variable long name
-         ELSE IF( fct_lower(td_var(ji)%c_longname) == fct_lower(cd_name) .AND.&
-         &    TRIM(fct_lower(td_var(ji)%c_longname)) /= '' )THEN
-            
-            var_get_id=td_var(ji)%i_id
-            EXIT
-
-         ELSE IF( PRESENT(cd_stdname) )THEN 
+         ELSE IF( PRESENT(cd_stdname) )THEN
+
             IF( fct_lower(td_var(ji)%c_stdname) == fct_lower(cd_stdname) .AND.&
             &    TRIM(fct_lower(td_var(ji)%c_stdname)) /= '' )THEN
@@ -6761,4 +6791,23 @@
                EXIT
             ENDIF
+
+         ENDIF
+
+         ! look for variable long name
+         IF( fct_lower(td_var(ji)%c_longname) == fct_lower(cd_name) .AND.&
+         &    TRIM(fct_lower(td_var(ji)%c_longname)) /= '' )THEN
+            
+            var_get_id=td_var(ji)%i_id
+            EXIT
+
+         ELSE IF( PRESENT(cd_stdname) )THEN 
+
+            IF( fct_lower(td_var(ji)%c_longname) == fct_lower(cd_stdname) .AND.&
+            &    TRIM(fct_lower(td_var(ji)%c_longname)) /= '' )THEN
+            
+               var_get_id=td_var(ji)%i_id
+               EXIT
+            ENDIF
+
          ENDIF
 
@@ -7176,6 +7225,23 @@
    !-------------------------------------------------------------------
    !> @brief
+   !> This subroutine clean global array of variable structure 
+   !> with extra information: tg_varextra.
+   !> 
+   !> @author J.Paul
+   !> @date October, 2016 - Initial Version
+   !-------------------------------------------------------------------
+   SUBROUTINE var_clean_extra( )
+      IMPLICIT NONE
+      ! Argument
+      !----------------------------------------------------------------
+
+      CALL var_clean(tg_varextra(:))
+      DEALLOCATE(tg_varextra)
+
+   END SUBROUTINE var_clean_extra
+   !-------------------------------------------------------------------
+   !> @brief
    !> This subroutine read matrix value from character string in namelist
-   !> and fill variable strucutre value.
+   !> and fill variable structure value.
    !>
    !> @details
@@ -8463,7 +8529,7 @@
       ! loop indices
       ! namelist
-      CHARACTER(LEN=lc), DIMENSION(ip_maxdum) :: cn_dumvar
-      CHARACTER(LEN=lc), DIMENSION(ip_maxdum) :: cn_dumdim
-      CHARACTER(LEN=lc), DIMENSION(ip_maxdum) :: cn_dumatt
+      CHARACTER(LEN=lc), DIMENSION(ip_maxdumcfg) :: cn_dumvar
+      CHARACTER(LEN=lc), DIMENSION(ip_maxdumcfg) :: cn_dumdim
+      CHARACTER(LEN=lc), DIMENSION(ip_maxdumcfg) :: cn_dumatt
 
       !----------------------------------------------------------------
@@ -8526,5 +8592,5 @@
 
       var_is_dummy=.FALSE.
-      DO ji=1,ip_maxdum
+      DO ji=1,ip_maxdumcfg
          IF( fct_lower(td_var%c_name) == fct_lower(cm_dumvar(ji)) )THEN
             var_is_dummy=.TRUE.
Index: branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/vgrid.f90
===================================================================
--- branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/vgrid.f90	(revision 8655)
+++ branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/src/vgrid.f90	(revision 8862)
@@ -751,5 +751,5 @@
       ENDIF
 
-      ! get ghoste cell
+      ! get ghost cell
       il_xghost(:,:)=grid_get_ghost(tl_bathy)
 
Index: branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/templates/merge_bathy.nam
===================================================================
--- branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/templates/merge_bathy.nam	(revision 8655)
+++ branches/2015/nemo_v3_6_STABLE/NEMOGCM/TOOLS/SIREN/templates/merge_bathy.nam	(revision 8862)
@@ -34,4 +34,5 @@
    cn_east=
    cn_west=
+   in_ncrs=
    ln_oneseg=
 /
