source: CIVL/mods/dev.civl.abc/examples/fortran/f77_standard/common.f

main
Last change on this file was aad342c, checked in by Stephen Siegel <siegel@…>, 3 years ago

Performing huge refactor to incorporate ABC, GMC, and SARL into CIVL repo and use Java modules.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5664 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 1.2 KB
Line 
1c 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)
13c$ civl assert(i .eq. 3)
14c$ civl assert(a .eq. 5.2)
15c$ civl assert(b .eq. 4.1)
16c$ civl assert(x .eq. 6.3)
17c$ civl assert(y .eq. 7.4)
18 call sub2
19c$ civl assert(i .eq. 3)
20c$ civl assert(a .eq. 5.2)
21c$ civl assert(b .eq. 4.1)
22c$ civl assert(x .eq. 6.3)
23c$ 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
30c$ civl assert(p .eq. 5.3)
31c$ civl assert(q .eq. 6.4)
32c$ civl assert(a .eq. 3.1)
33c$ civl assert(i .eq. 2)
34c$ 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
46c The list following each successive appearance of the same common block
47c name is treated as a continuation of the list for that common block name.
48 common /cm/ z
49 common /cm/ y
50c$ civl assert(y .eq. 8.6)
51c$ civl assert(z .eq. 7.5)
52 end subroutine
Note: See TracBrowser for help on using the repository browser.