Changeset 8528 for trunk/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90
- Timestamp:
- 2017-09-15T16:43:25+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90
r8524 r8528 752 752 ! 753 753 ! Find the factors of n. 754 IF( kn == 1 ) GOTO 20 755 756 ! nu holds the unfactorised part of the number. 757 ! knfax holds the number of factors found. 758 ! l points to the allowed factor list. 759 ! ifac holds the current factor. 760 ! 761 inu = kn 762 knfax = 0 763 ! 764 DO jl = ntest, 1, -1 754 IF( kn .NE. 1 ) THEN 755 756 ! nu holds the unfactorised part of the number. 757 ! knfax holds the number of factors found. 758 ! l points to the allowed factor list. 759 ! ifac holds the current factor. 765 760 ! 766 ifac = ilfax(jl) 767 IF( ifac > inu ) CYCLE 768 769 ! Test whether the factor will divide. 770 771 IF( MOD(inu,ifac) == 0 ) THEN 761 inu = kn 762 knfax = 0 763 ! 764 DO jl = ntest, 1, -1 772 765 ! 773 knfax = knfax + 1 ! Add the factor to the list 774 IF( knfax > kmaxfax ) THEN 775 kerr = 6 776 write (*,*) 'FACTOR: insufficient space in factor array ', knfax 777 return 766 ifac = ilfax(jl) 767 IF( ifac > inu ) CYCLE 768 769 ! Test whether the factor will divide. 770 771 IF( MOD(inu,ifac) == 0 ) THEN 772 ! 773 knfax = knfax + 1 ! Add the factor to the list 774 IF( knfax > kmaxfax ) THEN 775 kerr = 6 776 write (*,*) 'FACTOR: insufficient space in factor array ', knfax 777 return 778 ENDIF 779 kfax(knfax) = ifac 780 ! Store the other factor that goes with this one 781 knfax = knfax + 1 782 kfax(knfax) = inu / ifac 783 !WRITE (*,*) 'ARPDBG, factors ',knfax-1,' & ',knfax,' are ', kfax(knfax-1),' and ',kfax(knfax) 778 784 ENDIF 779 kfax(knfax) = ifac 780 ! Store the other factor that goes with this one 781 knfax = knfax + 1 782 kfax(knfax) = inu / ifac 783 !WRITE (*,*) 'ARPDBG, factors ',knfax-1,' & ',knfax,' are ', kfax(knfax-1),' and ',kfax(knfax) 784 ENDIF 785 ! 786 END DO 785 787 ! 786 END DO 787 ! 788 20 CONTINUE ! Label 20 is the exit point from the factor search loop. 788 ENDIF 789 789 ! 790 790 END SUBROUTINE factorise
Note: See TracChangeset
for help on using the changeset viewer.