program x
real :: z = 10
type position
real :: x
real :: y
real :: z
end type position
type(position) :: xyz
xyz = position(1,2,3)
z = fun1(z)
write(*,*) z
contains
real function fun1(x)
real intent(in) :: x
fun1 = (x+xyz%z)/xyz%z
end function fun1
end program x