diff options
| author | hibby <d@vehibberd.com> | 2026-10-06 21:24:40 +0100 |
|---|---|---|
| committer | hibby <d@vehibberd.com> | 2026-10-06 21:24:40 +0100 |
| commit | c25cbdf6fb6d946175f4335fab77bfea601b56db (patch) | |
| tree | 6f7a94b7b81f999e434f61b73d47e337dfd26bf2 /map65/libm65/chkhist.f90 | |
| parent | 71f5689252c9f13e70e1c24856904475b2307809 (diff) | |
| parent | 0685fcada9f95fe90f70b387cd7d757da8209624 (diff) | |
Merge tag 'debian/3.2.0_rc1+dfsg-2' into debian/trixie-backportsdebian/trixie-backports
tagging wsjtx 3.2.0~rc1+dfsg-2
Diffstat (limited to 'map65/libm65/chkhist.f90')
| -rw-r--r-- | map65/libm65/chkhist.f90 | 54 |
1 files changed, 40 insertions, 14 deletions
diff --git a/map65/libm65/chkhist.f90 b/map65/libm65/chkhist.f90 index c814c3ca..51d1ee72 100644 --- a/map65/libm65/chkhist.f90 +++ b/map65/libm65/chkhist.f90 @@ -1,23 +1,49 @@ -subroutine chkhist(mrsym,nmax,ipk) +module chkhist_mod + implicit none +contains - integer mrsym(63) - integer hist(0:63) +subroutine chkhist(mrsym, nmax, ipk) + implicit none - do i=0,63 - hist(i)=0 + !-------------------------------------------------------------------- + ! Arguments + !-------------------------------------------------------------------- + integer, intent(in) :: mrsym(63) + integer, intent(out) :: nmax + integer, intent(out) :: ipk + + !-------------------------------------------------------------------- + ! Locals + !-------------------------------------------------------------------- + integer :: hist(0:63) + integer :: i, j + + !-------------------------------------------------------------------- + ! Initialize histogram + !-------------------------------------------------------------------- + do i = 0, 63 + hist(i) = 0 enddo - do j=1,63 - i=mrsym(j) - hist(i)=hist(i)+1 + + !-------------------------------------------------------------------- + ! Count occurrences + !-------------------------------------------------------------------- + do j = 1, 63 + i = mrsym(j) + hist(i) = hist(i) + 1 enddo - nmax=0 - do i=0,63 - if(hist(i).gt.nmax) then - nmax=hist(i) - ipk=i+1 + !-------------------------------------------------------------------- + ! Find maximum bin and its index + !-------------------------------------------------------------------- + nmax = 0 + do i = 0, 63 + if (hist(i) > nmax) then + nmax = hist(i) + ipk = i + 1 endif enddo - return end subroutine chkhist + +end module chkhist_mod |
