主题:ivf11+vs2005 如何使用imsl
xaxaxaxaxdxd
[专家分:0] 发布于 2010-10-10 11:22:00
ivf11+vs2005
我按照网上说的 添加
C:\Program Files\VNI\imsl\fnl600\IA32\include\dll
C:\Program Files\VNI\imsl\fnl600\IA32\include\lib
program main
INCLUDE 'link_fnl_static.h'
use imsl //这句也同不过
use fftcf_int
complex::x(10),y(10)
call fftcf(10,x,y) /加上这句就出错了
stop
end program
请问如何使用fft进行计算,急啊
回复列表 (共2个回复)
沙发
asymptotic [专家分:16630] 发布于 2010-10-10 12:13:00
subroutine Test_FFTCF
use TypeKind, WP => DP
include 'link_fnl_shared.h'
use FFTCF_INT
implicit none
integer(kind = IP), parameter:: N = 27
real(kind = WP), parameter:: TwoPi = 6.283185307179586_WP
real(kind = WP), parameter:: SixPi = 18.84955592153876_WP
complex(kind = WP):: IU
complex(kind = WP):: COEF(N), SEQ(N)
complex(kind = WP):: H
complex(kind = WP):: CX
integer(kind = IP):: iL ! for loop
character(len = 50):: fmt_str
H = cmplx(0.0_WP, SixPi / N, WP)
CX = cmplx(0.0_WP, 0.0_WP, WP)
Do iL = 1, N, 1
SEQ( iL ) = exp( CX )
CX = CX + H
End Do ! iL
! Computes the Fourier Coefficients of a complex periodic sequence
call FFTCF(N, SEQ, COEF)
fmt_str = "(A5, 8X, A3, 15X, A4)"
write(*, fmt_str) "Index", "SEQ", "COEF"
!fmt_str = "(1X, I11, 5X, "(", F5.2, ",", F5.2, ")", 5X, "(", F5.2, ",", F5.2, ")")"
fmt_str = "(2X, I2, 5X, 2F8.4, 5X, 2F8.4)"
Do iL = 1, N, 1
!write(*, *) iL, SEQ(iL), COEF(iL)
write(*, fmt_str) iL, SEQ(iL), COEF(iL)
End Do ! iL
return
end subroutine
板凳
asymptotic [专家分:16630] 发布于 2010-10-10 12:13:00
! this module is dedicated to get machine independent data type
Module TypeKind
implicit none
integer(kind = kind(1)), parameter:: IP = kind(1) ! integer
integer(kind = IP), parameter:: LP = kind(.true.) ! logical
integer(kind = IP), parameter:: SP = kind(1.0) ! float
integer(kind = IP), parameter:: DP = kind(1.d0) ! double
End Module
program main
implicit none
call Test_FFTCF
stop
end program main
我来回复