| 1 |
program A_M |
| 2 |
implicit none |
| 3 |
real, parameter :: C(5:10) = 5.0 |
| 4 |
real, dimension (:), allocatable :: A, B |
| 5 |
allocate (A(6)) |
| 6 |
call Init (A) |
| 7 |
contains |
| 8 |
subroutine Init ( A ) |
| 9 |
real, dimension ( -1 : ), intent ( in ) :: A |
| 10 |
integer, dimension ( 1 ) :: lb_B |
| 11 |
|
| 12 |
allocate (B, mold = A) |
| 13 |
if (any (lbound (B) /= lbound (A))) stop 1 |
| 14 |
if (any (ubound (B) /= ubound (A))) stop 2 |
| 15 |
if (any (shape (B) /= shape (A))) stop 3 |
| 16 |
if (size (B) /= size (A)) stop 4 |
| 17 |
deallocate (B) |
| 18 |
allocate (B, mold = C) |
| 19 |
if (any (lbound (B) /= lbound (C))) stop 5 |
| 20 |
if (any (ubound (B) /= ubound (C))) stop 6 |
| 21 |
if (any (shape (B) /= shape (C))) stop 7 |
| 22 |
if (size (B) /= size (C)) stop 8 |
| 23 |
end |
| 24 |
end |