source: CIVL/mods/dev.civl.abc/examples/fortran/commonblock/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: 372 bytes
Line 
1! Variables in the nameless comon block stay in scope between
2! calls to SUB
3 PROGRAM MAIN
4 REAL X
5 X = 1.0
6 CALL SUB(X,1)
7 CALL SUB(X,2)
8 WRITE(*,*) X
9 END
10
11 SUBROUTINE SUB(X,FLAG)
12 INTEGER FLAG
13 REAL X
14 COMMON Y
15 IF(FLAG .eq. 1) THEN
16 Y = X * 2
17 ELSE
18 X = Y
19 ENDIF
20 END
Note: See TracBrowser for help on using the repository browser.