Index: NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/ISF/isfcpl.F90
===================================================================
--- NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/ISF/isfcpl.F90	(revision 12343)
+++ NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/ISF/isfcpl.F90	(revision 12353)
@@ -177,20 +177,18 @@
          !
          zdssmask(:,:) = ssmask(:,:) - zssmask0(:,:)
-         DO jj = 2,jpj-1
-            DO ji = 2,jpi-1
-               jip1=ji+1; jim1=ji-1;
-               jjp1=jj+1; jjm1=jj-1;
-               !
-               zsummsk = zssmask0(jip1,jj) + zssmask0(jim1,jj) + zssmask0(ji,jjp1) + zssmask0(ji,jjm1)
-               !
-               IF (zdssmask(ji,jj) == 1._wp .AND. zsummsk /= 0._wp) THEN
-                  ssh(ji,jj,Kmm)=( zssh(jip1,jj)*zssmask0(jip1,jj)     &
-                  &           + zssh(jim1,jj)*zssmask0(jim1,jj)     &
-                  &           + zssh(ji,jjp1)*zssmask0(ji,jjp1)     &
-                  &           + zssh(ji,jjm1)*zssmask0(ji,jjm1)) / zsummsk
-                  zssmask_b(ji,jj) = 1._wp
-               ENDIF
-            END DO
-         END DO
+         DO_2D_00_00
+            jip1=ji+1; jim1=ji-1;
+            jjp1=jj+1; jjm1=jj-1;
+            !
+            zsummsk = zssmask0(jip1,jj) + zssmask0(jim1,jj) + zssmask0(ji,jjp1) + zssmask0(ji,jjm1)
+            !
+            IF (zdssmask(ji,jj) == 1._wp .AND. zsummsk /= 0._wp) THEN
+               ssh(ji,jj,Kmm)=( zssh(jip1,jj)*zssmask0(jip1,jj)     &
+               &           + zssh(jim1,jj)*zssmask0(jim1,jj)     &
+               &           + zssh(ji,jjp1)*zssmask0(ji,jjp1)     &
+               &           + zssh(ji,jjm1)*zssmask0(ji,jjm1)) / zsummsk
+               zssmask_b(ji,jj) = 1._wp
+            ENDIF
+         END_2D
          !
          zssh(:,:) = ssh(:,:,Kmm)
@@ -300,50 +298,48 @@
             zdmask(:,:) = tmask(:,:,jk) - ztmask0(:,:,jk);
             !
-            DO jj = 2,jpj-1
-               DO ji = 2,jpi-1
-                  jip1=ji+1; jim1=ji-1;
-                  jjp1=jj+1; jjm1=jj-1;
+            DO_2D_00_00
+               jip1=ji+1; jim1=ji-1;
+               jjp1=jj+1; jjm1=jj-1;
+               !
+               ! check if a wet neigbourg cell is present
+               zsummsk = ztmask0(jip1,jj  ,jk) + ztmask0(jim1,jj  ,jk) &
+                       + ztmask0(ji  ,jjp1,jk) + ztmask0(ji  ,jjm1,jk)
+               !
+               ! if neigbourg wet cell available at the same level
+               IF ( zdmask(ji,jj) == 1._wp  .AND. zsummsk /= 0._wp ) THEN
+                  !
+                  ! horizontal basic extrapolation
+                  ts(ji,jj,jk,1,Kmm)=( zts0(jip1,jj  ,jk,1) * ztmask0(jip1,jj  ,jk) &
+                  &               + zts0(jim1,jj  ,jk,1) * ztmask0(jim1,jj  ,jk) &
+                  &               + zts0(ji  ,jjp1,jk,1) * ztmask0(ji  ,jjp1,jk) &
+                  &               + zts0(ji  ,jjm1,jk,1) * ztmask0(ji  ,jjm1,jk) ) / zsummsk
+                  ts(ji,jj,jk,2,Kmm)=( zts0(jip1,jj  ,jk,2) * ztmask0(jip1,jj  ,jk) &
+                  &               + zts0(jim1,jj  ,jk,2) * ztmask0(jim1,jj  ,jk) &
+                  &               + zts0(ji  ,jjp1,jk,2) * ztmask0(ji  ,jjp1,jk) &
+                  &               + zts0(ji  ,jjm1,jk,2) * ztmask0(ji  ,jjm1,jk) ) / zsummsk
+                  !
+                  ! update mask for next pass
+                  ztmask1(ji,jj,jk)=1
+                  !
+               ! in case no neigbourg wet cell available at the same level
+               ! check if a wet cell is available below
+               ELSEIF (zdmask(ji,jj) == 1._wp .AND. zsummsk == 0._wp) THEN
+                  !
+                  ! vertical extrapolation if horizontal extrapolation failed
+                  jkm1=max(1,jk-1) ; jkp1=min(jpk,jk+1)
                   !
                   ! check if a wet neigbourg cell is present
-                  zsummsk = ztmask0(jip1,jj  ,jk) + ztmask0(jim1,jj  ,jk) &
-                          + ztmask0(ji  ,jjp1,jk) + ztmask0(ji  ,jjm1,jk)
-                  !
-                  ! if neigbourg wet cell available at the same level
-                  IF ( zdmask(ji,jj) == 1._wp  .AND. zsummsk /= 0._wp ) THEN
-                     !
-                     ! horizontal basic extrapolation
-                     ts(ji,jj,jk,1,Kmm)=( zts0(jip1,jj  ,jk,1) * ztmask0(jip1,jj  ,jk) &
-                     &               + zts0(jim1,jj  ,jk,1) * ztmask0(jim1,jj  ,jk) &
-                     &               + zts0(ji  ,jjp1,jk,1) * ztmask0(ji  ,jjp1,jk) &
-                     &               + zts0(ji  ,jjm1,jk,1) * ztmask0(ji  ,jjm1,jk) ) / zsummsk
-                     ts(ji,jj,jk,2,Kmm)=( zts0(jip1,jj  ,jk,2) * ztmask0(jip1,jj  ,jk) &
-                     &               + zts0(jim1,jj  ,jk,2) * ztmask0(jim1,jj  ,jk) &
-                     &               + zts0(ji  ,jjp1,jk,2) * ztmask0(ji  ,jjp1,jk) &
-                     &               + zts0(ji  ,jjm1,jk,2) * ztmask0(ji  ,jjm1,jk) ) / zsummsk
+                  zsummsk = ztmask0(ji,jj,jkm1) + ztmask0(ji,jj,jkp1)
+                  IF (zdmask(ji,jj) == 1._wp .AND. zsummsk /= 0._wp ) THEN
+                     ts(ji,jj,jk,1,Kmm)=( zts0(ji,jj,jkp1,1)*ztmask0(ji,jj,jkp1)     &
+                     &               + zts0(ji,jj,jkm1,1)*ztmask0(ji,jj,jkm1)) / zsummsk
+                     ts(ji,jj,jk,2,Kmm)=( zts0(ji,jj,jkp1,2)*ztmask0(ji,jj,jkp1)     &
+                     &               + zts0(ji,jj,jkm1,2)*ztmask0(ji,jj,jkm1)) / zsummsk
                      !
                      ! update mask for next pass
-                     ztmask1(ji,jj,jk)=1
-                     !
-                  ! in case no neigbourg wet cell available at the same level
-                  ! check if a wet cell is available below
-                  ELSEIF (zdmask(ji,jj) == 1._wp .AND. zsummsk == 0._wp) THEN
-                     !
-                     ! vertical extrapolation if horizontal extrapolation failed
-                     jkm1=max(1,jk-1) ; jkp1=min(jpk,jk+1)
-                     !
-                     ! check if a wet neigbourg cell is present
-                     zsummsk = ztmask0(ji,jj,jkm1) + ztmask0(ji,jj,jkp1)
-                     IF (zdmask(ji,jj) == 1._wp .AND. zsummsk /= 0._wp ) THEN
-                        ts(ji,jj,jk,1,Kmm)=( zts0(ji,jj,jkp1,1)*ztmask0(ji,jj,jkp1)     &
-                        &               + zts0(ji,jj,jkm1,1)*ztmask0(ji,jj,jkm1)) / zsummsk
-                        ts(ji,jj,jk,2,Kmm)=( zts0(ji,jj,jkp1,2)*ztmask0(ji,jj,jkp1)     &
-                        &               + zts0(ji,jj,jkm1,2)*ztmask0(ji,jj,jkm1)) / zsummsk
-                        !
-                        ! update mask for next pass
-                        ztmask1(ji,jj,jk)=1._wp
-                     END IF
+                     ztmask1(ji,jj,jk)=1._wp
                   END IF
-               END DO
-            END DO
+               END IF
+            END_2D
          END DO
          !
