Index: trunk/NEMO/OPA_SRC/DOM/domcfg.F90
===================================================================
--- trunk/NEMO/OPA_SRC/DOM/domcfg.F90	(revision 3)
+++ trunk/NEMO/OPA_SRC/DOM/domcfg.F90	(revision 65)
@@ -100,5 +100,5 @@
       ! ============
 
-      ! local domain indices ==> global domain indices
+      ! local domain indices ==> data domain indices
       DO ji = 1, jpi
         mig(ji) = ji + jpizoom - 1 + nimpp - 1
@@ -108,18 +108,19 @@
       END DO
 
-      ! global domain indices ==> local domain indices
-      ! (return (m.0,m.1)=(1,0) if global domain gridpoint is not in the local domain)
-      DO ji = 1, jpiglo
-        mi0(ji) = MAX( 1, MIN( ji - jpizoom + 1 - nimpp + 1, jpi   ) )
-        mi1(ji) = MAX( 0, MIN( ji - jpizoom + 1 - nimpp + 1, jpim1 ) )
-      END DO
-      DO jj = 1, jpjglo
-        mj0(jj) = MAX( 1, MIN( jj - jpjzoom + 1 - njmpp + 1, jpj   ) )
-        mj1(jj) = MAX( 0, MIN( jj - jpjzoom + 1 - njmpp + 1, jpjm1 ) )
-      END DO
-
-      IF(lwp) THEN
-         WRITE(numout,*)
-         WRITE(numout,*) 'dom_glo : domain: data / global or zoom / local'
+      ! data domain indices ==> local domain indices
+      ! (return (m.0,m.1)=(1,0) if data domain gridpoint is to the west/south of the 
+      ! local domain, or (m.0,m.1)=(jp.+1,jp.) to the east/north of local domain. 
+      DO ji = 1, jpidta
+        mi0(ji) = MAX( 1, MIN( ji - jpizoom + 1 - nimpp + 1, jpi+1 ) )
+        mi1(ji) = MAX( 0, MIN( ji - jpizoom + 1 - nimpp + 1, jpi   ) )
+      END DO
+      DO jj = 1, jpjdta
+        mj0(jj) = MAX( 1, MIN( jj - jpjzoom + 1 - njmpp + 1, jpj+1 ) )
+        mj1(jj) = MAX( 0, MIN( jj - jpjzoom + 1 - njmpp + 1, jpj   ) )
+      END DO
+
+      IF(lwp) THEN
+         WRITE(numout,*)
+         WRITE(numout,*) 'dom_glo : domain: data / local '
          WRITE(numout,*) '~~~~~~~ '
          WRITE(numout,*) '          data input domain    : jpidta = ', jpidta,   &
@@ -133,21 +134,21 @@
             &                                           ' jpjzoom = ', jpjzoom
          WRITE(numout,*)
-         WRITE(numout,*) '          conversion local  ==> global/zoom i-index domain'
+         WRITE(numout,*) '          conversion local  ==> data i-index domain'
          WRITE(numout,25)              (mig(ji),ji = 1,jpi)
          WRITE(numout,*)
-         WRITE(numout,*) '          conversion global/zoom ==> local  i-index domain'
+         WRITE(numout,*) '          conversion data   ==> local  i-index domain'
          WRITE(numout,*) '             starting index'
-         WRITE(numout,25)              (mi0(ji),ji = 1,jpiglo)
+         WRITE(numout,25)              (mi0(ji),ji = 1,jpidta)
          WRITE(numout,*) '             ending index'
-         WRITE(numout,25)              (mi1(ji),ji = 1,jpiglo)
-         WRITE(numout,*)
-         WRITE(numout,*) '          conversion local  ==> global/zoom i-index domain'
+         WRITE(numout,25)              (mi1(ji),ji = 1,jpidta)
+         WRITE(numout,*)
+         WRITE(numout,*) '          conversion local  ==> data i-index domain'
          WRITE(numout,25)              (mjg(jj),jj = 1,jpj)
          WRITE(numout,*)
-         WRITE(numout,*) '          conversion global/zoom ==> local  i-index domain'
+         WRITE(numout,*) '          conversion data  ==> local i-index domain'
          WRITE(numout,*) '             starting index'
-         WRITE(numout,25)              (mj0(jj),jj = 1,jpjglo)
+         WRITE(numout,25)              (mj0(jj),jj = 1,jpjdta)
          WRITE(numout,*) '             ending index'
-         WRITE(numout,25)              (mj1(jj),jj = 1,jpjglo)
+         WRITE(numout,25)              (mj1(jj),jj = 1,jpjdta)
       ENDIF
  25   FORMAT( 100(10x,19i4,/) )
@@ -157,6 +158,6 @@
 
       ! zoom control
-      IF( jpiglo - jpizoom + 1  >  jpidta .OR.   &
-          jpjglo - jpjzoom + 1  >  jpjdta      ) THEN
+      IF( jpiglo + jpizoom - 1  >  jpidta .OR.   &
+          jpjglo + jpjzoom - 1  >  jpjdta      ) THEN
          IF(lwp)WRITE(numout,cform_err)
          IF(lwp)WRITE(numout,*)' global or zoom domain exceed the data domain ! '
@@ -168,7 +169,7 @@
 
       ! set zoom type flags
-      IF( lzoom .AND. jpizoom /= 1 )   lzoom_e = .TRUE.                     ! 
+      IF( lzoom .AND. jpizoom /= 1 )   lzoom_w = .TRUE.                     ! 
       IF( lzoom .AND. jpjzoom /= 1 )   lzoom_s = .TRUE.
-      IF( lzoom .AND. jpiglo + jpizoom -1 /= jpidta )   lzoom_w = .TRUE.
+      IF( lzoom .AND. jpiglo + jpizoom -1 /= jpidta )   lzoom_e = .TRUE.
       IF( lzoom .AND. jpjglo + jpjzoom -1 /= jpjdta )   lzoom_n = .TRUE.
 
@@ -192,5 +193,5 @@
          nstop = nstop + 1
       ENDIF
-      IF(  lzoom  .AND.  l_isl  ) THEN
+      IF(  lzoom  .AND.  lk_isl  ) THEN
          IF(lwp)WRITE(numout,cform_err)
          IF(lwp)WRITE(numout,*)' key_islands and zoom are not allowed'
