所以我再次被Fortran困惑。去搞清楚。无论如何,我正在试图写一个非常简单的例程,这些条带在数组的末尾。一切复杂工作正常,除了我想写的子例程,我不必将输入数组的下限传递给它。下面是子程序:Fortran - 绑定抛出错误6366“数组表达式的形状不符合”
subroutine Strip(list,lstart, index)
implicit none
integer :: i, index, isize, tsize, lstart, istart
real, dimension(:), allocatable, intent(inout) :: list
real, dimension(:), allocatable :: tlist
isize = size(list)
tsize = index-1
print *, 'index', index
print *, 'isize', isize
print*, 'lbound', INT(lbound(list))
print*, 'tsize', tsize
istart = lbound(list) !<---- This lines throws the error
!These are commented out because everything below here works
!allocate(tlist(lstart:tsize))
!tlist = list(lstart:index-1)
!deallocate(list)
!call move_alloc(tlist,list)
end subroutine Strip
现在,我路过下界输入列表进入子程序(lstart),但我想没有这样做。无论如何,这段代码不会编译,编译器会抛出错误6366: The shapes of the array expressions do not conform [ISTART]
我不知道如何解决这个问题。有什么建议么?
这是哪个编译器?不同的编译器有不同的错误信息。 –