subroutine mean(x,y,z,a,g,h)
   implicit none
   real,intent(in)::x,y,z
   real,intent(inout)::a,g,h
   real::d
   a=(x+y+z)/3.0
   g=(x*y*z)**(1.0/3.0)
   d=(1.0/x+1.0/y+1.0/z)/3.0
   h=1./d
end subroutine

! this is a example function
real function exmpfunc(a,g,h)
   implicit none
   real,intent(in)::a,g,h
   exmpfunc=exp(-a*a)*sin(g)-cos(h)
end function

