main
| Line | |
|---|
| 1 | c F77 standard Sec. 8.2: An EQUIVALENCE statement is used to specify the
|
|---|
| 2 | c sharing of storage units by two or more entities in a program unit.
|
|---|
| 3 | program p
|
|---|
| 4 | implicit none
|
|---|
| 5 | integer i(4), j(3)
|
|---|
| 6 | real a(2,2),b(4),y(2)
|
|---|
| 7 | complex z(1)
|
|---|
| 8 | equivalence (i(1), j), (a(1,1),b(1)), (y(1),z(1))
|
|---|
| 9 | i = 0
|
|---|
| 10 | j = 1
|
|---|
| 11 | c$ civl assert(all(i .eq. (/1,1,1,0/)))
|
|---|
| 12 | b(3) = 2
|
|---|
| 13 | c$ civl assert(a(1,2) .eq. 2)
|
|---|
| 14 | y = (/4,5/)
|
|---|
| 15 | c$ civl assert(imag(z) .eq. 5)
|
|---|
| 16 | end program
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.