-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainmodule.f90
55 lines (39 loc) · 873 Bytes
/
mainmodule.f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
module variables_module
implicit none
integer, parameter :: num_vars = 5
integer :: amount
real :: pi
complex :: frequency
character(len=1) :: initial
logical :: isOkay
contains
subroutine initialize_variables()
amount = 10
pi = 3.1415927
frequency = (1.0, -0.5)
initial = 'A'
isOkay = .false.
end subroutine initialize_variables
subroutine print_variables()
integer :: i
do i = 1, 5
select case(i)
case(1)
print *, 'amount = ', amount
case(2)
print *, 'pi = ', pi
case(3)
print *, 'frequency = ', frequency
case(4)
print *, 'initial = ', initial
case(5)
print *, 'isOkay = ', isOkay
end select
end do
end subroutine print_variables
end module variables_module
program main
use variables_module
call initialize_variables()
call print_variables()
end program main