From a8450874bca0f9643d5876be1128321bb8c0df26 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Thu, 29 Dec 2005 20:12:45 +0000 Subject: [PATCH] Removed ran1 and gasdev; replaced igray, sort, and indexx. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@34 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- JT65code_all.f | 1 - fsubs.f | 4 +-- g1 | 2 +- g1.bat | 2 +- gasdev.f | 24 --------------- go | 3 +- igray.c | 18 ++++++++++++ igray.f | 18 ------------ indexx.f | 79 -------------------------------------------------- ran1.f | 28 ------------------ sort.f | 74 ---------------------------------------------- wsjt.py | 2 +- 12 files changed, 24 insertions(+), 231 deletions(-) delete mode 100644 gasdev.f create mode 100644 igray.c delete mode 100644 igray.f delete mode 100644 indexx.f delete mode 100644 ran1.f delete mode 100644 sort.f diff --git a/JT65code_all.f b/JT65code_all.f index 203fb8615..3d81c18a4 100644 --- a/JT65code_all.f +++ b/JT65code_all.f @@ -18,4 +18,3 @@ include 'interleave63.f' include 'graycode.f' include 'set.f' - include 'igray.f' diff --git a/fsubs.f b/fsubs.f index 1b9f369be..a716f12e7 100644 --- a/fsubs.f +++ b/fsubs.f @@ -3,6 +3,7 @@ include 'db.f' include 'pctile.f' include 'sort.f' + include 'ssort.f' include 'ps.f' include 'smooth.f' include 'ping.f' @@ -32,7 +33,6 @@ include 'getsnr.f' include 'graycode.f' include 'grid2k.f' - include 'igray.f' include 'interleave63.f' include 'k2grid.f' include 'limit.f' @@ -57,5 +57,3 @@ include 'xfft.f' include 'wsjt65.f' - include 'gasdev.f' - include 'ran1.f' diff --git a/g1 b/g1 index 8f46b5cfb..3f90097b5 100755 --- a/g1 +++ b/g1 @@ -1 +1 @@ -python f2py.py -c --quiet --opt="-O -cpp -DLinux -fno-second-underscore" init_rs.o encode_rs.o decode_rs.o -m Audio --"f77exec=/home/joe/bin/g95" --f90exec="/home/joe/bin/g95" -L//usr/lib/gcc-lib/i386-redhat-linux/3.2.2/ -lpthread -lg2c only: ftn_init ftn_quit audio_init spec getfile azdist0 astro0 : a2d.f90 abc441.f90 astro0.f90 audio_init.f90 azdist0.f90 blanker.f90 decode1.f90 decode2.f90 decode3.f90 ftn_init.f90 ftn_quit.f90 get_fname.f90 getfile.f90 horizspec.f90 hscroll.f90 i1tor4.f90 pix2d.f90 pix2d65.f90 rfile.f90 savedata.f90 spec.f90 wsjtgen.f90 runqqq.f90 wsjt1.f fsubs1.f fsubs.f astro.f astropak.f jtaudio.c ptt_linux.c wrapkarn.c start_threads.c cutil.c fivehz.f90 +python f2py.py -c --quiet --opt="-O -cpp -DLinux -fno-second-underscore" init_rs.o encode_rs.o decode_rs.o -m Audio --"f77exec=/home/joe/bin/g95" --f90exec="/home/joe/bin/g95" -L//usr/lib/gcc-lib/i386-redhat-linux/3.2.2/ -lpthread -lg2c only: ftn_init ftn_quit audio_init spec getfile azdist0 astro0 : a2d.f90 abc441.f90 astro0.f90 audio_init.f90 azdist0.f90 blanker.f90 decode1.f90 decode2.f90 decode3.f90 ftn_init.f90 ftn_quit.f90 get_fname.f90 getfile.f90 horizspec.f90 hscroll.f90 i1tor4.f90 pix2d.f90 pix2d65.f90 rfile.f90 savedata.f90 spec.f90 wsjtgen.f90 runqqq.f90 wsjt1.f fsubs1.f fsubs.f astro.f astropak.f jtaudio.c ptt_linux.c igray.c wrapkarn.c start_threads.c cutil.c fivehz.f90 diff --git a/g1.bat b/g1.bat index 9a0d3cfc1..fe5901011 100644 --- a/g1.bat +++ b/g1.bat @@ -1,2 +1,2 @@ cl /c /DWin32 /Fojtaudio.o jtaudio.c -f2py.py -c --quiet --opt="/traceback /fast /fpp /define:Win32" init_rs.o encode_rs.o decode_rs.o jtaudio.o -lwinmm -lpa -llibsamplerate -m Audio --"fcompiler=compaqv" only: ftn_init ftn_quit audio_init spec getfile azdist0 astro0 : a2d.f90 abc441.f90 astro0.f90 audio_init.f90 azdist0.f90 blanker.f90 decode1.f90 decode2.f90 decode3.f90 ftn_init.f90 ftn_quit.f90 get_fname.f90 getfile.f90 horizspec.f90 hscroll.f90 i1tor4.f90 pix2d.f90 pix2d65.f90 rfile.f90 savedata.f90 spec.f90 wsjtgen.f90 runqqq.f90 wsjt1.f fsubs1.f fsubs.f astro.f astropak.f resample.c ptt.c wrapkarn.c fivehz.f90 +f2py.py -c --quiet --opt="/traceback /fast /fpp /define:Win32" init_rs.o encode_rs.o decode_rs.o jtaudio.o -lwinmm -lpa -llibsamplerate -m Audio --"fcompiler=compaqv" only: ftn_init ftn_quit audio_init spec getfile azdist0 astro0 : a2d.f90 abc441.f90 astro0.f90 audio_init.f90 azdist0.f90 blanker.f90 decode1.f90 decode2.f90 decode3.f90 ftn_init.f90 ftn_quit.f90 get_fname.f90 getfile.f90 horizspec.f90 hscroll.f90 i1tor4.f90 pix2d.f90 pix2d65.f90 rfile.f90 savedata.f90 spec.f90 wsjtgen.f90 runqqq.f90 wsjt1.f fsubs1.f fsubs.f astro.f astropak.f resample.c ptt.c igray.c wrapkarn.c fivehz.f90 diff --git a/gasdev.f b/gasdev.f deleted file mode 100644 index 98b45f49e..000000000 --- a/gasdev.f +++ /dev/null @@ -1,24 +0,0 @@ - FUNCTION gasdev(idum) - INTEGER idum - REAL gasdev -CU USES ran1 - INTEGER iset - REAL fac,gset,rsq,v1,v2,ran1 - SAVE iset,gset - DATA iset/0/ - if (iset.eq.0) then -1 v1=2.*ran1(idum)-1. - v2=2.*ran1(idum)-1. - rsq=v1**2+v2**2 - if(rsq.ge.1..or.rsq.eq.0.)goto 1 - fac=sqrt(-2.*log(rsq)/rsq) - gset=v1*fac - gasdev=v2*fac - iset=1 - else - gasdev=gset - iset=0 - endif - return - END -C (C) Copr. 1986-92 Numerical Recipes Software *(t9,12. diff --git a/go b/go index 93e19ecf0..108254c62 100755 --- a/go +++ b/go @@ -1,2 +1,3 @@ gcc -c wrapkarn.c -g95 -o JT65code -fno-second-underscore JT65code_all.f wrapkarn.o init_rs.o encode_rs.o decode_rs.o +gcc -c igray.c +g95 -o JT65code -fno-second-underscore JT65code_all.f igray.o wrapkarn.o init_rs.o encode_rs.o decode_rs.o diff --git a/igray.c b/igray.c new file mode 100644 index 000000000..4646898b5 --- /dev/null +++ b/igray.c @@ -0,0 +1,18 @@ +int igray_(int *n0, int *idir) +{ + int n; + unsigned long sh; + unsigned long nn; + n=*n0; + + if(*idir>0) return (n ^ (n >> 1)); + + sh = 1; + nn = (n >> sh); + while (nn > 0) { + n ^= nn; + sh <<= 1; + nn = (n >> sh); + } + return (n); +} diff --git a/igray.f b/igray.f deleted file mode 100644 index 4ec06b8f4..000000000 --- a/igray.f +++ /dev/null @@ -1,18 +0,0 @@ - FUNCTION igray(n,is) - INTEGER igray,is,n - INTEGER idiv,ish - if (is.ge.0) then - igray=ieor(n,n/2) - else - ish=-1 - igray=n -1 continue - idiv=ishft(igray,ish) - igray=ieor(igray,idiv) - if(idiv.le.1.or.ish.eq.-16)return - ish=ish+ish - goto 1 - endif - return - END -C (C) Copr. 1986-92 Numerical Recipes Software *(t9,12. diff --git a/indexx.f b/indexx.f deleted file mode 100644 index 3bb048d2d..000000000 --- a/indexx.f +++ /dev/null @@ -1,79 +0,0 @@ - SUBROUTINE indexx(n,arr,indx) - INTEGER n,indx(n),M,NSTACK - REAL arr(n) - PARAMETER (M=7,NSTACK=50) - INTEGER i,indxt,ir,itemp,j,jstack,k,l,istack(NSTACK) - REAL a - do 11 j=1,n - indx(j)=j -11 continue - jstack=0 - l=1 - ir=n -1 if(ir-l.lt.M)then - do 13 j=l+1,ir - indxt=indx(j) - a=arr(indxt) - do 12 i=j-1,1,-1 - if(arr(indx(i)).le.a)goto 2 - indx(i+1)=indx(i) -12 continue - i=0 -2 indx(i+1)=indxt -13 continue - if(jstack.eq.0)return - ir=istack(jstack) - l=istack(jstack-1) - jstack=jstack-2 - else - k=(l+ir)/2 - itemp=indx(k) - indx(k)=indx(l+1) - indx(l+1)=itemp - if(arr(indx(l+1)).gt.arr(indx(ir)))then - itemp=indx(l+1) - indx(l+1)=indx(ir) - indx(ir)=itemp - endif - if(arr(indx(l)).gt.arr(indx(ir)))then - itemp=indx(l) - indx(l)=indx(ir) - indx(ir)=itemp - endif - if(arr(indx(l+1)).gt.arr(indx(l)))then - itemp=indx(l+1) - indx(l+1)=indx(l) - indx(l)=itemp - endif - i=l+1 - j=ir - indxt=indx(l) - a=arr(indxt) -3 continue - i=i+1 - if(arr(indx(i)).lt.a)goto 3 -4 continue - j=j-1 - if(arr(indx(j)).gt.a)goto 4 - if(j.lt.i)goto 5 - itemp=indx(i) - indx(i)=indx(j) - indx(j)=itemp - goto 3 -5 indx(l)=indx(j) - indx(j)=indxt - jstack=jstack+2 - if(jstack.gt.NSTACK)pause 'NSTACK too small in indexx' - if(ir-i+1.ge.j-l)then - istack(jstack)=ir - istack(jstack-1)=i - ir=j-1 - else - istack(jstack)=j-1 - istack(jstack-1)=l - l=i - endif - endif - goto 1 - END -C (C) Copr. 1986-92 Numerical Recipes Software *(t9,12. diff --git a/ran1.f b/ran1.f deleted file mode 100644 index 420f1d3db..000000000 --- a/ran1.f +++ /dev/null @@ -1,28 +0,0 @@ - FUNCTION ran1(idum) - INTEGER idum,IA,IM,IQ,IR,NTAB,NDIV - REAL ran1,AM,EPS,RNMX - PARAMETER (IA=16807,IM=2147483647,AM=1./IM,IQ=127773,IR=2836, - *NTAB=32,NDIV=1+(IM-1)/NTAB,EPS=1.2e-7,RNMX=1.-EPS) - INTEGER j,k,iv(NTAB),iy - SAVE iv,iy - DATA iv /NTAB*0/, iy /0/ - if (idum.le.0.or.iy.eq.0) then - idum=max(-idum,1) - do 11 j=NTAB+8,1,-1 - k=idum/IQ - idum=IA*(idum-k*IQ)-IR*k - if (idum.lt.0) idum=idum+IM - if (j.le.NTAB) iv(j)=idum -11 continue - iy=iv(1) - endif - k=idum/IQ - idum=IA*(idum-k*IQ)-IR*k - if (idum.lt.0) idum=idum+IM - j=1+iy/NDIV - iy=iv(j) - iv(j)=idum - ran1=min(AM*iy,RNMX) - return - END -C (C) Copr. 1986-92 Numerical Recipes Software *(t9,12. diff --git a/sort.f b/sort.f deleted file mode 100644 index 4983239b9..000000000 --- a/sort.f +++ /dev/null @@ -1,74 +0,0 @@ - SUBROUTINE sort(n,arr) - INTEGER n,M,NSTACK - REAL arr(n) - PARAMETER (M=7,NSTACK=50) - INTEGER i,ir,j,jstack,k,l,istack(NSTACK) - REAL a,temp - jstack=0 - l=1 - ir=n -1 if(ir-l.lt.M)then - do 12 j=l+1,ir - a=arr(j) - do 11 i=j-1,1,-1 - if(arr(i).le.a)goto 2 - arr(i+1)=arr(i) -11 continue - i=0 -2 arr(i+1)=a -12 continue - if(jstack.eq.0)return - ir=istack(jstack) - l=istack(jstack-1) - jstack=jstack-2 - else - k=(l+ir)/2 - temp=arr(k) - arr(k)=arr(l+1) - arr(l+1)=temp - if(arr(l+1).gt.arr(ir))then - temp=arr(l+1) - arr(l+1)=arr(ir) - arr(ir)=temp - endif - if(arr(l).gt.arr(ir))then - temp=arr(l) - arr(l)=arr(ir) - arr(ir)=temp - endif - if(arr(l+1).gt.arr(l))then - temp=arr(l+1) - arr(l+1)=arr(l) - arr(l)=temp - endif - i=l+1 - j=ir - a=arr(l) -3 continue - i=i+1 - if(arr(i).lt.a)goto 3 -4 continue - j=j-1 - if(arr(j).gt.a)goto 4 - if(j.lt.i)goto 5 - temp=arr(i) - arr(i)=arr(j) - arr(j)=temp - goto 3 -5 arr(l)=arr(j) - arr(j)=a - jstack=jstack+2 - if(jstack.gt.NSTACK)pause 'NSTACK too small in sort' - if(ir-i+1.ge.j-l)then - istack(jstack)=ir - istack(jstack-1)=i - ir=j-1 - else - istack(jstack)=j-1 - istack(jstack-1)=l - l=i - endif - endif - goto 1 - END -C (C) Copr. 1986-92 Numerical Recipes Software *(t9,12. diff --git a/wsjt.py b/wsjt.py index 1872d0db8..444a400ac 100644 --- a/wsjt.py +++ b/wsjt.py @@ -1,4 +1,4 @@ -# ---------------------------------------------------------- WSJT +# ----------------------------------------------------------- WSJT from Tkinter import * from tkFileDialog import * import Pmw