- Timestamp:
- 2017-12-11T17:45:55+01:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2017/dev_r8126_ROBUST08_no_ghost/NEMOGCM/NEMO/SAO_SRC/nemogcm.F90
r8758 r8979 530 530 ! 531 531 ! 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 550 543 ! 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) 556 562 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 567 567 ! 568 568 END SUBROUTINE factorise
Note: See TracChangeset
for help on using the changeset viewer.