real function pbarfun(r, theta) implicit none real, intent(in) :: r, theta pbarfun = psifun(geom%psi(r, theta)) end function pbarfun