module mod | |
implicit none | |
integer :: variable !<<<<< 3, 14, 8, pass | |
private :: variable | |
contains | |
subroutine setVariable(value) | |
implicit none | |
integer, intent(in) :: value | |
variable = value | |
end subroutine | |
integer function getVariable() | |
implicit none | |
getVariable = variable | |
end function | |
integer function three() | |
three = 3 | |
end function | |
end module | |
program encap1 | |
use mod | |
implicit none | |
print *,getVariable() | |
call setVariable(3) | |
print *,getVariable() | |
end program encap1 |