source: CIVL/mods/dev.civl.abc/examples/fortran/commonblock/bug_common_preservation.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: 535 bytes
Line 
1! Variables in named common blocks drop out of scope
2! (become undefined) at the END statement, unless they
3! are still referenced somewhere else. See F77 Sec 15.8.4
4! The second call therefore reads an uninitialized variable.
5 PROGRAM MAIN
6 REAL X
7 X = 1.0
8 CALL SUB(X,1)
9 CALL SUB(X,2)
10 WRITE(*,*) X
11 END
12
13 SUBROUTINE SUB(X,FLAG)
14 INTEGER FLAG
15 REAL X
16 COMMON /MC/ Y
17 IF(FLAG .eq. 1) THEN
18 Y = X * 2
19 ELSE
20 X = Y
21 ENDIF
22 END
Note: See TracBrowser for help on using the repository browser.