Index: /trunk/NEMO/OPA_SRC/DOM/domzgr.F90
===================================================================
--- /trunk/NEMO/OPA_SRC/DOM/domzgr.F90	(revision 410)
+++ /trunk/NEMO/OPA_SRC/DOM/domzgr.F90	(revision 411)
@@ -380,4 +380,5 @@
          !  EEL R5 configuration with east and west open boundaries.
          !  Two rows of zeroes are needed at the south and north for OBCs
+         !  This is for compatibility with the rigid lid option. 
           
          IF( cp_cfg == "eel" .AND. jp_cfg == 5 ) THEN
@@ -389,63 +390,60 @@
       ELSEIF( ntopo == 1 ) THEN                       !   read in file  !
          !                                            ! =============== !
-
-         clname = 'bathy_level.nc'                       ! Level bathymetry
+         IF( lk_zco ) THEN
+            clname = 'bathy_level.nc'                       ! Level bathymetry
 #if defined key_agrif
-      if ( .NOT. Agrif_Root() ) then
-         clname = TRIM(Agrif_CFixed())//'_'//TRIM(clname)
-      endif
+            IF( .NOT. Agrif_Root() ) THEN
+               clname = TRIM(Agrif_CFixed())//'_'//TRIM(clname)
+            ENDIF
 #endif         
-         INQUIRE( FILE=clname, EXIST=llbon )
-         IF( llbon ) THEN
-            IF(lwp) WRITE(numout,*)
-            IF(lwp) WRITE(numout,*) '         read level bathymetry in ', clname
-            IF(lwp) WRITE(numout,*)
-            itime = 1
-            ipi = jpidta
-            ipj = jpjdta
-            ipk = 1
-            zdt = rdt
-            CALL flinopen( clname, 1, jpidta, 1, jpjdta, .FALSE.,   &
-                           ipi, ipj, ipk, zlamt, zphit, zdept, itime, istep, zdate0, zdt, inum )
-            CALL flinget( inum, 'Bathy_level', jpidta, jpjdta, 1,   &
-                          itime, 1, 1, 1, jpidta, 1, jpjdta, zdta(:,:) )
-            idta(:,:) = zdta(:,:)
-            CALL flinclo( inum )
-
-         ELSE
-            IF(lwp) WRITE(numout,cform_err)
-            IF(lwp) WRITE(numout,*)'    zgr_bat : unable to read the file', clname
-            nstop = nstop + 1
-         ENDIF     
-
-         clname = 'bathy_meter.nc'                       ! meter bathymetry
+            INQUIRE( FILE=clname, EXIST=llbon )
+            IF( llbon ) THEN
+               IF(lwp) WRITE(numout,*)
+               IF(lwp) WRITE(numout,*) '         read level bathymetry in ', clname
+               IF(lwp) WRITE(numout,*)
+               itime = 1
+               ipi = jpidta
+               ipj = jpjdta
+               ipk = 1
+               zdt = rdt
+               CALL flinopen( clname, 1, jpidta, 1, jpjdta, .FALSE.,   &
+                              ipi, ipj, ipk, zlamt, zphit, zdept, itime, istep, zdate0, zdt, inum )
+               CALL flinget( inum, 'Bathy_level', jpidta, jpjdta, 1,   &
+                             itime, 1, 1, 1, jpidta, 1, jpjdta, zdta(:,:) )
+               idta(:,:) = zdta(:,:)
+               CALL flinclo( inum )
+
+            ELSE
+               IF(lwp) WRITE(numout,cform_err)
+               IF(lwp) WRITE(numout,*)'    zgr_bat : unable to read the file', clname
+               nstop = nstop + 1
+            ENDIF   
+  
+         ELSEIF( lk_zps ) THEN
+            clname = 'bathy_meter.nc'                       ! meter bathymetry
 #if defined key_agrif
-      if ( .NOT. Agrif_Root() ) then
-         clname = TRIM(Agrif_CFixed())//'_'//TRIM(clname)
-      endif
+            IF( .NOT. Agrif_Root() ) THEN
+               clname = TRIM(Agrif_CFixed())//'_'//TRIM(clname)
+            ENDIF
 #endif   	 
-         INQUIRE( FILE=clname, EXIST=llbon )
-         IF( llbon ) THEN
-            IF(lwp) WRITE(numout,*)
-            IF(lwp) WRITE(numout,*) '         read meter bathymetry in ', clname
-            IF(lwp) WRITE(numout,*)
-            itime = 1
-            ipi = jpidta
-            ipj = jpjdta
-            ipk = 1
-            zdt = rdt
-            CALL flinopen( clname, 1, jpidta, 1, jpjdta, .FALSE.,   &    
-                           ipi, ipj, ipk, zlamt, zphit, zdept, itime, istep, zdate0, zdt, inum )
-            CALL flinget( inum, 'Bathymetry', jpidta, jpjdta, 1,   &
-                          itime, 1, 1, 1, jpidta, 1, jpjdta, zdta(:,:) ) 
-            CALL flinclo( inum )
-         ELSE
-            IF( lk_zps .OR. lk_sco ) THEN
+            INQUIRE( FILE=clname, EXIST=llbon )
+            IF( llbon ) THEN
+               IF(lwp) WRITE(numout,*)
+               IF(lwp) WRITE(numout,*) '         read meter bathymetry in ', clname
+               IF(lwp) WRITE(numout,*)
+               itime = 1
+               ipi = jpidta
+               ipj = jpjdta
+               ipk = 1
+               zdt = rdt
+               CALL flinopen( clname, 1, jpidta, 1, jpjdta, .FALSE.,   &    
+                              ipi, ipj, ipk, zlamt, zphit, zdept, itime, istep, zdate0, zdt, inum )
+               CALL flinget( inum, 'Bathymetry', jpidta, jpjdta, 1,   &
+                             itime, 1, 1, 1, jpidta, 1, jpjdta, zdta(:,:) ) 
+               CALL flinclo( inum )
+            ELSE
                IF(lwp) WRITE(numout,cform_err)       
                IF(lwp) WRITE(numout,*)'    zgr_bat : unable to read the file', clname
                nstop = nstop + 1
-            ELSE
-               zdta(:,:) = 0.e0
-               IF(lwp) WRITE(numout,*)'    zgr_bat : bathy_meter not found, but not used, bathy array set to zero'
             ENDIF
          ENDIF
@@ -605,94 +603,94 @@
       IF( .NOT. lk_cfg_1d )   THEN
 
-      ! Suppress isolated ocean grid points
-
-      IF(lwp) WRITE(numout,*)
-      IF(lwp) WRITE(numout,*)'                   suppress isolated ocean grid points'
-      IF(lwp) WRITE(numout,*)'                   -----------------------------------'
-
-      icompt = 0
-      
-      DO jl = 1, 2
-
-         IF( nperio == 1 .OR. nperio  ==  4 .OR. nperio  ==  6 ) THEN
+         ! Suppress isolated ocean grid points
+
+         IF(lwp) WRITE(numout,*)
+         IF(lwp) WRITE(numout,*)'                   suppress isolated ocean grid points'
+         IF(lwp) WRITE(numout,*)'                   -----------------------------------'
+
+         icompt = 0
+
+         DO jl = 1, 2
+
+            IF( nperio == 1 .OR. nperio  ==  4 .OR. nperio  ==  6 ) THEN
+               mbathy( 1 ,:) = mbathy(jpim1,:)
+               mbathy(jpi,:) = mbathy(  2  ,:)
+            ENDIF
+            DO jj = 2, jpjm1
+               DO ji = 2, jpim1
+                  ibtest = MAX( mbathy(ji-1,jj), mbathy(ji+1,jj),   &
+                     mbathy(ji,jj-1),mbathy(ji,jj+1) )
+                  IF( ibtest < mbathy(ji,jj) ) THEN
+                     IF(lwp) WRITE(numout,*) ' the number of ocean level at ',   &
+                        'grid-point (i,j) =  ',ji,jj,' is changed from ',   &
+                        mbathy(ji,jj),' to ', ibtest
+                     mbathy(ji,jj) = ibtest
+                     icompt = icompt + 1
+                  ENDIF
+               END DO
+            END DO
+
+         END DO
+         IF( icompt == 0 ) THEN
+            IF(lwp) WRITE(numout,*)'     no isolated ocean grid points'
+         ELSE
+            IF(lwp) WRITE(numout,*)'    ',icompt,' ocean grid points suppressed'
+         ENDIF
+         IF( lk_mpp ) THEN
+            zbathy(:,:) = FLOAT( mbathy(:,:) )
+            CALL lbc_lnk( zbathy, 'T', 1. )
+            mbathy(:,:) = INT( zbathy(:,:) )
+         ENDIF
+
+         ! 3.2 East-west cyclic boundary conditions
+
+         IF( nperio == 0 ) THEN
+            IF(lwp) WRITE(numout,*) ' mbathy set to 0 along east and west',   &
+               ' boundary: nperio = ', nperio
+            IF( lk_mpp ) THEN
+               IF( nbondi == -1 .OR. nbondi == 2 ) THEN
+                  IF( jperio /= 1 )   mbathy(1,:) = 0
+               ENDIF
+               IF( nbondi == 1 .OR. nbondi == 2 ) THEN
+                  IF( jperio /= 1 )   mbathy(nlci,:) = 0
+               ENDIF
+            ELSE
+               mbathy( 1 ,:) = 0
+               mbathy(jpi,:) = 0
+            ENDIF
+         ELSEIF( nperio == 1 .OR. nperio == 4 .OR. nperio ==  6 ) THEN
+            IF(lwp) WRITE(numout,*)' east-west cyclic boundary conditions',   &
+               ' on mbathy: nperio = ', nperio
             mbathy( 1 ,:) = mbathy(jpim1,:)
             mbathy(jpi,:) = mbathy(  2  ,:)
-         ENDIF
-         DO jj = 2, jpjm1
-            DO ji = 2, jpim1
-               ibtest = MAX( mbathy(ji-1,jj), mbathy(ji+1,jj),   &
-                  mbathy(ji,jj-1),mbathy(ji,jj+1) )
-               IF( ibtest < mbathy(ji,jj) ) THEN
-                  IF(lwp) WRITE(numout,*) ' the number of ocean level at ',   &
-                     'grid-point (i,j) =  ',ji,jj,' is changed from ',   &
-                     mbathy(ji,jj),' to ', ibtest
-                  mbathy(ji,jj) = ibtest
-                  icompt = icompt + 1
-               ENDIF
-            END DO
-         END DO
-
-      END DO
-      IF( icompt == 0 ) THEN
-         IF(lwp) WRITE(numout,*)'     no isolated ocean grid points'
-      ELSE
-         IF(lwp) WRITE(numout,*)'    ',icompt,' ocean grid points suppressed'
-      ENDIF
-      IF( lk_mpp ) THEN
-         zbathy(:,:) = FLOAT( mbathy(:,:) )
-         CALL lbc_lnk( zbathy, 'T', 1. )
-         mbathy(:,:) = INT( zbathy(:,:) )
-      ENDIF
-
-      ! 3.2 East-west cyclic boundary conditions
-
-      IF( nperio == 0 ) THEN
-         IF(lwp) WRITE(numout,*) ' mbathy set to 0 along east and west',   &
-            ' boundary: nperio = ', nperio
-         IF( lk_mpp ) THEN
-            IF( nbondi == -1 .OR. nbondi == 2 ) THEN
-               IF( jperio /= 1 )   mbathy(1,:) = 0
+         ELSEIF( nperio == 2 ) THEN
+            IF(lwp) WRITE(numout,*) '   equatorial boundary conditions',   &
+               ' on mbathy: nperio = ', nperio
+         ELSE
+            IF(lwp) WRITE(numout,*) '    e r r o r'
+            IF(lwp) WRITE(numout,*) '    parameter , nperio = ', nperio
+            !         STOP 'dom_mba'
+         ENDIF
+
+         ! Set to zero mbathy over islands if necessary  (lk_isl=F)
+         IF( .NOT. lk_isl ) THEN    ! No island
+            IF(lwp) WRITE(numout,*)
+            IF(lwp) WRITE(numout,*) '         mbathy set to 0 over islands'
+            IF(lwp) WRITE(numout,*) '         ----------------------------'
+
+            mbathy(:,:) = MAX( 0, mbathy(:,:) )
+
+            !  Boundary condition on mbathy
+            IF( .NOT.lk_mpp ) THEN 
+               
+               !!bug ???  y reflechir!
+               !   ... mono- or macro-tasking: T-point, >0, 2D array, no slab
+               
+               zbathy(:,:) = FLOAT( mbathy(:,:) )
+               CALL lbc_lnk( zbathy, 'T', 1. )
+               mbathy(:,:) = INT( zbathy(:,:) )
             ENDIF
-            IF( nbondi == 1 .OR. nbondi == 2 ) THEN
-               IF( jperio /= 1 )   mbathy(nlci,:) = 0
-            ENDIF
-         ELSE
-            mbathy( 1 ,:) = 0
-            mbathy(jpi,:) = 0
-         ENDIF
-      ELSEIF( nperio == 1 .OR. nperio == 4 .OR. nperio ==  6 ) THEN
-         IF(lwp) WRITE(numout,*)' east-west cyclic boundary conditions',   &
-            ' on mbathy: nperio = ', nperio
-         mbathy( 1 ,:) = mbathy(jpim1,:)
-         mbathy(jpi,:) = mbathy(  2  ,:)
-      ELSEIF( nperio == 2 ) THEN
-         IF(lwp) WRITE(numout,*) '   equatorial boundary conditions',   &
-            ' on mbathy: nperio = ', nperio
-      ELSE
-         IF(lwp) WRITE(numout,*) '    e r r o r'
-         IF(lwp) WRITE(numout,*) '    parameter , nperio = ', nperio
-         !         STOP 'dom_mba'
-      ENDIF
-
-      ! Set to zero mbathy over islands if necessary  (lk_isl=F)
-      IF( .NOT. lk_isl ) THEN    ! No island
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) '         mbathy set to 0 over islands'
-         IF(lwp) WRITE(numout,*) '         ----------------------------'
-
-         mbathy(:,:) = MAX( 0, mbathy(:,:) )
-
-         !  Boundary condition on mbathy
-         IF( .NOT.lk_mpp ) THEN 
-            
-	    !!bug ???  y reflechir!
-            !   ... mono- or macro-tasking: T-point, >0, 2D array, no slab
-            
-	    zbathy(:,:) = FLOAT( mbathy(:,:) )
-            CALL lbc_lnk( zbathy, 'T', 1. )
-            mbathy(:,:) = INT( zbathy(:,:) )
-         ENDIF
-
-      ENDIF
+
+         ENDIF
 
       ENDIF
