! Module module my_modules implicit none private ! Defaults everthing to private public :: point, assignment(=) ! Makes only 'point' and '(=)' public ! Meaning that the main program wont be able to ! directly call the subroutine 'array_to_point' type point real :: x,y,z end type point interface assignment (=) module procedure array_to_point end interface contains subroutine array_to_point(some_point, some_array) type(point), intent(out) :: some_point real, intent(in) :: some_array(3) some_point%x = some_array(1) some_point%y = some_array(2) some_point%z = some_array(3) end subroutine array_to_point end module my_modules ! Program program main use my_modules implicit none type(point) :: p real :: a(3) a = (/1.,2.,3./) p = a ! Uses the assignment operator print*, p ! Using 'call array_to_point(p,a)' will NOT work since the subroutine is 'private' in the module end program main