使用隐式循环在Fortran数组中填充特定范围

时间:2018-09-12 16:31:01

标签: arrays loops fortran

我想从隐式循环中用一些值填充数组...我的问题是,尽管第一行工作正常,但第二行从我的编辑器调试器中得到了错误表达式”。

usum(:,:,:,1:3) = (usum(:,:,:,ll)+(um(ll)*ur(:,:,:,ll),ll=1,3)
usum(:,:,:,4:6) = (usum(:,:,:,ll+3)+(um(ll)*ur(:,:,:,ll))**2, ll=1,3)

我不明白为什么第一行有效,而第二行却无效...

它是固定格式的源代码,来自ifort的确切错误消息是:

snapstat.f(353): error #5082: Syntax error, found '=' when expecting one of: .EQV. .NEQV. .XOR. .OR. .AND. .LT. < .LE. <= .EQ. == .NE. /= .GT. > ...         
     1                  ll=1,3)                                                                                                                              
--------------------------^                                                                                                                                                                                                                                                     
snapstat.f(355): error #5082: Syntax error, found '=' when expecting one of: .EQV. .NEQV. .XOR. .OR. .AND. .LT. < .LE. <= .EQ. == .NE. /= .GT. > ...         
     1                  ur(:,:,:,ll))**2, ll=1,3)
--------------------------------------------^
snapstat.f(353): error #5082: Syntax error, found '=' when expecting one of: .EQV. .NEQV. .XOR. .OR. .AND. .LT. < .LE. <= .EQ. == .NE. /= .GT. > ...         
     1                  ll=1,3)                                                                                                                              
--------------------------^                                                                                                                                                                                                                                                
snapstat.f(355): error #5082: Syntax error, found '=' when expecting one of: .EQV. .NEQV. .XOR. .OR. .AND. .LT. < .LE. <= .EQ. == .NE. /= .GT. > ...         
     1                  ur(:,:,:,ll))**2, ll=1,3)
--------------------------------------------^

(我在编辑器中将行分割了,所以不超过72)

0 个答案:

没有答案