(Re)allocation of allocatable arrays on assignment - F2003

Dominique Dhumieres dominiq@lps.ens.fr
Tue Oct 26 15:23:00 GMT 2010


Paul,

Another problem with bounds:

real :: a(10)=1, b(51:60)=2
real, allocatable :: c(:)
c=b
print *, c
print *, lbound(c), ubound(c)
c=a
print *, c
print *, lbound(c), ubound(c)
c=a(2:9)
print *, c
print *, lbound(c), ubound(c)
end

the bounds are 51:60, 51:60 (previous message), and 2:9.
Should not the last one be 1:8 (bounds of a section)?

Cheers,

Dominique



More information about the Fortran mailing list