我在Fortran 90中有类似下面的代码:
PROGRAM TICTACTOE
IMPLICIT none
character (len=1), DIMENSION(3,3) :: ticTac
character :: winner
SUBROUTINE CHKOVR(ticTac, over, winner)
character (len=1), DIMENSION(3,3) :: ticTac
character :: winner
logical over
END SUBROUTINE CHKOVR
END PROGRAM TICTACTOE
我收到了错误:
tictactoe.f90:11:2:
SUBROUTINE CHKOVR(ticTac, over, winner)
1
Error: Unclassifiable statement at (1)
tictactoe.f90:12:47:
character (len=1), DIMENSION(3,3) :: ticTac
1
Error: Symbol ‘tictac’ at (1) already has basic type of CHARACTER
tictactoe.f90:13:23:
character :: winner
1
Error: Symbol ‘winner’ at (1) already has basic type of CHARACTER
tictactoe.f90:16:5:
我正在尝试将一些旧的fortran代码转换为更现代的fortran 90。
诚然,我现在还不太清楚这种语言。在旧代码中,这种东西工作得很好。 ticTac
在这里被视为全局变量,我不应该将它传递给子例程吗?旧代码做到了这一点,但我怀疑我现在拥有的是某种全局变量。
或问题是其他问题?