      subroutine normal(CRS,XYZ,ZCFD)
!输入CRS(5)－gm,a,j2,omega,1/f
!输出ZCFD(3)-正常位u,正常重力,正常重力梯度grad
!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
      implicit double precision (a-h,o-z)
	parameter(nn=180)
      double precision CRS(5),XYZ(3),ZCFD(3),djn(nn)
	double precision gm,ae,omega,ff,x,y,z
	double precision  DJ2N,psq,rsq
	real*8 tf,tfsq,fz,fm,bb,df,xn1,xn2,xn3
 	ff=CRS(5)
	gm=CRS(1) 
	ae=CRS(2) 
	omega=CRS(4)
	ii=nn
	x=XYZ(1) 
	y=XYZ(2) 
	z=XYZ(3) 
	do 101 n2=1,ii,1
	djn(n2)=0.d0
  101	continue
	djn(2)=CRS(3)
      capesq=ae**2*(2.d0-ff)*ff
      esq=(2.d0-ff)*ff   
      do 200 n2=4,ii,2
      n=n2/2
      djn(n2)=(-1.d0)**(n+1)*3.d0*esq**n/(dble(n2)+1.d0)/(dble(n2)+3.d0)
     **(1.d0-dble(n)+5.d0*dble(n)*djn(2)/esq)
  200 continue
      psq=x**2+y**2
      rsq=psq+z**2
      r=dsqrt(rsq)
      gmor=gm/r
      aor=ae/r
      sine=z/r
      pnl1=sine
      pn=1.5d0*sine**2-0.5d0
	xn1=dsqrt(1.d0-sine*sine)
	xn2=xn1*3.d0*sine
      f=1.d0
      fp=0.d0
      fpp=0.d0
	xk_a=0.0d0
      aorn=1.d0
      aor2=aor**2
      do 10 n=2,ii,2
      aorn=aorn*aor2
      term=-djn(n)*aorn*pn
      f=f+term
      fp=fp-dble(n)*term/r
      fpp=fpp+dble(n*(n+1))*term/rsq
	xk_a=xk_a+djn(n)*aorn*xn2/r
	!---------------------------------
      sve=(n+n+1.d0)/(n+1.d0)*sine*pn-n/(n+1.d0)*pnl1
      pnl1=pn
      pn=sve
      sve=(n+n+3.d0)/(n+2.d0)*sine*pn-(n+1.d0)/(n+2.d0)*pnl1
      pnl1=pn
	pn=sve

	xn3=(2.d0*n+1.d0)/n*sine*xn2-(n+1.d0)/n*xn1
	xn1=xn2
	xn2=xn3
	xn3=(2.d0*(n+1.d0)+1.d0)/(n+1.d0)*sine*xn2-(n+3.d0)/(n+1.)*xn1
	xn1=xn2
	xn2=xn3
   10 continue
      u=gmor*f
      gamma=gmor*fp-u/r
      omega2=omega**2
      grad=(u+u)/rsq-2.d0*gmor*fp/r+gmor*fpp+omega2*psq/rsq
      grad=dabs(grad)
      u=u+0.5d0*omega2*psq
      gamma=dabs(gamma+psq/r*omega2)  !
!-------------------------------------------
	AA=gmor*xk_a
	gthta=dabs(AA+omega2*z*dsqrt(psq)/r)  !
	gamma1=dsqrt(gamma*gamma+gthta*gthta)  
!-------------------------------------------
	ZCFD(1)=u
	ZCFD(2)=gamma1 
	ZCFD(3)=grad
      return
      end
