      SUBROUTINE SQUAD8 (SFUN,LDER,XI,ETA)
      DOUBLE PRECISION SFUN(8), LDER(2,8), XI, ETA
      DOUBLE PRECISION ONE, TWO, FOUR
      PARAMETER (ONE=1.D0, TWO=2.D0, FOUR=4.D0)
      SFUN(1) = (ONE-XI)*(ONE-ETA)*(-XI-ETA-ONE)/FOUR
      SFUN(2) = (ONE-XI*XI)*(ONE-ETA)/TWO
      SFUN(3) = (ONE+XI)*(ONE-ETA)*(XI-ETA-ONE)/FOUR
      SFUN(4) = (ONE-ETA*ETA)*(ONE+XI)/TWO
      SFUN(5) = (ONE+XI)*(ONE+ETA)*(XI+ETA-ONE)/FOUR
      SFUN(6) = (ONE-XI*XI)*(ONE+ETA)/TWO
      SFUN(7) = (ONE-XI)*(ONE+ETA)*(-XI+ETA-ONE)/FOUR
      SFUN(8) = (ONE-ETA*ETA)*(ONE-XI)/TWO
      LDER(1,1) = (ETA+TWO*XI-TWO*XI*ETA-ETA*ETA)/FOUR
      LDER(2,1) = (XI+TWO*ETA-TWO*XI*ETA-XI*XI)/FOUR
      LDER(1,2) = -XI+XI*ETA
      LDER(2,2) = (-ONE+XI*XI)/TWO
      LDER(1,3) = (-ETA+TWO*XI-TWO*XI*ETA+ETA*ETA)/FOUR
      LDER(2,3) = (-XI+TWO*ETA-XI*XI+TWO*XI*ETA)/FOUR
      LDER(1,4) = (ONE-ETA*ETA)/TWO
      LDER(2,4) = -ETA-XI*ETA
      LDER(1,5) = (ETA+TWO*XI+TWO*XI*ETA+ETA*ETA)/FOUR 
      LDER(2,5) = (XI+TWO*ETA+XI*XI+TWO*XI*ETA)/FOUR
      LDER(1,6) = -XI-XI*ETA
      LDER(2,6) = (ONE-XI*XI)/TWO
      LDER(1,7) = (-ETA+TWO*XI+TWO*XI*ETA-ETA*ETA)/FOUR
      LDER(2,7) = (-XI+TWO*ETA+XI*XI-TWO*XI*ETA)/FOUR
      LDER(1,8) = (-ONE+ETA*ETA)/TWO
      LDER(2,8) = -ETA+XI*ETA
      RETURN
      END
