source: CIVL/mods/dev.civl.abc/examples/fortran/commonblock/common_short.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: 585 bytes
Line 
1! Using a common block where the first 8 bytes are taken by
2! a double precision variable in MAIN, and by two reals in
3! SUB. Also, the last variable in the common block (PAD2)
4! is not made visible inside SUB.
5 PROGRAM MAIN
6 INTEGER A
7 REAL F,R,X,Y
8 DOUBLE PRECISION PAD, PAD2
9 COMMON PAD,R,A,F,PAD2
10 A = 5
11 R = 3.5
12 CALL SUB(X,Y)
13 PAD = F
14 WRITE(*,*) PAD
15 END
16
17 SUBROUTINE SUB(P,Q)
18 INTEGER I
19 REAL A,B,P,Q,PAD,PAD2
20 COMMON PAD,PAD2,A,I,B
21 PAD = A
22 PAD2 = I
23 B = PAD2 + 2*PAD
24 END
Note: See TracBrowser for help on using the repository browser.