- 积分
- 58
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2016-4-28
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
小波分出现下列错误是怎么回事呢
wave.obj : error LNK2001: unresolved external symbol _WAVE_SIGNIF@76
wave.obj : error LNK2001: unresolved external symbol _WAVELET@52
wave.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.
wave.exe - 3 error(s), 0 warning(s)
程序如下:
PROGRAM wavetest
IMPLICIT none
INTEGER n,jtot
DOUBLE PRECISION dt,s0,dj
PARAMETER (n=155,dt=1.0D0,s0=dt/4.)
parameter (dj=0.25)
PARAMETER (jtot=30)
INTEGER mother,ibase2,npad
DOUBLE PRECISION sst(n),recon_sst(n),param,pi
DOUBLE PRECISION scale(jtot),period(jtot),coi(n)
DOUBLE COMPLEX wave(n,jtot)
INTEGER i,j,isigtest,javg1,javg2
DOUBLE PRECISION lag1,siglvl,dof(jtot)
DOUBLE PRECISION fft_theor(jtot),signif(jtot),ymean,variance
DOUBLE PRECISION recon_mean,recon_vari
DOUBLE PRECISION Cdelta,psi0
DOUBLE PRECISION global_ws(jtot),global_signif(jtot)
DOUBLE PRECISION savg_dof(jtot),savg_signif(jtot)
DOUBLE PRECISION savg_sst(n),savg_ws(n)
integer nm,m,na
double precision tr(6,100)
print*,'nm=2'
read*,nm
print*,nm
open(11,file='waliguan.txt')
do i=1,n
read(11,*)na,(tr(m,i),m=1,2)
enddo
do i=1,n
sst(i)=tr(nm,i)
enddo
close(11)
pi = 4.D0*ATAN(1.D0)
ibase2 = NINT(LOG(DBLE(n))/LOG(2.D0))+1
npad = INT(2.D0**ibase2)
mother = 2
param = 2
CALL WAVELET(n,sst,dt,mother,param,s0,dj,jtot,npad,
& wave,scale,period,coi)
isigtest = 0
lag1 = 0.72D0
siglvl = 0.05D0
CALL WAVE_SIGNIF (isigtest,n,sst,dt,mother,param,dj,jtot,
& scale,period,lag1,siglvl,dof,fft_theor,signif,
& ymean,variance,Cdelta,psi0)
isigtest = 1
siglvl = 0.05D0
DO 10 j=1,jtot
DO 20 i=1,n
global_ws(j) = global_ws(j) + ABS(wave(i,j))**2
20 CONTINUE
global_ws(j) = global_ws(j)/n
dof(j) = n - scale(j)
10 CONTINUE
CALL WAVE_SIGNIF (isigtest,n,sst,dt,mother,param,dj,jtot,
& scale,period,lag1,siglvl,dof,fft_theor,global_signif,
& ymean,variance,Cdelta,psi0)
isigtest = 2
siglvl = 0.05D0
savg_dof(1) = 2.0D0
savg_dof(2) = 7.9D0
javg1 = 0
javg2 = 0
DO 30 j=1,jtot
IF ((scale(j).GE.savg_dof(1)).AND.(javg1.EQ.0)) javg1 = j
IF (scale(j).LE.savg_dof(2)) javg2 = j
30 CONTINUE
CALL WAVE_SIGNIF (isigtest,n,sst,dt,mother,param,dj,jtot,
& scale,period,lag1,siglvl,savg_dof,fft_theor,savg_signif,
& ymean,variance,Cdelta,psi0)
DO 50 i=1,n
savg_ws(i) = 0.D0
savg_sst(i) = 0.D0
DO 60 j=javg1,javg2
savg_ws(i) = savg_ws(i) + (ABS(wave(i,j))**2)/scale(j)
savg_sst(i) = savg_sst(i) + (DBLE(wave(i,j)))/SQRT(scale(j))
60 CONTINUE
savg_ws(i) = dj*dt*savg_ws(i)/Cdelta
SAVG_sst(i) = dj*SQRT(dt)*SAVG_sst(i)/(Cdelta*psi0)
50 CONTINUE
PRINT*,' n=',n
PRINT*,' dt=',dt
PRINT*,' mother=',mother
PRINT*,' param=',param
PRINT*,' s0=',s0
PRINT*,' dj=',dj
PRINT*,' jtot=',jtot
PRINT*,' npad=',npad
PRINT'(/,"Let w = wave(n/2,j)",/)'
PRINT'(A4,7A10)',"j","Scale","Period","ABS(w)^2","phase(w)",
& "5%signif","Global","GWS5%sig"
PRINT'(I4,7F10.3)',(j,scale(j),period(j),
& ABS(wave(n/2,j))**2,
& ATAN2(DIMAG(wave(n/2,j)),DBLE(wave(n/2,j)))*180.D0/pi,
& signif(j),global_ws(j),global_signif(j),j=1,jtot)
PRINT'(/,A,F10.3)',
& ' Scale-average degrees of freedom = ',savg_dof(1)
PRINT'(A,F10.3,/)',
& ' Scale-avg 5% significance level = ',savg_signif(1)
print*,'lag1=',lag1
recon_vari = 0.D0
DO 900 i=1,n
DO 1000 j=1,jtot
recon_vari = recon_vari + (ABS(wave(i,j))**2)/scale(j)
1000 CONTINUE
900 CONTINUE
recon_vari = dj*dt*recon_vari/(Cdelta*n)
PRINT'(A,F14.5)',' Reconstructed variance=',recon_vari
PRINT'(A,F14.5)',' Original variance =',variance
PRINT'(A,F14.5,A,/)',' Ratio = ',recon_vari/variance,
& ' (this is low due to padding with zeroes)'
recon_mean=0.D0
recon_vari = 0.D0
DO 1100 i=1,n
recon_sst(i)=0.D0
DO 1200 j=1,jtot
recon_sst(i) = recon_sst(i)+(DBLE(wave(i,j)))/SQRT(scale(j))
1200 CONTINUE
recon_sst(i) = dj*SQRT(dt)*recon_sst(i)/(Cdelta*psi0)
recon_vari = recon_vari+(sst(i)-ymean-recon_sst(i))**2
recon_mean = recon_mean + recon_sst(i)
1100 CONTINUE
recon_mean = recon_mean/n
recon_vari = SQRT(recon_vari/n)
PRINT'(A,F14.6)',' Reconstructed mean=',recon_mean
PRINT'(A,F14.6)',' Original mean =',ymean
PRINT'(A,F14.6,/)',' Root-mean-square difference of time series=',
& recon_vari
OPEN(77,FILE='waliguan.OUT')
WRITE(77,*)'FOURIER PERIOD'
WRITE(77,777)(PERIOD(J),J=1,JTOT)
WRITE(77,*)'WAVELET POWER'
DO I=1,N
WRITE(77,777)(dble(wave(i,j)),J=1,JTOT)
ENDDO
WRITE(77,*)'LOCAL SIGNIFICANCE'
WRITE(77,777)(SIGNIF(J)/variance,J=1,JTOT)
WRITE(77,*)'CONE OF INFLUENCE'
WRITE(77,777)(COI(I),I=1,N)
WRITE(77,*)'GLOBAL WAVELET SPECTRUM'
WRITE(77,777)(GLOBAL_WS(J)/VARIANCE,J=1,JTOT)
WRITE(77,*)'GLOBAL SIGNIFICANCE'
WRITE(77,777)(GLOBAL_SIGNIF(J)/variance,J=1,JTOT)
WRITE(77,*)'SCALE AVGRERAGE SSTA'
WRITE(77,777)(SAVG_sst(I),I=1,N)
777 FORMAT(50F20.15)
CLOSE(77)
END
subroutine corr(sst,n,lag1)
integer n,i
DOUBLE PRECISION sst(n),lag1
double precision bm,cm,suf,sua,svb,a,b
CM=0.
BM=0.
DO 602 i=1,n-1
CM=CM+sst(I)
BM=BM+sst(I+1)
602 CONTINUE
CM=CM/float(n-1)
BM=BM/float(n-1)
SUF=0.0
SUA=0.0
SVB=0.0
DO 603 i=1,n-1
A=sst(I)-CM
B=sst(i+1)-BM
SUF=SUF+A*B
SUA=SUA+A*A
SVB=SVB+B*B
603 CONTINUE
lag1=SUF/SQRT(SUA*SVB)
return
end
|
|