module test_module
  implicit none
  private
  integer, public :: a=1
  integer, public, protected :: b=1
  integer, private :: c=1
end module test_module

program main
  use test_module

  ! accessing public object works
  print *, a

  ! editing public object works
  a = 2

  ! accessing protected object works
  print *, b

  ! editing protected object does not work
  !b = 2 <- ERROR

  ! accessing private object does not work
  !print *, c <- ERROR

  ! editing protected object does not work
  !c = 2 <- ERROR

end program main