      FUNCTION G (XFM,N)
      IMPLICIT  REAL*8   (A-H,O-Z)
C *** SEE R H LANDAU, PROGRAM LPOTT, 1981
C
C     THOMAS S SEP POTS FOR PIN INTERACTN 2 B USED IN PAULI
C
      Q=XFM*XFM
      IF(N.EQ.4) GO TO 10
      IF(N.EQ.1) GO TO 20
      IF(N.EQ.5) GO TO 30
      IF(N.EQ.2) GO TO 40
      IF(N.EQ.6) GO TO 50
      IF(N.EQ.3) GO TO 60
C     SET G=0 FOR D,F WAVES, I.E. NO PAULI MOD
      G=0.
      GO TO 101
C
C     S11
 10   QQ=Q+10.16245
      G=1.782555/QQ
      QQ=Q+0.6765392
      G=G+0.0893673/QQ
      GO TO 101
C
C     S31
 20   QQ=Q+11.43562
      G=6.078618/QQ
      QQ=Q+1.226003
      G=G-.166086/QQ
      GO TO 101
C
C     P11
 30   QQ=Q+1.152918
      G=.3959393/(QQ*QQ)
      G=G*XFM
      GO TO 101
C
C     P31
 40   QQ=Q+4.240288
      G=4.289725/(QQ*QQ)
      G=G*XFM
      GO TO 101
C
C     P13
 50   QQ=Q+1.546665
      G=1.556884/(QQ*QQ)
      QQ=Q+3.783998
      G=G+3.659448*Q/(QQ*QQ)
      G=G*XFM
      GO TO 101
C
C     P33
 60   CONTINUE
      QQ=Q+2.175711
      GG=.5403217/(QQ*QQ)
      QQ=Q+11.55941
      GG=GG+Q*1.05832/(QQ*QQ)
      G=XFM*GG
      GO TO 101
 101  CONTINUE
      RETURN
      END
