mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-05-23 18:02:29 -04:00
Restore rfile2.f
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/map65@1622 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
03a797c7fb
commit
ec7c3b347a
192
four2a.f
192
four2a.f
@ -1,96 +1,96 @@
|
|||||||
subroutine four2a(a,nfft,ndim,isign,iform)
|
subroutine four2a(a,nfft,ndim,isign,iform)
|
||||||
|
|
||||||
C IFORM = 1, 0 or -1, as data is
|
C IFORM = 1, 0 or -1, as data is
|
||||||
C complex, real, or the first half of a complex array. Transform
|
C complex, real, or the first half of a complex array. Transform
|
||||||
C values are returned in array DATA. They are complex, real, or
|
C values are returned in array DATA. They are complex, real, or
|
||||||
C the first half of a complex array, as IFORM = 1, -1 or 0.
|
C the first half of a complex array, as IFORM = 1, -1 or 0.
|
||||||
|
|
||||||
C The transform of a real array (IFORM = 0) dimensioned N(1) by N(2)
|
C The transform of a real array (IFORM = 0) dimensioned N(1) by N(2)
|
||||||
C by ... will be returned in the same array, now considered to
|
C by ... will be returned in the same array, now considered to
|
||||||
C be complex of dimensions N(1)/2+1 by N(2) by .... Note that if
|
C be complex of dimensions N(1)/2+1 by N(2) by .... Note that if
|
||||||
C IFORM = 0 or -1, N(1) must be even, and enough room must be
|
C IFORM = 0 or -1, N(1) must be even, and enough room must be
|
||||||
C reserved. The missing values may be obtained by complex conjuga-
|
C reserved. The missing values may be obtained by complex conjuga-
|
||||||
C tion.
|
C tion.
|
||||||
|
|
||||||
C The reverse transformation of a half complex array dimensioned
|
C The reverse transformation of a half complex array dimensioned
|
||||||
C N(1)/2+1 by N(2) by ..., is accomplished by setting IFORM
|
C N(1)/2+1 by N(2) by ..., is accomplished by setting IFORM
|
||||||
C to -1. In the N array, N(1) must be the true N(1), not N(1)/2+1.
|
C to -1. In the N array, N(1) must be the true N(1), not N(1)/2+1.
|
||||||
C The transform will be real and returned to the input array.
|
C The transform will be real and returned to the input array.
|
||||||
|
|
||||||
parameter (NPMAX=100)
|
parameter (NPMAX=100)
|
||||||
parameter (NSMALL=16384)
|
parameter (NSMALL=16384)
|
||||||
complex a(nfft)
|
complex a(nfft)
|
||||||
complex aa(NSMALL)
|
complex aa(NSMALL)
|
||||||
integer nn(NPMAX),ns(NPMAX),nf(NPMAX),nl(NPMAX)
|
integer nn(NPMAX),ns(NPMAX),nf(NPMAX),nl(NPMAX)
|
||||||
real*8 plan(NPMAX) !Actually should be i*8, but no matter
|
real*8 plan(NPMAX) !Actually should be i*8, but no matter
|
||||||
data nplan/0/
|
data nplan/0/
|
||||||
include 'fftw3.f'
|
include 'fftw3.f'
|
||||||
save plan,nplan,nn,ns,nf,nl
|
save plan,nplan,nn,ns,nf,nl
|
||||||
|
|
||||||
if(nfft.lt.0) go to 999
|
if(nfft.lt.0) go to 999
|
||||||
|
|
||||||
nloc=loc(a)
|
nloc=loc(a)
|
||||||
do i=1,nplan
|
do i=1,nplan
|
||||||
if(nfft.eq.nn(i) .and. isign.eq.ns(i) .and.
|
if(nfft.eq.nn(i) .and. isign.eq.ns(i) .and.
|
||||||
+ iform.eq.nf(i) .and. nloc.eq.nl(i)) go to 10
|
+ iform.eq.nf(i) .and. nloc.eq.nl(i)) go to 10
|
||||||
enddo
|
enddo
|
||||||
if(nplan.ge.NPMAX) stop 'Too many FFTW plans requested.'
|
if(nplan.ge.NPMAX) stop 'Too many FFTW plans requested.'
|
||||||
nplan=nplan+1
|
nplan=nplan+1
|
||||||
i=nplan
|
i=nplan
|
||||||
nn(i)=nfft
|
nn(i)=nfft
|
||||||
ns(i)=isign
|
ns(i)=isign
|
||||||
nf(i)=iform
|
nf(i)=iform
|
||||||
nl(i)=nloc
|
nl(i)=nloc
|
||||||
|
|
||||||
C Planning: FFTW_ESTIMATE, FFTW_ESTIMATE_PATIENT, FFTW_MEASURE,
|
C Planning: FFTW_ESTIMATE, FFTW_ESTIMATE_PATIENT, FFTW_MEASURE,
|
||||||
C FFTW_PATIENT, FFTW_EXHAUSTIVE
|
C FFTW_PATIENT, FFTW_EXHAUSTIVE
|
||||||
C NB: "EXHAUSTIVE" takes more or less forever, for long transforms.
|
C NB: "EXHAUSTIVE" takes more or less forever, for long transforms.
|
||||||
npatience=1
|
npatience=1
|
||||||
nflags=FFTW_ESTIMATE
|
nflags=FFTW_ESTIMATE
|
||||||
if(npatience.eq.1) nflags=FFTW_ESTIMATE_PATIENT
|
if(npatience.eq.1) nflags=FFTW_ESTIMATE_PATIENT
|
||||||
if(npatience.eq.2) nflags=FFTW_MEASURE
|
if(npatience.eq.2) nflags=FFTW_MEASURE
|
||||||
if(npatience.eq.3) nflags=FFTW_PATIENT
|
if(npatience.eq.3) nflags=FFTW_PATIENT
|
||||||
if(npatience.eq.4) nflags=FFTW_EXHAUSTIVE
|
if(npatience.eq.4) nflags=FFTW_EXHAUSTIVE
|
||||||
if(nfft.le.NSMALL) then
|
if(nfft.le.NSMALL) then
|
||||||
jz=nfft
|
jz=nfft
|
||||||
if(iform.eq.0) jz=nfft/2
|
if(iform.eq.0) jz=nfft/2
|
||||||
do j=1,jz
|
do j=1,jz
|
||||||
aa(j)=a(j)
|
aa(j)=a(j)
|
||||||
enddo
|
enddo
|
||||||
endif
|
endif
|
||||||
call sleep_msec(0)
|
call sleep_msec(0)
|
||||||
if(isign.eq.-1 .and. iform.eq.1) then
|
if(isign.eq.-1 .and. iform.eq.1) then
|
||||||
call sfftw_plan_dft_1d_(plan(i),nfft,a,a,
|
call sfftw_plan_dft_1d_(plan(i),nfft,a,a,
|
||||||
+ FFTW_FORWARD,nflags)
|
+ FFTW_FORWARD,nflags)
|
||||||
else if(isign.eq.1 .and. iform.eq.1) then
|
else if(isign.eq.1 .and. iform.eq.1) then
|
||||||
call sfftw_plan_dft_1d_(plan(i),nfft,a,a,
|
call sfftw_plan_dft_1d_(plan(i),nfft,a,a,
|
||||||
+ FFTW_BACKWARD,nflags)
|
+ FFTW_BACKWARD,nflags)
|
||||||
else if(isign.eq.-1 .and. iform.eq.0) then
|
else if(isign.eq.-1 .and. iform.eq.0) then
|
||||||
call sfftw_plan_dft_r2c_1d_(plan(i),nfft,a,a,nflags)
|
call sfftw_plan_dft_r2c_1d_(plan(i),nfft,a,a,nflags)
|
||||||
else if(isign.eq.1 .and. iform.eq.-1) then
|
else if(isign.eq.1 .and. iform.eq.-1) then
|
||||||
call sfftw_plan_dft_c2r_1d_(plan(i),nfft,a,a,nflags)
|
call sfftw_plan_dft_c2r_1d_(plan(i),nfft,a,a,nflags)
|
||||||
else
|
else
|
||||||
stop 'Unsupported request in four2a'
|
stop 'Unsupported request in four2a'
|
||||||
endif
|
endif
|
||||||
call sleep_msec(0)
|
call sleep_msec(0)
|
||||||
i=nplan
|
i=nplan
|
||||||
if(nfft.le.NSMALL) then
|
if(nfft.le.NSMALL) then
|
||||||
jz=nfft
|
jz=nfft
|
||||||
if(iform.eq.0) jz=nfft/2
|
if(iform.eq.0) jz=nfft/2
|
||||||
do j=1,jz
|
do j=1,jz
|
||||||
a(j)=aa(j)
|
a(j)=aa(j)
|
||||||
enddo
|
enddo
|
||||||
endif
|
endif
|
||||||
|
|
||||||
10 continue
|
10 continue
|
||||||
call sleep_msec(0)
|
call sleep_msec(0)
|
||||||
call sfftw_execute_(plan(i))
|
call sfftw_execute_(plan(i))
|
||||||
call sleep_msec(0)
|
call sleep_msec(0)
|
||||||
return
|
return
|
||||||
|
|
||||||
999 do i=1,nplan
|
999 do i=1,nplan
|
||||||
call sfftw_destroy_plan_(plan(i))
|
call sfftw_destroy_plan_(plan(i))
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
2
map65.py
2
map65.py
@ -1,4 +1,4 @@
|
|||||||
#-------------------------------------------------------------------- MAP65
|
#------------------------------------------------------------------- MAP65
|
||||||
# $Date$ $Revision$
|
# $Date$ $Revision$
|
||||||
#
|
#
|
||||||
from Tkinter import *
|
from Tkinter import *
|
||||||
|
26
rfile2.f
Normal file
26
rfile2.f
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
subroutine rfile2(fname,buf,n,nr)
|
||||||
|
|
||||||
|
C Read data from disk.
|
||||||
|
|
||||||
|
integer RMODE
|
||||||
|
parameter(RMODE=0)
|
||||||
|
integer*1 buf(n)
|
||||||
|
integer open,read,close
|
||||||
|
integer fd
|
||||||
|
character fname*(*)
|
||||||
|
data iz/0/ !Silence g77 warning
|
||||||
|
|
||||||
|
do i=80,1,-1
|
||||||
|
if(fname(i:i).ne.' ') then
|
||||||
|
iz=i
|
||||||
|
go to 10
|
||||||
|
endif
|
||||||
|
enddo
|
||||||
|
|
||||||
|
10 fname=fname(1:iz)//char(0)
|
||||||
|
fd=open(fname,RMODE) !Open file for reading
|
||||||
|
nr=read(fd,buf,n)
|
||||||
|
i=close(fd)
|
||||||
|
|
||||||
|
return
|
||||||
|
end
|
Loading…
x
Reference in New Issue
Block a user