New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 8979 for branches/2017/dev_r8126_ROBUST08_no_ghost/NEMOGCM/NEMO/OFF_SRC/nemogcm.F90 – NEMO

Ignore:
Timestamp:
2017-12-11T17:45:55+01:00 (6 years ago)
Author:
acc
Message:

Branch 2017/dev_r8126_ROBUST08_no_ghost. Merge in trunk changes up to rev 8864 in preparation for the merge. Sette tests OK except for AGRIF restartability but uncertain about the trunks status for this?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2017/dev_r8126_ROBUST08_no_ghost/NEMOGCM/NEMO/OFF_SRC/nemogcm.F90

    r8758 r8979  
    565565 
    566566      ! Find the factors of n. 
    567       IF( kn == 1 )   GOTO 20 
    568  
    569       ! nu holds the unfactorised part of the number. 
    570       ! knfax holds the number of factors found. 
    571       ! l points to the allowed factor list. 
    572       ! ifac holds the current factor. 
    573  
    574       inu   = kn 
    575       knfax = 0 
    576  
    577       DO jl = ntest, 1, -1 
    578          ! 
    579          ifac = ilfax(jl) 
    580          IF( ifac > inu )   CYCLE 
    581  
    582          ! Test whether the factor will divide. 
    583  
    584          IF( MOD(inu,ifac) == 0 ) THEN 
     567      IF( kn .NE. 1 ) THEN 
     568 
     569         ! nu holds the unfactorised part of the number. 
     570         ! knfax holds the number of factors found. 
     571         ! l points to the allowed factor list. 
     572         ! ifac holds the current factor. 
     573    
     574         inu   = kn 
     575         knfax = 0 
     576    
     577         DO jl = ntest, 1, -1 
    585578            ! 
    586             knfax = knfax + 1            ! Add the factor to the list 
    587             IF( knfax > kmaxfax ) THEN 
    588                kerr = 6 
    589                write (*,*) 'FACTOR: insufficient space in factor array ', knfax 
    590                return 
     579            ifac = ilfax(jl) 
     580            IF( ifac > inu )   CYCLE 
     581    
     582            ! Test whether the factor will divide. 
     583    
     584            IF( MOD(inu,ifac) == 0 ) THEN 
     585               ! 
     586               knfax = knfax + 1            ! Add the factor to the list 
     587               IF( knfax > kmaxfax ) THEN 
     588                  kerr = 6 
     589                  write (*,*) 'FACTOR: insufficient space in factor array ', knfax 
     590                  return 
     591               ENDIF 
     592               kfax(knfax) = ifac 
     593               ! Store the other factor that goes with this one 
     594               knfax = knfax + 1 
     595               kfax(knfax) = inu / ifac 
     596               !WRITE (*,*) 'ARPDBG, factors ',knfax-1,' & ',knfax,' are ', kfax(knfax-1),' and ',kfax(knfax) 
    591597            ENDIF 
    592             kfax(knfax) = ifac 
    593             ! Store the other factor that goes with this one 
    594             knfax = knfax + 1 
    595             kfax(knfax) = inu / ifac 
    596             !WRITE (*,*) 'ARPDBG, factors ',knfax-1,' & ',knfax,' are ', kfax(knfax-1),' and ',kfax(knfax) 
    597          ENDIF 
    598          ! 
    599       END DO 
    600  
    601    20 CONTINUE      ! Label 20 is the exit point from the factor search loop. 
     598            ! 
     599         END DO 
     600    
     601      ENDIF 
    602602      ! 
    603603   END SUBROUTINE factorise 
Note: See TracChangeset for help on using the changeset viewer.