|
我要求A1,A3,可是只有含有A1,A3的表达式A,B,C,D的关系式,编程如下,求大师指导
[Fortran] 纯文本查看 复制代码 06 | real , parameter :: ERRREL = 0.0001 |
08 | integer , parameter :: ITMAX = 100 |
09 | real * 8 :: XGUESS ( N ) = ( / 0.0467 , 0.0732 / ) |
11 | real * 8 A 1 , A 2 , A 3 , A , B , C , D |
14 | real , parameter :: pi = 3.14159 |
15 | integer , parameter :: Zrs = 5 |
16 | integer , parameter :: A 4 s = 9 |
18 | real * 8 :: Zr ( Zrs ) = ( / 1.0 , 2.0 , 3.0 , 4.0 , 5.0 / ) |
19 | real * 8 :: A 4 ( A 4 s ) = ( / 0.075 , 0.10 , 0.15 , 0.20 , 0.25 , 0.30 , 0.35 , 0.40 , 0.425 / ) |
29 | call NEQNF ( Zr ( i ) , A 4 ( k ) , FCN ( i , k ) , ERRREL , N , ITMAX , XGUESS , X , FNORM ) |
34 | subroutine A 4 _get_A ( A 4 , A ) |
37 | real , parameter :: pi = 3.14159 |
39 | A = cos ( 2.0 * pi * A 2 ) * cos ( 2.0 * pi * A 4 ) - sin ( 2.0 * pi * A 2 ) * ( - cos ( 2.0 * pi * A 4 ) / tan ( 2.0 * pi * A 3 ) + sin ( 2.0 * pi * A 4 ) ) |
44 | subroutine A 4 _get_B ( A 4 , B ) |
47 | real , parameter :: pi = 3.14159 |
50 | B = Z 0 * ( cos ( 2.0 * pi * A 2 ) * sin ( 2.0 * pi * A 4 ) + sin ( 2.0 * pi * A 2 ) * ( sin ( 2.0 * pi * A 4 ) / tan ( 2.0 * pi * A 3 ) + cos ( 2.0 * pi * A 4 ) ) ) |
54 | subroutine A 4 _get_C ( A 4 , C ) |
56 | real * 8 A 1 , A 2 , A 3 , A 4 , Z 0 , C |
57 | real , parameter :: pi = 3.14159 |
64 | subroutine A 4 _get_D ( A 4 , D ) |
67 | real , parameter :: pi = 3.14159 |
70 | D = - sin ( 2.0 * pi * A 4 ) * ( - cos ( 2.0 * pi * A 2 ) / tan ( 2.0 * pi * A 1 ) + sin ( 2.0 * pi * A 2 ) ) + ( sin ( 2.0 * pi * A 2 ) / tan ( 2.0 * pi * A 1 ) + cos ( 2.0 * pi * A 2 ) ) * ( sin ( 2.0 * pi * A 4 ) / tan ( 2.0 * pi * A 3 ) + cos ( 2.0 * pi * A 4 ) ) |
75 | subroutine FCN ( A , B , C , D , A 4 , Zr , XA , F , N ) |
81 | real * 8 A , B , C , D , A 4 , Z 0 , Zr , Zi |
92 | F ( 1 ) = A * D + B * C - Z 0 * ( ( D - C * Zi ) * ( D - C * Zi ) + ( C * Zr ) * ( C * Zr ) ) |
93 | F ( 2 ) = ( D * A - B * C ) * Zi - A * C * ( Zr * Zr + Zi * Zi ) + D * B |
以下是错误指示
Compiling Fortran...
C:\Program Files\Microsoft Visual Studio\MyProjects\tu2\tu2.f90
C:\Program Files\Microsoft Visual Studio\MyProjects\tu2\tu2.f90(29) : Error: The number of actual arguments cannot be greater than the number of dummy arguments. [NEQNF]
call NEQNF(Zr(i),A4(k),FCN(i,k),ERRREL,N,ITMAX,XGUESS,X,FNORM)
------^
C:\Program Files\Microsoft Visual Studio\MyProjects\tu2\tu2.f90(29) : Error: The type of the actual argument differs from the type of the dummy argument. [A4]
call NEQNF(Zr(i),A4(k),FCN(i,k),ERRREL,N,ITMAX,XGUESS,X,FNORM)
------------------^
C:\Program Files\Microsoft Visual Studio\MyProjects\tu2\tu2.f90(29) : Error: The type of the actual argument differs from the type of the dummy argument. [FCN]
call NEQNF(Zr(i),A4(k),FCN(i,k),ERRREL,N,ITMAX,XGUESS,X,FNORM)
------------------------^
C:\Program Files\Microsoft Visual Studio\MyProjects\tu2\tu2.f90(29) : Error: The type of the actual argument differs from the type of the dummy argument. [0.0001]
call NEQNF(Zr(i),A4(k),FCN(i,k),ERRREL,N,ITMAX,XGUESS,X,FNORM)
---------------------------------^
C:\Program Files\Microsoft Visual Studio\MyProjects\tu2\tu2.f90(29) : Error: The type of the actual argument differs from the type of the dummy argument. [2]
call NEQNF(Zr(i),A4(k),FCN(i,k),ERRREL,N,ITMAX,XGUESS,X,FNORM)
----------------------------------------^
C:\Program Files\Microsoft Visual Studio\MyProjects\tu2\tu2.f90(29) : Error: The type of the actual argument differs from the type of the dummy argument. [100]
call NEQNF(Zr(i),A4(k),FCN(i,k),ERRREL,N,ITMAX,XGUESS,X,FNORM)
------------------------------------------^
C:\Program Files\Microsoft Visual Studio\MyProjects\tu2\tu2.f90(29) : Error: The type of the actual argument differs from the type of the dummy argument. [XGUESS]
call NEQNF(Zr(i),A4(k),FCN(i,k),ERRREL,N,ITMAX,XGUESS,X,FNORM)
------------------------------------------------^
C:\Program Files\Microsoft Visual Studio\MyProjects\tu2\tu2.f90(29) : Error: This actual argument must be the name of a user subroutine or the name of intrinsic subroutine. [ZR]
call NEQNF(Zr(i),A4(k),FCN(i,k),ERRREL,N,ITMAX,XGUESS,X,FNORM)
------------^
C:\Program Files\Microsoft Visual Studio\MyProjects\tu2\tu2.f90(29) : Error: The shape matching rules of actual arguments and dummy arguments have been violated. [XGUESS]
call NEQNF(Zr(i),A4(k),FCN(i,k),ERRREL,N,ITMAX,XGUESS,X,FNORM)
------------------------------------------------^
C:\Program Files\Microsoft Visual Studio\MyProjects\tu2\tu2.f90(28) : Error: An unterminated block exists.
do k=1,A4s
^
C:\Program Files\Microsoft Visual Studio\MyProjects\tu2\tu2.f90(27) : Error: An unterminated block exists.
do i=1,Zrs
^
Error executing df.exe.
tu2.obj - 11 error(s), 0 warning(s)
在此谢过!!
|
|