- Timestamp:
- 2017-12-11T17:45:55+01:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2017/dev_r8126_ROBUST08_no_ghost/NEMOGCM/NEMO/OFF_SRC/nemogcm.F90
r8758 r8979 565 565 566 566 ! 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 585 578 ! 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) 591 597 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 602 602 ! 603 603 END SUBROUTINE factorise
Note: See TracChangeset
for help on using the changeset viewer.