|
在IVF+VS环境调试出现下面这样的错误,要怎么解决?
ex0836.f90(31): error #6552: The CALL statement is invoking a function subprogram as a subroutine. [GET_DISTANCE]
附源代码:
[Fortran] 纯文本查看 复制代码 03 | real , parameter :: PI = 3.14159 |
04 | real , parameter :: G = 9.81 |
18 | integer , parameter :: players = 5 |
19 | type ( player ) :: people ( players ) = ( / player ( 30.0 , 25.0 , 0.0 ) , & |
20 | player ( 45.0 , 20.0 , 0.0 ) , & |
21 | player ( 35.0 , 21.0 , 0.0 ) , & |
22 | player ( 50.0 , 27.0 , 0.0 ) , & |
23 | player ( 40.0 , 22.0 , 0.0 ) & |
25 | real , external :: Get_Distance |
28 | call Get_Distance ( people ( I ) ) |
29 | write ( * , "('Player ',I1,' =',F8.2)" ) I , people ( I ) % distance |
34 | real function Angle_TO_Rad ( angle ) |
38 | Angle_TO_Rad = angle * pi / 180.0 |
42 | subroutine Get_Distance ( person ) |
46 | type ( player ) :: person |
48 | real , external :: Angle_TO_Rad |
49 | rad = Angle_TO_Rad ( person % angle ) |
50 | Vx = person % speed * cos ( rad ) |
51 | time = 2.0 * person % speed * sin ( rad ) / G |
52 | person % distance = Vx * time |
|
|