Index: NEMO/releases/r4.0/r4.0-HEAD/src/NST/agrif_oce_interp.F90
===================================================================
--- NEMO/releases/r4.0/r4.0-HEAD/src/NST/agrif_oce_interp.F90	(revision 12578)
+++ NEMO/releases/r4.0/r4.0-HEAD/src/NST/agrif_oce_interp.F90	(revision 12737)
@@ -96,11 +96,11 @@
       i1 =  1   ;   i2 = nlci
       j1 =  1   ;   j2 = nlcj
-      IF( nbondj == -1 .OR. nbondj == 2 )   j1 = 2 + nbghostcells
-      IF( nbondj == +1 .OR. nbondj == 2 )   j2 = nlcj - nbghostcells - 1
-      IF( nbondi == -1 .OR. nbondi == 2 )   i1 = 2 + nbghostcells 
-      IF( nbondi == +1 .OR. nbondi == 2 )   i2 = nlci - nbghostcells - 1
+      IF( l_Northedge )   j1 = 2 + nbghostcells
+      IF( l_Southedge )   j2 = nlcj - nbghostcells - 1
+      IF( l_Westedge )    i1 = 2 + nbghostcells 
+      IF( l_Eastedge )    i2 = nlci - nbghostcells - 1
 
       ! --- West --- !
-      IF( nbondi == -1 .OR. nbondi == 2 ) THEN
+      IF( l_Westedge ) THEN
          ibdy1 = 2
          ibdy2 = 1+nbghostcells 
@@ -173,5 +173,5 @@
 
       ! --- East --- !
-      IF( nbondi ==  1 .OR. nbondi == 2 ) THEN
+      IF( l_Eastedge ) THEN
          ibdy1 = nlci-1-nbghostcells
          ibdy2 = nlci-2 
@@ -246,5 +246,5 @@
 
       ! --- South --- !
-      IF( nbondj == -1 .OR. nbondj == 2 ) THEN
+      IF ( l_Southedge ) THEN
          jbdy1 = 2
          jbdy2 = 1+nbghostcells 
@@ -318,5 +318,5 @@
 
       ! --- North --- !
-      IF( nbondj ==  1 .OR. nbondj == 2 ) THEN
+      IF( l_Northedge ) THEN
          jbdy1 = nlcj-1-nbghostcells
          jbdy2 = nlcj-2 
@@ -405,5 +405,5 @@
       IF( Agrif_Root() )   RETURN
       !
-      IF((nbondi == -1).OR.(nbondi == 2)) THEN
+      IF( l_Westedge ) THEN
          DO jj=1,jpj
             va_e(2:nbghostcells+1,jj) = vbdy_w(1:nbghostcells,jj) * hvr_e(2:nbghostcells+1,jj)
@@ -416,5 +416,5 @@
       ENDIF
       !
-      IF((nbondi == 1).OR.(nbondi == 2)) THEN
+      IF( l_Eastedge ) THEN
          DO jj=1,jpj
             va_e(nlci-nbghostcells:nlci-1,jj)   = vbdy_e(1:nbghostcells,jj) * hvr_e(nlci-nbghostcells:nlci-1,jj)
@@ -427,5 +427,5 @@
       ENDIF
       !
-      IF((nbondj == -1).OR.(nbondj == 2)) THEN
+      IF ( l_Southedge ) THEN
          DO ji=1,jpi
             ua_e(ji,2:nbghostcells+1) = ubdy_s(ji,1:nbghostcells) * hur_e(ji,2:nbghostcells+1)
@@ -438,5 +438,5 @@
       ENDIF
       !
-      IF((nbondj == 1).OR.(nbondj == 2)) THEN
+      IF ( l_Northedge ) THEN
          DO ji=1,jpi
             ua_e(ji,nlcj-nbghostcells:nlcj-1)   = ubdy_n(ji,1:nbghostcells) * hur_e(ji,nlcj-nbghostcells:nlcj-1)
@@ -516,5 +516,5 @@
       !
       ! --- West --- !
-      IF((nbondi == -1).OR.(nbondi == 2)) THEN
+      IF( l_Westedge ) THEN
          indx = 1+nbghostcells
          DO jj = 1, jpj
@@ -526,5 +526,5 @@
       !
       ! --- East --- !
-      IF((nbondi == 1).OR.(nbondi == 2)) THEN
+      IF( l_Eastedge ) THEN
          indx = nlci-nbghostcells
          DO jj = 1, jpj
@@ -536,5 +536,5 @@
       !
       ! --- South --- !
-      IF((nbondj == -1).OR.(nbondj == 2)) THEN
+      IF ( l_Southedge ) THEN
          indy = 1+nbghostcells
          DO jj = 2, indy
@@ -546,5 +546,5 @@
       !
       ! --- North --- !
-      IF((nbondj == 1).OR.(nbondj == 2)) THEN
+      IF ( l_Northedge ) THEN
          indy = nlcj-nbghostcells
          DO jj = indy, nlcj-1
@@ -571,5 +571,5 @@
       !
       ! --- West --- !
-      IF((nbondi == -1).OR.(nbondi == 2)) THEN
+      IF( l_Westedge ) THEN
          indx = 1+nbghostcells
          DO jj = 1, jpj
@@ -581,5 +581,5 @@
       !
       ! --- East --- !
-      IF((nbondi == 1).OR.(nbondi == 2)) THEN
+      IF( l_Eastedge ) THEN
          indx = nlci-nbghostcells
          DO jj = 1, jpj
@@ -591,5 +591,5 @@
       !
       ! --- South --- !
-      IF((nbondj == -1).OR.(nbondj == 2)) THEN
+      IF( l_Southedge ) THEN
          indy = 1+nbghostcells
          DO jj = 2, indy
@@ -601,5 +601,5 @@
       !
       ! --- North --- !
-      IF((nbondj == 1).OR.(nbondj == 2)) THEN
+      IF( l_Northedge ) THEN
          indy = nlcj-nbghostcells
          DO jj = indy, nlcj-1
@@ -722,8 +722,8 @@
             ! 
             ! Remove CORNERS
-            IF((nbondj == -1).OR.(nbondj == 2)) jmin = 2 + nbghostcells
-            IF((nbondj == +1).OR.(nbondj == 2)) jmax = nlcj - nbghostcells - 1
-            IF((nbondi == -1).OR.(nbondi == 2)) imin = 2 + nbghostcells
-            IF((nbondi == +1).OR.(nbondi == 2)) imax = nlci - nbghostcells - 1      
+            IF( l_Southedge ) jmin = 2 + nbghostcells
+            IF( l_Northedge ) jmax = nlcj - nbghostcells - 1
+            IF( l_Westedge )  imin = 2 + nbghostcells
+            IF( l_Eastedge )  imax = nlci - nbghostcells - 1      
             !
             IF( eastern_side ) THEN
