Index: /utils/tools/NESTING/src/agrif_create_restart.f90
===================================================================
--- /utils/tools/NESTING/src/agrif_create_restart.f90	(revision 10383)
+++ /utils/tools/NESTING/src/agrif_create_restart.f90	(revision 10384)
@@ -17,4 +17,5 @@
   USE agrif_interpolation
   USE agrif_partial_steps        
+  USE agrif_connect_topo
   !
   IMPLICIT NONE
@@ -38,5 +39,5 @@
   CHARACTER*20 :: vert_coord_name
   CHARACTER*1 :: posvar
-  CHARACTER*100 :: Child_file,Childcoordinates,varname,Childbathy,Childbathymeter   
+  CHARACTER*100 :: Child_file,Childcoordinates,varname,Child_Bathy_Level,Child_Bathy_Meter   
   REAL*8, POINTER, DIMENSION(:,:) :: lonChild,latChild => NULL()
   REAL*8, POINTER, DIMENSION(:,:) :: lonParent,latParent => NULL()
@@ -72,4 +73,5 @@
   CHARACTER(len=20) :: timedimname
 
+  LOGICAL, PARAMETER :: conservation = .FALSE.
   !      
   ! Variables for dimg
@@ -100,5 +102,5 @@
 
   IF (iom_activated) THEN
-     timedimname = 't'
+     timedimname = 'time_counter'
   ELSE
      timedimname='time'
@@ -113,6 +115,6 @@
   !       
   CALL set_child_name(parent_coordinate_file,Childcoordinates)   
-  CALL set_child_name(parent_bathy_level,Childbathy) 
-  CALL set_child_name(parent_bathy_meter,Childbathymeter)   
+  IF( TRIM(parent_bathy_level) /= '' )   CALL set_child_name(parent_bathy_level,Child_Bathy_Level) 
+  IF( TRIM(parent_bathy_meter) /= '' )   CALL set_child_name(parent_bathy_meter,Child_Bathy_Meter)   
   !
   ! create this file
@@ -131,5 +133,5 @@
   CALL Read_Ncdf_dim('x',restart_file,x)
   CALL Read_Ncdf_dim('y',restart_file,y) 
-  CALL Read_Ncdf_dim('z',restart_file,z)
+  CALL Read_Ncdf_dim('nav_lev',restart_file,z)
   CALL Read_Ncdf_dim('x_a',restart_file,x_a)
   CALL Read_Ncdf_dim('y_a',restart_file,y_a)
@@ -165,6 +167,17 @@
   ENDIF
   !
+  ! one needs bathy_level
+  IF( TRIM(parent_bathy_level) /= '' ) THEN
+     status = Read_bathy_level(TRIM(parent_bathy_level),G0)
+     status = Read_bathy_level(TRIM(child_bathy_level),G1)
+  ELSE
+     status = read_bathy_meter(TRIM(parent_bathy_meter),G0)
+     status = read_bathy_meter(TRIM(child_bathy_meter),G1)
+     CALL meter_to_levels(G0)
+     CALL meter_to_levels(G1)
+  ENDIF
+  ! get masks
   CALL Init_mask(parent_bathy_level,G0,x,y)
-  CALL Init_mask(childbathy,G1,1,1)
+  CALL Init_mask(child_bathy_level,G1,1,1)
 
   G0%tmask = 1.    
@@ -295,5 +308,5 @@
      CALL Write_Ncdf_dim('x',Child_file,nxfin)
      CALL Write_Ncdf_dim('y',Child_file,nyfin)
-     CALL Write_Ncdf_dim('z',Child_file,z)
+     CALL Write_Ncdf_dim('nav_lev',Child_file,z)
      CALL Write_Ncdf_dim(TRIM(timedimname),Child_file,0) 
      IF (.NOT.iom_activated) THEN
@@ -354,5 +367,5 @@
         CALL Read_Ncdf_var('nav_lev',TRIM(restart_file),nav_lev) 
         IF(.NOT. dimg ) THEN
-           CALL Write_Ncdf_var('nav_lev','z',Child_file,nav_lev,'float')
+           CALL Write_Ncdf_var('nav_lev','nav_lev',Child_file,nav_lev,'float')
            CALL Copy_Ncdf_att('nav_lev',TRIM(restart_file),Child_file)      
         ENDIF
@@ -445,5 +458,5 @@
 
         WRITE(*,*) TRIM(varname),'interpolation ...'    
-        vert_coord_name = 'z'             
+        vert_coord_name = 'nav_lev'             
         posvar='U'
         Interpolation = .TRUE.  
@@ -463,5 +476,5 @@
 
         WRITE(*,*) TRIM(varname),'interpolation ...'      
-        vert_coord_name = 'z'
+        vert_coord_name = 'nav_lev'
         posvar='V'
         Interpolation = .TRUE.     
@@ -497,5 +510,5 @@
 
         WRITE(*,*) TRIM(varname),'interpolation ...'     
-        vert_coord_name = 'z'
+        vert_coord_name = 'nav_lev'
         posvar='T'
         Interpolation = .TRUE.            
@@ -505,5 +518,5 @@
         irec = 12 * z + 6
         WRITE(*,*) TRIM(varname),'interpolation ...'     
-        vert_coord_name = 'z'
+        vert_coord_name = 'nav_lev'
         posvar='T'
         Interpolation = .TRUE.             
@@ -516,5 +529,5 @@
      IF( Interpolation ) THEN
         !		  
-        IF( vert_coord_name == 'z') THEN
+        IF( vert_coord_name == 'nav_lev') THEN
            nbvert_lev = z 
         ELSE IF( vert_coord_name == 'z_b') THEN
@@ -592,8 +605,9 @@
                          nxfin,nyfin,matrix,src_add,dst_add) 
                  END SELECT
-                 !                      
-                 CALL Correctforconservation(tabvar1(:,:,1,1),tabinterp4d(:,:,1,1), &
-                      G0%e1t,G0%e2t,G1%e1t,G1%e2t,nxfin,nyfin,posvar,imin-jpizoom+1,jmin-jpjzoom+1)
-
+                 !
+                 IF( conservation ) THEN ! clem: it currently does not work
+                    CALL Correctforconservation(tabvar1(:,:,1,1),tabinterp4d(:,:,1,1), &
+                       G0%e1t,G0%e2t,G1%e1t,G1%e2t,nxfin,nyfin,posvar,imin-jpizoom+1,jmin-jpjzoom+1)
+                 ENDIF
 
               ENDIF
@@ -625,7 +639,8 @@
                  END SELECT
                  !                      
-                 CALL Correctforconservation(tabvar1(:,:,1,1),tabinterp4d(:,:,1,1), &
-                      G0%e1u,G0%e2u,G1%e1u,G1%e2u,nxfin,nyfin,posvar,imin-jpizoom+1,jmin-jpjzoom+1)
-
+                 IF( conservation ) THEN ! clem: not coded for U
+                    CALL Correctforconservation(tabvar1(:,:,1,1),tabinterp4d(:,:,1,1), &
+                       G0%e1u,G0%e2u,G1%e1u,G1%e2u,nxfin,nyfin,posvar,imin-jpizoom+1,jmin-jpjzoom+1)
+                 ENDIF
               ENDIF
 
@@ -658,7 +673,8 @@
                  END SELECT
                  !                      
-                 CALL Correctforconservation(tabvar1(:,:,1,1),tabinterp4d(:,:,1,1), &
-                      G0%e1v,G0%e2v,G1%e1v,G1%e2v,nxfin,nyfin,posvar,imin-jpizoom+1,jmin-jpjzoom+1)
-
+                 IF( conservation ) THEN ! clem: not coded for V
+                    CALL Correctforconservation(tabvar1(:,:,1,1),tabinterp4d(:,:,1,1), &
+                       G0%e1v,G0%e2v,G1%e1v,G1%e2v,nxfin,nyfin,posvar,imin-jpizoom+1,jmin-jpjzoom+1)
+                 ENDIF
               ENDIF
 
@@ -777,5 +793,5 @@
         dimnames(1)='x'
         dimnames(2)='y'
-        dimnames(3)='z'
+        dimnames(3)='nav_lev'
         dimnames(4)=TRIM(timedimname)
         CALL Write_Ncdf_var('tb',dimnames,Child_file,tb,'double')
@@ -803,5 +819,5 @@
         dimnames(1)='x'
         dimnames(2)='y'
-        dimnames(3)='z'
+        dimnames(3)='nav_lev'
         dimnames(4)=TRIM(timedimname)
         CALL Write_Ncdf_var('sb',dimnames,Child_file,sb,'double')
@@ -875,5 +891,5 @@
   !      
   IF(partial_steps) THEN
-     status = Read_Bathy_Meter(TRIM(Childbathymeter),G1)
+     status = Read_Bathy_Meter(TRIM(Child_Bathy_Meter),G1)
      CALL get_scale_factors( G1,fse3t,fse3u,fse3v )
   ELSE       
@@ -961,5 +977,5 @@
      dimnames(1)='x'
      dimnames(2)='y'
-     dimnames(3)='z'
+     dimnames(3)='nav_lev'
      dimnames(4)=TRIM(timedimname)
      CALL Write_Ncdf_var('rotn',dimnames,Child_file,rotn,'double')
