这个product的使用报错,不知道如何更改
Subroutine Wii_()Implicit none
real*8::x(11),y(11),pi=3.141592653589793,L
Integer::N,i,j
L=1
N=11
Do i=1,N,1
x(i)=(L/2)*(1-cos(((i-1)/(N-1))*pi))
Do j=1,N,1
y(j)=(L/2)*(1-cos(((j-1)/(N-1))*pi))
END Do
END Do
end Subroutine Wii_
program main_mik
Implicit real*8(a-z)
real*8::G(1),W(1),x(11),y(11)
Integer::k
k=1
callWii_()
G(k)=product(x(i)-y(j),y(j)/=x(i))
W(k)=1/G(k)
write(*,*)"W(k)=W(k)"
end program main_mik
product(x(i)-y,y/=x(i)) Subroutine Wii_(x,y)
Implicit none
real*8::x(11),y(11),pi=acos(-1.0),L
Integer::N,i,j
L=1
N=11
Do i=1,N
x(i)=(L/2)*(1-cos(((i-1.0)/(N-1.0))*pi))
END Do
Do j=1,N
y(j)=(L/2)*(1-sin(((j-1.0)/(N-1.0))*pi))
END Do
end Subroutine Wii_
program main_mik
Implicit real*8(a-z)
real*8::G(1),W(1),x(11),y(11)
Integer::k
k=1
callWii_(x,y)
G(k)=product(x-y,x/=y)
W(k)=1/G(k)
write(*,*)"W(k)=",W(k)
end program main_mik 谢谢大佬,已经解决了 li913 发表于 2023-12-15 11:20
product(x(i)-y,y/=x(i))
谢谢您的帮助,已解决
页:
[1]