Index: branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/NST_SRC/agrif_lim3_update.F90
===================================================================
--- branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/NST_SRC/agrif_lim3_update.F90	(revision 7899)
+++ branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/NST_SRC/agrif_lim3_update.F90	(revision 7953)
@@ -31,12 +31,11 @@
    PRIVATE
 
-   PUBLIC agrif_update_lim3
+   PUBLIC   agrif_update_lim3   ! called by ????
 
    !!----------------------------------------------------------------------
-   !! NEMO/NST 3.6 , LOCEAN-IPSL (2016)
+   !! NEMO/NST 4.0 , LOCEAN-IPSL (2017)
    !! $Id: agrif_lim3_update.F90 6204 2016-01-04 13:47:06Z cetlod $
    !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
 
@@ -49,5 +48,4 @@
       !!----------------------------------------------------------------------
       INTEGER, INTENT(in) :: kt
-      !!
       !!----------------------------------------------------------------------
       !
@@ -57,5 +55,5 @@
                                                                                                                            ! i.e. update only at the parent time step
       Agrif_UseSpecialValueInUpdate = .TRUE.
-      Agrif_SpecialValueFineGrid = -9999.
+      Agrif_SpecialValueFineGrid    = -9999.
 # if defined TWO_WAY
       IF( MOD(nbcline,nbclineupdate) == 0) THEN ! update the whole basin at each nbclineupdate (=nn_cln_update) baroclinic parent time steps
@@ -75,7 +73,4 @@
 
 
-   !!------------------
-   !! Local subroutines
-   !!------------------
    SUBROUTINE update_tra_ice( ptab, i1, i2, j1, j2, k1, k2, before )
       !!-----------------------------------------------------------------------
@@ -84,7 +79,7 @@
       !!              the properties per mass on the coarse grid
       !!-----------------------------------------------------------------------
-      INTEGER , INTENT(in) :: i1, i2, j1, j2, k1, k2
-      REAL(wp), DIMENSION(i1:i2,j1:j2,k1:k2), INTENT(inout) :: ptab
-      LOGICAL , INTENT(in) :: before
+      INTEGER                               , INTENT(in   ) ::   i1, i2, j1, j2, k1, k2
+      REAL(wp), DIMENSION(i1:i2,j1:j2,k1:k2), INTENT(inout) ::   ptab
+      LOGICAL                               , INTENT(in   ) ::   before
       !!
       INTEGER  :: jk, jl, jm
@@ -94,36 +89,36 @@
          jm = 1
          DO jl = 1, jpl
-            ptab(:,:,jm) = a_i  (i1:i2,j1:j2,jl) ; jm = jm + 1
-            ptab(:,:,jm) = v_i  (i1:i2,j1:j2,jl) ; jm = jm + 1
-            ptab(:,:,jm) = v_s  (i1:i2,j1:j2,jl) ; jm = jm + 1
-            ptab(:,:,jm) = smv_i(i1:i2,j1:j2,jl) ; jm = jm + 1
-            ptab(:,:,jm) = oa_i (i1:i2,j1:j2,jl) ; jm = jm + 1
+            ptab(:,:,jm) = a_i  (i1:i2,j1:j2,jl)   ;   jm = jm + 1
+            ptab(:,:,jm) = v_i  (i1:i2,j1:j2,jl)   ;   jm = jm + 1
+            ptab(:,:,jm) = v_s  (i1:i2,j1:j2,jl)   ;   jm = jm + 1
+            ptab(:,:,jm) = smv_i(i1:i2,j1:j2,jl)   ;   jm = jm + 1
+            ptab(:,:,jm) = oa_i (i1:i2,j1:j2,jl)   ;   jm = jm + 1
             DO jk = 1, nlay_s
-               ptab(:,:,jm) = e_s(i1:i2,j1:j2,jk,jl) ; jm = jm + 1
-            ENDDO
+               ptab(:,:,jm) = e_s(i1:i2,j1:j2,jk,jl)   ;   jm = jm + 1
+            END DO
             DO jk = 1, nlay_i
-               ptab(:,:,jm) = e_i(i1:i2,j1:j2,jk,jl) ; jm = jm + 1
-            ENDDO
-         ENDDO
+               ptab(:,:,jm) = e_i(i1:i2,j1:j2,jk,jl)   ;   jm = jm + 1
+            END DO
+         END DO
 
          DO jk = k1, k2
             WHERE( tmask(i1:i2,j1:j2,1) == 0. )  ptab(:,:,jk) = -9999.
-         ENDDO
-                  
+         END DO
+         !       
       ELSE
          jm = 1
          DO jl = 1, jpl
-            a_i  (i1:i2,j1:j2,jl) = ptab(:,:,jm) * tmask(i1:i2,j1:j2,1) ; jm = jm + 1
-            v_i  (i1:i2,j1:j2,jl) = ptab(:,:,jm) * tmask(i1:i2,j1:j2,1) ; jm = jm + 1
-            v_s  (i1:i2,j1:j2,jl) = ptab(:,:,jm) * tmask(i1:i2,j1:j2,1) ; jm = jm + 1
-            smv_i(i1:i2,j1:j2,jl) = ptab(:,:,jm) * tmask(i1:i2,j1:j2,1) ; jm = jm + 1
-            oa_i (i1:i2,j1:j2,jl) = ptab(:,:,jm) * tmask(i1:i2,j1:j2,1) ; jm = jm + 1
+            a_i  (i1:i2,j1:j2,jl) = ptab(:,:,jm) * tmask(i1:i2,j1:j2,1)   ;   jm = jm + 1
+            v_i  (i1:i2,j1:j2,jl) = ptab(:,:,jm) * tmask(i1:i2,j1:j2,1)   ;   jm = jm + 1
+            v_s  (i1:i2,j1:j2,jl) = ptab(:,:,jm) * tmask(i1:i2,j1:j2,1)   ;   jm = jm + 1
+            smv_i(i1:i2,j1:j2,jl) = ptab(:,:,jm) * tmask(i1:i2,j1:j2,1)   ;   jm = jm + 1
+            oa_i (i1:i2,j1:j2,jl) = ptab(:,:,jm) * tmask(i1:i2,j1:j2,1)   ;   jm = jm + 1
             DO jk = 1, nlay_s
-               e_s(i1:i2,j1:j2,jk,jl) = ptab(:,:,jm) * tmask(i1:i2,j1:j2,1) ; jm = jm + 1
+               e_s(i1:i2,j1:j2,jk,jl) = ptab(:,:,jm) * tmask(i1:i2,j1:j2,1)   ;   jm = jm + 1
             ENDDO
             DO jk = 1, nlay_i
-               e_i(i1:i2,j1:j2,jk,jl) = ptab(:,:,jm) * tmask(i1:i2,j1:j2,1) ; jm = jm + 1
-            ENDDO
-         ENDDO
+               e_i(i1:i2,j1:j2,jk,jl) = ptab(:,:,jm) * tmask(i1:i2,j1:j2,1)   ;   jm = jm + 1
+            END DO
+         END DO
 
          ! integrated values
@@ -144,9 +139,9 @@
       !! ** Method  : Update the fluxes and recover the properties (C-grid)
       !!-----------------------------------------------------------------------
-      INTEGER , INTENT(in) :: i1, i2, j1, j2
-      REAL(wp), DIMENSION(i1:i2,j1:j2), INTENT(inout) :: ptab
-      LOGICAL , INTENT(in) :: before
+      INTEGER                         , INTENT(in   ) ::   i1, i2, j1, j2
+      REAL(wp), DIMENSION(i1:i2,j1:j2), INTENT(inout) ::   ptab
+      LOGICAL                         , INTENT(in   ) ::   before
       !!
-      REAL(wp) :: zrhoy
+      REAL(wp) ::   zrhoy   ! local scalar
       !!-----------------------------------------------------------------------
       !
@@ -154,5 +149,5 @@
          zrhoy = Agrif_Rhoy()
          ptab(:,:) = e2u(i1:i2,j1:j2) * u_ice(i1:i2,j1:j2) * zrhoy
-         WHERE( umask(i1:i2,j1:j2,1) == 0. )  ptab(:,:) = -9999.
+         WHERE( umask(i1:i2,j1:j2,1) == 0. )   ptab(:,:) = -9999.
       ELSE
          u_ice(i1:i2,j1:j2) = ptab(:,:) / e2u(i1:i2,j1:j2) * umask(i1:i2,j1:j2,1)
@@ -167,9 +162,9 @@
       !! ** Method  : Update the fluxes and recover the properties (C-grid)
       !!-----------------------------------------------------------------------
-      INTEGER , INTENT(in) :: i1,i2,j1,j2
-      REAL(wp), DIMENSION(i1:i2,j1:j2),  INTENT(inout) :: ptab
-      LOGICAL , INTENT(in) :: before
+      INTEGER                         , INTENT(in   ) ::   i1, i2, j1, j2
+      REAL(wp), DIMENSION(i1:i2,j1:j2), INTENT(inout) ::   ptab
+      LOGICAL                         , INTENT(in   ) ::   before
       !!
-      REAL(wp) :: zrhox
+      REAL(wp) ::   zrhox   ! local scalar
       !!-----------------------------------------------------------------------
       !
@@ -177,5 +172,5 @@
          zrhox = Agrif_Rhox()
          ptab(:,:) = e1v(i1:i2,j1:j2) * v_ice(i1:i2,j1:j2) * zrhox
-         WHERE( vmask(i1:i2,j1:j2,1) == 0. )  ptab(:,:) = -9999.
+         WHERE( vmask(i1:i2,j1:j2,1) == 0. )   ptab(:,:) = -9999.
       ELSE
          v_ice(i1:i2,j1:j2) = ptab(:,:) / e1v(i1:i2,j1:j2) * vmask(i1:i2,j1:j2,1)
@@ -185,11 +180,13 @@
 
 #else
+   !!----------------------------------------------------------------------
+   !!   Empty module                                             no sea-ice
+   !!----------------------------------------------------------------------
 CONTAINS
    SUBROUTINE agrif_lim3_update_empty
-      !!---------------------------------------------
-      !!   *** ROUTINE agrif_lim3_update_empty ***
-      !!---------------------------------------------
       WRITE(*,*)  'agrif_lim3_update : You should not have seen this print! error?'
    END SUBROUTINE agrif_lim3_update_empty
 #endif
+
+   !!======================================================================
 END MODULE agrif_lim3_update
