SUBROUTINE CalculateQuadraticBaseFunctions(z,zg,basefv)
IMPLICIT NONE
DOUBLE PRECISION,INTENT(IN)::z,zg(3)
DOUBLE PRECISION,INTENT(OUT)::basefv(3)
DOUBLE PRECISION am,d,x1,x2
!-------------------------------------------------------
am=0.5D0*(zg(1)+zg(3)) 
d=0.5D0*(zg(3)-zg(1))
!-----------------------------------------------------
x1=(z-am)/(d+d)
x2=x1*(x1+x1)
!--------------------------------------------------
basefv(1:3)=[x2-x1,1.D0-x2-x2,x2+x1]
!----------------------------------------------------
RETURN
END
