I try to initialize a local logical array in the Fortran routine to false, but I get an error:
error # 6562: initialization of data-expr is not valid for this object.
Here is my expression:
integer , intent(in) :: nLOW integer , intent(in) :: nUP logical , dimension(nLOW:nUP) :: leastSQUARE = .false.
I get the same error if I use:
integer :: I integer , intent(in) :: nLOW integer , intent(in) :: nUP logical , dimension(nLOW:nUP) :: leastSQUARE = (/ (.false., I = nLOW:nUP) /)
If I write:
integer , intent(in) :: nLOW integer , intent(in) :: nUP logical , dimension(1:100) :: leastSQUARE = .false.
the routine compiles with zero errors. Any idea why this is happening? I explicitly need leastSQUARE with dimensions nLOW:nUP , so the latter is not a workaround.
source share