Index: /branches/dev_r2586_dynamic_mem/NEMOGCM/NEMO/OFF_SRC/nemogcm.F90
===================================================================
--- /branches/dev_r2586_dynamic_mem/NEMOGCM/NEMO/OFF_SRC/nemogcm.F90	(revision 2651)
+++ /branches/dev_r2586_dynamic_mem/NEMOGCM/NEMO/OFF_SRC/nemogcm.F90	(revision 2652)
@@ -379,11 +379,10 @@
       !! ** Method  :
       !!----------------------------------------------------------------------
-      USE par_oce
       INTEGER, INTENT(in) :: num_pes ! The number of MPI processes we have
-      ! Local variables
+      !
       INTEGER, PARAMETER :: nfactmax = 20
       INTEGER :: nfact ! The no. of factors returned
       INTEGER :: ierr  ! Error flag
-      INTEGER :: i
+      INTEGER :: ji
       INTEGER :: idiff, mindiff, imin ! For choosing pair of factors that are closest in value
       INTEGER, DIMENSION(nfactmax) :: ifact ! Array of factors
@@ -403,10 +402,10 @@
          mindiff = 1000000
          imin    = 1
-         DO i=1,nfact-1,2
-            idiff = ABS(ifact(i) - ifact(i+1))
-            IF(idiff < mindiff)THEN
+         DO ji = 1, nfact-1, 2
+            idiff = ABS( ifact(ji) - ifact(ji+1) )
+            IF( idiff < mindiff ) THEN
                mindiff = idiff
-               imin = i
-            END IF
+               imin = ji
+            ENDIF
          END DO
          jpnj = ifact(imin)
@@ -419,64 +418,62 @@
    END SUBROUTINE nemo_partition
 
-
-   SUBROUTINE factorise( ifax, maxfax, nfax, n, ierr )
+   SUBROUTINE factorise( kfax, kmaxfax, knfax, kn, kerr )
       !!----------------------------------------------------------------------
       !!                     ***  ROUTINE factorise  ***
       !!
       !! ** Purpose :   return the prime factors of n.
-      !!                nfax factors are returned in array ifax which is of 
-      !!                maximum dimension maxfax.
+      !!                knfax factors are returned in array kfax which is of 
+      !!                maximum dimension kmaxfax.
       !! ** Method  :
       !!----------------------------------------------------------------------
-      INTEGER, INTENT(in)  :: n, maxfax
-      INTEGER, INTENT(Out) :: ierr, nfax
-      INTEGER, INTENT(out) :: ifax(maxfax)
-      ! Local variables.
-      INTEGER :: i, ifac, l, nu
+      INTEGER                    , INTENT(in   ) ::   kn, kmaxfax
+      INTEGER                    , INTENT(  out) ::   kerr, knfax
+      INTEGER, DIMENSION(kmaxfax), INTENT(  out) ::   kfax
+      !
+      INTEGER :: ifac, jl, inu
       INTEGER, PARAMETER :: ntest = 14
-      INTEGER :: lfax(ntest)
+      INTEGER :: ilfax(ntest)
 
       ! lfax contains the set of allowed factors.
-      data (lfax(i),i=1,ntest) / 16384, 8192, 4096, 2048, 1024, 512, 256,  &
-         &                         128,   64,   32,   16,    8,   4,   2  /
+      data (ilfax(jl),jl=1,ntest) / 16384, 8192, 4096, 2048, 1024, 512, 256,  &
+         &                            128,   64,   32,   16,    8,   4,   2  /
       !!----------------------------------------------------------------------
 
       ! Clear the error flag and initialise output vars
-      ierr = 0
-      ifax = 1
-      nfax = 0
+      kerr = 0
+      kfax = 1
+      knfax = 0
 
       ! Find the factors of n.
-      IF( n == 1 ) GOTO 20
+      IF( kn == 1 )   GOTO 20
 
       ! nu holds the unfactorised part of the number.
-      ! nfax holds the number of factors found.
+      ! knfax holds the number of factors found.
       ! l points to the allowed factor list.
       ! ifac holds the current factor.
 
-      nu   = n
-      nfax = 0
-
-      DO l = ntest, 1, -1
-         !
-         ifac = lfax(l)
-         IF(ifac > nu)CYCLE
+      inu   = kn
+      knfax = 0
+
+      DO jl = ntest, 1, -1
+         !
+         ifac = ilfax(jl)
+         IF( ifac > inu )   CYCLE
 
          ! Test whether the factor will divide.
 
-         IF( MOD(nu,ifac) == 0 ) THEN
+         IF( MOD(inu,ifac) == 0 ) THEN
             !
-            nfax = nfax+1            ! Add the factor to the list
-            IF( nfax > maxfax ) THEN
-               ierr = 6
-               write (*,*) 'FACTOR: insufficient space in factor array ',nfax
+            knfax = knfax + 1            ! Add the factor to the list
+            IF( knfax > kmaxfax ) THEN
+               kerr = 6
+               write (*,*) 'FACTOR: insufficient space in factor array ', knfax
                return
             ENDIF
-            ifax(nfax) = ifac
+            kfax(knfax) = ifac
             ! Store the other factor that goes with this one
-            nfax = nfax + 1
-            ifax(nfax) = nu / ifac
-            !WRITE (*,*) 'ARPDBG, factors ',nfax-1,' & ',nfax,' are ', &
-            !            ifax(nfax-1),' and ',ifax(nfax)
+            knfax = knfax + 1
+            kfax(knfax) = inu / ifac
+            !WRITE (*,*) 'ARPDBG, factors ',knfax-1,' & ',knfax,' are ', kfax(knfax-1),' and ',kfax(knfax)
          ENDIF
          !
@@ -485,7 +482,6 @@
    20 CONTINUE      ! Label 20 is the exit point from the factor search loop.
       !
-      RETURN
-      !
    END SUBROUTINE factorise
+
    !!======================================================================
 END MODULE nemogcm
