main
| Line | |
|---|
| 1 | c F77 standard Sec. 8.3 COMMON statement
|
|---|
| 2 | program p
|
|---|
| 3 | integer i
|
|---|
| 4 | real a,b,x,y,w,z
|
|---|
| 5 | common b,i,a
|
|---|
| 6 | common /cm/ w,z
|
|---|
| 7 | i = 2
|
|---|
| 8 | b = 3.1
|
|---|
| 9 | a = 4.2
|
|---|
| 10 | x = 5.3
|
|---|
| 11 | y = 6.4
|
|---|
| 12 | call sub(x,y)
|
|---|
| 13 | c$ civl assert(i .eq. 3)
|
|---|
| 14 | c$ civl assert(a .eq. 5.2)
|
|---|
| 15 | c$ civl assert(b .eq. 4.1)
|
|---|
| 16 | c$ civl assert(x .eq. 6.3)
|
|---|
| 17 | c$ civl assert(y .eq. 7.4)
|
|---|
| 18 | call sub2
|
|---|
| 19 | c$ civl assert(i .eq. 3)
|
|---|
| 20 | c$ civl assert(a .eq. 5.2)
|
|---|
| 21 | c$ civl assert(b .eq. 4.1)
|
|---|
| 22 | c$ civl assert(x .eq. 6.3)
|
|---|
| 23 | c$ civl assert(y .eq. 7.4)
|
|---|
| 24 | end program
|
|---|
| 25 |
|
|---|
| 26 | subroutine sub(p,q)
|
|---|
| 27 | integer i
|
|---|
| 28 | real a,b,p,q,y,z
|
|---|
| 29 | common a,i,b, /cm/ y,z
|
|---|
| 30 | c$ civl assert(p .eq. 5.3)
|
|---|
| 31 | c$ civl assert(q .eq. 6.4)
|
|---|
| 32 | c$ civl assert(a .eq. 3.1)
|
|---|
| 33 | c$ civl assert(i .eq. 2)
|
|---|
| 34 | c$ civl assert(b .eq. 4.2)
|
|---|
| 35 | p = p + 1
|
|---|
| 36 | q = q + 1
|
|---|
| 37 | a = a + 1
|
|---|
| 38 | b = b + 1
|
|---|
| 39 | i = i + 1
|
|---|
| 40 | y = 7.5
|
|---|
| 41 | z = 8.6
|
|---|
| 42 | end subroutine
|
|---|
| 43 |
|
|---|
| 44 | subroutine sub2
|
|---|
| 45 | real z,y
|
|---|
| 46 | c The list following each successive appearance of the same common block
|
|---|
| 47 | c name is treated as a continuation of the list for that common block name.
|
|---|
| 48 | common /cm/ z
|
|---|
| 49 | common /cm/ y
|
|---|
| 50 | c$ civl assert(y .eq. 8.6)
|
|---|
| 51 | c$ civl assert(z .eq. 7.5)
|
|---|
| 52 | end subroutine
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.