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/SAO_SRC – 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/SAO_SRC/nemogcm.F90

    r8758 r8979  
    530530      ! 
    531531      ! Find the factors of n. 
    532       IF( kn == 1 )   GOTO 20 
    533  
    534       ! nu holds the unfactorised part of the number. 
    535       ! knfax holds the number of factors found. 
    536       ! l points to the allowed factor list. 
    537       ! ifac holds the current factor. 
    538       ! 
    539       inu   = kn 
    540       knfax = 0 
    541       ! 
    542       DO jl = ntest, 1, -1 
    543          ! 
    544          ifac = ilfax(jl) 
    545          IF( ifac > inu )   CYCLE 
    546  
    547          ! Test whether the factor will divide. 
    548  
    549          IF( MOD(inu,ifac) == 0 ) THEN 
     532      IF( kn .NE. 1 ) THEN 
     533 
     534         ! nu holds the unfactorised part of the number. 
     535         ! knfax holds the number of factors found. 
     536         ! l points to the allowed factor list. 
     537         ! ifac holds the current factor. 
     538         ! 
     539         inu   = kn 
     540         knfax = 0 
     541         ! 
     542         DO jl = ntest, 1, -1 
    550543            ! 
    551             knfax = knfax + 1            ! Add the factor to the list 
    552             IF( knfax > kmaxfax ) THEN 
    553                kerr = 6 
    554                write (*,*) 'FACTOR: insufficient space in factor array ', knfax 
    555                return 
     544            ifac = ilfax(jl) 
     545            IF( ifac > inu )   CYCLE 
     546    
     547            ! Test whether the factor will divide. 
     548    
     549            IF( MOD(inu,ifac) == 0 ) THEN 
     550               ! 
     551               knfax = knfax + 1            ! Add the factor to the list 
     552               IF( knfax > kmaxfax ) THEN 
     553                  kerr = 6 
     554                  write (*,*) 'FACTOR: insufficient space in factor array ', knfax 
     555                  return 
     556               ENDIF 
     557               kfax(knfax) = ifac 
     558               ! Store the other factor that goes with this one 
     559               knfax = knfax + 1 
     560               kfax(knfax) = inu / ifac 
     561               !WRITE (*,*) 'ARPDBG, factors ',knfax-1,' & ',knfax,' are ', kfax(knfax-1),' and ',kfax(knfax) 
    556562            ENDIF 
    557             kfax(knfax) = ifac 
    558             ! Store the other factor that goes with this one 
    559             knfax = knfax + 1 
    560             kfax(knfax) = inu / ifac 
    561             !WRITE (*,*) 'ARPDBG, factors ',knfax-1,' & ',knfax,' are ', kfax(knfax-1),' and ',kfax(knfax) 
    562          ENDIF 
    563          ! 
    564       END DO 
    565       ! 
    566    20 CONTINUE      ! Label 20 is the exit point from the factor search loop. 
     563            ! 
     564         END DO 
     565         ! 
     566      ENDIF 
    567567      ! 
    568568   END SUBROUTINE factorise 
Note: See TracChangeset for help on using the changeset viewer.