- Timestamp:
- 2017-12-01T09:43:23+01:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2017/dev_METO_2017/NEMOGCM/NEMO/OFF_SRC/nemogcm.F90
r7761 r8868 548 548 549 549 ! Find the factors of n. 550 IF( kn == 1 ) GOTO 20 551 552 ! nu holds the unfactorised part of the number. 553 ! knfax holds the number of factors found. 554 ! l points to the allowed factor list. 555 ! ifac holds the current factor. 556 557 inu = kn 558 knfax = 0 559 560 DO jl = ntest, 1, -1 561 ! 562 ifac = ilfax(jl) 563 IF( ifac > inu ) CYCLE 564 565 ! Test whether the factor will divide. 566 567 IF( MOD(inu,ifac) == 0 ) THEN 550 IF( kn .NE. 1 ) THEN 551 552 ! nu holds the unfactorised part of the number. 553 ! knfax holds the number of factors found. 554 ! l points to the allowed factor list. 555 ! ifac holds the current factor. 556 557 inu = kn 558 knfax = 0 559 560 DO jl = ntest, 1, -1 568 561 ! 569 knfax = knfax + 1 ! Add the factor to the list 570 IF( knfax > kmaxfax ) THEN 571 kerr = 6 572 write (*,*) 'FACTOR: insufficient space in factor array ', knfax 573 return 562 ifac = ilfax(jl) 563 IF( ifac > inu ) CYCLE 564 565 ! Test whether the factor will divide. 566 567 IF( MOD(inu,ifac) == 0 ) THEN 568 ! 569 knfax = knfax + 1 ! Add the factor to the list 570 IF( knfax > kmaxfax ) THEN 571 kerr = 6 572 write (*,*) 'FACTOR: insufficient space in factor array ', knfax 573 return 574 ENDIF 575 kfax(knfax) = ifac 576 ! Store the other factor that goes with this one 577 knfax = knfax + 1 578 kfax(knfax) = inu / ifac 579 !WRITE (*,*) 'ARPDBG, factors ',knfax-1,' & ',knfax,' are ', kfax(knfax-1),' and ',kfax(knfax) 574 580 ENDIF 575 kfax(knfax) = ifac 576 ! Store the other factor that goes with this one 577 knfax = knfax + 1 578 kfax(knfax) = inu / ifac 579 !WRITE (*,*) 'ARPDBG, factors ',knfax-1,' & ',knfax,' are ', kfax(knfax-1),' and ',kfax(knfax) 580 ENDIF 581 ! 582 END DO 583 584 20 CONTINUE ! Label 20 is the exit point from the factor search loop. 581 ! 582 END DO 583 584 ENDIF 585 585 ! 586 586 END SUBROUTINE factorise
Note: See TracChangeset
for help on using the changeset viewer.