Should the call to UBOUND return a value smaller than the call to LBOUND in this code?
program main
real :: a(3)
a = 0.0
print *, 'size of a(2:1) is ', size(a(2:1)) !< Should be 0 (works OK)
print *, 'Lower bound of a(2:1) is ', lbound(a(2:1)) !< Should be 1 (works OK)
print *, 'Upper bound of a(2:1) is ', ubound(a(2:1)) !< Should be 0 (but 1 obtained)
end
The SIZE and LBOUND are correct I think. If you implement UBOUND as LBOUND + SIZE - 1 it should always work.