main
| Line | |
|---|
| 1 | c F77 standard Sec. 8.3 COMMON statement
|
|---|
| 2 | c Just like in the equivalence statement, the shape does not need to match.
|
|---|
| 3 | c Also, the un-named common block does not need the same size everywhere.
|
|---|
| 4 | program p
|
|---|
| 5 | integer a, b(6), c, d(6)
|
|---|
| 6 | common b,a
|
|---|
| 7 | common /cm/ c,d
|
|---|
| 8 | a = 1
|
|---|
| 9 | b = (/1,2,3,4,5,6/)
|
|---|
| 10 | c = a
|
|---|
| 11 | d = b
|
|---|
| 12 | call sub
|
|---|
| 13 | end program
|
|---|
| 14 |
|
|---|
| 15 | subroutine sub
|
|---|
| 16 | integer b(2,3), c, d(2,3)
|
|---|
| 17 | common b
|
|---|
| 18 | common /cm/ c,d
|
|---|
| 19 | c$ civl assert(b(2,2) .eq. 4)
|
|---|
| 20 | c$ civl assert(d(2,2) .eq. 4)
|
|---|
| 21 | c$ civl assert(c .eq. 1)
|
|---|
| 22 | end subroutine
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.