Index: NEMO/trunk/src/OCE/BDY/bdyini.F90
===================================================================
--- NEMO/trunk/src/OCE/BDY/bdyini.F90	(revision 13538)
+++ NEMO/trunk/src/OCE/BDY/bdyini.F90	(revision 13541)
@@ -786,5 +786,5 @@
                   ii = idx_bdy(ib_bdy)%nbi(ib,igrd)
                   ij = idx_bdy(ib_bdy)%nbj(ib,igrd)
-                  IF(  mig(ii) > 2 .AND. mig(ii) < jpiglo-2 .AND. mjg(ij) > 2 .AND. mjg(ij) < jpjglo-2  ) THEN
+                  IF(  mig0(ii) > 2 .AND. mig0(ii) < Ni0glo-2 .AND. mjg0(ij) > 2 .AND. mjg0(ij) < Nj0glo-2  ) THEN
                      WRITE(ctmp1,*) ' Orlanski is not safe when the open boundaries are on the interior of the computational domain'
                      CALL ctl_stop( ctmp1 )
@@ -1071,5 +1071,5 @@
    SUBROUTINE bdy_read_seg( kb_bdy, knblendta ) 
       !!----------------------------------------------------------------------
-      !!                 ***  ROUTINE bdy_coords_seg  ***
+      !!                 ***  ROUTINE bdy_read_seg  ***
       !!
       !! ** Purpose :  build bdy coordinates with segments defined in namelist
@@ -1113,11 +1113,11 @@
             nbdyind  = Nj0glo - 2  ! set boundary to whole side of model domain.
             nbdybeg  = 2
-            nbdyend  = Ni0glo -1
+            nbdyend  = Ni0glo - 1
          ENDIF
          nbdysegn = nbdysegn + 1
          npckgn(nbdysegn) = kb_bdy ! Save bdy package number
-         jpjnob(nbdysegn) = nbdyind + nn_hls
-         jpindt(nbdysegn) = nbdybeg + nn_hls
-         jpinft(nbdysegn) = nbdyend + nn_hls
+         jpjnob(nbdysegn) = nbdyind 
+         jpindt(nbdysegn) = nbdybeg
+         jpinft(nbdysegn) = nbdyend
          !
       CASE( 'S' )
@@ -1129,7 +1129,7 @@
          nbdysegs = nbdysegs + 1
          npckgs(nbdysegs) = kb_bdy ! Save bdy package number
-         jpjsob(nbdysegs) = nbdyind + nn_hls
-         jpisdt(nbdysegs) = nbdybeg + nn_hls
-         jpisft(nbdysegs) = nbdyend + nn_hls
+         jpjsob(nbdysegs) = nbdyind
+         jpisdt(nbdysegs) = nbdybeg
+         jpisft(nbdysegs) = nbdyend
          !
       CASE( 'E' )
@@ -1141,7 +1141,7 @@
          nbdysege = nbdysege + 1 
          npckge(nbdysege) = kb_bdy ! Save bdy package number
-         jpieob(nbdysege) = nbdyind + nn_hls
-         jpjedt(nbdysege) = nbdybeg + nn_hls
-         jpjeft(nbdysege) = nbdyend + nn_hls
+         jpieob(nbdysege) = nbdyind
+         jpjedt(nbdysege) = nbdybeg
+         jpjeft(nbdysege) = nbdyend
          !
       CASE( 'W' )
@@ -1153,7 +1153,7 @@
          nbdysegw = nbdysegw + 1
          npckgw(nbdysegw) = kb_bdy ! Save bdy package number
-         jpiwob(nbdysegw) = nbdyind + nn_hls
-         jpjwdt(nbdysegw) = nbdybeg + nn_hls
-         jpjwft(nbdysegw) = nbdyend + nn_hls
+         jpiwob(nbdysegw) = nbdyind
+         jpjwdt(nbdysegw) = nbdybeg
+         jpjwft(nbdysegw) = nbdyend
          !
       CASE DEFAULT   ;   CALL ctl_stop( 'ctypebdy must be N, S, E or W' )
@@ -1197,36 +1197,36 @@
       DO ib = 1, nbdysegn
          IF (lwp) WRITE(numout,*) '**check north seg bounds pckg: ', npckgn(ib)
-         IF ((jpjnob(ib).ge.jpjglo-1).or.& 
+         IF ((jpjnob(ib).ge.Nj0glo-1).or.& 
             &(jpjnob(ib).le.1))        CALL ctl_stop( 'nbdyind out of domain' )
          IF (jpindt(ib).ge.jpinft(ib)) CALL ctl_stop( 'Bdy start index is greater than end index' )
          IF (jpindt(ib).lt.1     )     CALL ctl_stop( 'Start index out of domain' )
-         IF (jpinft(ib).gt.jpiglo)     CALL ctl_stop( 'End index out of domain' )
+         IF (jpinft(ib).gt.Ni0glo)     CALL ctl_stop( 'End index out of domain' )
       END DO
       !
       DO ib = 1, nbdysegs
          IF (lwp) WRITE(numout,*) '**check south seg bounds pckg: ', npckgs(ib)
-         IF ((jpjsob(ib).ge.jpjglo-1).or.& 
+         IF ((jpjsob(ib).ge.Nj0glo-1).or.& 
             &(jpjsob(ib).le.1))        CALL ctl_stop( 'nbdyind out of domain' )
          IF (jpisdt(ib).ge.jpisft(ib)) CALL ctl_stop( 'Bdy start index is greater than end index' )
          IF (jpisdt(ib).lt.1     )     CALL ctl_stop( 'Start index out of domain' )
-         IF (jpisft(ib).gt.jpiglo)     CALL ctl_stop( 'End index out of domain' )
+         IF (jpisft(ib).gt.Ni0glo)     CALL ctl_stop( 'End index out of domain' )
       END DO
       !
       DO ib = 1, nbdysege
          IF (lwp) WRITE(numout,*) '**check east  seg bounds pckg: ', npckge(ib)
-         IF ((jpieob(ib).ge.jpiglo-1).or.& 
+         IF ((jpieob(ib).ge.Ni0glo-1).or.& 
             &(jpieob(ib).le.1))        CALL ctl_stop( 'nbdyind out of domain' )
          IF (jpjedt(ib).ge.jpjeft(ib)) CALL ctl_stop( 'Bdy start index is greater than end index' )
          IF (jpjedt(ib).lt.1     )     CALL ctl_stop( 'Start index out of domain' )
-         IF (jpjeft(ib).gt.jpjglo)     CALL ctl_stop( 'End index out of domain' )
+         IF (jpjeft(ib).gt.Nj0glo)     CALL ctl_stop( 'End index out of domain' )
       END DO
       !
       DO ib = 1, nbdysegw
          IF (lwp) WRITE(numout,*) '**check west  seg bounds pckg: ', npckgw(ib)
-         IF ((jpiwob(ib).ge.jpiglo-1).or.& 
+         IF ((jpiwob(ib).ge.Ni0glo-1).or.& 
             &(jpiwob(ib).le.1))        CALL ctl_stop( 'nbdyind out of domain' )
          IF (jpjwdt(ib).ge.jpjwft(ib)) CALL ctl_stop( 'Bdy start index is greater than end index' )
          IF (jpjwdt(ib).lt.1     )     CALL ctl_stop( 'Start index out of domain' )
-         IF (jpjwft(ib).gt.jpjglo)     CALL ctl_stop( 'End index out of domain' )
+         IF (jpjwft(ib).gt.Nj0glo)     CALL ctl_stop( 'End index out of domain' )
       ENDDO
       !      
@@ -1378,6 +1378,6 @@
          DO ji = 1, jpi
             DO jj = 1, jpj             
-              IF( mig(ji) == jpiwob(ib) .AND. mjg(jj) == jpjwdt(ib) )   ztestmask(1) = tmask(ji,jj,1)
-              IF( mig(ji) == jpiwob(ib) .AND. mjg(jj) == jpjwft(ib) )   ztestmask(2) = tmask(ji,jj,1)  
+              IF( mig0(ji) == jpiwob(ib) .AND. mjg0(jj) == jpjwdt(ib) )   ztestmask(1) = tmask(ji,jj,1)
+              IF( mig0(ji) == jpiwob(ib) .AND. mjg0(jj) == jpjwft(ib) )   ztestmask(2) = tmask(ji,jj,1)  
             END DO
          END DO
@@ -1414,6 +1414,6 @@
          DO ji = 1, jpi
             DO jj = 1, jpj             
-              IF( mig(ji) == jpieob(ib)+1 .AND. mjg(jj) == jpjedt(ib) )   ztestmask(1) = tmask(ji,jj,1)
-              IF( mig(ji) == jpieob(ib)+1 .AND. mjg(jj) == jpjeft(ib) )   ztestmask(2) = tmask(ji,jj,1)  
+              IF( mig0(ji) == jpieob(ib)+1 .AND. mjg0(jj) == jpjedt(ib) )   ztestmask(1) = tmask(ji,jj,1)
+              IF( mig0(ji) == jpieob(ib)+1 .AND. mjg0(jj) == jpjeft(ib) )   ztestmask(2) = tmask(ji,jj,1)  
             END DO
          END DO
@@ -1450,6 +1450,6 @@
          DO ji = 1, jpi
             DO jj = 1, jpj             
-              IF( mjg(jj) == jpjsob(ib) .AND. mig(ji) == jpisdt(ib) )   ztestmask(1) = tmask(ji,jj,1)
-              IF( mjg(jj) == jpjsob(ib) .AND. mig(ji) == jpisft(ib) )   ztestmask(2) = tmask(ji,jj,1)  
+              IF( mjg0(jj) == jpjsob(ib) .AND. mig0(ji) == jpisdt(ib) )   ztestmask(1) = tmask(ji,jj,1)
+              IF( mjg0(jj) == jpjsob(ib) .AND. mig0(ji) == jpisft(ib) )   ztestmask(2) = tmask(ji,jj,1)  
             END DO
          END DO
@@ -1472,6 +1472,6 @@
          DO ji = 1, jpi
             DO jj = 1, jpj             
-               IF( mjg(jj) == jpjnob(ib)+1 .AND. mig(ji) == jpindt(ib) )   ztestmask(1) = tmask(ji,jj,1)
-               IF( mjg(jj) == jpjnob(ib)+1 .AND. mig(ji) == jpinft(ib) )   ztestmask(2) = tmask(ji,jj,1)  
+               IF( mjg0(jj) == jpjnob(ib)+1 .AND. mig0(ji) == jpindt(ib) )   ztestmask(1) = tmask(ji,jj,1)
+               IF( mjg0(jj) == jpjnob(ib)+1 .AND. mig0(ji) == jpinft(ib) )   ztestmask(2) = tmask(ji,jj,1)  
             END DO
          END DO
@@ -1526,6 +1526,6 @@
             DO ij = jpjedt(iseg), jpjeft(iseg)
                icount = icount + 1
-               nbidta(icount, igrd, ib_bdy) = jpieob(iseg) + 2 - ir
-               nbjdta(icount, igrd, ib_bdy) = ij
+               nbidta(icount, igrd, ib_bdy) = jpieob(iseg) + 2 - ir + nn_hls
+               nbjdta(icount, igrd, ib_bdy) = ij + nn_hls
                nbrdta(icount, igrd, ib_bdy) = ir
             ENDDO
@@ -1538,6 +1538,6 @@
             DO ij = jpjedt(iseg), jpjeft(iseg)
                icount = icount + 1
-               nbidta(icount, igrd, ib_bdy) = jpieob(iseg) + 1 - ir
-               nbjdta(icount, igrd, ib_bdy) = ij
+               nbidta(icount, igrd, ib_bdy) = jpieob(iseg) + 1 - ir + nn_hls
+               nbjdta(icount, igrd, ib_bdy) = ij + nn_hls
                nbrdta(icount, igrd, ib_bdy) = ir
             ENDDO
@@ -1551,6 +1551,6 @@
             DO ij = jpjedt(iseg), jpjeft(iseg)
                icount = icount + 1
-               nbidta(icount, igrd, ib_bdy) = jpieob(iseg) + 2 - ir
-               nbjdta(icount, igrd, ib_bdy) = ij
+               nbidta(icount, igrd, ib_bdy) = jpieob(iseg) + 2 - ir + nn_hls
+               nbjdta(icount, igrd, ib_bdy) = ij + nn_hls
                nbrdta(icount, igrd, ib_bdy) = ir
             ENDDO
@@ -1571,6 +1571,6 @@
             DO ij = jpjwdt(iseg), jpjwft(iseg)
                icount = icount + 1
-               nbidta(icount, igrd, ib_bdy) = jpiwob(iseg) + ir - 1
-               nbjdta(icount, igrd, ib_bdy) = ij
+               nbidta(icount, igrd, ib_bdy) = jpiwob(iseg) + ir - 1 + nn_hls
+               nbjdta(icount, igrd, ib_bdy) = ij + nn_hls
                nbrdta(icount, igrd, ib_bdy) = ir
             ENDDO
@@ -1583,6 +1583,6 @@
             DO ij = jpjwdt(iseg), jpjwft(iseg)
                icount = icount + 1
-               nbidta(icount, igrd, ib_bdy) = jpiwob(iseg) + ir - 1
-               nbjdta(icount, igrd, ib_bdy) = ij
+               nbidta(icount, igrd, ib_bdy) = jpiwob(iseg) + ir - 1 + nn_hls
+               nbjdta(icount, igrd, ib_bdy) = ij + nn_hls
                nbrdta(icount, igrd, ib_bdy) = ir
             ENDDO
@@ -1596,6 +1596,6 @@
             DO ij = jpjwdt(iseg), jpjwft(iseg)
                icount = icount + 1
-               nbidta(icount, igrd, ib_bdy) = jpiwob(iseg) + ir - 1
-               nbjdta(icount, igrd, ib_bdy) = ij
+               nbidta(icount, igrd, ib_bdy) = jpiwob(iseg) + ir - 1 + nn_hls
+               nbjdta(icount, igrd, ib_bdy) = ij + nn_hls
                nbrdta(icount, igrd, ib_bdy) = ir
             ENDDO
@@ -1616,6 +1616,6 @@
             DO ii = jpindt(iseg), jpinft(iseg)
                icount = icount + 1
-               nbidta(icount, igrd, ib_bdy) = ii
-               nbjdta(icount, igrd, ib_bdy) = jpjnob(iseg) + 2 - ir 
+               nbidta(icount, igrd, ib_bdy) = ii + nn_hls
+               nbjdta(icount, igrd, ib_bdy) = jpjnob(iseg) + 2 - ir + nn_hls 
                nbrdta(icount, igrd, ib_bdy) = ir
             ENDDO
@@ -1629,6 +1629,6 @@
             DO ii = jpindt(iseg), jpinft(iseg)
                icount = icount + 1
-               nbidta(icount, igrd, ib_bdy) = ii
-               nbjdta(icount, igrd, ib_bdy) = jpjnob(iseg) + 2 - ir
+               nbidta(icount, igrd, ib_bdy) = ii + nn_hls
+               nbjdta(icount, igrd, ib_bdy) = jpjnob(iseg) + 2 - ir + nn_hls
                nbrdta(icount, igrd, ib_bdy) = ir
             ENDDO
@@ -1643,6 +1643,6 @@
             DO ii = jpindt(iseg), jpinft(iseg)
                icount = icount + 1
-               nbidta(icount, igrd, ib_bdy) = ii
-               nbjdta(icount, igrd, ib_bdy) = jpjnob(iseg) + 1 - ir
+               nbidta(icount, igrd, ib_bdy) = ii + nn_hls
+               nbjdta(icount, igrd, ib_bdy) = jpjnob(iseg) + 1 - ir + nn_hls
                nbrdta(icount, igrd, ib_bdy) = ir
             ENDDO
@@ -1661,6 +1661,6 @@
             DO ii = jpisdt(iseg), jpisft(iseg)
                icount = icount + 1
-               nbidta(icount, igrd, ib_bdy) = ii
-               nbjdta(icount, igrd, ib_bdy) = jpjsob(iseg) + ir - 1
+               nbidta(icount, igrd, ib_bdy) = ii + nn_hls
+               nbjdta(icount, igrd, ib_bdy) = jpjsob(iseg) + ir - 1 + nn_hls
                nbrdta(icount, igrd, ib_bdy) = ir
             ENDDO
@@ -1674,6 +1674,6 @@
             DO ii = jpisdt(iseg), jpisft(iseg)
                icount = icount + 1
-               nbidta(icount, igrd, ib_bdy) = ii
-               nbjdta(icount, igrd, ib_bdy) = jpjsob(iseg) + ir - 1
+               nbidta(icount, igrd, ib_bdy) = ii + nn_hls
+               nbjdta(icount, igrd, ib_bdy) = jpjsob(iseg) + ir - 1 + nn_hls
                nbrdta(icount, igrd, ib_bdy) = ir
             ENDDO
@@ -1688,6 +1688,6 @@
             DO ii = jpisdt(iseg), jpisft(iseg)
                icount = icount + 1
-               nbidta(icount, igrd, ib_bdy) = ii
-               nbjdta(icount, igrd, ib_bdy) = jpjsob(iseg) + ir - 1
+               nbidta(icount, igrd, ib_bdy) = ii + nn_hls
+               nbjdta(icount, igrd, ib_bdy) = jpjsob(iseg) + ir - 1 + nn_hls
                nbrdta(icount, igrd, ib_bdy) = ir
             ENDDO
