!234567890123456789012345678901234567890123456789012345678901234567890 
      function f2(ro)
!
!	function for gen_1.f
!
      implicit real *8 (a-h,o-z)

!	Global variables

common /param1/ rm,cpref,cliqref,cpair,t0,rntu,hfg
common /param3/ rmu,rmu_prime
common /param4/ tau_b,tau_1,tau_w
	
	! superheated section

	tau3=tau_w-rmu*(ro-tau_b)
	
	c=(ro-tau_b)/(tau_w-tau_b)
	
!	c=(tau_w-tau3)/rmu/(tau_w-tau_b)

	aux1=(c-1.d0)/(c*rmu-1.d0)

	x=-rmu*log(aux1)/(rntu*(1.d0-rmu))
	
	! boiling section

	aux2=1.d0-rmu*hfg/cpref/t0/(tau3-tau_b)

	y=-log(aux2)/rntu

	! liquid section

	tau4=tau3-rmu*hfg/cpref/t0

	auxe=(tau_b-tau_1)/(tau4-tau_1)

	aux3=(1.d0-rmu_prime*auxe)/(1.d0-auxe)

	xy=rmu_prime*log(aux3)/(rntu*(1.d0-rmu_prime))


	f2=xy-(1-x-y)


      return
      end
!--------------------------------------------------------------
!234567890123456789012345678901234567890123456789012345678901234567890 
      function j1(r)



!     derivative for gen_1.f



      implicit real *8 (a-h,o-z)

      common /const/ sigma,beta,gama,ratio,ht2

      s=sigma*ht2

      j1=1.d0-ht2*(gama-3.d0*beta*r*r)-2.d0*s

      return

      end
!*****************************************************************8
!234567890123456789012345678901234567890123456789012345678901234567890 
      function ftest(x)
!
!	function for gen_1.f
!
      implicit real *8 (a-h,o-z)

	ftest=exp(x)-3.d0*x

!	ftest=x-log(x)-1.d0

	return
	end

!23456789012345678901234567890123456789012345678901234567890123456789012

