Clicky

Fortran Wiki
use_test (changes)

Skip the Navigation Links | Home Page | All Pages | Recently Revised | Authors | Feeds | Export |

Showing changes from revision #0 to #1: (追記) Added (追記ここまで) | (削除) Removed (削除ここまで) | (削除) Chan (削除ここまで)(追記) ged (追記ここまで)

Jason Blevins (10 May 2009) This is a test program to answer the following question: If bar_mod uses foo_mod, do we get access to the public symbols of foo_mod when we use bar_mod?

! use_test.f90 -- testing multi-level use statements
module foo_mod
 implicit none
 real, parameter :: foo = 3.1416
end module foo_mod
module bar_mod
 use foo_mod
 implicit none
 real, parameter :: bar = 2.7183
end module bar_mod
program use_test
 use bar_mod
 implicit none
 print *, 'foo:', foo
 print *, 'bar:', bar
end program use_test

The answer is yes:

% gfortran -o use_test use_test.f90
% ./use_test
 foo: 3.1415999 
 bar: 2.7183001
Created on May 10, 2009 16:15:06 by Jason Blevins (74.251.196.253) (700 characters / 0.0 pages)
Edit | Views: Print | TeX | Source | Linked from: Code, 2009

AltStyle によって変換されたページ (->オリジナル) /