! copyright 2005,  J. E. Akin, all rights reserved.
! NOTE: May need compiler flag to allow 99 continuation lines

SUBROUTINE GAUSS_1D (M_QP, NIP, PT, WT)
! * * * * * * * * * * * * * * * * * * * * * * * *
! EXTRACT M_QP 1-D GAUSS DATA FROM TABLES
! * * * * * * * * * * * * * * * * * * * * * * * *
Use System_Constants
!b Use Precision_Module
 INTEGER,  INTENT(IN)  :: M_QP, NIP
 REAL(DP), INTENT(OUT) :: PT (1, NIP), WT (NIP)
!          Automatic Arrays
 REAL(DP) :: GPT (M_QP), GWT (M_QP)
  N_GP = M_QP
  IF ( N_GP /= NIP ) THEN
    N_GP = NIP
    WRITE (6, *) 'WARNING: DATA CHANGED, GAUSS_1D', &
                  M_QP, NIP, N_GP
    N_WARN = N_WARN + 1 ! INCREMENT WARNING
  END IF
  CALL GAUSS_COEFF (N_GP, GPT, GWT)
  DO IG = 1, N_GP
    PT (1, IG) = GPT (IG)
    WT (IG) = GWT (IG)
  END DO
END SUBROUTINE GAUSS_1D
                     
SUBROUTINE GAUSS_2D (M_QP, NIP, PT, WT)
! * * * * * * * * * * * * * * * * * * * * * * * *
!      USE M_QP 1-D GAUSSIAN DATA TO GENERATE
!        NIP QUADRATURE DATA FOR A SQUARE
! * * * * * * * * * * * * * * * * * * * * * * * *
Use System_Constants
!b Use Precision_Module
 INTEGER,  INTENT(IN)  :: M_QP, NIP
 REAL(DP), INTENT(OUT) :: PT (2, NIP), WT (NIP)
!          Automatic Arrays
 REAL(DP) :: GPT (M_QP), GWT (M_QP)

! M_QP = NUMBER OF TABULATED 1-D POINTS
! NIP  = M_QP*M_QP = NUMBER OF 2-D POINTS
! GPT  = TABULATED 1-D QUADRATURE POINTS
! GWT  = TABULATED 1-D QUADRATURE WEIGHTS
! PT   = CALCULATED COORDS IN A SQUARE
! WT   = CALCULATED WEIGHTS IN A SQUARE

  N_GP = M_QP
  IF ( (N_GP * N_GP) /= NIP ) THEN
    N_GP = SQRT (FLOAT (NIP) ) + 0.1
    WRITE (6, *) 'WARNING: DATA CORRECTED, GAUSS_2D', &
                  M_QP, NIP, N_GP
    N_WARN = N_WARN + 1 ! INCREMENT WARNING
  END IF
!  GET DATA FROM TABLE
  CALL GAUSS_COEFF (N_GP, GPT, GWT)
  K = 0
!  LOOP OVER GENERATED POINTS
  DO I = 1, N_GP
    DO J = 1, N_GP
      K = K + 1
      WT (K) = GWT (I) * GWT (J)
      PT (1, K) = GPT (J)
      PT (2, K) = GPT (I)
    END DO
  END DO
END SUBROUTINE GAUSS_2D
                     
SUBROUTINE GAUSS_3D (M_QP, NIP, PT, WT)
! * * * * * * * * * * * * * * * * * * * * * * * *
!     USE 1-D GAUSSIAN DATA TO GENERATE
!       QUADRATURE DATA FOR A CUBE
! * * * * * * * * * * * * * * * * * * * * * * * *
Use System_Constants
!b Use Precision_Module
 INTEGER,  INTENT(IN)  :: M_QP, NIP
 REAL(DP), INTENT(OUT) :: PT (3, NIP), WT (NIP)
!          Automatic Arrays
 REAL(DP) :: GPT (M_QP), GWT (M_QP)

! M_QP = NUMBER OF TABULATED 1-D POINTS
! NIP = M_QP**3 = NUMBER OF 3-D POINTS
! GPT = TABULATED 1-D QUADRATURE POINTS
! GWT = TABULATED 1-D QUADRATURE WEIGHTS
! PT  = CALCULATED COORDS IN A CUBE
! WT  = CALCULATED WEIGHTS IN A CUBE
  N_GP = M_QP
  N_GP3 = N_GP * N_GP * N_GP
  IF ( N_GP3 /= NIP ) THEN
    N_GP = (FLOAT (NIP) ) ** (1. / 3.)
    WRITE (6, *) 'WARNING: DATA CHANGED IN GAUSS_3D WHERE'
    WRITE (6, *) '1D RULE, 3D REQUESTED, 3D USED = ', &
                  M_QP, NIP, N_GP
    N_WARN = N_WARN + 1 ! INCREMENT WARNING
  END IF
!  GET TABLE DATA
  CALL GAUSS_COEFF (N_GP, GPT, GWT)
  K = 0
!  LOOP OVER GENERATED POINTS
  DO L = 1, N_GP
    DO I = 1, N_GP
      DO J = 1, N_GP
        K = K + 1
        WT (K) = GWT (I) * GWT (J) * GWT (L)
        PT (1, K) = GPT (J)
        PT (2, K) = GPT (I)
        PT (3, K) = GPT (L)
      END DO
    END DO
  END DO
END SUBROUTINE GAUSS_3D
                     
SUBROUTINE GAUSS_COEFF (M_QP, PT, WT)
! * * * * * * * * * * * * * * * * * * * * * * * * * *
! GAUSSIAN QUADRATURE ABSCISSAE AND WEIGHT COEFFS
! * * * * * * * * * * * * * * * * * * * * * * * * * *
Use System_Constants
!b Use Precision_Module
 INTEGER,  PARAMETER   :: NMAX = 12
 INTEGER,  INTENT(IN)  :: M_QP
 REAL(DP), INTENT(OUT) :: PT (M_QP), WT (M_QP)

! M_QP  = NO. OF GAUSS POINTS IN ONE DIMENSION
! PT   = ABSCISSAE OF GAUSS POINTS
! WT   = WEIGHTS  OF GAUSS POINTS
! NMAX = MAX. NO. OF POINTS TABULATED HEREIN
  N_GP = M_QP
  IF ( N_GP > NMAX ) THEN
    N_GP = NMAX
    WRITE (6, * ) 'WARNING, GAUSS_COEFF USED gauss = ', NMAX
    N_WARN = N_WARN + 1 ! INCREMENT WARNING
  END IF
  IF ( N_GP < 1 ) STOP 'gauss = 0, NO POINTS IN GAUSS_COEFF'
  IF ( N_GP == 1 ) THEN
!9 use select case here
!9 need to append _DP to all real parameters
!  N_GP =  1, PRECISION =  1
    PT (1) = 0.000000000000000000000000D+00
    WT (1) = 0.20000000000000000000000D+01
    RETURN
  ELSEIF (N_GP == 2 ) THEN
!  N_GP =  2, PRECISION =  3
    PT (1) = - .577350269189625764509149D+00
    PT (2) = 0.577350269189625764509149D+00
    WT (1) = 0.10000000000000000000000D+01
    WT (2) = 0.10000000000000000000000D+01
    RETURN
  ELSEIF (N_GP == 3 ) THEN
!  N_GP =  3, PRECISION =  5
    PT (1) = - .774596669241483377035835D+00
    PT (2) = 0.000000000000000000000000D+00
    PT (3) = 0.774596669241483377035835D+00
    WT (1) = 0.55555555555555555555556D+00
    WT (2) = 0.88888888888888888888889D+00
    WT (3) = 0.55555555555555555555556D+00
    RETURN
  ELSEIF (N_GP == 4 ) THEN
!  N_GP =  4, PRECISION =  7
    PT (1) = - .861136311594052575223946D+00
    PT (2) = - .339981043584856264802666D+00
    PT (3) = 0.339981043584856264802666D+00
    PT (4) = 0.861136311594052575223946D+00
    WT (1) = 0.34785484513745385737306D+00
    WT (2) = 0.65214515486254614262694D+00
    WT (3) = 0.65214515486254614262694D+00
    WT (4) = 0.34785484513745385737306D+00
    RETURN
  ELSEIF (N_GP == 5 ) THEN
!  N_GP =  5, PRECISION =  9
    PT (1) = - .906179845938663992797627D+00
    PT (2) = - .538469310105683091036314D+00
    PT (3) = 0.000000000000000000000000D+00
    PT (4) = 0.538469310105683091036314D+00
    PT (5) = 0.906179845938663992797627D+00
    WT (1) = 0.23692688505618908751426D+00
    WT (2) = 0.47862867049936646804129D+00
    WT (3) = 0.56888888888888888888889D+00
    WT (4) = 0.47862867049936646804129D+00
    WT (5) = 0.23692688505618908751426D+00
    RETURN
  ELSEIF (N_GP == 6 ) THEN
    PT (1) = - .932469514203152027812302D+00
    PT (2) = - .661209386466264513661400D+00
    PT (3) = - .238619186083196908630502D+00
    PT (4) = 0.238619186083196908630502D+00
    PT (5) = 0.661209386466264513661400D+00
    PT (6) = 0.932469514203152027812302D+00
    WT (1) = 0.17132449237917034504030D+00
    WT (2) = 0.36076157304813860756983D+00
    WT (3) = 0.46791393457269104738987D+00
    WT (4) = 0.46791393457269104738987D+00
    WT (5) = 0.36076157304813860756983D+00
    WT (6) = 0.17132449237917034504030D+00
  ELSEIF (N_GP == 7 ) THEN
!  N_GP =  7, PRECISION = 13
    PT (1) = - .949107912342758524526190D+00
    PT (2) = - .741531185599394439863865D+00
    PT (3) = - .405845151377397166906607D+00
    PT (4) = 0.000000000000000000000000D+00
    PT (5) = 0.405845151377397166906607D+00
    PT (6) = 0.741531185599394439863865D+00
    PT (7) = 0.949107912342758524526190D+00
    WT (1) = 0.12948496616886969327061D+00
    WT (2) = 0.27970539148927666790147D+00
    WT (3) = 0.38183005050511894495037D+00
    WT (4) = 0.41795918367346938775510D+00
    WT (5) = 0.38183005050511894495037D+00
    WT (6) = 0.27970539148927666790147D+00
    WT (7) = 0.12948496616886969327061D+00
    RETURN
  ELSEIF (N_GP == 8 ) THEN
!  N_GP =  8, PRECISION = 15
    PT (1) = - .960289856497536231683561D+00
    PT (2) = - .796666477413626739591554D+00
    PT (3) = - .525532409916328985817739D+00
    PT (4) = - .183434642495649804939476D+00
    PT (5) = 0.183434642495649804939476D+00
    PT (6) = 0.525532409916328985817739D+00
    PT (7) = 0.796666477413626739591554D+00
    PT (8) = 0.960289856497536231683561D+00
    WT (1) = 0.10122853629037625915253D+00
    WT (2) = 0.22238103445337447054436D+00
    WT (3) = 0.31370664587788728733796D+00
    WT (4) = 0.36268378337836198296515D+00
    WT (5) = 0.36268378337836198296515D+00
    WT (6) = 0.31370664587788728733796D+00
    WT (7) = 0.22238103445337447054436D+00
    WT (8) = 0.10122853629037625915253D+00
    RETURN
  ELSEIF (N_GP == 9 ) THEN
!  N_GP =  9, PRECISION = 17
    PT (1) = - .968160239507626089835576D+00
    PT (2) = - .836031107326635794299430D+00
    PT (3) = - .613371432700590397308702D+00
    PT (4) = - .324253423403808929038538D+00
    PT (5) = 0.000000000000000000000000D+00
    PT (6) = 0.324253423403808929038538D+00
    PT (7) = 0.613371432700590397308702D+00
    PT (8) = 0.836031107326635794299430D+00
    PT (9) = 0.968160239507626089835576D+00
    WT (1) = 0.081274388361574411971890D+00
    WT (2) = 0.18064816069485740405847D+00
    WT (3) = 0.26061069640293546231874D+00
    WT (4) = 0.31234707704000284006863D+00
    WT (5) = 0.33023935500125976316453D+00
    WT (6) = 0.31234707704000284006863D+00
    WT (7) = 0.26061069640293546231874D+00
    WT (8) = 0.18064816069485740405847D+00
    WT (9) = 0.08127438836157441197189D+00
    RETURN
  ELSEIF (N_GP == 10 ) THEN
!  N_GP = 10, PRECISION = 19
    PT (1) = - .973906528517171720077964D+00
    PT (2) = - .865063366688984510732097D+00
    PT (3) = - .679409568299024406234327D+00
    PT (4) = - .433395394129247190799266D+00
    PT (5) = - .148874338981631210884826D+00
    PT (6) = 0.148874338981631210884826D+00
    PT (7) = 0.433395394129247190799266D+00
    PT (8) = 0.865063366688984510732097D+00
    PT (9) = 0.679409568299024406234327D+00
    PT (10) = 0.973906528517171720077964D+00
    WT (1) = 0.066671344308688137593570D+00
    WT (2) = 0.14945134915058059314578D+00
    WT (3) = 0.21908636251598204399554D+00
    WT (4) = 0.26926671930999635509123D+00
    WT (5) = 0.29552422471475287017389D+00
    WT (6) = 0.29552422471475287017389D+00
    WT (7) = 0.26926671930999635509123D+00
    WT (8) = 0.14945134915058059314578D+00
    WT (9) = 0.21908636251598204399554D+00
    WT (10) = 0.06667134430868813759357D+00
    RETURN
  ELSEIF (N_GP == 11 ) THEN
!  N_GP = 11, PRECISION = 21
    PT (1) = - .987228658146056992803938D+00
    PT (2) = - .887062599768095299075158D+00
    PT (3) = - .730152005574049324093416D+00
    PT (4) = - .519096129206811815925726D+00
    PT (5) = - .269543155952344972331532D+00
    PT (6) = 0.000000000000000000000000D+00
    PT (7) = 0.269543155952344972331532D+00
    PT (8) = 0.519096129206811815925726D+00
    PT (9) = 0.730152005574049324093416D+00
    PT (10) = 0.887062599768095299075158D+00
    PT (11) = 0.987228658146056992803938D+00
    WT (1) = 0.055668567116173666482750D+00
    WT (2) = 0.12558036946490462463469D+00
    WT (3) = 0.18629021092773425142610D+00
    WT (4) = 0.23319376459199047991852D+00
    WT (5) = 0.26280454451024666218069D+00
    WT (6) = 0.27292508677790063071448D+00
    WT (7) = 0.26280454451024666218069D+00
    WT (8) = 0.23319376459199047991852D+00
    WT (9) = 0.18629021092773425142610D+00
    WT (10) = 0.12558036946490462463469D+00
    WT (11) = 0.05566856711617366648275D+00
    RETURN
  ELSEIF (N_GP == 12 ) THEN
!  N_GP = 12, PRECISION = 23
    PT (1) = - .981560634246719250690549D+00
    PT (2) = - .904117256370474856678466D+00
    PT (3) = - .769002674194304687036894D+00
    PT (4) = - .587317954286617447296702D+00
    PT (5) = - .367831498998180193752692D+00
    PT (6) = - .125233408511468915472441D+00
    PT (7) = 0.125233408511468915472441D+00
    PT (8) = 0.367831498998180193752692D+00
    PT (9) = 0.587317954286617447296702D+00
    PT (10) = 0.769002674194304687036894D+00
    PT (11) = 0.904117256370474856678466D+00
    PT (12) = 0.981560634246719250690549D+00
    WT (1) = 0.047175336386511827194620D+00
    WT (2) = 0.10693932599531843096025D+00
    WT (3) = 0.16007832854334622633465D+00
    WT (4) = 0.20316742672306592174906D+00
    WT (5) = 0.23349253653835480876085D+00
    WT (6) = 0.24914704581340278500056D+00
    WT (7) = 0.24914704581340278500056D+00
    WT (8) = 0.23349253653835480876085D+00
    WT (9) = 0.20316742672306592174906D+00
    WT (10) = 0.16007832854334622633465D+00
    WT (11) = 0.10693932599531843096025D+00
    WT (12) = 0.04717533638651182719462D+00
    RETURN
  END IF
END SUBROUTINE GAUSS_COEFF
                     
SUBROUTINE RADAU_QUADRATURE (M_QP, P, W)
! * * * * * * * * * * * * * * * * * * * * * * * * * * * *
! RADAU QUADRATURE ABSCISSAE AND WEIGHTS FOR UNIT TRIANGLE
! * * * * * * * * * * * * * * * * * * * * * * * * * * * *
! REF: O.C. ZIENKIEWICZ, "FEM IN ENGR. SCI." 1971, P. 149
Use System_Constants
!b Use Precision_Module
 IMPLICIT NONE
 INTEGER , PARAMETER   :: NMAX = 16    !b , N_PRT = 6
 INTEGER,  INTENT(IN)  :: M_QP
 REAL(DP), INTENT(OUT) :: P (2, M_QP), W (M_QP)
 INTEGER :: N_GP

! M_QP      = TOTAL NUMBER OF QUADRATURE POINTS
! P(1,I) = ABSCISSAE IN R-DIRECTION
! P(2,I) = ABSCISSAE IN S-DIRECTION
! W(I)   = CORRESPONDING WEIGHTS
! NMAX   = MAXIMUM DEGREE TABULATED HEREIN
  N_GP = M_QP
  IF ( M_QP > NMAX ) THEN
    WRITE (N_PRT, * ) 'WARNING, RADAU_QUADRATURE M_QP SET TO', NMAX
    N_WARN = N_WARN + 1 ! INCREMENT WARNING
    N_GP = NMAX
  END IF
!9      use case STATEMENTS
  IF ( N_GP == 1 ) THEN
!    M = N_GP = 1
    P (1, 1) = 0.333333333333d0
    P (2, 1) = 0.333333333333d0
    W (1) = 0.5d0
    RETURN
  END IF
  IF ( N_GP == 4 ) THEN
!    M = 2, N_GP = M*M
    W (1) = 0.0909793091d0
    W (2) = 0.1590206909d0
    W (3) = 0.0909793091d0
    W (4) = 0.1590206909d0
    P (1, 1) = 0.2800199155d0
    P (1, 2) = 0.6663902460d0
    P (1, 3) = 0.0750311102d0
    P (1, 4) = 0.1785587283d0
    P (2, 1) = 0.0750311102d0
    P (2, 2) = 0.1785587283d0
    P (2, 3) = 0.2800199155d0
    P (2, 4) = 0.6663902460d0
    RETURN
  END IF
  IF ( N_GP == 9 ) THEN
!    M = 3, N_GP = M*M
    W (1) = 0.019396383304d0
    W (2) = 0.063678085097d0
    W (3) = 0.055814420490d0
    W (4) = 0.031034213285d0
    W (5) = 0.101884936154d0
    W (6) = 0.089303072783d0
    W (7) = 0.019396383304d0
    W (8) = 0.063678085097d0
    W (9) = 0.055814420490d0
    P (1, 1) = 0.18840940591d0
    P (1, 2) = 0.52397906774d0
    P (1, 3) = 0.80869438567d0
    P (1, 4) = 0.10617026910d0
    P (1, 5) = 0.29526656780d0
    P (1, 6) = 0.45570602025d0
    P (1, 7) = 0.02393113229d0
    P (1, 8) = 0.06655406786d0
    P (1, 9) = 0.10271765483d0
    P (2, 1) = 0.02393113229d0
    P (2, 2) = 0.06655406786d0
    P (2, 3) = 0.10271765483d0
    P (2, 4) = 0.10617026910d0
    P (2, 5) = 0.29526656780d0
    P (2, 6) = 0.45570602025d0
    P (2, 7) = 0.18840940591d0
    P (2, 8) = 0.52397906774d0
    P (2, 9) = 0.8086943856d0
    RETURN
  END IF
  IF ( N_GP == 16 ) THEN
!    M = 4, N_GP = M*M
    W (1) = 0.005423225910d0
    W (2) = 0.022584049287d0
    W (3) = 0.035388067900d0
    W (4) = 0.023568368199d0
    W (5) = 0.010167259561d0
    W (6) = 0.042339724518d0
    W (7) = 0.066344216093d0
    W (8) = 0.044185088522d0
    W (9) = 0.010167259561d0
    W (10) = 0.042339724518d0
    W (11) = 0.066344216093d0
    W (12) = 0.044185088522d0
    W (13) = 0.005423225910d0
    W (14) = 0.022584049287d0
    W (15) = 0.035388067900d0
    W (16) = 0.023568368199d0
    P (1, 1) = 0.13005607918d0
    P (1, 2) = 0.38749748338d0
    P (1, 3) = 0.67294686319d0
    P (1, 4) = 0.87742880935d0
    P (1, 5) = 0.09363778441d0
    P (1, 6) = 0.27899046348d0
    P (1, 7) = 0.48450832666d0
    P (1, 8) = 0.63173125166d0
    P (1, 9) = 0.04612207989d0
    P (1, 10) = 0.13741910412d0
    P (1, 11) = 0.23864865974d0
    P (1, 12) = 0.31116455224d0
    P (1, 13) = 0.00970378512d0
    P (1, 14) = 0.02891208422d0
    P (1, 15) = 0.05021012321d0
    P (1, 16) = 0.06546699455d0
    P (2, 1) = 0.00970378512d0
    P (2, 2) = 0.02891208422d0
    P (2, 3) = 0.05021012321d0
    P (2, 4) = 0.06546699455d0
    P (2, 5) = 0.04612207989d0
    P (2, 6) = 0.13741910412d0
    P (2, 7) = 0.23864865974d0
    P (2, 8) = 0.31116455224d0
    P (2, 9) = 0.09363778441d0
    P (2, 10) = 0.27899046348d0
    P (2, 11) = 0.48450832666d0
    P (2, 12) = 0.63173125166d0
    P (2, 13) = 0.13005607918d0
    P (2, 14) = 0.38749748338d0
    P (2, 15) = 0.67294686319d0
    P (2, 16) = 0.87742880935d0
  END IF
END SUBROUTINE RADAU_QUADRATURE
                               
SUBROUTINE SYMRUL (NIP, QPT, WT)
! * * * * * * * * * * * * * * * * * * * * * * * * * *
! SYMMETRICAL QUADRATURE RULES FOR TRIANGLES
!              IN UNIT COORDINATES
! * * * * * * * * * * * * * * * * * * * * * * * * * *
Use System_Constants
!b Use Precision_Module
! IMPLICIT NONE
 INTEGER , PARAMETER   :: MAX = 13
 INTEGER,  INTENT(IN)  :: NIP
 REAL(DP), INTENT(OUT) :: QPT (2, NIP), WT (NIP)

! NIP = NUMBER OF SYMMETRIC POINTS
! QPT = UNIT COORDINATES OF QUADRATURE POINTS
! WT  = WEIGHTS AT POINTS
  M_QP = NIP
  IF ( M_QP > MAX ) THEN
    M_QP = MAX
    WRITE (6, * ) 'WARNING SYMRUL SET M_QP =', MAX
    N_WARN = N_WARN + 1 ! INCREMENT WARNING
  END IF
  IF ( M_QP < 1 ) THEN
    PRINT *,'WARNING: SYMRUL, INVALID RULE', M_QP
    PRINT *,'CHECK IF shape 2 IS INCORRECT IN KEYWORD CONTROL'
    N_WARN = N_WARN + 1
    STOP 'ERROR IN SYMRUL, INVALID RULE'
  END IF

 SELECT CASE (M_QP)
!-->  ONE POINT RULE
  CASE (1) 
    WT (1) = 0.5d0
    QPT (1, 1) = 1.d0 / 3.d0
    QPT (2, 1) = 1.d0 / 3.d0
!-->  THREE POINT INTERIOR RULE
  CASE (3) 
    WT (1) = 1.d0 / 6.d0
    WT (2) = WT (1)
    WT (3) = WT (1)
    QPT (1, 1) = 1.d0 / 6.d0
    QPT (2, 1) = 1.d0 / 6.d0
    QPT (1, 2) = 2.d0 / 3.d0
    QPT (2, 2) = 1.d0 / 6.d0
    QPT (1, 3) = 1.d0 / 6.d0
    QPT (2, 3) = 2.d0 / 3.d0
!-->  FOUR POINT INTERIOR (ALL) RULE
  CASE (4) 
    WT (1) = - 27.d0 / 96.d0
    WT (2) = 25.d0 / 96.d0
    WT (3) = WT (2)
    WT (4) = WT (2)
    QPT (1, 1) = 1.d0 / 3.d0
    QPT (2, 1) = 1.d0 / 3.d0
    QPT (1, 2) = 0.2d0
    QPT (2, 2) = 0.2d0
    QPT (1, 3) = 0.2d0
    QPT (2, 3) = 0.6d0
    QPT (1, 4) = 0.6d0
    QPT (2, 4) = 0.2d0
!-->  SIX POINT RULE
  CASE (6)
    WT (1) = 0.054975872d0
    WT (2) = WT (1)
    WT (3) = WT (1)
    WT (4) = 0.111690795d0
    WT (5) = WT (4)
    WT (6) = WT (4)
    QPT (1, 1) = 0.81684757d0
    QPT (2, 1) = 0.091576214d0
    QPT (1, 2) = 0.091576214d0
    QPT (2, 2) = 0.091576214d0
    QPT (1, 3) = 0.091576214d0
    QPT (2, 3) = 0.81684757d0
    QPT (1, 4) = 0.10810302d0
    QPT (2, 4) = 0.44594849d0
    QPT (1, 5) = 0.44594849d0
    QPT (2, 5) = 0.44594849d0
    QPT (1, 6) = 0.44594849d0
    QPT (2, 6) = 0.10810302d0
!-->  SEVEN POINT INTERIOR RULE
  CASE (7) 
    WT (1) = 0.06296959d0
    WT (2) = 0.06619708d0
    WT (3) = 0.06296959d0
    WT (4) = 0.06619708d0
    WT (5) = 0.06296959d0
    WT (6) = 0.06619708d0
    WT (7) = 0.11250000d0
    QPT (1, 1) = 0.10128651d0
    QPT (2, 1) = 0.10128651d0
    QPT (1, 2) = 0.47014206d0
    QPT (2, 2) = 0.05971587d0
    QPT (1, 3) = 0.79742699d0
    QPT (2, 3) = 0.10128651d0
    QPT (1, 4) = 0.47014206d0
    QPT (2, 4) = 0.47014206d0
    QPT (1, 5) = 0.10128651d0
    QPT (2, 5) = 0.79742699d0
    QPT (1, 6) = 0.05971587d0
    QPT (2, 6) = 0.47014206d0
    QPT (1, 7) = 1.d0 / 3.d0
    QPT (2, 7) = 1.d0 / 3.d0
!-->  TWELVE POINT RULE
  CASE (12)
    WT (1) = 0.025422453d0
    WT (2) = WT (1)
    WT (3) = WT (1)
    WT (4) = 0.058393138d0
    WT (5) = WT (4)
    WT (6) = WT (4)
    WT (7) = 0.041425538d0
    WT (8) = WT (7)
    WT (9) = WT (7)
    WT (10) = WT (7)
    WT (11) = WT (7)
    WT (12) = WT (7)
    QPT (1, 1) = 0.87382197d0
    QPT (2, 1) = 0.063089014d0
    QPT (1, 2) = 0.063089014d0
    QPT (2, 2) = 0.063089014d0
    QPT (1, 3) = 0.063089014d0
    QPT (2, 3) = 0.87382197d0
    QPT (1, 4) = 0.50142651d0
    QPT (2, 4) = 0.24928675d0
    QPT (1, 5) = 0.24928675d0
    QPT (2, 5) = 0.24928675d0
    QPT (1, 6) = 0.24928675d0
    QPT (2, 6) = 0.50142651d0
    QPT (1, 7) = 0.63650250d0
    QPT (2, 7) = 0.31035245d0
    QPT (1, 8) = 0.31035245d0
    QPT (2, 8) = 0.053145050d0
    QPT (1, 9) = 0.053145050d0
    QPT (2, 9) = 0.63650250d0
    QPT (1, 10) = 0.63650250d0
    QPT (2, 10) = 0.053145050d0
    QPT (1, 11) = 0.31035245d0
    QPT (2, 11) = 0.63650250d0
    QPT (1, 12) = 0.053145050d0
    QPT (2, 12) = 0.31035245d0
!-->  THIRTEEN POINT RULE
  CASE (13) 
    WT (1) = - 0.074785022d0
    WT (2) = 0.087807629d0
    WT (3) = WT (2)
    WT (4) = WT (2)
    WT (5) = 0.026673618d0
    WT (6) = WT (5)
    WT (7) = WT (5)
    WT (8) = 0.038556880d0
    WT (9) = WT (8)
    WT (10) = WT (8)
    WT (11) = WT (8)
    WT (12) = WT (8)
    WT (13) = WT (8)
    QPT (1, 1) = 1.d0 / 3.d0
    QPT (2, 1) = 1.d0 / 3.d0
    QPT (1, 2) = 0.47930807d0
    QPT (2, 2) = 0.26034597d0
    QPT (1, 3) = 0.26034597d0
    QPT (2, 3) = 0.26034597d0
    QPT (1, 4) = 0.26034597d0
    QPT (2, 4) = 0.47930807d0
    QPT (1, 5) = 0.86973979d0
    QPT (2, 5) = 0.065130103d0
    QPT (1, 6) = 0.065130103d0
    QPT (2, 6) = 0.065130103d0
    QPT (1, 7) = 0.065130103d0
    QPT (2, 7) = 0.86973979d0
    QPT (1, 8) = 0.63844419d0
    QPT (2, 8) = 0.31286550d0
    QPT (1, 9) = 0.31286550d0
    QPT (2, 9) = 0.048690315d0
    QPT (1, 10) = 0.048690315d0
    QPT (2, 10) = 0.63844419d0
    QPT (1, 11) = 0.63844419d0
    QPT (2, 11) = 0.048690315d0
    QPT (1, 12) = 0.31286550d0
    QPT (2, 12) = 0.63844419d0
    QPT (1, 13) = 0.048690315d0
    QPT (2, 13) = 0.31286550d0
  CASE DEFAULT ! UNTABULATED DATA
    PRINT *,'WARNING: SYMRUL, INVALID RULE', M_QP
    PRINT *,'CHECK IF shape 2 IS INCORRECT IN KEYWORD CONTROL'
    N_WARN = N_WARN + 1
    STOP 'DATA NOT IN SYMRUL, MAX gauss = 13'
END SELECT
END SUBROUTINE SYMRUL
                     
SUBROUTINE USER_QUADRATURE (M_QP, N_SPACE, PT, WT)
! * * * * * * * * * * * * * * * * * * * * * * * * * * *
!          USER SUPPLIED QUADRATURE RULE DATA
! * * * * * * * * * * * * * * * * * * * * * * * * * * *
Use Precision_Module
 IMPLICIT NONE
 INTEGER,  INTENT(IN)  :: M_QP, N_SPACE
 REAL(DP), INTENT(OUT) :: PT (N_SPACE, M_QP), WT (M_QP)
! ......................................................
! USER SUPPLIED OPTION FOLLOWS
! ......................................................
! SPECIAL RULE FOR SINGULARITY ELEMENTS
! CALL RADAU_QUADRATURE (M_QP, PT, WT)
   PT = 0.d0 ; WT = 0.d0
   STOP 'ERROR, NO RULE IN USER_QUADRATURE'
END SUBROUTINE USER_QUADRATURE
                     
SUBROUTINE GAUSS_UNIT_COEF (M_QP, PT, WT)
! * * * * * * * * * * * * * * * * * * * * * * * * * *
! GAUSSIAN QUADRATURE ABSCISSAE AND WEIGHT COEFFS
! IN UNIT COORDINATES, 0 <= R <= 1
! * * * * * * * * * * * * * * * * * * * * * * * * * *
Use System_Constants
!b Use Precision_Module
 IMPLICIT NONE
 INTEGER,  PARAMETER   :: NMAX = 12
 INTEGER,  INTENT(IN)  :: M_QP
 REAL(DP), INTENT(OUT) :: PT (M_QP), WT (M_QP)
 INTEGER  :: N_GP
                             
! M_QP  = NO. OF GAUSS POINTS IN ONE DIMENSION
! PT   = ABSCISSAE OF GAUSS POINTS
! WT   = WEIGHTS  OF GAUSS POINTS
! NMAX = MAX. NO. OF POINTS TABULATED HEREIN
                                            
  N_GP = M_QP
  IF ( N_GP > NMAX ) THEN
    N_GP = NMAX
    WRITE (6, * ) 'WARNING, GAUSS_UNIT_COEF USED M_QP = ', NMAX
    N_WARN = N_WARN + 1 ! INCREMENT WARNING
  END IF
  IF ( N_GP < 1  ) STOP 'NO POINTS IN GAUSS_UNIT_COEF'
  IF ( N_GP == 1 ) THEN
!  N_GP =  1, PRECISION =  1
    PT (1) = 5.0000000000000000000000D-01
    WT (1) = 1.0000000000000000000000D+00
    RETURN
  ELSEIF ( N_GP == 2 ) THEN
!  N_GP =  2, PRECISION =  3
    PT (1) = 2.1132486540518711774543D-01
    PT (2) = 7.8867513459481288225457D-01
    WT (1) = 5.0000000000000000000000D-01
    WT (2) = 5.0000000000000000000000D-01
    RETURN
  ELSEIF ( N_GP == 3 ) THEN
!  N_GP =  3, PRECISION =  5
    PT (1) = 1.1270166537925831148208D-01
    PT (2) = 5.0000000000000000000000D-01
    PT (3) = 8.8729833462074168851792D-01
    WT (1) = 2.7777777777777777777778D-01
    WT (2) = 4.4444444444444444444445D-01
    WT (3) = 2.7777777777777777777778D-01
    RETURN
  ELSEIF ( N_GP == 4 ) THEN
!  N_GP =  4, PRECISION =  7
    PT (1) = 6.9431844202973712388027D-02
    PT (2) = 3.3000947820757186759867D-01
    PT (3) = 6.6999052179242813240133D-01
    PT (4) = 9.3056815579702628761197D-01
    WT (1) = 1.7392742256872692868653D-01
    WT (2) = 3.2607257743127307131347D-01
    WT (3) = 3.2607257743127307131347D-01
    WT (4) = 1.7392742256872692868653D-01
    RETURN
  ELSEIF ( N_GP == 5 ) THEN
!  N_GP =  5, PRECISION =  9
    PT (1) = 4.6910077030668003601186D-02
    PT (2) = 2.3076534494715845448184D-01
    PT (3) = 5.0000000000000000000000D-01
    PT (4) = 7.6923465505284154551816D-01
    PT (5) = 9.5308992296933199639881D-01
    WT (1) = 1.1846344252809454375713D-01
    WT (2) = 2.3931433524968323402065D-01
    WT (3) = 2.8444444444444444444444D-01
    WT (4) = 2.3931433524968323402065D-01
    WT (5) = 1.1846344252809454375713D-01
    RETURN
  ELSEIF ( N_GP == 6 ) THEN
!  N_GP =  6, PRECISION = 11
    PT (1) = 3.3765242898423986093849D-02
    PT (2) = 1.6939530676686774316930D-01
    PT (3) = 3.8069040695840154568475D-01
    PT (4) = 6.1930959304159845431525D-01
    PT (5) = 8.3060469323313225683070D-01
    PT (6) = 9.6623475710157601390615D-01
    WT (1) = 8.5662246189585172520150D-02
    WT (2) = 1.8038078652406930378491D-01
    WT (3) = 2.3395696728634552369493D-01
    WT (4) = 2.3395696728634552369493D-01
    WT (5) = 1.8038078652406930378491D-01
    WT (6) = 8.5662246189585172520150D-02
    RETURN
  ELSEIF ( N_GP == 7 ) THEN
!  N_GP =  7, PRECISION = 13
    PT (1) = 2.5446043828620737736905D-02
    PT (2) = 1.2923440720030278006807D-01
    PT (3) = 2.9707742431130141654670D-01
    PT (4) = 5.0000000000000000000000D-01
    PT (5) = 7.0292257568869858345330D-01
    PT (6) = 8.7076559279969721993193D-01
    PT (7) = 9.7455395617137926226309D-01
    WT (1) = 6.4742483084434846635305D-02
    WT (2) = 1.3985269574463833395073D-01
    WT (3) = 1.9091502525255947247519D-01
    WT (4) = 2.0897959183673469387755D-01
    WT (5) = 1.9091502525255947247519D-01
    WT (6) = 1.3985269574463833395073D-01
    WT (7) = 6.4742483084434846635305D-02
    RETURN
  ELSEIF ( N_GP == 8 ) THEN
!  N_GP =  8, PRECISION = 15
    PT (1) = 1.9855071751231884158220D-02
    PT (2) = 1.0166676129318663020422D-01
    PT (3) = 2.3723379504183550709113D-01
    PT (4) = 4.0828267875217509753026D-01
    PT (5) = 5.9171732124782490246974D-01
    PT (6) = 7.6276620495816449290887D-01
    PT (7) = 8.9833323870681336979578D-01
    PT (8) = 9.8014492824876811584178D-01
    WT (1) = 5.0614268145188129576265D-02
    WT (2) = 1.1119051722668723527218D-01
    WT (3) = 1.5685332293894364366898D-01
    WT (4) = 1.8134189168918099148257D-01
    WT (5) = 1.8134189168918099148257D-01
    WT (6) = 1.5685332293894364366898D-01
    WT (7) = 1.1119051722668723527218D-01
    WT (8) = 5.0614268145188129576265D-02
    RETURN
  ELSEIF ( N_GP == 9 ) THEN
!  N_GP =  9, PRECISION = 17
    PT (1) = 1.5919880246186955082212D-02
    PT (2) = 8.1984446336682102850285D-02
    PT (3) = 1.9331428364970480134565D-01
    PT (4) = 3.3787328829809553548073D-01
    PT (5) = 5.0000000000000000000000D-01
    PT (6) = 6.6212671170190446451927D-01
    PT (7) = 8.0668571635029519865435D-01
    PT (8) = 9.1801555366331789714971D-01
    PT (9) = 9.8408011975381304491779D-01
    WT (1) = 4.0637194180787205985945D-02
    WT (2) = 9.0324080347428702029235D-02
    WT (3) = 1.3030534820146773115937D-01
    WT (4) = 1.5617353852000142003431D-01
    WT (5) = 1.6511967750062988158226D-01
    WT (6) = 1.5617353852000142003431D-01
    WT (7) = 1.3030534820146773115937D-01
    WT (8) = 9.0324080347428702029235D-02
    WT (9) = 4.0637194180787205985945D-02
    RETURN
  ELSEIF ( N_GP == 10 ) THEN
!  N_GP = 10, PRECISION = 19
    PT (1) = 1.3046735741414139961018D-02
    PT (2) = 6.7468316655507744633952D-02
    PT (3) = 1.6029521585048779688284D-01
    PT (4) = 2.8330230293537640460037D-01
    PT (5) = 4.2556283050918439455759D-01
    PT (6) = 5.7443716949081560544241D-01
    PT (7) = 7.1669769706462359539963D-01
    PT (8) = 9.3253168334449225536605D-01
    PT (9) = 8.3970478414951220311716D-01
    PT (10) = 9.8695326425858586003898D-01
    WT (1) = 3.3335672154344068796785D-02
    WT (2) = 7.4725674575290296572890D-02
    WT (3) = 1.0954318125799102199777D-01
    WT (4) = 1.3463335965499817754561D-01
    WT (5) = 1.4776211235737643508695D-01
    WT (6) = 1.4776211235737643508695D-01
    WT (7) = 1.3463335965499817754561D-01
    WT (8) = 7.4725674575290296572890D-02
    WT (9) = 1.0954318125799102199777D-01
    WT (10) = 3.3335672154344068796785D-02
    RETURN
  ELSEIF ( N_GP == 11 ) THEN
!  N_GP = 11, PRECISION = 21
    PT (1) = 6.3856709269715035980310D-03
    PT (2) = 5.6468700115952350462421D-02
    PT (3) = 1.3492399721297533795329D-01
    PT (4) = 2.4045193539659409203714D-01
    PT (5) = 3.6522842202382751383423D-01
    PT (6) = 5.0000000000000000000000D-01
    PT (7) = 6.3477157797617248616577D-01
    PT (8) = 7.5954806460340590796286D-01
    PT (9) = 8.6507600278702466204671D-01
    PT (10) = 9.4353129988404764953758D-01
    PT (11) = 9.9361432907302849640197D-01
    WT (1) = 2.7834283558086833241375D-02
    WT (2) = 6.2790184732452312317345D-02
    WT (3) = 9.3145105463867125713050D-02
    WT (4) = 1.1659688229599523995926D-01
    WT (5) = 1.3140227225512333109035D-01
    WT (6) = 1.3646254338895031535724D-01
    WT (7) = 1.3140227225512333109035D-01
    WT (8) = 1.1659688229599523995926D-01
    WT (9) = 9.3145105463867125713050D-02
    WT (10) = 6.2790184732452312317345D-02
    WT (11) = 2.7834283558086833241375D-02
    RETURN
  ELSEIF ( N_GP == 12 ) THEN
!  N_GP = 12, PRECISION = 23
    PT (1) = 9.2196828766403746547255D-03
    PT (2) = 4.7941371814762571660767D-02
    PT (3) = 1.1549866290284765648155D-01
    PT (4) = 2.0634102285669127635165D-01
    PT (5) = 3.1608425050090990312365D-01
    PT (6) = 4.3738329574426554226378D-01
    PT (7) = 5.6261670425573445773622D-01
    PT (8) = 6.8391574949909009687635D-01
    PT (9) = 7.9365897714330872364835D-01
    PT (10) = 8.8450133709715234351845D-01
    PT (11) = 9.5205862818523742833923D-01
    PT (12) = 9.9078031712335962534527D-01
    WT (1) = 2.3587668193255913597310D-02
    WT (2) = 5.3469662997659215480125D-02
    WT (3) = 8.0039164271673113167325D-02
    WT (4) = 1.0158371336153296087453D-01
    WT (5) = 1.1674626826917740438042D-01
    WT (6) = 1.2457352290670139250028D-01
    WT (7) = 1.2457352290670139250028D-01
    WT (8) = 1.1674626826917740438042D-01
    WT (9) = 1.0158371336153296087453D-01
    WT (10) = 8.0039164271673113167325D-02
    WT (11) = 5.3469662997659215480125D-02
    WT (12) = 2.3587668193255913597310D-02
    RETURN
  END IF
END SUBROUTINE GAUSS_UNIT_COEF
                     
SUBROUTINE LOBATTO_1D (QP_N, PT, WT)
! * * * * * * * * * * * * * * * * * * * * * * * * * *
! LOBATTO QUADRATURE ABSCISSAE AND WEIGHT COEFFS
! * * * * * * * * * * * * * * * * * * * * * * * * * *
Use System_Constants
!b Use Precision_Module
 IMPLICIT  NONE
 INTEGER,  INTENT(IN)  :: QP_N
 REAL(DP), INTENT(OUT) :: PT (QP_N), WT (QP_N)
!               LOCALS
 INTEGER, PARAMETER :: NMAX = 10
 INTEGER            :: N_GP

! QP_N  = NO. OF LOBATTO POINTS IN ONE DIMENSION
! PT   = ABSCISSAE OF LOBATTO POINTS
! WT   = WEIGHTS  OF LOBATTO POINTS
! NMAX = MAX. NO. OF POINTS TABULATED HEREIN
  N_GP = QP_N
  IF ( N_GP > NMAX ) THEN
    N_GP = NMAX
    WRITE (6, * ) 'WARNING, LOBATTO_1D USED N_GP = ', NMAX
    N_WARN = N_WARN + 1 ! INCREMENT WARNING
  END IF
  IF ( N_GP < 1 ) STOP 'NO POINTS IN LOBATTO_1D'
  IF ( N_GP == 1 ) THEN
!...     N_GP = 1
    PT (1) = 0.00000000000000D+00
    WT (1) = 2.00000000000000D+00
    RETURN
  ELSEIF ( N_GP == 2 ) THEN
!...     N_GP = 2
    PT (1) = 1.00000000000000D+00
    WT (1) = 1.00000000000000D+00
    PT (2) = - PT (1)
    WT (2) = WT (1)
    RETURN
  ELSEIF ( N_GP == 3 ) THEN
!...     N_GP = 3
    PT (1) = 1.00000000000000D+00
    WT (1) = 3.33333333333333D-01
    PT (2) = 0.00000000000000D+00
    WT (2) = 1.33333333333333D+00
    PT (3) = - PT (1)
    WT (3) = WT (1)
    RETURN
  ELSEIF ( N_GP == 4 ) THEN
!...     N_GP = 4
    PT (1) = 1.00000000000000D+00
    WT (1) = 1.66666666666667D-01
    PT (2) = 4.47213595499958D-01
    WT (2) = 8.33333333333333D-01
    PT (3) = - PT (1)
    WT (3) = WT (1)
    PT (4) = - PT (2)
    WT (4) = WT (2)
    RETURN
  ELSEIF ( N_GP == 5 ) THEN
!...     N_GP = 5
    PT (1) = 1.00000000000000D+00
    WT (1) = 1.00000000000000D-01
    PT (2) = 6.54653670707977D-01
    WT (2) = 5.44444444444444D-01
    PT (3) = 0.00000000000000D+00
    WT (3) = 7.11111111111111D-01
    PT (4) = - PT (1)
    WT (4) = WT (1)
    PT (5) = - PT (2)
    WT (5) = WT (2)
    RETURN
  ELSEIF ( N_GP == 6 ) THEN
!...     N_GP = 6
    PT (1) = 1.00000000000000D+00
    WT (1) = 6.66666666666667D-02
    PT (2) = 7.65055323929465D-01
    WT (2) = 3.78474956297847D-01
    PT (3) = 2.85231516480645D-01
    WT (3) = 5.54858377035486D-01
    PT (4) = - PT (1)
    WT (4) = WT (1)
    PT (5) = - PT (2)
    WT (5) = WT (2)
    PT (6) = - PT (3)
    WT (6) = WT (3)
  ELSEIF ( N_GP == 7 ) THEN
!...     N_GP = 7
    PT (1) = 1.00000000000000D+00
    WT (1) = 0.47619047619048D-01
    PT (2) = 8.30223896278567D-01
    WT (2) = 2.76826047361566D-01
    PT (3) = 4.68848793470714D-01
    WT (3) = 4.31745381209863D-01
    PT (4) = 0.00000000000000D+00
    WT (4) = 4.87619047619048D-01
    PT (5) = - PT (1)
    WT (5) = WT (1)
    PT (6) = - PT (2)
    WT (6) = WT (2)
    PT (7) = - PT (3)
    WT (7) = WT (3)
    RETURN
  ELSEIF ( N_GP == 8 ) THEN
!...     N_GP = 8
    PT (1) = 1.00000000000000D+00
    WT (1) = 3.5714285714286D-02
    PT (2) = 8.71740148509607D-01
    WT (2) = 2.10704227143506D-01
    PT (3) = 5.91700181433142D-01
    WT (3) = 3.41122692483504D-01
    PT (4) = 2.09299217902479D-01
    WT (4) = 4.12458794658704D-01
    PT (5) = - PT (1)
    WT (5) = WT (1)
    PT (6) = - PT (2)
    WT (6) = WT (2)
    PT (7) = - PT (3)
    WT (7) = WT (3)
    PT (8) = - PT (4)
    WT (8) = WT (4)
    RETURN
  ELSEIF ( N_GP == 9 ) THEN
!...     N_GP = 9
    PT (1) = 1.00000000000000D+00
    WT (1) = 2.77777777777778D-02
    PT (2) = 8.99757995411460D-01
    WT (2) = 1.65495361560805D-01
    PT (3) = 6.77186279510738D-01
    WT (3) = 2.74538712500162D-01
    PT (4) = 3.63117463826178D-01
    WT (4) = 3.46428510973406D-01
    PT (5) = 0.00000000000000D+00
    WT (5) = 3.71519274376417D-01
    PT (6) = - PT (1)
    WT (6) = WT (1)
    PT (7) = - PT (2)
    WT (7) = WT (2)
    PT (8) = - PT (3)
    WT (8) = WT (3)
    PT (9) = - PT (4)
    WT (9) = WT (4)
    RETURN
  ELSEIF ( N_GP == 10 ) THEN
!...     N_GP = 10
    PT (1) = 1.00000000000000D+00
    WT (1) = 2.22222222222222D-02
    PT (2) = 9.19533908166459D-01
    WT (2) = 1.33305990851070D-01
    PT (3) = 7.38773865105505D-01
    WT (3) = 2.24889342063126D-01
    PT (4) = 4.77924949810444D-01
    WT (4) = 2.92042683679684D-01
    PT (5) = 1.65278957666387D-01
    WT (5) = 3.27539761183897D-01
    PT (6) = - PT (1)
    WT (6) = WT (1)
    PT (7) = - PT (2)
    WT (7) = WT (2)
    PT (8) = - PT (3)
    WT (8) = WT (3)
    PT (9) = - PT (4)
    WT (9) = WT (4)
    PT (10) = - PT (5)
    WT (10) = WT (5)
    RETURN
  END IF
END SUBROUTINE LOBATTO_1D
                         
SUBROUTINE NATURAL_TO_UNIT_QUADRATURE (K, A, W)
! * * * * * * * * * * * * * * * * * * * * * * * * * *
! CONVERT GAUSS COEFF FROM NATURAL TO UNIT COORDINATES
!  (SEE SUBROUTINE GAUSS_COEFF FOR NATURAL COORDINATE DATA)
! * * * * * * * * * * * * * * * * * * * * * * * * * *
Use Precision_Module
 IMPLICIT NONE
 INTEGER,  INTENT(IN)    :: K
 REAL(DP), INTENT(INOUT) :: A (K), W (K)
! A = ABSISSAE, INPUT -1 TO 1 ARE 0 TO 1 ON EXIT
! K = NUMBER OF TABULATED GAUSS OR LOBATTO PTS IN 1-D
! W = QUADRATURE WEIGHTS
    A = (A + 1.0_dp)/2.0_dp ; W = W/2.0_dp
END SUBROUTINE NATURAL_TO_UNIT_QUADRATURE

SUBROUTINE KEAST_VOLUME_TET_RULE (NQP, PT, WT) 
! * * * * * * * * * * * * * * * * * * * * * * * * * * *
! KEAST VOLUME COORDINATE QUADRATURE RULE FOR TETRAHEDRA,
! DEGREE 4 TO 8, C.M.A.M.E. V. 55, PP. 339-348, 1986 
! [WITH SIGN & SCALE FIX] COPYRIGHT 1998, J. E. AKIN
! GIVEN NQP        = 1, 4, 5, 10, 11, 15, 24, 31, 45
! EXACT FOR DEGREE = 0, 1, 2,  3,  4,  5,  6,  7,  8
! * * * * * * * * * * * * * * * * * * * * * * * * * * *
Use Precision_Module
  IMPLICIT NONE
  INTEGER,  INTENT (IN)  :: NQP
  REAL(DP), INTENT (OUT) :: PT (4, NQP), WT (NQP) 
              
! NQP = NUMBER OF QUADRATURE POINTS
! PT  = RETURNED QUADRATURE COORDINATES
! WT  = RETURNED QUADRATURE WEIGHTS
                                                                        
REAL(DP), SAVE :: WT_1  ( 1),   WT_4  ( 4),   WT_5  ( 5)
REAL(DP), SAVE :: WT_10 (10),   WT_11 (11),   WT_15 (15) 
REAL(DP), SAVE :: WT_24 (24),   WT_31 (31),   WT_45 (45)
REAL(DP), SAVE :: PT_1  (4, 1), PT_4  (4, 4), PT_5  (4, 5)
REAL(DP), SAVE :: PT_10 (4,10), PT_11 (4,11), PT_15 (4,15)
REAL(DP), SAVE :: PT_24 (4,24), PT_31 (4,31), PT_45 (4,45)

DATA  WT_1  /                 1.66666666666666667E-01_DP  / 
DATA  PT_1  /                                             &
 2.50000000000000000E-01_DP,  2.50000000000000000E-01_DP, &
 2.50000000000000000E-01_DP,  2.50000000000000000E-01_DP  / 
DATA  WT_4  /                                             &
 4.16666666666666667E-02_DP,  4.16666666666666667E-02_DP, &
 4.16666666666666667E-02_DP,  4.16666666666666667E-02_DP  / 
DATA  PT_4  /                                             &
 5.85410196624968500E-01_DP,  1.38196601125010500E-01_DP, &
 1.38196601125010500E-01_DP,  1.38196601125010500E-01_DP, &
 1.38196601125010500E-01_DP,  5.85410196624968500E-01_DP, &
 1.38196601125010500E-01_DP,  1.38196601125010500E-01_DP, &
 1.38196601125010500E-01_DP,  1.38196601125010500E-01_DP, &
 5.85410196624968500E-01_DP,  1.38196601125010500E-01_DP, &
 1.38196601125010500E-01_DP,  1.38196601125010500E-01_DP, &
 1.38196601125010500E-01_DP,  5.85410196624968500E-01_DP  / 
DATA  WT_5  /                                             &
-1.33333333333333333E-01_DP,  7.50000000000000000E-02_DP, &
 7.50000000000000000E-02_DP,  7.50000000000000000E-02_DP, &
 7.50000000000000000E-02_DP / 
DATA  PT_5  /                                             &
 2.50000000000000000E-01_DP,  2.50000000000000000E-01_DP, &
 2.50000000000000000E-01_DP,  2.50000000000000000E-01_DP, &
 3.33333333333333333E-01_DP,  1.66666666666666667E-01_DP, &
 1.66666666666666667E-01_DP,  3.33333333333333333E-01_DP, &
 1.66666666666666667E-01_DP,  3.33333333333333333E-01_DP, &
 1.66666666666666667E-01_DP,  3.33333333333333333E-01_DP, &
 1.66666666666666667E-01_DP,  1.66666666666666667E-01_DP, &
 3.33333333333333333E-01_DP,  3.33333333333333333E-01_DP, &
 1.66666666666666667E-01_DP,  1.66666666666666667E-01_DP, &
 1.66666666666666667E-01_DP,  5.00000000000000000E-01_DP  / 
DATA  WT_10  /                                            &
 3.62941783134009000E-02_DP,  3.62941783134009000E-02_DP, &
 3.62941783134009000E-02_DP,  3.62941783134009000E-02_DP, &
 3.58165890217718333E-03_DP,  3.58165890217718333E-03_DP, &
 3.58165890217718333E-03_DP,  3.58165890217718333E-03_DP, &
 3.58165890217718333E-03_DP,  3.58165890217718333E-03_DP  / 
DATA  PT_10  /                                            &
 5.68430584196844400E-01_DP,  1.43856471934385200E-01_DP, &
 1.43856471934385200E-01_DP,  1.43856471934385200E-01_DP, &
 1.43856471934385200E-01_DP,  5.68430584196844400E-01_DP, &
 1.43856471934385200E-01_DP,  1.43856471934385200E-01_DP, &
 1.43856471934385200E-01_DP,  1.43856471934385200E-01_DP, &
 5.68430584196844400E-01_DP,  1.43856471934385200E-01_DP, &
 1.43856471934385200E-01_DP,  1.43856471934385200E-01_DP, &
 1.43856471934385200E-01_DP,  5.68430584196844400E-01_DP, &
 5.00000000000000000E-01_DP,  5.00000000000000000E-01_DP, &
 0.00000000000000000E+00_DP,  0.00000000000000000E+00_DP, &
 5.00000000000000000E-01_DP,  0.00000000000000000E+00_DP, &
 5.00000000000000000E-01_DP,  0.00000000000000000E+00_DP, &
 5.00000000000000000E-01_DP,  0.00000000000000000E+00_DP, &
 0.00000000000000000E+00_DP,  5.00000000000000000E-01_DP, &
 0.00000000000000000E+00_DP,  5.00000000000000000E-01_DP, &
 5.00000000000000000E-01_DP,  0.00000000000000000E+00_DP, &
 0.00000000000000000E+00_DP,  5.00000000000000000E-01_DP, &
 0.00000000000000000E+00_DP,  5.00000000000000000E-01_DP, &
 0.00000000000000000E+00_DP,  0.00000000000000000E+00_DP, &
 5.00000000000000000E-01_DP,  5.00000000000000000E-01_DP  / 
DATA  WT_11  /                                        &
-1.31555555555555556E-02_DP,  7.62222222222222222E-03_DP, &
 7.62222222222222222E-03_DP,  7.62222222222222222E-03_DP, &
 7.62222222222222222E-03_DP,  2.48888888888888889E-02_DP, &
 2.48888888888888889E-02_DP,  2.48888888888888889E-02_DP, &
 2.48888888888888889E-02_DP,  2.48888888888888889E-02_DP, &
 2.48888888888888889E-02_DP  / 
DATA  PT_11  /                                        &
 2.50000000000000000E-01_DP,  2.50000000000000000E-01_DP, &
 2.50000000000000000E-01_DP,  2.50000000000000000E-01_DP, &
 7.14285714285714285E-02_DP,  7.14285714285714285E-02_DP, &
 7.14285714285714285E-02_DP,  7.85714285714285714E-01_DP, &
 7.14285714285714285E-02_DP,  7.14285714285714285E-02_DP, &
 7.85714285714285714E-01_DP,  7.14285714285714285E-02_DP, &
 7.14285714285714285E-02_DP,  7.85714285714285714E-01_DP, &
 7.14285714285714285E-02_DP,  7.14285714285714285E-02_DP, &
 7.85714285714285714E-01_DP,  7.14285714285714285E-02_DP, &
 7.14285714285714285E-02_DP,  7.14285714285714285E-02_DP, &
 3.99403576166799219E-01_DP,  3.99403576166799219E-01_DP, &
 1.00596423833200785E-01_DP,  1.00596423833200785E-01_DP, &
 3.99403576166799219E-01_DP,  1.00596423833200785E-01_DP, &
 1.00596423833200785E-01_DP,  3.99403576166799219E-01_DP, &
 1.00596423833200785E-01_DP,  1.00596423833200785E-01_DP, &
 3.99403576166799219E-01_DP,  3.99403576166799219E-01_DP, &
 1.00596423833200785E-01_DP,  3.99403576166799219E-01_DP, &
 3.99403576166799219E-01_DP,  1.00596423833200785E-01_DP, &
 3.99403576166799219E-01_DP,  1.00596423833200785E-01_DP, &
 3.99403576166799219E-01_DP,  1.00596423833200785E-01_DP, &
 1.00596423833200785E-01_DP,  3.99403576166799219E-01_DP, &
 1.00596423833200785E-01_DP,  3.99403576166799219E-01_DP   / 
DATA  WT_15  /                                        &
 6.02678571428571597E-03_DP,  6.02678571428571597E-03_DP, &
 6.02678571428571597E-03_DP,  6.02678571428571597E-03_DP, &
 3.02836780970891856E-02_DP,  1.16452490860289742E-02_DP, &
 1.16452490860289742E-02_DP,  1.16452490860289742E-02_DP, &
 1.16452490860289742E-02_DP,  1.09491415613864534E-02_DP, &
 1.09491415613864534E-02_DP,  1.09491415613864534E-02_DP, &
 1.09491415613864534E-02_DP,  1.09491415613864534E-02_DP, &
 1.09491415613864534E-02_DP  / 
DATA  PT_15  /                                        &
 3.33333333333333333E-01_DP,  3.33333333333333333E-01_DP, &
 3.33333333333333333E-01_DP,  0.00000000000000000E+00_DP, &
 3.33333333333333333E-01_DP,  3.33333333333333333E-01_DP, &
 0.00000000000000000E+00_DP,  3.33333333333333333E-01_DP, &
 3.33333333333333333E-01_DP,  0.00000000000000000E+00_DP, &
 3.33333333333333333E-01_DP,  3.33333333333333333E-01_DP, &
 0.00000000000000000E+00_DP,  3.33333333333333333E-01_DP, &
 3.33333333333333333E-01_DP,  3.33333333333333333E-01_DP, &
 2.50000000000000000E-01_DP,  2.50000000000000000E-01_DP, &
 2.50000000000000000E-01_DP,  2.50000000000000000E-01_DP, &
 9.09090909090909091E-02_DP,  9.09090909090909091E-02_DP, &
 9.09090909090909091E-02_DP,  7.27272727272727273E-01_DP, &
 9.09090909090909091E-02_DP,  9.09090909090909091E-02_DP, &
 7.27272727272727273E-01_DP,  9.09090909090909091E-02_DP, &
 9.09090909090909091E-02_DP,  7.27272727272727273E-01_DP, &
 9.09090909090909091E-02_DP,  9.09090909090909091E-02_DP, &
 7.27272727272727273E-01_DP,  9.09090909090909091E-02_DP, &
 9.09090909090909091E-02_DP,  9.09090909090909091E-02_DP, &
 6.65501535736642813E-02_DP,  6.65501535736642813E-02_DP, &
 4.33449846426335728E-01_DP,  4.33449846426335728E-01_DP, &
 6.65501535736642813E-02_DP,  4.33449846426335728E-01_DP, &
 4.33449846426335728E-01_DP,  6.65501535736642813E-02_DP, &
 4.33449846426335728E-01_DP,  4.33449846426335728E-01_DP, &
 6.65501535736642813E-02_DP,  6.65501535736642813E-02_DP, &
 4.33449846426335728E-01_DP,  6.65501535736642813E-02_DP, &
 6.65501535736642813E-02_DP,  4.33449846426335728E-01_DP, &
 6.65501535736642813E-02_DP,  4.33449846426335728E-01_DP, &
 6.65501535736642813E-02_DP,  4.33449846426335728E-01_DP, &
 4.33449846426335728E-01_DP,  6.65501535736642813E-02_DP, &
 4.33449846426335728E-01_DP,  6.65501535736642813E-02_DP   / 
DATA  WT_24  /                                        &
 6.65379170969464506E-03_DP,  6.65379170969464506E-03_DP, &
 6.65379170969464506E-03_DP,  6.65379170969464506E-03_DP, &
 1.67953517588677620E-03_DP,  1.67953517588677620E-03_DP, &
 1.67953517588677620E-03_DP,  1.67953517588677620E-03_DP, &
 9.22619692394239843E-03_DP,  9.22619692394239843E-03_DP, &
 9.22619692394239843E-03_DP,  9.22619692394239843E-03_DP, &
 8.03571428571428248E-03_DP,  8.03571428571428248E-03_DP, &
 8.03571428571428248E-03_DP,  8.03571428571428248E-03_DP, &
 8.03571428571428248E-03_DP,  8.03571428571428248E-03_DP, &
 8.03571428571428248E-03_DP,  8.03571428571428248E-03_DP, &
 8.03571428571428248E-03_DP,  8.03571428571428248E-03_DP, &
 8.03571428571428248E-03_DP,  8.03571428571428248E-03_DP  / 
DATA  PT_24  /                                            &
 2.14602871259151684E-01_DP,  2.14602871259151684E-01_DP, &
 2.14602871259151684E-01_DP,  3.56191386222544953E-01_DP, &
 2.14602871259151684E-01_DP,  2.14602871259151684E-01_DP, &
 3.56191386222544953E-01_DP,  2.14602871259151684E-01_DP, &
 2.14602871259151684E-01_DP,  3.56191386222544953E-01_DP, &
 2.14602871259151684E-01_DP,  2.14602871259151684E-01_DP, &
 3.56191386222544953E-01_DP,  2.14602871259151684E-01_DP, &
 2.14602871259151684E-01_DP,  2.14602871259151684E-01_DP, &
 4.06739585346113397E-02_DP,  4.06739585346113397E-02_DP, &
 4.06739585346113397E-02_DP,  8.77978124396165982E-01_DP, &
 4.06739585346113397E-02_DP,  4.06739585346113397E-02_DP, &
 8.77978124396165982E-01_DP,  4.06739585346113397E-02_DP, &
 4.06739585346113397E-02_DP,  8.77978124396165982E-01_DP, &
 4.06739585346113397E-02_DP,  4.06739585346113397E-02_DP, &
 8.77978124396165982E-01_DP,  4.06739585346113397E-02_DP, &
 4.06739585346113397E-02_DP,  4.06739585346113397E-02_DP, &
 3.22337890142275646E-01_DP,  3.22337890142275646E-01_DP, &
 3.22337890142275646E-01_DP,  3.29863295731730594E-02_DP, &
 3.22337890142275646E-01_DP,  3.22337890142275646E-01_DP, &
 3.29863295731730594E-02_DP,  3.22337890142275646E-01_DP, &
 3.22337890142275646E-01_DP,  3.29863295731730594E-02_DP, &
 3.22337890142275646E-01_DP,  3.22337890142275646E-01_DP, &
 3.29863295731730594E-02_DP,  3.22337890142275646E-01_DP, &
 3.22337890142275646E-01_DP,  3.22337890142275646E-01_DP, &
 6.36610018750175299E-02_DP,  6.36610018750175299E-02_DP, &
 2.69672331458315867E-01_DP,  6.03005664791649076E-01_DP, &
 6.36610018750175299E-02_DP,  2.69672331458315867E-01_DP, &
 6.03005664791649076E-01_DP,  6.36610018750175299E-02_DP, &
 2.69672331458315867E-01_DP,  6.03005664791649076E-01_DP, &
 6.36610018750175299E-02_DP,  6.36610018750175299E-02_DP, &
 6.03005664791649076E-01_DP,  6.36610018750175299E-02_DP, &
 6.36610018750175299E-02_DP,  2.69672331458315867E-01_DP, &
 6.36610018750175299E-02_DP,  6.03005664791649076E-01_DP, &
 6.36610018750175299E-02_DP,  2.69672331458315867E-01_DP, &
 6.03005664791649076E-01_DP,  6.36610018750175299E-02_DP, &
 2.69672331458315867E-01_DP,  6.36610018750175299E-02_DP, &
 6.36610018750175299E-02_DP,  2.69672331458315867E-01_DP, &
 6.36610018750175299E-02_DP,  6.03005664791649076E-01_DP, &
 6.36610018750175299E-02_DP,  6.03005664791649076E-01_DP, &
 2.69672331458315867E-01_DP,  6.36610018750175299E-02_DP, &
 2.69672331458315867E-01_DP,  6.36610018750175299E-02_DP, &
 6.03005664791649076E-01_DP,  6.36610018750175299E-02_DP, &
 6.03005664791649076E-01_DP,  2.69672331458315867E-01_DP, &
 6.36610018750175299E-02_DP,  6.36610018750175299E-02_DP, &
 2.69672331458315867E-01_DP,  6.36610018750175299E-02_DP, &
 6.36610018750175299E-02_DP,  6.03005664791649076E-01_DP, &
 6.36610018750175299E-02_DP,  6.36610018750175299E-02_DP, &
 6.03005664791649076E-01_DP,  2.69672331458315867E-01_DP  / 
DATA  WT_31  /                                        &
 9.70017636684296702E-04_DP,  9.70017636684296702E-04_DP, &
 9.70017636684296702E-04_DP,  9.70017636684296702E-04_DP, &
 9.70017636684296702E-04_DP,  9.70017636684296702E-04_DP, &
 1.82642234661087939E-02_DP,  1.05999415244141609E-02_DP, &
 1.05999415244141609E-02_DP,  1.05999415244141609E-02_DP, &
 1.05999415244141609E-02_DP, -6.25177401143299494E-02_DP, &
-6.25177401143299494E-02_DP, -6.25177401143299494E-02_DP, &
-6.25177401143299494E-02_DP,  4.89142526307353653E-03_DP, &
 4.89142526307353653E-03_DP,  4.89142526307353653E-03_DP, &
 4.89142526307353653E-03_DP,  2.75573192239850917E-02_DP, &
 2.75573192239850917E-02_DP,  2.75573192239850917E-02_DP, &
 2.75573192239850917E-02_DP,  2.75573192239850917E-02_DP, &
 2.75573192239850917E-02_DP,  2.75573192239850917E-02_DP, &
 2.75573192239850917E-02_DP,  2.75573192239850917E-02_DP, &
 2.75573192239850917E-02_DP,  2.75573192239850917E-02_DP, &
 2.75573192239850917E-02_DP  / 
DATA  PT_31  /                                            &
 5.00000000000000000E-01_DP,  5.00000000000000000E-01_DP, &
 0.00000000000000000E+00_DP,  0.00000000000000000E+00_DP, &
 5.00000000000000000E-01_DP,  0.00000000000000000E+00_DP, &
 0.00000000000000000E+00_DP,  5.00000000000000000E-01_DP, &
 0.00000000000000000E+00_DP,  0.00000000000000000E+00_DP, &
 5.00000000000000000E-01_DP,  5.00000000000000000E-01_DP, &
 0.00000000000000000E+00_DP,  5.00000000000000000E-01_DP, &
 5.00000000000000000E-01_DP,  0.00000000000000000E+00_DP, &
 5.00000000000000000E-01_DP,  0.00000000000000000E+00_DP, &
 5.00000000000000000E-01_DP,  0.00000000000000000E+00_DP, &
 0.00000000000000000E+00_DP,  5.00000000000000000E-01_DP, &
 0.00000000000000000E+00_DP,  5.00000000000000000E-01_DP, &
 2.50000000000000000E-01_DP,  2.50000000000000000E-01_DP, &
 2.50000000000000000E-01_DP,  2.50000000000000000E-01_DP, &
 7.82131923303186549E-02_DP,  7.82131923303186549E-02_DP, &
 7.82131923303186549E-02_DP,  7.65360423009044044E-01_DP, &
 7.82131923303186549E-02_DP,  7.82131923303186549E-02_DP, &
 7.65360423009044044E-01_DP,  7.82131923303186549E-02_DP, &
 7.82131923303186549E-02_DP,  7.65360423009044044E-01_DP, &
 7.82131923303186549E-02_DP,  7.82131923303186549E-02_DP, &
 7.65360423009044044E-01_DP,  7.82131923303186549E-02_DP, &
 7.82131923303186549E-02_DP,  7.82131923303186549E-02_DP, &
 1.21843216663904411E-01_DP,  1.21843216663904411E-01_DP, &
 1.21843216663904411E-01_DP,  6.34470350008286765E-01_DP, &
 1.21843216663904411E-01_DP,  1.21843216663904411E-01_DP, &
 6.34470350008286765E-01_DP,  1.21843216663904411E-01_DP, &
 1.21843216663904411E-01_DP,  6.34470350008286765E-01_DP, &
 1.21843216663904411E-01_DP,  1.21843216663904411E-01_DP, &
 6.34470350008286765E-01_DP,  1.21843216663904411E-01_DP, &
 1.21843216663904411E-01_DP,  1.21843216663904411E-01_DP, &
 3.32539164446420554E-01_DP,  3.32539164446420554E-01_DP, &
 3.32539164446420554E-01_DP,  2.38250666073834549E-03_DP, &
 3.32539164446420554E-01_DP,  3.32539164446420554E-01_DP, &
 2.38250666073834549E-03_DP,  3.32539164446420554E-01_DP, &
 3.32539164446420554E-01_DP,  2.38250666073834549E-03_DP, &
 3.32539164446420554E-01_DP,  3.32539164446420554E-01_DP, &
 2.38250666073834549E-03_DP,  3.32539164446420554E-01_DP, &
 3.32539164446420554E-01_DP,  3.32539164446420554E-01_DP, &
 1.00000000000000000E-01_DP,  1.00000000000000000E-01_DP, &
 2.00000000000000000E-01_DP,  6.00000000000000000E-01_DP, &
 1.00000000000000000E-01_DP,  2.00000000000000000E-01_DP, &
 6.00000000000000000E-01_DP,  1.00000000000000000E-01_DP, &
 2.00000000000000000E-01_DP,  6.00000000000000000E-01_DP, &
 1.00000000000000000E-01_DP,  1.00000000000000000E-01_DP, &
 6.00000000000000000E-01_DP,  1.00000000000000000E-01_DP, &
 1.00000000000000000E-01_DP,  2.00000000000000000E-01_DP, &
 1.00000000000000000E-01_DP,  6.00000000000000000E-01_DP, &
 1.00000000000000000E-01_DP,  2.00000000000000000E-01_DP, &
 6.00000000000000000E-01_DP,  1.00000000000000000E-01_DP, &
 2.00000000000000000E-01_DP,  1.00000000000000000E-01_DP, &
 1.00000000000000000E-01_DP,  2.00000000000000000E-01_DP, &
 1.00000000000000000E-01_DP,  6.00000000000000000E-01_DP, &
 1.00000000000000000E-01_DP,  6.00000000000000000E-01_DP, &
 2.00000000000000000E-01_DP,  1.00000000000000000E-01_DP, &
 2.00000000000000000E-01_DP,  1.00000000000000000E-01_DP, &
 6.00000000000000000E-01_DP,  1.00000000000000000E-01_DP, &
 6.00000000000000000E-01_DP,  2.00000000000000000E-01_DP, &
 1.00000000000000000E-01_DP,  1.00000000000000000E-01_DP, &
 2.00000000000000000E-01_DP,  1.00000000000000000E-01_DP, &
 1.00000000000000000E-01_DP,  6.00000000000000000E-01_DP, &
 1.00000000000000000E-01_DP,  1.00000000000000000E-01_DP, &
 6.00000000000000000E-01_DP,  2.00000000000000000E-01_DP  / 
DATA  WT_45  /                                            &
-3.93270066412926145E-02_DP,  4.08131605934270525E-03_DP, &
 4.08131605934270525E-03_DP,  4.08131605934270525E-03_DP, &
 4.08131605934270525E-03_DP,  6.58086773304341943E-04_DP, &
 6.58086773304341943E-04_DP,  6.58086773304341943E-04_DP, &
 6.58086773304341943E-04_DP,  4.38425882512284693E-03_DP, &
 4.38425882512284693E-03_DP,  4.38425882512284693E-03_DP, &
 4.38425882512284693E-03_DP,  4.38425882512284693E-03_DP, &
 4.38425882512284693E-03_DP,  1.38300638425098166E-02_DP, &
 1.38300638425098166E-02_DP,  1.38300638425098166E-02_DP, &
 1.38300638425098166E-02_DP,  1.38300638425098166E-02_DP, &
 1.38300638425098166E-02_DP,  4.24043742468372453E-03_DP, &
 4.24043742468372453E-03_DP,  4.24043742468372453E-03_DP, &
 4.24043742468372453E-03_DP,  4.24043742468372453E-03_DP, &
 4.24043742468372453E-03_DP,  4.24043742468372453E-03_DP, &
 4.24043742468372453E-03_DP,  4.24043742468372453E-03_DP, &
 4.24043742468372453E-03_DP,  4.24043742468372453E-03_DP, &
 4.24043742468372453E-03_DP,  2.23873973961420164E-03_DP, &
 2.23873973961420164E-03_DP,  2.23873973961420164E-03_DP, &
 2.23873973961420164E-03_DP,  2.23873973961420164E-03_DP, &
 2.23873973961420164E-03_DP,  2.23873973961420164E-03_DP, &
 2.23873973961420164E-03_DP,  2.23873973961420164E-03_DP, &
 2.23873973961420164E-03_DP,  2.23873973961420164E-03_DP, &
 2.23873973961420164E-03_DP  / 
DATA  PT_45  /                                            &
 2.50000000000000000E-01_DP,  2.50000000000000000E-01_DP, &
 2.50000000000000000E-01_DP,  2.50000000000000000E-01_DP, &
 1.27470936566639015E-01_DP,  1.27470936566639015E-01_DP, &
 1.27470936566639015E-01_DP,  6.17587190300082967E-01_DP, &
 1.27470936566639015E-01_DP,  1.27470936566639015E-01_DP, &
 6.17587190300082967E-01_DP,  1.27470936566639015E-01_DP, &
 1.27470936566639015E-01_DP,  6.17587190300082967E-01_DP, &
 1.27470936566639015E-01_DP,  1.27470936566639015E-01_DP, &
 6.17587190300082967E-01_DP,  1.27470936566639015E-01_DP, &
 1.27470936566639015E-01_DP,  1.27470936566639015E-01_DP, &
 3.20788303926322960E-02_DP,  3.20788303926322960E-02_DP, &
 3.20788303926322960E-02_DP,  9.03763508822103123E-01_DP, &
 3.20788303926322960E-02_DP,  3.20788303926322960E-02_DP, &
 9.03763508822103123E-01_DP,  3.20788303926322960E-02_DP, &
 3.20788303926322960E-02_DP,  9.03763508822103123E-01_DP, &
 3.20788303926322960E-02_DP,  3.20788303926322960E-02_DP, &
 9.03763508822103123E-01_DP,  3.20788303926322960E-02_DP, &
 3.20788303926322960E-02_DP,  3.20788303926322960E-02_DP, &
 4.97770956432810185E-02_DP,  4.97770956432810185E-02_DP, &
 4.50222904356718978E-01_DP,  4.50222904356718978E-01_DP, &
 4.97770956432810185E-02_DP,  4.50222904356718978E-01_DP, &
 4.50222904356718978E-01_DP,  4.97770956432810185E-02_DP, &
 4.50222904356718978E-01_DP,  4.50222904356718978E-01_DP, &
 4.97770956432810185E-02_DP,  4.97770956432810185E-02_DP, &
 4.50222904356718978E-01_DP,  4.97770956432810185E-02_DP, &
 4.97770956432810185E-02_DP,  4.50222904356718978E-01_DP, &
 4.97770956432810185E-02_DP,  4.50222904356718978E-01_DP, &
 4.97770956432810185E-02_DP,  4.50222904356718978E-01_DP, &
 4.50222904356718978E-01_DP,  4.97770956432810185E-02_DP, &
 4.50222904356718978E-01_DP,  4.97770956432810185E-02_DP, &
 1.83730447398549945E-01_DP,  1.83730447398549945E-01_DP, &
 3.16269552601450060E-01_DP,  3.16269552601450060E-01_DP, &
 1.83730447398549945E-01_DP,  3.16269552601450060E-01_DP, &
 3.16269552601450060E-01_DP,  1.83730447398549945E-01_DP, &
 3.16269552601450060E-01_DP,  3.16269552601450060E-01_DP, &
 1.83730447398549945E-01_DP,  1.83730447398549945E-01_DP, &
 3.16269552601450060E-01_DP,  1.83730447398549945E-01_DP, &
 1.83730447398549945E-01_DP,  3.16269552601450060E-01_DP, &
 1.83730447398549945E-01_DP,  3.16269552601450060E-01_DP, &
 1.83730447398549945E-01_DP,  3.16269552601450060E-01_DP, &
 3.16269552601450060E-01_DP,  1.83730447398549945E-01_DP, &
 3.16269552601450060E-01_DP,  1.83730447398549945E-01_DP, &
 2.31901089397150906E-01_DP,  2.31901089397150906E-01_DP, &
 2.29177878448171174E-02_DP,  5.13280033360881072E-01_DP, &
 2.31901089397150906E-01_DP,  2.29177878448171174E-02_DP, &
 5.13280033360881072E-01_DP,  2.31901089397150906E-01_DP, &
 2.29177878448171174E-02_DP,  5.13280033360881072E-01_DP, &
 2.31901089397150906E-01_DP,  2.31901089397150906E-01_DP, &
 5.13280033360881072E-01_DP,  2.31901089397150906E-01_DP, &
 2.31901089397150906E-01_DP,  2.29177878448171174E-02_DP, &
 2.31901089397150906E-01_DP,  5.13280033360881072E-01_DP, &
 2.31901089397150906E-01_DP,  2.29177878448171174E-02_DP, &
 5.13280033360881072E-01_DP,  2.31901089397150906E-01_DP, &
 2.29177878448171174E-02_DP,  2.31901089397150906E-01_DP, &
 2.31901089397150906E-01_DP,  2.29177878448171174E-02_DP, &
 2.31901089397150906E-01_DP,  5.13280033360881072E-01_DP, &
 2.31901089397150906E-01_DP,  5.13280033360881072E-01_DP, &
 2.29177878448171174E-02_DP,  2.31901089397150906E-01_DP, &
 2.29177878448171174E-02_DP,  2.31901089397150906E-01_DP, &
 5.13280033360881072E-01_DP,  2.31901089397150906E-01_DP, &
 5.13280033360881072E-01_DP,  2.29177878448171174E-02_DP, &
 2.31901089397150906E-01_DP,  2.31901089397150906E-01_DP, &
 2.29177878448171174E-02_DP,  2.31901089397150906E-01_DP, &
 2.31901089397150906E-01_DP,  5.13280033360881072E-01_DP, &
 2.31901089397150906E-01_DP,  2.31901089397150906E-01_DP, &
 5.13280033360881072E-01_DP,  2.29177878448171174E-02_DP, &
 3.79700484718286102E-02_DP,  3.79700484718286102E-02_DP, &
 7.30313427807538396E-01_DP,  1.93746475248804382E-01_DP, &
 3.79700484718286102E-02_DP,  7.30313427807538396E-01_DP, &
 1.93746475248804382E-01_DP,  3.79700484718286102E-02_DP, &
 7.30313427807538396E-01_DP,  1.93746475248804382E-01_DP, &
 3.79700484718286102E-02_DP,  3.79700484718286102E-02_DP, &
 1.93746475248804382E-01_DP,  3.79700484718286102E-02_DP, &
 3.79700484718286102E-02_DP,  7.30313427807538396E-01_DP, &
 3.79700484718286102E-02_DP,  1.93746475248804382E-01_DP, &
 3.79700484718286102E-02_DP,  7.30313427807538396E-01_DP, &
 1.93746475248804382E-01_DP,  3.79700484718286102E-02_DP, &
 7.30313427807538396E-01_DP,  3.79700484718286102E-02_DP, &
 3.79700484718286102E-02_DP,  7.30313427807538396E-01_DP, &
 3.79700484718286102E-02_DP,  1.93746475248804382E-01_DP, &
 3.79700484718286102E-02_DP,  1.93746475248804382E-01_DP, &
 7.30313427807538396E-01_DP,  3.79700484718286102E-02_DP, &
 7.30313427807538396E-01_DP,  3.79700484718286102E-02_DP, &
 1.93746475248804382E-01_DP,  3.79700484718286102E-02_DP, &
 1.93746475248804382E-01_DP,  7.30313427807538396E-01_DP, &
 3.79700484718286102E-02_DP,  3.79700484718286102E-02_DP, &
 7.30313427807538396E-01_DP,  3.79700484718286102E-02_DP, &
 3.79700484718286102E-02_DP,  1.93746475248804382E-01_DP, &
 3.79700484718286102E-02_DP,  3.79700484718286102E-02_DP, &
 1.93746475248804382E-01_DP,  7.30313427807538396E-01_DP  / 

 SELECT CASE (NQP)
   CASE ( 1) ; WT = WT_1  ; PT = PT_1 
   CASE ( 4) ; WT = WT_4  ; PT = PT_4 
   CASE ( 5) ; WT = WT_5  ; PT = PT_5 
   CASE (10) ; WT = WT_10 ; PT = PT_10
   CASE (11) ; WT = WT_11 ; PT = PT_11
   CASE (15) ; WT = WT_15 ; PT = PT_15
   CASE (24) ; WT = WT_24 ; PT = PT_24
   CASE (31) ; WT = WT_31 ; PT = PT_31
   CASE (45) ; WT = WT_45 ; PT = PT_45
   CASE DEFAULT
    PRINT *,'WARNING: KEAST_VOLUME_TET_RULE, INVALID RULE', NQP 
    PRINT *,'CHECK IF shape 5 IS INCORRECT IN KEYWORD CONTROL'
    !b N_WARN = N_WARN + 1
     STOP 'INVALID RULE KEAST_VOLUME_TET_RULE'
 END SELECT
END SUBROUTINE KEAST_VOLUME_TET_RULE 

SUBROUTINE KEAST_UNIT_TET_RULE (NQP, PT, WT) 
! * * * * * * * * * * * * * * * * * * * * * * * * * * *
! KEAST UNIT COORDINATE QUADRATURE RULE FOR TETRAHEDRA,
! DEGREE 1 TO 8, C.M.A.M.E. V. 55, PP. 339-348, 1986 
! [WITH SIGN & SCALE FIX] COPYRIGHT 1998, J. E. AKIN
! GIVEN NQP        = 1, 4, 5, 10, 11, 15, 24, 31, 45
! EXACT FOR DEGREE = 0, 1, 2,  3,  4,  5,  6,  7,  8 
! * * * * * * * * * * * * * * * * * * * * * * * * * * *
Use Precision_Module
  IMPLICIT NONE
  INTEGER,  INTENT (IN)  :: NQP
  REAL(DP), INTENT (OUT) :: PT (3, NQP), WT (NQP) 
              
! NQP = NUMBER OF QUADRATURE POINTS
! PT  = RETURNED QUADRATURE COORDINATES
! WT  = RETURNED QUADRATURE WEIGHTS
                                                                        
REAL(DP), SAVE :: WT_1  ( 1),   WT_4  ( 4),   WT_5  ( 5)
REAL(DP), SAVE :: WT_10 (10),   WT_11 (11),   WT_15 (15) 
REAL(DP), SAVE :: WT_24 (24),   WT_31 (31),   WT_45 (45)
REAL(DP), SAVE :: PT_1  (3, 1), PT_4  (3, 4), PT_5  (3, 5)
REAL(DP), SAVE :: PT_10 (3,10), PT_11 (3,11), PT_15 (3,15)
REAL(DP), SAVE :: PT_24 (3,24), PT_31 (3,31), PT_45 (3,45)

DATA  WT_1  /               1.66666666666666666E-01_DP   / 
DATA  PT_1  /                                             &
 2.50000000000000000E-01_DP,  2.50000000000000000E-01_DP, &
 2.50000000000000000E-01_DP  / 
DATA  WT_4  /                                         &
 4.16666666666666667E-02_DP,  4.16666666666666667E-02_DP, &
 4.16666666666666667E-02_DP,  4.16666666666666667E-02_DP  / 
DATA  PT_4  /                                         &
 5.85410196624968515E-01_DP,  1.38196601125010504E-01_DP, &
 1.38196601125010504E-01_DP,  1.38196601125010504E-01_DP, &
 5.85410196624968515E-01_DP,  1.38196601125010504E-01_DP, &
 1.38196601125010504E-01_DP,  1.38196601125010504E-01_DP, &
 5.85410196624968515E-01_DP,  1.38196601125010504E-01_DP, &
 1.38196601125010504E-01_DP,  1.38196601125010504E-01_DP   / 
DATA  WT_5  /                                         &
-1.33333333333333333E-01_DP,  7.49999999999999999E-02_DP, &
 7.49999999999999999E-02_DP,  7.49999999999999999E-02_DP, &
 7.49999999999999999E-02_DP  / 
DATA  PT_5  /                                         &
 2.50000000000000000E-01_DP,  2.50000000000000000E-01_DP, &
 2.50000000000000000E-01_DP,  5.00000000000000000E-01_DP, &
 1.66666666666666667E-01_DP,  1.66666666666666667E-01_DP, &
 1.66666666666666667E-01_DP,  5.00000000000000000E-01_DP, &
 1.66666666666666667E-01_DP,  1.66666666666666667E-01_DP, &
 1.66666666666666667E-01_DP,  5.00000000000000000E-01_DP, &
 1.66666666666666667E-01_DP,  1.66666666666666667E-01_DP, &
 1.66666666666666667E-01_DP  / 
DATA  WT_10  /                                        &
 3.62941783134008988E-02_DP,  3.62941783134008988E-02_DP, &
 3.62941783134008988E-02_DP,  3.62941783134008988E-02_DP, &
 3.58165890217718337E-03_DP,  3.58165890217718337E-03_DP, &
 3.58165890217718337E-03_DP,  3.58165890217718337E-03_DP, &
 3.58165890217718337E-03_DP,  3.58165890217718337E-03_DP   / 
DATA  PT_10  /                                        &
 5.68430584196844446E-01_DP,  1.43856471934385194E-01_DP, &
 1.43856471934385194E-01_DP,  1.43856471934385194E-01_DP, &
 5.68430584196844446E-01_DP,  1.43856471934385194E-01_DP, &
 1.43856471934385194E-01_DP,  1.43856471934385194E-01_DP, &
 5.68430584196844446E-01_DP,  1.43856471934385194E-01_DP, &
 1.43856471934385194E-01_DP,  1.43856471934385194E-01_DP, &
 5.00000000000000000E-01_DP,  5.00000000000000000E-01_DP, &
 0.00000000000000000E+00_DP,  5.00000000000000000E-01_DP, &
 0.00000000000000000E+00_DP,  5.00000000000000000E-01_DP, &
 5.00000000000000000E-01_DP,  0.00000000000000000E+00_DP, &
 0.00000000000000000E+00_DP,  0.00000000000000000E+00_DP, &
 5.00000000000000000E-01_DP,  5.00000000000000000E-01_DP, &
 0.00000000000000000E+00_DP,  5.00000000000000000E-01_DP, &
 0.00000000000000000E+00_DP,  0.00000000000000000E+00_DP, &
 0.00000000000000000E+00_DP,  5.00000000000000000E-01_DP   / 
DATA  WT_11  /                                        &
-1.31555555555555556E-02_DP,  7.62222222222222222E-03_DP, &
 7.62222222222222222E-03_DP,  7.62222222222222222E-03_DP, &
 7.62222222222222222E-03_DP,  2.48888888888888889E-02_DP, &
 2.48888888888888889E-02_DP,  2.48888888888888889E-02_DP, &
 2.48888888888888889E-02_DP,  2.48888888888888889E-02_DP, &
 2.48888888888888889E-02_DP  / 
DATA  PT_11  /                                        &
 2.50000000000000000E-01_DP,  2.50000000000000000E-01_DP, &
 2.50000000000000000E-01_DP,  7.14285714285714285E-02_DP, &
 7.14285714285714285E-02_DP,  7.14285714285714285E-02_DP, &
 7.14285714285714285E-02_DP,  7.14285714285714285E-02_DP, &
 7.85714285714285714E-01_DP,  7.14285714285714285E-02_DP, &
 7.85714285714285714E-01_DP,  7.14285714285714285E-02_DP, &
 7.85714285714285714E-01_DP,  7.14285714285714285E-02_DP, &
 7.14285714285714285E-02_DP,  3.99403576166799219E-01_DP, &
 3.99403576166799219E-01_DP,  1.00596423833200785E-01_DP, &
 3.99403576166799219E-01_DP,  1.00596423833200785E-01_DP, &
 1.00596423833200785E-01_DP,  1.00596423833200785E-01_DP, &
 1.00596423833200785E-01_DP,  3.99403576166799219E-01_DP, &
 1.00596423833200785E-01_DP,  3.99403576166799219E-01_DP, &
 3.99403576166799219E-01_DP,  3.99403576166799219E-01_DP, &
 1.00596423833200785E-01_DP,  3.99403576166799219E-01_DP, &
 1.00596423833200785E-01_DP,  3.99403576166799219E-01_DP, &
 1.00596423833200785E-01_DP  / 
DATA  WT_15  /                                        &
 6.02678571428571597E-03_DP,  6.02678571428571597E-03_DP, &
 6.02678571428571597E-03_DP,  6.02678571428571597E-03_DP, &
 3.02836780970891856E-02_DP,  1.16452490860289742E-02_DP, &
 1.16452490860289742E-02_DP,  1.16452490860289742E-02_DP, &
 1.16452490860289742E-02_DP,  1.09491415613864534E-02_DP, &
 1.09491415613864534E-02_DP,  1.09491415613864534E-02_DP, &
 1.09491415613864534E-02_DP,  1.09491415613864534E-02_DP, &
 1.09491415613864534E-02_DP  / 
DATA  PT_15  /                                        &
 3.33333333333333333E-01_DP,  3.33333333333333333E-01_DP, &
 3.33333333333333333E-01_DP,  3.33333333333333333E-01_DP, &
 3.33333333333333333E-01_DP,  0.00000000000000000E+00_DP, &
 3.33333333333333333E-01_DP,  0.00000000000000000E+00_DP, &
 3.33333333333333333E-01_DP,  0.00000000000000000E+00_DP, &
 3.33333333333333333E-01_DP,  3.33333333333333333E-01_DP, &
 2.50000000000000000E-01_DP,  2.50000000000000000E-01_DP, &
 2.50000000000000000E-01_DP,  9.09090909090909091E-02_DP, &
 9.09090909090909091E-02_DP,  9.09090909090909091E-02_DP, &
 9.09090909090909091E-02_DP,  9.09090909090909091E-02_DP, &
 7.27272727272727273E-01_DP,  9.09090909090909091E-02_DP, &
 7.27272727272727273E-01_DP,  9.09090909090909091E-02_DP, &
 7.27272727272727273E-01_DP,  9.09090909090909091E-02_DP, &
 9.09090909090909091E-02_DP,  6.65501535736642813E-02_DP, &
 6.65501535736642813E-02_DP,  4.33449846426335728E-01_DP, &
 6.65501535736642813E-02_DP,  4.33449846426335728E-01_DP, &
 4.33449846426335728E-01_DP,  4.33449846426335728E-01_DP, &
 4.33449846426335728E-01_DP,  6.65501535736642813E-02_DP, &
 4.33449846426335728E-01_DP,  6.65501535736642813E-02_DP, &
 6.65501535736642813E-02_DP,  6.65501535736642813E-02_DP, &
 4.33449846426335728E-01_DP,  6.65501535736642813E-02_DP, &
 4.33449846426335728E-01_DP,  6.65501535736642813E-02_DP, &
 4.33449846426335728E-01_DP  / 
DATA  WT_24  /                                        &
 6.65379170969464506E-03_DP,  6.65379170969464506E-03_DP, &
 6.65379170969464506E-03_DP,  6.65379170969464506E-03_DP, &
 1.67953517588677620E-03_DP,  1.67953517588677620E-03_DP, &
 1.67953517588677620E-03_DP,  1.67953517588677620E-03_DP, &
 9.22619692394239843E-03_DP,  9.22619692394239843E-03_DP, &
 9.22619692394239843E-03_DP,  9.22619692394239843E-03_DP, &
 8.03571428571428248E-03_DP,  8.03571428571428248E-03_DP, &
 8.03571428571428248E-03_DP,  8.03571428571428248E-03_DP, &
 8.03571428571428248E-03_DP,  8.03571428571428248E-03_DP, &
 8.03571428571428248E-03_DP,  8.03571428571428248E-03_DP, &
 8.03571428571428248E-03_DP,  8.03571428571428248E-03_DP, &
 8.03571428571428248E-03_DP,  8.03571428571428248E-03_DP   / 
DATA  PT_24  /                                            &
 2.14602871259151684E-01_DP,  2.14602871259151684E-01_DP, &
 2.14602871259151684E-01_DP,  2.14602871259151684E-01_DP, &
 2.14602871259151684E-01_DP,  3.56191386222544953E-01_DP, &
 2.14602871259151684E-01_DP,  3.56191386222544953E-01_DP, &
 2.14602871259151684E-01_DP,  3.56191386222544953E-01_DP, &
 2.14602871259151684E-01_DP,  2.14602871259151684E-01_DP, &
 4.06739585346113397E-02_DP,  4.06739585346113397E-02_DP, &
 4.06739585346113397E-02_DP,  4.06739585346113397E-02_DP, &
 4.06739585346113397E-02_DP,  8.77978124396165982E-01_DP, &
 4.06739585346113397E-02_DP,  8.77978124396165982E-01_DP, &
 4.06739585346113397E-02_DP,  8.77978124396165982E-01_DP, &
 4.06739585346113397E-02_DP,  4.06739585346113397E-02_DP, &
 3.22337890142275646E-01_DP,  3.22337890142275646E-01_DP, &
 3.22337890142275646E-01_DP,  3.22337890142275646E-01_DP, &
 3.22337890142275646E-01_DP,  3.29863295731730594E-02_DP, &
 3.22337890142275646E-01_DP,  3.29863295731730594E-02_DP, &
 3.22337890142275646E-01_DP,  3.29863295731730594E-02_DP, &
 3.22337890142275646E-01_DP,  3.22337890142275646E-01_DP, &
 6.36610018750175299E-02_DP,  6.36610018750175299E-02_DP, &
 2.69672331458315867E-01_DP,  6.36610018750175299E-02_DP, &
 2.69672331458315867E-01_DP,  6.03005664791649076E-01_DP, &
 2.69672331458315867E-01_DP,  6.03005664791649076E-01_DP, &
 6.36610018750175299E-02_DP,  6.03005664791649076E-01_DP, &
 6.36610018750175299E-02_DP,  6.36610018750175299E-02_DP, &
 6.36610018750175299E-02_DP,  6.03005664791649076E-01_DP, &
 6.36610018750175299E-02_DP,  6.03005664791649076E-01_DP, &
 6.36610018750175299E-02_DP,  2.69672331458315867E-01_DP, &
 6.36610018750175299E-02_DP,  2.69672331458315867E-01_DP, &
 6.36610018750175299E-02_DP,  6.36610018750175299E-02_DP, &
 6.03005664791649076E-01_DP,  2.69672331458315867E-01_DP, &
 2.69672331458315867E-01_DP,  6.36610018750175299E-02_DP, &
 6.03005664791649076E-01_DP,  6.03005664791649076E-01_DP, &
 2.69672331458315867E-01_DP,  6.36610018750175299E-02_DP, &
 2.69672331458315867E-01_DP,  6.36610018750175299E-02_DP, &
 6.36610018750175299E-02_DP,  6.36610018750175299E-02_DP, &
 6.36610018750175299E-02_DP,  6.03005664791649076E-01_DP  / 
DATA  WT_31  /                                            &
 9.70017636684296702E-04_DP,  9.70017636684296702E-04_DP, &
 9.70017636684296702E-04_DP,  9.70017636684296702E-04_DP, &
 9.70017636684296702E-04_DP,  9.70017636684296702E-04_DP, &
 1.82642234661087939E-02_DP,  1.05999415244141609E-02_DP, &
 1.05999415244141609E-02_DP,  1.05999415244141609E-02_DP, &
 1.05999415244141609E-02_DP, -6.25177401143299494E-02_DP, &
-6.25177401143299494E-02_DP, -6.25177401143299494E-02_DP, &
-6.25177401143299494E-02_DP,  4.89142526307353653E-03_DP, &
 4.89142526307353653E-03_DP,  4.89142526307353653E-03_DP, &
 4.89142526307353653E-03_DP,  2.75573192239850917E-02_DP, &
 2.75573192239850917E-02_DP,  2.75573192239850917E-02_DP, &
 2.75573192239850917E-02_DP,  2.75573192239850917E-02_DP, &
 2.75573192239850917E-02_DP,  2.75573192239850917E-02_DP, &
 2.75573192239850917E-02_DP,  2.75573192239850917E-02_DP, &
 2.75573192239850917E-02_DP,  2.75573192239850917E-02_DP, &
 2.75573192239850917E-02_DP  / 
DATA  PT_31  /                                            &
 5.00000000000000000E-01_DP,  5.00000000000000000E-01_DP, &
 0.00000000000000000E+00_DP,  5.00000000000000000E-01_DP, &
 0.00000000000000000E+00_DP,  0.00000000000000000E+00_DP, &
 0.00000000000000000E+00_DP,  0.00000000000000000E+00_DP, &
 5.00000000000000000E-01_DP,  0.00000000000000000E+00_DP, &
 5.00000000000000000E-01_DP,  5.00000000000000000E-01_DP, &
 5.00000000000000000E-01_DP,  0.00000000000000000E+00_DP, &
 5.00000000000000000E-01_DP,  0.00000000000000000E+00_DP, &
 5.00000000000000000E-01_DP,  0.00000000000000000E+00_DP, &
 2.50000000000000000E-01_DP,  2.50000000000000000E-01_DP, &
 2.50000000000000000E-01_DP,  7.82131923303186549E-02_DP, &
 7.82131923303186549E-02_DP,  7.82131923303186549E-02_DP, &
 7.82131923303186549E-02_DP,  7.82131923303186549E-02_DP, &
 7.65360423009044044E-01_DP,  7.82131923303186549E-02_DP, &
 7.65360423009044044E-01_DP,  7.82131923303186549E-02_DP, &
 7.65360423009044044E-01_DP,  7.82131923303186549E-02_DP, &
 7.82131923303186549E-02_DP,  1.21843216663904411E-01_DP, &
 1.21843216663904411E-01_DP,  1.21843216663904411E-01_DP, &
 1.21843216663904411E-01_DP,  1.21843216663904411E-01_DP, &
 6.34470350008286765E-01_DP,  1.21843216663904411E-01_DP, &
 6.34470350008286765E-01_DP,  1.21843216663904411E-01_DP, &
 6.34470350008286765E-01_DP,  1.21843216663904411E-01_DP, &
 1.21843216663904411E-01_DP,  3.32539164446420554E-01_DP, &
 3.32539164446420554E-01_DP,  3.32539164446420554E-01_DP, &
 3.32539164446420554E-01_DP,  3.32539164446420554E-01_DP, &
 2.38250666073834549E-03_DP,  3.32539164446420554E-01_DP, &
 2.38250666073834549E-03_DP,  3.32539164446420554E-01_DP, &
 2.38250666073834549E-03_DP,  3.32539164446420554E-01_DP, &
 3.32539164446420554E-01_DP,  1.00000000000000000E-01_DP, &
 1.00000000000000000E-01_DP,  2.00000000000000000E-01_DP, &
 1.00000000000000000E-01_DP,  2.00000000000000000E-01_DP, &
 6.00000000000000000E-01_DP,  2.00000000000000000E-01_DP, &
 6.00000000000000000E-01_DP,  1.00000000000000000E-01_DP, &
 6.00000000000000000E-01_DP,  1.00000000000000000E-01_DP, &
 1.00000000000000000E-01_DP,  1.00000000000000000E-01_DP, &
 6.00000000000000000E-01_DP,  1.00000000000000000E-01_DP, &
 6.00000000000000000E-01_DP,  1.00000000000000000E-01_DP, &
 2.00000000000000000E-01_DP,  1.00000000000000000E-01_DP, &
 2.00000000000000000E-01_DP,  1.00000000000000000E-01_DP, &
 1.00000000000000000E-01_DP,  6.00000000000000000E-01_DP, &
 2.00000000000000000E-01_DP,  2.00000000000000000E-01_DP, &
 1.00000000000000000E-01_DP,  6.00000000000000000E-01_DP, &
 6.00000000000000000E-01_DP,  2.00000000000000000E-01_DP, &
 1.00000000000000000E-01_DP,  2.00000000000000000E-01_DP, &
 1.00000000000000000E-01_DP,  1.00000000000000000E-01_DP, &
 1.00000000000000000E-01_DP,  1.00000000000000000E-01_DP, &
 6.00000000000000000E-01_DP  / 
DATA  WT_45  /                                            &
-3.93270066412926145E-02_DP,  4.08131605934270525E-03_DP, &
 4.08131605934270525E-03_DP,  4.08131605934270525E-03_DP, &
 4.08131605934270525E-03_DP,  6.58086773304341943E-04_DP, &
 6.58086773304341943E-04_DP,  6.58086773304341943E-04_DP, &
 6.58086773304341943E-04_DP,  4.38425882512284693E-03_DP, &
 4.38425882512284693E-03_DP,  4.38425882512284693E-03_DP, &
 4.38425882512284693E-03_DP,  4.38425882512284693E-03_DP, &
 4.38425882512284693E-03_DP,  1.38300638425098166E-02_DP, &
 1.38300638425098166E-02_DP,  1.38300638425098166E-02_DP, &
 1.38300638425098166E-02_DP,  1.38300638425098166E-02_DP, &
 1.38300638425098166E-02_DP,  4.24043742468372453E-03_DP, &
 4.24043742468372453E-03_DP,  4.24043742468372453E-03_DP, &
 4.24043742468372453E-03_DP,  4.24043742468372453E-03_DP, &
 4.24043742468372453E-03_DP,  4.24043742468372453E-03_DP, &
 4.24043742468372453E-03_DP,  4.24043742468372453E-03_DP, &
 4.24043742468372453E-03_DP,  4.24043742468372453E-03_DP, &
 4.24043742468372453E-03_DP,  2.23873973961420164E-03_DP, &
 2.23873973961420164E-03_DP,  2.23873973961420164E-03_DP, &
 2.23873973961420164E-03_DP,  2.23873973961420164E-03_DP, &
 2.23873973961420164E-03_DP,  2.23873973961420164E-03_DP, &
 2.23873973961420164E-03_DP,  2.23873973961420164E-03_DP, &
 2.23873973961420164E-03_DP,  2.23873973961420164E-03_DP, &
 2.23873973961420164E-03_DP  / 
DATA  PT_45  /                                            &
 2.50000000000000000E-01_DP,  2.50000000000000000E-01_DP, &
 2.50000000000000000E-01_DP,  1.27470936566639015E-01_DP, &
 1.27470936566639015E-01_DP,  1.27470936566639015E-01_DP, &
 1.27470936566639015E-01_DP,  1.27470936566639015E-01_DP, &
 6.17587190300082967E-01_DP,  1.27470936566639015E-01_DP, &
 6.17587190300082967E-01_DP,  1.27470936566639015E-01_DP, &
 6.17587190300082967E-01_DP,  1.27470936566639015E-01_DP, &
 1.27470936566639015E-01_DP,  3.20788303926322960E-02_DP, &
 3.20788303926322960E-02_DP,  3.20788303926322960E-02_DP, &
 3.20788303926322960E-02_DP,  3.20788303926322960E-02_DP, &
 9.03763508822103123E-01_DP,  3.20788303926322960E-02_DP, &
 9.03763508822103123E-01_DP,  3.20788303926322960E-02_DP, &
 9.03763508822103123E-01_DP,  3.20788303926322960E-02_DP, &
 3.20788303926322960E-02_DP,  4.97770956432810185E-02_DP, &
 4.97770956432810185E-02_DP,  4.50222904356718978E-01_DP, &
 4.97770956432810185E-02_DP,  4.50222904356718978E-01_DP, &
 4.50222904356718978E-01_DP,  4.50222904356718978E-01_DP, &
 4.50222904356718978E-01_DP,  4.97770956432810185E-02_DP, &
 4.50222904356718978E-01_DP,  4.97770956432810185E-02_DP, &
 4.97770956432810185E-02_DP,  4.97770956432810185E-02_DP, &
 4.50222904356718978E-01_DP,  4.97770956432810185E-02_DP, &
 4.50222904356718978E-01_DP,  4.97770956432810185E-02_DP, &
 4.50222904356718978E-01_DP,  1.83730447398549945E-01_DP, &
 1.83730447398549945E-01_DP,  3.16269552601450060E-01_DP, &
 1.83730447398549945E-01_DP,  3.16269552601450060E-01_DP, &
 3.16269552601450060E-01_DP,  3.16269552601450060E-01_DP, &
 3.16269552601450060E-01_DP,  1.83730447398549945E-01_DP, &
 3.16269552601450060E-01_DP,  1.83730447398549945E-01_DP, &
 1.83730447398549945E-01_DP,  1.83730447398549945E-01_DP, &
 3.16269552601450060E-01_DP,  1.83730447398549945E-01_DP, &
 3.16269552601450060E-01_DP,  1.83730447398549945E-01_DP, &
 3.16269552601450060E-01_DP,  2.31901089397150906E-01_DP, &
 2.31901089397150906E-01_DP,  2.29177878448171174E-02_DP, &
 2.31901089397150906E-01_DP,  2.29177878448171174E-02_DP, &
 5.13280033360881072E-01_DP,  2.29177878448171174E-02_DP, &
 5.13280033360881072E-01_DP,  2.31901089397150906E-01_DP, &
 5.13280033360881072E-01_DP,  2.31901089397150906E-01_DP, &
 2.31901089397150906E-01_DP,  2.31901089397150906E-01_DP, &
 5.13280033360881072E-01_DP,  2.31901089397150906E-01_DP, &
 5.13280033360881072E-01_DP,  2.31901089397150906E-01_DP, &
 2.29177878448171174E-02_DP,  2.31901089397150906E-01_DP, &
 2.29177878448171174E-02_DP,  2.31901089397150906E-01_DP, &
 2.31901089397150906E-01_DP,  5.13280033360881072E-01_DP, &
 2.29177878448171174E-02_DP,  2.29177878448171174E-02_DP, &
 2.31901089397150906E-01_DP,  5.13280033360881072E-01_DP, &
 5.13280033360881072E-01_DP,  2.29177878448171174E-02_DP, &
 2.31901089397150906E-01_DP,  2.29177878448171174E-02_DP, &
 2.31901089397150906E-01_DP,  2.31901089397150906E-01_DP, &
 2.31901089397150906E-01_DP,  2.31901089397150906E-01_DP, &
 5.13280033360881072E-01_DP,  3.79700484718286102E-02_DP, &
 3.79700484718286102E-02_DP,  7.30313427807538396E-01_DP, &
 3.79700484718286102E-02_DP,  7.30313427807538396E-01_DP, &
 1.93746475248804382E-01_DP,  7.30313427807538396E-01_DP, &
 1.93746475248804382E-01_DP,  3.79700484718286102E-02_DP, &
 1.93746475248804382E-01_DP,  3.79700484718286102E-02_DP, &
 3.79700484718286102E-02_DP,  3.79700484718286102E-02_DP, &
 1.93746475248804382E-01_DP,  3.79700484718286102E-02_DP, &
 1.93746475248804382E-01_DP,  3.79700484718286102E-02_DP, &
 7.30313427807538396E-01_DP,  3.79700484718286102E-02_DP, &
 7.30313427807538396E-01_DP,  3.79700484718286102E-02_DP, &
 3.79700484718286102E-02_DP,  1.93746475248804382E-01_DP, &
 7.30313427807538396E-01_DP,  7.30313427807538396E-01_DP, &
 3.79700484718286102E-02_DP,  1.93746475248804382E-01_DP, &
 1.93746475248804382E-01_DP,  7.30313427807538396E-01_DP, &
 3.79700484718286102E-02_DP,  7.30313427807538396E-01_DP, &
 3.79700484718286102E-02_DP,  3.79700484718286102E-02_DP, &
 3.79700484718286102E-02_DP,  3.79700484718286102E-02_DP, &
 1.93746475248804382E-01_DP  / 

 SELECT CASE (NQP)
   CASE ( 1) ; WT = WT_1  ; PT = PT_1 
   CASE ( 4) ; WT = WT_4  ; PT = PT_4 
   CASE ( 5) ; WT = WT_5  ; PT = PT_5 
   CASE (10) ; WT = WT_10 ; PT = PT_10
   CASE (11) ; WT = WT_11 ; PT = PT_11
   CASE (15) ; WT = WT_15 ; PT = PT_15
   CASE (24) ; WT = WT_24 ; PT = PT_24
   CASE (31) ; WT = WT_31 ; PT = PT_31
   CASE (45) ; WT = WT_45 ; PT = PT_45
   CASE DEFAULT 
     PRINT *,'WARNING: KEAST_UNIT_TET_RULE, INVALID RULE', NQP
     PRINT *,'CHECK IF shape 2 IS INCORRECT IN KEYWORD CONTROL'
     !b N_WARN = N_WARN + 1
     STOP 'INVALID RULE KEAST_UNIT_TET_RULE'
 END SELECT
END SUBROUTINE KEAST_UNIT_TET_RULE 

SUBROUTINE DUNAVANT_UNIT_TRIANGLE_RULE (M_QP, PT, WT)
! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
! DUNAVANT QUADRATURE RULE FOR TRIANGLES, TO DEGREE = 17, IN
!  UNIT COORDINATES, I.J.N.M.E. VOL. 21, PP.1129-1148, 1985
! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
! FOR  M_QP = 1,3,4,6,7,12,13,16,19,25,27,33,37,42,48,52,61
!    DEGREE = 1,2,3,4,5, 6, 7, 8, 9,10,11,12,13,14,15,16,17
Use Precision_Module
 IMPLICIT NONE
 INTEGER,  INTENT(IN)  :: M_QP     
 REAL(DP), INTENT(OUT) :: PT (2, M_QP), WT (M_QP)  

 REAL(DP) :: WT_1  ( 1), WT_3  ( 3), WT_4  ( 4)
 REAL(DP) :: WT_6  ( 6), WT_7  ( 7), WT_12 (12)
 REAL(DP) :: WT_13 (13), WT_16 (16), WT_19 (19)
 REAL(DP) :: WT_25 (25), WT_27 (27), WT_33 (33)
 REAL(DP) :: WT_37 (37), WT_42 (42), WT_48 (48)
 REAL(DP) :: WT_52 (52), WT_61 (61)
 REAL(DP) :: PT_1  (2, 1), PT_3  (2, 3), PT_4  (2, 4)
 REAL(DP) :: PT_6  (2, 6), PT_7  (2, 7), PT_12 (2,12)
 REAL(DP) :: PT_13 (2,13), PT_16 (2,16), PT_19 (2,19)
 REAL(DP) :: PT_25 (2,25), PT_27 (2,27), PT_33 (2,33)
 REAL(DP) :: PT_37 (2,37), PT_42 (2,42), PT_48 (2,48)
 REAL(DP) :: PT_52 (2,52), PT_61 (2,61)

! M_QP     = NUMBER OF QUADRATURE POINTS
! PT       = RETURNED QUADRATURE COORDINATES
! WT       = RETURNED QUADRATURE WEIGHTS

DATA  WT_1   /                5.00000000000000000E-01_DP  / 
DATA  PT_1   /                                            &
 3.33333333333333333E-01_DP,  3.33333333333333333E-01_DP  / 
DATA  WT_3   /                                            &
 1.66666666666666666E-01_DP,  1.66666666666666667E-01_DP, &
 1.66666666666666667E-01_DP / 
DATA  PT_3   /                                            &
 6.66666666666666667E-01_DP,  1.66666666666666667E-01_DP, &
 1.66666666666666667E-01_DP,  6.66666666666666667E-01_DP, &
 1.66666666666666667E-01_DP,  1.66666666666666667E-01_DP  / 
DATA  WT_4   /                                            &
-2.81250000000000000E-01_DP,  2.60416666666666667E-01_DP, &
 2.60416666666666667E-01_DP,  2.60416666666666666E-01_DP  / 
DATA  PT_4   /                                            &
 3.33333333333333333E-01_DP,  3.33333333333333333E-01_DP, &
 6.00000000000000000E-01_DP,  2.00000000000000000E-01_DP, &
 2.00000000000000000E-01_DP,  6.00000000000000000E-01_DP, &
 2.00000000000000000E-01_DP,  2.00000000000000000E-01_DP  / 
DATA  WT_6   /                                        &
 1.116907948390055E-01_DP,  1.116907948390055E-01_DP, &
 1.116907948390055E-01_DP,  5.497587182766100E-02_DP, &
 5.497587182766100E-02_DP,  5.497587182766100E-02_DP  / 
DATA  PT_6   /                                        &
 1.081030181680700E-01_DP,  4.459484909159650E-01_DP, &
 4.459484909159650E-01_DP,  1.081030181680700E-01_DP, &
 4.459484909159650E-01_DP,  4.459484909159650E-01_DP, &
 8.168475729804590E-01_DP,  9.157621350977100E-02_DP, &
 9.157621350977100E-02_DP,  8.168475729804590E-01_DP, &
 9.157621350977100E-02_DP,  9.157621350977100E-02_DP  / 
DATA  WT_7   /                                      &
 1.12500000000000E-01_DP,  6.61970763942530E-02_DP, &
 6.61970763942530E-02_DP,  6.61970763942530E-02_DP, &
 6.29695902724135E-02_DP,  6.29695902724135E-02_DP, &
 6.29695902724135E-02_DP / 
DATA  PT_7   /                                      &
 3.33333333333333E-01_DP,  3.33333333333333E-01_DP, &
 5.97158717897700E-02_DP,  4.70142064105115E-01_DP, &
 4.70142064105115E-01_DP,  5.97158717897700E-02_DP, &
 4.70142064105115E-01_DP,  4.70142064105115E-01_DP, &
 7.97426985353087E-01_DP,  1.01286507323456E-01_DP, &
 1.01286507323456E-01_DP,  7.97426985353087E-01_DP, &
 1.01286507323456E-01_DP,  1.01286507323456E-01_DP  / 
DATA  WT_12  /                                      &
 5.83931378631895E-02_DP,  5.83931378631895E-02_DP, &
 5.83931378631895E-02_DP,  2.54224531851035E-02_DP, &
 2.54224531851035E-02_DP,  2.54224531851035E-02_DP, &
 4.14255378091870E-02_DP,  4.14255378091870E-02_DP, &
 4.14255378091870E-02_DP,  4.14255378091870E-02_DP, &
 4.14255378091870E-02_DP,  4.14255378091870E-02_DP  / 
DATA  PT_12  /                                      &
 5.01426509658179E-01_DP,  2.49286745170910E-01_DP, &
 2.49286745170910E-01_DP,  5.01426509658179E-01_DP, &
 2.49286745170910E-01_DP,  2.49286745170910E-01_DP, &
 8.73821971016996E-01_DP,  6.30890144915020E-02_DP, &
 6.30890144915020E-02_DP,  8.73821971016996E-01_DP, &
 6.30890144915020E-02_DP,  6.30890144915020E-02_DP, &
 5.31450498448170E-02_DP,  3.10352451033784E-01_DP, &
 6.36502499121399E-01_DP,  5.31450498448170E-02_DP, &
 3.10352451033784E-01_DP,  6.36502499121399E-01_DP, &
 5.31450498448170E-02_DP,  6.36502499121399E-01_DP, &
 6.36502499121399E-01_DP,  3.10352451033784E-01_DP, &
 3.10352451033784E-01_DP,  5.31450498448170E-02_DP  / 
DATA  WT_13  /                                      &
-7.47850222338410E-02_DP,  8.78076287166040E-02_DP, &
 8.78076287166040E-02_DP,  8.78076287166040E-02_DP, &
 2.66736178044190E-02_DP,  2.66736178044190E-02_DP, &
 2.66736178044190E-02_DP,  3.85568804451285E-02_DP, &
 3.85568804451285E-02_DP,  3.85568804451285E-02_DP, &
 3.85568804451285E-02_DP,  3.85568804451285E-02_DP, &
 3.85568804451285E-02_DP / 
DATA  PT_13  /                                      &
 3.33333333333333E-01_DP,  3.33333333333333E-01_DP, &
 4.79308067841920E-01_DP,  2.60345966079040E-01_DP, &
 2.60345966079040E-01_DP,  4.79308067841920E-01_DP, &
 2.60345966079040E-01_DP,  2.60345966079040E-01_DP, &
 8.69739794195568E-01_DP,  6.51301029022160E-02_DP, &
 6.51301029022160E-02_DP,  8.69739794195568E-01_DP, &
 6.51301029022160E-02_DP,  6.51301029022160E-02_DP, &
 4.86903154253160E-02_DP,  3.12865496004874E-01_DP, &
 6.38444188569810E-01_DP,  4.86903154253160E-02_DP, &
 3.12865496004874E-01_DP,  6.38444188569810E-01_DP, &
 4.86903154253160E-02_DP,  6.38444188569810E-01_DP, &
 6.38444188569810E-01_DP,  3.12865496004874E-01_DP, &
 3.12865496004874E-01_DP,  4.86903154253160E-02_DP  / 
DATA  WT_16  /                                      &
 7.21578038388935E-02_DP,  4.75458171336425E-02_DP, &
 4.75458171336425E-02_DP,  4.75458171336425E-02_DP, &
 5.16086852673590E-02_DP,  5.16086852673590E-02_DP, &
 5.16086852673590E-02_DP,  1.62292488115990E-02_DP, &
 1.62292488115990E-02_DP,  1.62292488115990E-02_DP, &
 1.36151570872175E-02_DP,  1.36151570872175E-02_DP, &
 1.36151570872175E-02_DP,  1.36151570872175E-02_DP, &
 1.36151570872175E-02_DP,  1.36151570872175E-02_DP  / 
DATA  PT_16  /                                      &
 3.33333333333333E-01_DP,  3.33333333333333E-01_DP, &
 8.14148234145540E-02_DP,  4.59292588292723E-01_DP, &
 4.59292588292723E-01_DP,  8.14148234145540E-02_DP, &
 4.59292588292723E-01_DP,  4.59292588292723E-01_DP, &
 6.58861384496480E-01_DP,  1.70569307751760E-01_DP, &
 1.70569307751760E-01_DP,  6.58861384496480E-01_DP, &
 1.70569307751760E-01_DP,  1.70569307751760E-01_DP, &
 8.98905543365938E-01_DP,  5.05472283170310E-02_DP, &
 5.05472283170310E-02_DP,  8.98905543365938E-01_DP, &
 5.05472283170310E-02_DP,  5.05472283170310E-02_DP, &
 8.39477740995800E-03_DP,  2.63112829634638E-01_DP, &
 7.28492392955404E-01_DP,  8.39477740995800E-03_DP, &
 2.63112829634638E-01_DP,  7.28492392955404E-01_DP, &
 8.39477740995800E-03_DP,  7.28492392955404E-01_DP, &
 7.28492392955404E-01_DP,  2.63112829634638E-01_DP, &
 2.63112829634638E-01_DP,  8.39477740995800E-03_DP  / 
DATA  WT_19  /                                      &
 4.85678981413995E-02_DP,  1.56673501135695E-02_DP, &
 1.56673501135695E-02_DP,  1.56673501135695E-02_DP, &
 3.89137705023870E-02_DP,  3.89137705023870E-02_DP, &
 3.89137705023870E-02_DP,  3.98238694636050E-02_DP, &
 3.98238694636050E-02_DP,  3.98238694636050E-02_DP, &
 1.27888378293490E-02_DP,  1.27888378293490E-02_DP, &
 1.27888378293490E-02_DP,  2.16417696886445E-02_DP, &
 2.16417696886445E-02_DP,  2.16417696886445E-02_DP, &
 2.16417696886445E-02_DP,  2.16417696886445E-02_DP, &
 2.16417696886445E-02_DP / 
DATA  PT_19  /                                      &
 3.33333333333333E-01_DP,  3.33333333333333E-01_DP, &
 2.06349616025250E-02_DP,  4.89682519198738E-01_DP, &
 4.89682519198738E-01_DP,  2.06349616025250E-02_DP, &
 4.89682519198738E-01_DP,  4.89682519198738E-01_DP, &
 1.25820817014127E-01_DP,  4.37089591492937E-01_DP, &
 4.37089591492937E-01_DP,  1.25820817014127E-01_DP, &
 4.37089591492937E-01_DP,  4.37089591492937E-01_DP, &
 6.23592928761935E-01_DP,  1.88203535619033E-01_DP, &
 1.88203535619033E-01_DP,  6.23592928761935E-01_DP, &
 1.88203535619033E-01_DP,  1.88203535619033E-01_DP, &
 9.10540973211095E-01_DP,  4.47295133944530E-02_DP, &
 4.47295133944530E-02_DP,  9.10540973211095E-01_DP, &
 4.47295133944530E-02_DP,  4.47295133944530E-02_DP, &
 3.68384120547360E-02_DP,  2.21962989160766E-01_DP, &
 7.41198598784498E-01_DP,  3.68384120547360E-02_DP, &
 2.21962989160766E-01_DP,  7.41198598784498E-01_DP, &
 3.68384120547360E-02_DP,  7.41198598784498E-01_DP, &
 7.41198598784498E-01_DP,  2.21962989160766E-01_DP, &
 2.21962989160766E-01_DP,  3.68384120547360E-02_DP  / 
DATA  WT_25  /                                      &
 4.54089951913770E-02_DP,  1.83629788782335E-02_DP, &
 1.83629788782335E-02_DP,  1.83629788782335E-02_DP, &
 2.26605297177640E-02_DP,  2.26605297177640E-02_DP, &
 2.26605297177640E-02_DP,  3.63789584227100E-02_DP, &
 3.63789584227100E-02_DP,  3.63789584227100E-02_DP, &
 3.63789584227100E-02_DP,  3.63789584227100E-02_DP, &
 3.63789584227100E-02_DP,  1.41636212655285E-02_DP, &
 1.41636212655285E-02_DP,  1.41636212655285E-02_DP, &
 1.41636212655285E-02_DP,  1.41636212655285E-02_DP, &
 1.41636212655285E-02_DP,  4.71083348186650E-03_DP, &
 4.71083348186650E-03_DP,  4.71083348186650E-03_DP, &
 4.71083348186650E-03_DP,  4.71083348186650E-03_DP, &
 4.71083348186650E-03_DP / 
DATA  PT_25  /                                      &
 3.33333333333333E-01_DP,  3.33333333333333E-01_DP, &
 2.88447332326850E-02_DP,  4.85577633383657E-01_DP, &
 4.85577633383657E-01_DP,  2.88447332326850E-02_DP, &
 4.85577633383657E-01_DP,  4.85577633383657E-01_DP, &
 7.81036849029926E-01_DP,  1.09481575485037E-01_DP, &
 1.09481575485037E-01_DP,  7.81036849029926E-01_DP, &
 1.09481575485037E-01_DP,  1.09481575485037E-01_DP, &
 1.41707219414880E-01_DP,  3.07939838764121E-01_DP, &
 5.50352941820999E-01_DP,  1.41707219414880E-01_DP, &
 3.07939838764121E-01_DP,  5.50352941820999E-01_DP, &
 1.41707219414880E-01_DP,  5.50352941820999E-01_DP, &
 5.50352941820999E-01_DP,  3.07939838764121E-01_DP, &
 3.07939838764121E-01_DP,  1.41707219414880E-01_DP, &
 2.50035347626860E-02_DP,  2.46672560639903E-01_DP, &
 7.28323904597411E-01_DP,  2.50035347626860E-02_DP, &
 2.46672560639903E-01_DP,  7.28323904597411E-01_DP, &
 2.50035347626860E-02_DP,  7.28323904597411E-01_DP, &
 7.28323904597411E-01_DP,  2.46672560639903E-01_DP, &
 2.46672560639903E-01_DP,  2.50035347626860E-02_DP, &
 9.54081540029900E-03_DP,  6.68032510122000E-02_DP, &
 9.23655933587500E-01_DP,  9.54081540029900E-03_DP, &
 6.68032510122000E-02_DP,  9.23655933587500E-01_DP, &
 9.54081540029900E-03_DP,  9.23655933587500E-01_DP, &
 9.23655933587500E-01_DP,  6.68032510122000E-02_DP, &
 6.68032510122000E-02_DP,  9.54081540029900E-03_DP  / 
DATA  WT_27  /                                      &
 4.63503164480500E-04_DP,  4.63503164480500E-04_DP, &
 4.63503164480500E-04_DP,  3.85747674574065E-02_DP, &
 3.85747674574065E-02_DP,  3.85747674574065E-02_DP, &
 2.96614886903870E-02_DP,  2.96614886903870E-02_DP, &
 2.96614886903870E-02_DP,  1.80922702517090E-02_DP, &
 1.80922702517090E-02_DP,  1.80922702517090E-02_DP, &
 6.82986550133900E-03_DP,  6.82986550133900E-03_DP, &
 6.82986550133900E-03_DP,  2.61685559811020E-02_DP, &
 2.61685559811020E-02_DP,  2.61685559811020E-02_DP, &
 2.61685559811020E-02_DP,  2.61685559811020E-02_DP, &
 2.61685559811020E-02_DP,  1.03538298195705E-02_DP, &
 1.03538298195705E-02_DP,  1.03538298195705E-02_DP, &
 1.03538298195705E-02_DP,  1.03538298195705E-02_DP, &
 1.03538298195705E-02_DP / 
DATA  PT_27  /                                      &
-6.92220965415170E-02_DP,  5.34611048270758E-01_DP, &
 5.34611048270758E-01_DP, -6.92220965415170E-02_DP, &
 5.34611048270758E-01_DP,  5.34611048270758E-01_DP, &
 2.02061394068290E-01_DP,  3.98969302965855E-01_DP, &
 3.98969302965855E-01_DP,  2.02061394068290E-01_DP, &
 3.98969302965855E-01_DP,  3.98969302965855E-01_DP, &
 5.93380199137435E-01_DP,  2.03309900431282E-01_DP, &
 2.03309900431282E-01_DP,  5.93380199137435E-01_DP, &
 2.03309900431282E-01_DP,  2.03309900431282E-01_DP, &
 7.61298175434837E-01_DP,  1.19350912282581E-01_DP, &
 1.19350912282581E-01_DP,  7.61298175434837E-01_DP, &
 1.19350912282581E-01_DP,  1.19350912282581E-01_DP, &
 9.35270103777448E-01_DP,  3.23649481112760E-02_DP, &
 3.23649481112760E-02_DP,  9.35270103777448E-01_DP, &
 3.23649481112760E-02_DP,  3.23649481112760E-02_DP, &
 5.01781383104950E-02_DP,  3.56620648261293E-01_DP, &
 5.93201213428213E-01_DP,  5.01781383104950E-02_DP, &
 3.56620648261293E-01_DP,  5.93201213428213E-01_DP, &
 5.01781383104950E-02_DP,  5.93201213428213E-01_DP, &
 5.93201213428213E-01_DP,  3.56620648261293E-01_DP, &
 3.56620648261293E-01_DP,  5.01781383104950E-02_DP, &
 2.10220165361660E-02_DP,  1.71488980304042E-01_DP, &
 8.07489003159792E-01_DP,  2.10220165361660E-02_DP, &
 1.71488980304042E-01_DP,  8.07489003159792E-01_DP, &
 2.10220165361660E-02_DP,  8.07489003159792E-01_DP, &
 8.07489003159792E-01_DP,  1.71488980304042E-01_DP, &
 1.71488980304042E-01_DP,  2.10220165361660E-02_DP  / 
DATA  WT_33  /                                      &
 1.28655332202275E-02_DP,  1.28655332202275E-02_DP, &
 1.28655332202275E-02_DP,  2.18462722690190E-02_DP, &
 2.18462722690190E-02_DP,  2.18462722690190E-02_DP, &
 3.14291121089425E-02_DP,  3.14291121089425E-02_DP, &
 3.14291121089425E-02_DP,  1.73980564653545E-02_DP, &
 1.73980564653545E-02_DP,  1.73980564653545E-02_DP, &
 3.08313052577950E-03_DP,  3.08313052577950E-03_DP, &
 3.08313052577950E-03_DP,  2.01857788831905E-02_DP, &
 2.01857788831905E-02_DP,  2.01857788831905E-02_DP, &
 2.01857788831905E-02_DP,  2.01857788831905E-02_DP, &
 2.01857788831905E-02_DP,  1.11783866011515E-02_DP, &
 1.11783866011515E-02_DP,  1.11783866011515E-02_DP, &
 1.11783866011515E-02_DP,  1.11783866011515E-02_DP, &
 1.11783866011515E-02_DP,  8.65811555432950E-03_DP, &
 8.65811555432950E-03_DP,  8.65811555432950E-03_DP, &
 8.65811555432950E-03_DP,  8.65811555432950E-03_DP, &
 8.65811555432950E-03_DP / 
DATA  PT_33  /                                      &
 2.35652204523900E-02_DP,  4.88217389773805E-01_DP, &
 4.88217389773805E-01_DP,  2.35652204523900E-02_DP, &
 4.88217389773805E-01_DP,  4.88217389773805E-01_DP, &
 1.20551215411079E-01_DP,  4.39724392294460E-01_DP, &
 4.39724392294460E-01_DP,  1.20551215411079E-01_DP, &
 4.39724392294460E-01_DP,  4.39724392294460E-01_DP, &
 4.57579229975768E-01_DP,  2.71210385012116E-01_DP, &
 2.71210385012116E-01_DP,  4.57579229975768E-01_DP, &
 2.71210385012116E-01_DP,  2.71210385012116E-01_DP, &
 7.44847708916828E-01_DP,  1.27576145541586E-01_DP, &
 1.27576145541586E-01_DP,  7.44847708916828E-01_DP, &
 1.27576145541586E-01_DP,  1.27576145541586E-01_DP, &
 9.57365299093579E-01_DP,  2.13173504532100E-02_DP, &
 2.13173504532100E-02_DP,  9.57365299093579E-01_DP, &
 2.13173504532100E-02_DP,  2.13173504532100E-02_DP, &
 1.15343494534698E-01_DP,  2.75713269685514E-01_DP, &
 6.08943235779788E-01_DP,  1.15343494534698E-01_DP, &
 2.75713269685514E-01_DP,  6.08943235779788E-01_DP, &
 1.15343494534698E-01_DP,  6.08943235779788E-01_DP, &
 6.08943235779788E-01_DP,  2.75713269685514E-01_DP, &
 2.75713269685514E-01_DP,  1.15343494534698E-01_DP, &
 2.28383322222570E-02_DP,  2.81325580989940E-01_DP, &
 6.95836086787803E-01_DP,  2.28383322222570E-02_DP, &
 2.81325580989940E-01_DP,  6.95836086787803E-01_DP, &
 2.28383322222570E-02_DP,  6.95836086787803E-01_DP, &
 6.95836086787803E-01_DP,  2.81325580989940E-01_DP, &
 2.81325580989940E-01_DP,  2.28383322222570E-02_DP, &
 2.57340505483300E-02_DP,  1.16251915907597E-01_DP, &
 8.58014033544073E-01_DP,  2.57340505483300E-02_DP, &
 1.16251915907597E-01_DP,  8.58014033544073E-01_DP, &
 2.57340505483300E-02_DP,  8.58014033544073E-01_DP, &
 8.58014033544073E-01_DP,  1.16251915907597E-01_DP, &
 1.16251915907597E-01_DP,  2.57340505483300E-02_DP  / 
DATA  WT_37  /                                      &
 2.62604617004010E-02_DP,  5.64007260466500E-03_DP, &
 5.64007260466500E-03_DP,  5.64007260466500E-03_DP, &
 1.57117591812270E-02_DP,  1.57117591812270E-02_DP, &
 1.57117591812270E-02_DP,  2.35362512520970E-02_DP, &
 2.35362512520970E-02_DP,  2.35362512520970E-02_DP, &
 2.36817932681775E-02_DP,  2.36817932681775E-02_DP, &
 2.36817932681775E-02_DP,  1.55837645228970E-02_DP, &
 1.55837645228970E-02_DP,  1.55837645228970E-02_DP, &
 3.98788573253700E-03_DP,  3.98788573253700E-03_DP, &
 3.98788573253700E-03_DP,  1.84242013643660E-02_DP, &
 1.84242013643660E-02_DP,  1.84242013643660E-02_DP, &
 1.84242013643660E-02_DP,  1.84242013643660E-02_DP, &
 1.84242013643660E-02_DP,  8.70073165191100E-03_DP, &
 8.70073165191100E-03_DP,  8.70073165191100E-03_DP, &
 8.70073165191100E-03_DP,  8.70073165191100E-03_DP, &
 8.70073165191100E-03_DP,  7.76089341952250E-03_DP, &
 7.76089341952250E-03_DP,  7.76089341952250E-03_DP, &
 7.76089341952250E-03_DP,  7.76089341952250E-03_DP, &
 7.76089341952250E-03_DP / 
DATA  PT_37  /                                      &
 3.33333333333333E-01_DP,  3.33333333333333E-01_DP, &
 9.90363012059100E-03_DP,  4.95048184939705E-01_DP, &
 4.95048184939705E-01_DP,  9.90363012059100E-03_DP, &
 4.95048184939705E-01_DP,  4.95048184939705E-01_DP, &
 6.25667297808520E-02_DP,  4.68716635109574E-01_DP, &
 4.68716635109574E-01_DP,  6.25667297808520E-02_DP, &
 4.68716635109574E-01_DP,  4.68716635109574E-01_DP, &
 1.70957326397447E-01_DP,  4.14521336801277E-01_DP, &
 4.14521336801277E-01_DP,  1.70957326397447E-01_DP, &
 4.14521336801277E-01_DP,  4.14521336801277E-01_DP, &
 5.41200855914337E-01_DP,  2.29399572042831E-01_DP, &
 2.29399572042831E-01_DP,  5.41200855914337E-01_DP, &
 2.29399572042831E-01_DP,  2.29399572042831E-01_DP, &
 7.71151009607340E-01_DP,  1.14424495196330E-01_DP, &
 1.14424495196330E-01_DP,  7.71151009607340E-01_DP, &
 1.14424495196330E-01_DP,  1.14424495196330E-01_DP, &
 9.50377217273082E-01_DP,  2.48113913634590E-02_DP, &
 2.48113913634590E-02_DP,  9.50377217273082E-01_DP, &
 2.48113913634590E-02_DP,  2.48113913634590E-02_DP, &
 9.48538283795790E-02_DP,  2.68794997058761E-01_DP, &
 6.36351174561660E-01_DP,  9.48538283795790E-02_DP, &
 2.68794997058761E-01_DP,  6.36351174561660E-01_DP, &
 9.48538283795790E-02_DP,  6.36351174561660E-01_DP, &
 6.36351174561660E-01_DP,  2.68794997058761E-01_DP, &
 2.68794997058761E-01_DP,  9.48538283795790E-02_DP, &
 1.81007732788070E-02_DP,  2.91730066734288E-01_DP, &
 6.90169159986905E-01_DP,  1.81007732788070E-02_DP, &
 2.91730066734288E-01_DP,  6.90169159986905E-01_DP, &
 1.81007732788070E-02_DP,  6.90169159986905E-01_DP, &
 6.90169159986905E-01_DP,  2.91730066734288E-01_DP, &
 2.91730066734288E-01_DP,  1.81007732788070E-02_DP, &
 2.22330766740900E-02_DP,  1.26357385491669E-01_DP, &
 8.51409537834241E-01_DP,  2.22330766740900E-02_DP, &
 1.26357385491669E-01_DP,  8.51409537834241E-01_DP, &
 2.22330766740900E-02_DP,  8.51409537834241E-01_DP, &
 8.51409537834241E-01_DP,  1.26357385491669E-01_DP, &
 1.26357385491669E-01_DP,  2.22330766740900E-02_DP  / 
DATA  WT_42  /                                      &
 1.09417906847145E-02_DP,  1.09417906847145E-02_DP, &
 1.09417906847145E-02_DP,  1.63941767720625E-02_DP, &
 1.63941767720625E-02_DP,  1.63941767720625E-02_DP, &
 2.58870522536460E-02_DP,  2.58870522536460E-02_DP, &
 2.58870522536460E-02_DP,  2.10812943684965E-02_DP, &
 2.10812943684965E-02_DP,  2.10812943684965E-02_DP, &
 7.21684983488850E-03_DP,  7.21684983488850E-03_DP, &
 7.21684983488850E-03_DP,  2.46170180120000E-03_DP, &
 2.46170180120000E-03_DP,  2.46170180120000E-03_DP, &
 1.23328766062820E-02_DP,  1.23328766062820E-02_DP, &
 1.23328766062820E-02_DP,  1.23328766062820E-02_DP, &
 1.23328766062820E-02_DP,  1.23328766062820E-02_DP, &
 1.92857553935305E-02_DP,  1.92857553935305E-02_DP, &
 1.92857553935305E-02_DP,  1.92857553935305E-02_DP, &
 1.92857553935305E-02_DP,  1.92857553935305E-02_DP, &
 7.21815405676700E-03_DP,  7.21815405676700E-03_DP, &
 7.21815405676700E-03_DP,  7.21815405676700E-03_DP, &
 7.21815405676700E-03_DP,  7.21815405676700E-03_DP, &
 2.50511441925050E-03_DP,  2.50511441925050E-03_DP, &
 2.50511441925050E-03_DP,  2.50511441925050E-03_DP, &
 2.50511441925050E-03_DP,  2.50511441925050E-03_DP  / 
DATA  PT_42  /                                      &
 2.20721792756430E-02_DP,  4.88963910362179E-01_DP, &
 4.88963910362179E-01_DP,  2.20721792756430E-02_DP, &
 4.88963910362179E-01_DP,  4.88963910362179E-01_DP, &
 1.64710561319092E-01_DP,  4.17644719340454E-01_DP, &
 4.17644719340454E-01_DP,  1.64710561319092E-01_DP, &
 4.17644719340454E-01_DP,  4.17644719340454E-01_DP, &
 4.53044943382323E-01_DP,  2.73477528308839E-01_DP, &
 2.73477528308839E-01_DP,  4.53044943382323E-01_DP, &
 2.73477528308839E-01_DP,  2.73477528308839E-01_DP, &
 6.45588935174913E-01_DP,  1.77205532412543E-01_DP, &
 1.77205532412543E-01_DP,  6.45588935174913E-01_DP, &
 1.77205532412543E-01_DP,  1.77205532412543E-01_DP, &
 8.76400233818255E-01_DP,  6.17998830908730E-02_DP, &
 6.17998830908730E-02_DP,  8.76400233818255E-01_DP, &
 6.17998830908730E-02_DP,  6.17998830908730E-02_DP, &
 9.61218077502598E-01_DP,  1.93909612487010E-02_DP, &
 1.93909612487010E-02_DP,  9.61218077502598E-01_DP, &
 1.93909612487010E-02_DP,  1.93909612487010E-02_DP, &
 5.71247574036480E-02_DP,  1.72266687821356E-01_DP, &
 7.70608554774996E-01_DP,  5.71247574036480E-02_DP, &
 1.72266687821356E-01_DP,  7.70608554774996E-01_DP, &
 5.71247574036480E-02_DP,  7.70608554774996E-01_DP, &
 7.70608554774996E-01_DP,  1.72266687821356E-01_DP, &
 1.72266687821356E-01_DP,  5.71247574036480E-02_DP, &
 9.29162493569720E-02_DP,  3.36861459796345E-01_DP, &
 5.70222290846683E-01_DP,  9.29162493569720E-02_DP, &
 3.36861459796345E-01_DP,  5.70222290846683E-01_DP, &
 9.29162493569720E-02_DP,  5.70222290846683E-01_DP, &
 5.70222290846683E-01_DP,  3.36861459796345E-01_DP, &
 3.36861459796345E-01_DP,  9.29162493569720E-02_DP, &
 1.46469500556540E-02_DP,  2.98372882136258E-01_DP, &
 6.86980167808088E-01_DP,  1.46469500556540E-02_DP, &
 2.98372882136258E-01_DP,  6.86980167808088E-01_DP, &
 1.46469500556540E-02_DP,  6.86980167808088E-01_DP, &
 6.86980167808088E-01_DP,  2.98372882136258E-01_DP, &
 2.98372882136258E-01_DP,  1.46469500556540E-02_DP, &
 1.26833093287200E-03_DP,  1.18974497696957E-01_DP, &
 8.79757171370171E-01_DP,  1.26833093287200E-03_DP, &
 1.18974497696957E-01_DP,  8.79757171370171E-01_DP, &
 1.26833093287200E-03_DP,  8.79757171370171E-01_DP, &
 8.79757171370171E-01_DP,  1.18974497696957E-01_DP, &
 1.18974497696957E-01_DP,  1.26833093287200E-03_DP  / 
DATA  WT_48  /                                      &
 9.58437821424500E-04_DP,  9.58437821424500E-04_DP, &
 9.58437821424500E-04_DP,  2.21245136355725E-02_DP, &
 2.21245136355725E-02_DP,  2.21245136355725E-02_DP, &
 2.55932743594260E-02_DP,  2.55932743594260E-02_DP, &
 2.55932743594260E-02_DP,  1.18438679353440E-02_DP, &
 1.18438679353440E-02_DP,  1.18438679353440E-02_DP, &
 6.64488784501050E-03_DP,  6.64488784501050E-03_DP, &
 6.64488784501050E-03_DP,  2.37445830409600E-03_DP, &
 2.37445830409600E-03_DP,  2.37445830409600E-03_DP, &
 1.92750362997965E-02_DP,  1.92750362997965E-02_DP, &
 1.92750362997965E-02_DP,  1.92750362997965E-02_DP, &
 1.92750362997965E-02_DP,  1.92750362997965E-02_DP, &
 1.36079071603120E-02_DP,  1.36079071603120E-02_DP, &
 1.36079071603120E-02_DP,  1.36079071603120E-02_DP, &
 1.36079071603120E-02_DP,  1.36079071603120E-02_DP, &
 1.09103868339850E-03_DP,  1.09103868339850E-03_DP, &
 1.09103868339850E-03_DP,  1.09103868339850E-03_DP, &
 1.09103868339850E-03_DP,  1.09103868339850E-03_DP, &
 1.07526599238655E-02_DP,  1.07526599238655E-02_DP, &
 1.07526599238655E-02_DP,  1.07526599238655E-02_DP, &
 1.07526599238655E-02_DP,  1.07526599238655E-02_DP, &
 3.83697131552450E-03_DP,  3.83697131552450E-03_DP, &
 3.83697131552450E-03_DP,  3.83697131552450E-03_DP, &
 3.83697131552450E-03_DP,  3.83697131552450E-03_DP  / 
DATA  PT_48  /                                      &
-1.39458337164860E-02_DP,  5.06972916858243E-01_DP, &
 5.06972916858243E-01_DP, -1.39458337164860E-02_DP, &
 5.06972916858243E-01_DP,  5.06972916858243E-01_DP, &
 1.37187291433955E-01_DP,  4.31406354283023E-01_DP, &
 4.31406354283023E-01_DP,  1.37187291433955E-01_DP, &
 4.31406354283023E-01_DP,  4.31406354283023E-01_DP, &
 4.44612710305711E-01_DP,  2.77693644847144E-01_DP, &
 2.77693644847144E-01_DP,  4.44612710305711E-01_DP, &
 2.77693644847144E-01_DP,  2.77693644847144E-01_DP, &
 7.47070217917492E-01_DP,  1.26464891041254E-01_DP, &
 1.26464891041254E-01_DP,  7.47070217917492E-01_DP, &
 1.26464891041254E-01_DP,  1.26464891041254E-01_DP, &
 8.58383228050628E-01_DP,  7.08083859746860E-02_DP, &
 7.08083859746860E-02_DP,  8.58383228050628E-01_DP, &
 7.08083859746860E-02_DP,  7.08083859746860E-02_DP, &
 9.62069659517853E-01_DP,  1.89651702410730E-02_DP, &
 1.89651702410730E-02_DP,  9.62069659517853E-01_DP, &
 1.89651702410730E-02_DP,  1.89651702410730E-02_DP, &
 1.33734161966621E-01_DP,  2.61311371140087E-01_DP, &
 6.04954466893291E-01_DP,  1.33734161966621E-01_DP, &
 2.61311371140087E-01_DP,  6.04954466893291E-01_DP, &
 1.33734161966621E-01_DP,  6.04954466893291E-01_DP, &
 6.04954466893291E-01_DP,  2.61311371140087E-01_DP, &
 2.61311371140087E-01_DP,  1.33734161966621E-01_DP, &
 3.63666773969170E-02_DP,  3.88046767090269E-01_DP, &
 5.75586555512814E-01_DP,  3.63666773969170E-02_DP, &
 3.88046767090269E-01_DP,  5.75586555512814E-01_DP, &
 3.63666773969170E-02_DP,  5.75586555512814E-01_DP, &
 5.75586555512814E-01_DP,  3.88046767090269E-01_DP, &
 3.88046767090269E-01_DP,  3.63666773969170E-02_DP, &
-1.01748831265710E-02_DP,  2.85712220049916E-01_DP, &
 7.24462663076655E-01_DP, -1.01748831265710E-02_DP, &
 2.85712220049916E-01_DP,  7.24462663076655E-01_DP, &
-1.01748831265710E-02_DP,  7.24462663076655E-01_DP, &
 7.24462663076655E-01_DP,  2.85712220049916E-01_DP, &
 2.85712220049916E-01_DP, -1.01748831265710E-02_DP, &
 3.68438698758780E-02_DP,  2.15599664072284E-01_DP, &
 7.47556466051838E-01_DP,  3.68438698758780E-02_DP, &
 2.15599664072284E-01_DP,  7.47556466051838E-01_DP, &
 3.68438698758780E-02_DP,  7.47556466051838E-01_DP, &
 7.47556466051838E-01_DP,  2.15599664072284E-01_DP, &
 2.15599664072284E-01_DP,  3.68438698758780E-02_DP, &
 1.24598093311990E-02_DP,  1.03575616576386E-01_DP, &
 8.83964574092416E-01_DP,  1.24598093311990E-02_DP, &
 1.03575616576386E-01_DP,  8.83964574092416E-01_DP, &
 1.24598093311990E-02_DP,  8.83964574092416E-01_DP, &
 8.83964574092416E-01_DP,  1.03575616576386E-01_DP, &
 1.03575616576386E-01_DP,  1.24598093311990E-02_DP  / 
DATA  WT_52  /                                      &
 2.34378487138210E-02_DP,  3.20293928929250E-03_DP, &
 3.20293928929250E-03_DP,  3.20293928929250E-03_DP, &
 2.08551483696935E-02_DP,  2.08551483696935E-02_DP, &
 2.08551483696935E-02_DP,  1.34457421250320E-02_DP, &
 1.34457421250320E-02_DP,  1.34457421250320E-02_DP, &
 2.10662613808250E-02_DP,  2.10662613808250E-02_DP, &
 2.10662613808250E-02_DP,  1.50001334213865E-02_DP, &
 1.50001334213865E-02_DP,  1.50001334213865E-02_DP, &
 7.10004946251200E-03_DP,  7.10004946251200E-03_DP, &
 7.10004946251200E-03_DP,  1.79123117563650E-03_DP, &
 1.79123117563650E-03_DP,  1.79123117563650E-03_DP, &
 1.63865737303135E-02_DP,  1.63865737303135E-02_DP, &
 1.63865737303135E-02_DP,  1.63865737303135E-02_DP, &
 1.63865737303135E-02_DP,  1.63865737303135E-02_DP, &
 7.64915312422050E-03_DP,  7.64915312422050E-03_DP, &
 7.64915312422050E-03_DP,  7.64915312422050E-03_DP, &
 7.64915312422050E-03_DP,  7.64915312422050E-03_DP, &
 1.19312209641950E-03_DP,  1.19312209641950E-03_DP, &
 1.19312209641950E-03_DP,  1.19312209641950E-03_DP, &
 1.19312209641950E-03_DP,  1.19312209641950E-03_DP, &
 9.54239637794950E-03_DP,  9.54239637794950E-03_DP, &
 9.54239637794950E-03_DP,  9.54239637794950E-03_DP, &
 9.54239637794950E-03_DP,  9.54239637794950E-03_DP, &
 3.42502727327100E-03_DP,  3.42502727327100E-03_DP, &
 3.42502727327100E-03_DP,  3.42502727327100E-03_DP, &
 3.42502727327100E-03_DP,  3.42502727327100E-03_DP  / 
DATA  PT_52  /                                      &
 3.33333333333333E-01_DP,  3.33333333333333E-01_DP, &
 5.23891610312300E-03_DP,  4.97380541948438E-01_DP, &
 4.97380541948438E-01_DP,  5.23891610312300E-03_DP, &
 4.97380541948438E-01_DP,  4.97380541948438E-01_DP, &
 1.73061122901295E-01_DP,  4.13469438549352E-01_DP, &
 4.13469438549352E-01_DP,  1.73061122901295E-01_DP, &
 4.13469438549352E-01_DP,  4.13469438549352E-01_DP, &
 5.90828018660170E-02_DP,  4.70458599066991E-01_DP, &
 4.70458599066991E-01_DP,  5.90828018660170E-02_DP, &
 4.70458599066991E-01_DP,  4.70458599066991E-01_DP, &
 5.18892500060958E-01_DP,  2.40553749969521E-01_DP, &
 2.40553749969521E-01_DP,  5.18892500060958E-01_DP, &
 2.40553749969521E-01_DP,  2.40553749969521E-01_DP, &
 7.04068411554854E-01_DP,  1.47965794222573E-01_DP, &
 1.47965794222573E-01_DP,  7.04068411554854E-01_DP, &
 1.47965794222573E-01_DP,  1.47965794222573E-01_DP, &
 8.49069624685052E-01_DP,  7.54651876574740E-02_DP, &
 7.54651876574740E-02_DP,  8.49069624685052E-01_DP, &
 7.54651876574740E-02_DP,  7.54651876574740E-02_DP, &
 9.66807194753950E-01_DP,  1.65964026230250E-02_DP, &
 1.65964026230250E-02_DP,  9.66807194753950E-01_DP, &
 1.65964026230250E-02_DP,  1.65964026230250E-02_DP, &
 1.03575692245252E-01_DP,  2.96555596579887E-01_DP, &
 5.99868711174861E-01_DP,  1.03575692245252E-01_DP, &
 2.96555596579887E-01_DP,  5.99868711174861E-01_DP, &
 1.03575692245252E-01_DP,  5.99868711174861E-01_DP, &
 5.99868711174861E-01_DP,  2.96555596579887E-01_DP, &
 2.96555596579887E-01_DP,  1.03575692245252E-01_DP, &
 2.00834116554160E-02_DP,  3.37723063403079E-01_DP, &
 6.42193524941505E-01_DP,  2.00834116554160E-02_DP, &
 3.37723063403079E-01_DP,  6.42193524941505E-01_DP, &
 2.00834116554160E-02_DP,  6.42193524941505E-01_DP, &
 6.42193524941505E-01_DP,  3.37723063403079E-01_DP, &
 3.37723063403079E-01_DP,  2.00834116554160E-02_DP, &
-4.34100261413900E-03_DP,  2.04748281642812E-01_DP, &
 7.99592720971327E-01_DP, -4.34100261413900E-03_DP, &
 2.04748281642812E-01_DP,  7.99592720971327E-01_DP, &
-4.34100261413900E-03_DP,  7.99592720971327E-01_DP, &
 7.99592720971327E-01_DP,  2.04748281642812E-01_DP, &
 2.04748281642812E-01_DP, -4.34100261413900E-03_DP, &
 4.19417864680100E-02_DP,  1.89358492130623E-01_DP, &
 7.68699721401368E-01_DP,  4.19417864680100E-02_DP, &
 1.89358492130623E-01_DP,  7.68699721401368E-01_DP, &
 4.19417864680100E-02_DP,  7.68699721401368E-01_DP, &
 7.68699721401368E-01_DP,  1.89358492130623E-01_DP, &
 1.89358492130623E-01_DP,  4.19417864680100E-02_DP, &
 1.43173202306810E-02_DP,  8.52836156826570E-02_DP, &
 9.00399064086661E-01_DP,  1.43173202306810E-02_DP, &
 8.52836156826570E-02_DP,  9.00399064086661E-01_DP, &
 1.43173202306810E-02_DP,  9.00399064086661E-01_DP, &
 9.00399064086661E-01_DP,  8.52836156826570E-02_DP, &
 8.52836156826570E-02_DP,  1.43173202306810E-02_DP  / 
DATA  WT_61  /                                      &
 1.67185996454015E-02_DP,  2.54670772025350E-03_DP, &
 2.54670772025350E-03_DP,  2.54670772025350E-03_DP, &
 7.33543226381900E-03_DP,  7.33543226381900E-03_DP, &
 7.33543226381900E-03_DP,  1.21754391768360E-02_DP, &
 1.21754391768360E-02_DP,  1.21754391768360E-02_DP, &
 1.55537754344845E-02_DP,  1.55537754344845E-02_DP, &
 1.55537754344845E-02_DP,  1.56285556093100E-02_DP, &
 1.56285556093100E-02_DP,  1.56285556093100E-02_DP, &
 1.24078271698325E-02_DP,  1.24078271698325E-02_DP, &
 1.24078271698325E-02_DP,  7.02803653527850E-03_DP, &
 7.02803653527850E-03_DP,  7.02803653527850E-03_DP, &
 1.59733808688950E-03_DP,  1.59733808688950E-03_DP, &
 1.59733808688950E-03_DP,  4.05982765949650E-03_DP, &
 4.05982765949650E-03_DP,  4.05982765949650E-03_DP, &
 4.05982765949650E-03_DP,  4.05982765949650E-03_DP, &
 4.05982765949650E-03_DP,  1.34028711415815E-02_DP, &
 1.34028711415815E-02_DP,  1.34028711415815E-02_DP, &
 1.34028711415815E-02_DP,  1.34028711415815E-02_DP, &
 1.34028711415815E-02_DP,  9.22999660541100E-03_DP, &
 9.22999660541100E-03_DP,  9.22999660541100E-03_DP, &
 9.22999660541100E-03_DP,  9.22999660541100E-03_DP, &
 9.22999660541100E-03_DP,  4.23843426716400E-03_DP, &
 4.23843426716400E-03_DP,  4.23843426716400E-03_DP, &
 4.23843426716400E-03_DP,  4.23843426716400E-03_DP, &
 4.23843426716400E-03_DP,  9.14639838501250E-03_DP, &
 9.14639838501250E-03_DP,  9.14639838501250E-03_DP, &
 9.14639838501250E-03_DP,  9.14639838501250E-03_DP, &
 9.14639838501250E-03_DP,  3.33281600208250E-03_DP, &
 3.33281600208250E-03_DP,  3.33281600208250E-03_DP, &
 3.33281600208250E-03_DP,  3.33281600208250E-03_DP, &
 3.33281600208250E-03_DP / 
DATA  PT_61  /                                      &
 3.33333333333333E-01_DP,  3.33333333333333E-01_DP, &
 5.65891888645200E-03_DP,  4.97170540556774E-01_DP, &
 4.97170540556774E-01_DP,  5.65891888645200E-03_DP, &
 4.97170540556774E-01_DP,  4.97170540556774E-01_DP, &
 3.56473547507510E-02_DP,  4.82176322624625E-01_DP, &
 4.82176322624625E-01_DP,  3.56473547507510E-02_DP, &
 4.82176322624625E-01_DP,  4.82176322624625E-01_DP, &
 9.95200619584370E-02_DP,  4.50239969020782E-01_DP, &
 4.50239969020782E-01_DP,  9.95200619584370E-02_DP, &
 4.50239969020782E-01_DP,  4.50239969020782E-01_DP, &
 1.99467521245206E-01_DP,  4.00266239377397E-01_DP, &
 4.00266239377397E-01_DP,  1.99467521245206E-01_DP, &
 4.00266239377397E-01_DP,  4.00266239377397E-01_DP, &
 4.95717464058095E-01_DP,  2.52141267970953E-01_DP, &
 2.52141267970953E-01_DP,  4.95717464058095E-01_DP, &
 2.52141267970953E-01_DP,  2.52141267970953E-01_DP, &
 6.75905990683077E-01_DP,  1.62047004658461E-01_DP, &
 1.62047004658461E-01_DP,  6.75905990683077E-01_DP, &
 1.62047004658461E-01_DP,  1.62047004658461E-01_DP, &
 8.48248235478508E-01_DP,  7.58758822607460E-02_DP, &
 7.58758822607460E-02_DP,  8.48248235478508E-01_DP, &
 7.58758822607460E-02_DP,  7.58758822607460E-02_DP, &
 9.68690546064356E-01_DP,  1.56547269678220E-02_DP, &
 1.56547269678220E-02_DP,  9.68690546064356E-01_DP, &
 1.56547269678220E-02_DP,  1.56547269678220E-02_DP, &
 1.01869288269190E-02_DP,  3.34319867363658E-01_DP, &
 6.55493203809423E-01_DP,  1.01869288269190E-02_DP, &
 3.34319867363658E-01_DP,  6.55493203809423E-01_DP, &
 1.01869288269190E-02_DP,  6.55493203809423E-01_DP, &
 6.55493203809423E-01_DP,  3.34319867363658E-01_DP, &
 3.34319867363658E-01_DP,  1.01869288269190E-02_DP, &
 1.35440871671036E-01_DP,  2.92221537796944E-01_DP, &
 5.72337590532020E-01_DP,  1.35440871671036E-01_DP, &
 2.92221537796944E-01_DP,  5.72337590532020E-01_DP, &
 1.35440871671036E-01_DP,  5.72337590532020E-01_DP, &
 5.72337590532020E-01_DP,  2.92221537796944E-01_DP, &
 2.92221537796944E-01_DP,  1.35440871671036E-01_DP, &
 5.44239242905830E-02_DP,  3.19574885423190E-01_DP, &
 6.26001190286228E-01_DP,  5.44239242905830E-02_DP, &
 3.19574885423190E-01_DP,  6.26001190286228E-01_DP, &
 5.44239242905830E-02_DP,  6.26001190286228E-01_DP, &
 6.26001190286228E-01_DP,  3.19574885423190E-01_DP, &
 3.19574885423190E-01_DP,  5.44239242905830E-02_DP, &
 1.28685608336370E-02_DP,  1.90704224192292E-01_DP, &
 7.96427214974071E-01_DP,  1.28685608336370E-02_DP, &
 1.90704224192292E-01_DP,  7.96427214974071E-01_DP, &
 1.28685608336370E-02_DP,  7.96427214974071E-01_DP, &
 7.96427214974071E-01_DP,  1.90704224192292E-01_DP, &
 1.90704224192292E-01_DP,  1.28685608336370E-02_DP, &
 6.71657824135240E-02_DP,  1.80483211648746E-01_DP, &
 7.52351005937729E-01_DP,  6.71657824135240E-02_DP, &
 1.80483211648746E-01_DP,  7.52351005937729E-01_DP, &
 6.71657824135240E-02_DP,  7.52351005937729E-01_DP, &
 7.52351005937729E-01_DP,  1.80483211648746E-01_DP, &
 1.80483211648746E-01_DP,  6.71657824135240E-02_DP, &
 1.46631822248280E-02_DP,  8.07113136795640E-02_DP, &
 9.04625504095608E-01_DP,  1.46631822248280E-02_DP, &
 8.07113136795640E-02_DP,  9.04625504095608E-01_DP, &
 1.46631822248280E-02_DP,  9.04625504095608E-01_DP, &
 9.04625504095608E-01_DP,  8.07113136795640E-02_DP, &
 8.07113136795640E-02_DP,  1.46631822248280E-02_DP  / 

 SELECT CASE (M_QP)
   CASE ( 1) ; WT = WT_1  ; PT = PT_1 
   CASE ( 3) ; WT = WT_3  ; PT = PT_3 
   CASE ( 4) ; WT = WT_4  ; PT = PT_4 
   CASE ( 6) ; WT = WT_6  ; PT = PT_6 
   CASE ( 7) ; WT = WT_7  ; PT = PT_7 
   CASE (12) ; WT = WT_12 ; PT = PT_12
   CASE (13) ; WT = WT_13 ; PT = PT_13
   CASE (16) ; WT = WT_16 ; PT = PT_16
   CASE (19) ; WT = WT_19 ; PT = PT_19
   CASE (25) ; WT = WT_25 ; PT = PT_25
   CASE (27) ; WT = WT_27 ; PT = PT_27
   CASE (33) ; WT = WT_33 ; PT = PT_33
   CASE (37) ; WT = WT_37 ; PT = PT_37
   CASE (42) ; WT = WT_42 ; PT = PT_42
   CASE (48) ; WT = WT_48 ; PT = PT_48
   CASE (52) ; WT = WT_52 ; PT = PT_52
   CASE (61) ; WT = WT_61 ; PT = PT_61
   CASE DEFAULT 
     PRINT *,'WARNING: DUNAVANT_UNIT_TRIANGLE_RULE, INVALID RULE', M_QP
     PRINT *,'CHECK IF shape 2 IS INCORRECT IN KEYWORD CONTROL'
     !b N_WARN = N_WARN + 1
     STOP 'INVALID RULE DUNAVANT_UNIT_TRIANGLE_RULE'
 END SELECT
END SUBROUTINE DUNAVANT_UNIT_TRIANGLE_RULE 

SUBROUTINE D_Q_RULE (M_QP, NPARM, PT, WT, I_DEG)
! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
!     DUNAVANT QUADRATURE RULE FOR TRIANGLES, TO DEGREE = 17
!  IN AREA COORDINATES (NPARM=3), OR UNIT COORDINATES (NPARM=2)
!          I.J.N.M.E. VOL. 21, PP.1129-1148, 1985
! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
! FOR  M_QP = 1,3,4,6,7,12,13,16,19,25,27,33,37,42,48,52,61
!     I_DEG = 1,2,3,4,5, 6, 7, 8, 9,10,11,12,13,14,15,16,17
! WARNING: MAY REQUIRE COMPILER FLAG FOR MANY CONTINUATION LINES
Use System_Constants
!b Use Precision_Module
 IMPLICIT NONE
 INTEGER,  INTENT(IN)  :: NPARM   ! local space type
 INTEGER,  INTENT(IN)  :: M_QP     ! number of quadrature points
 REAL(DP), INTENT(OUT) :: PT (NPARM, M_QP), WT (M_QP)  
 INTEGER,  INTENT(OUT) :: I_DEG    ! polynomial degree
!                         LOCALS
 INTEGER, PARAMETER :: MAXDEG = 17, MAXLIN = 107
 REAL(DP) :: AW (MAXLIN), A1 (MAXLIN), A2 (MAXLIN), &
             A3 (MAXLIN), SUM
 INTEGER  :: M_QP_DEG (MAXDEG), ISTART (MAXDEG), &
             LINES (MAXDEG),    KOUNTS (MAXLIN)
 INTEGER  :: I, IPT, IRULE, J, KOUNT, LDEG

! M_QP     = NUMBER OF QUADRATURE POINTS, USE 0 IF I_DEG GOVERNS
! NPARM   = NUMBER OF PARAMETRIC DIMENSIONS: 3-AREA, 2-UNIT CORD
! PT       = RETURNED QUADRATURE COORDINATES, PT(NPARM,M_QP)
! WT       = RETURNED QUADRATURE WEIGHTS,     WT(M_QP)
! I_DEG    = DEGREE OF POLYNOMIAL EXACTLY INTEGRATED, 0 TO MAXDEG
!
! M_QP_DEG = NUMBER QUADRATURE PTS FOR POLYNOMIAL DEGREE
! ISTART   = WHERE I_DEG RULE DATA STARTS IN DATA TABLES
! LINES    = NUMBER OF LINES OF DATA FOR EACH RULE
! KOUNTS   = NUMBER OF TIMES THAT A RULE LINE IS USED
! A1,A2,A3 = AREA COORDINATES OF TABLE POINT
! AW       = AREA WEIGHT OF TABLE POINT
  DATA M_QP_DEG / 1, 3, 4, 6, 7, 12, 13, 16, 19, 25, 27, 33, 37, &
                  42, 48, 52, 61 /
  DATA LINES / 1, 1, 2, 2, 3, 3, 4, 5, 6, 6, 7, 8, 10, 10, 11, 13,&
               15 /
  DATA ISTART / 1, 2, 3, 5, 7, 10, 13, 17, 22, 28, 34, 41, 49, 59,&
               69, 80, 93 /
  DATA KOUNTS / 1, 3, 1, 3, 3, 3, 1, 3, 3, 3, 3, 6, 1, 3, 3, 6, 1,&
                3, 3, 3, 6, 1, 3, 3, 3, 3, 6, 1, 3, 3, 6, 6, 6, 3,&
                3, 3, 3, 3, 6, 6, 3, 3, 3, 3, 3, 6, 6, 6, 1, 3, 3,&
                3, 3, 3, 3, 6, 6, 6, 3, 3, 3, 3, 3, 3, 6, 6, 6, 6,&
                3, 3, 3, 3, 3, 3, 6, 6, 6, 6, 6, 1, 3, 3, 3, 3, 3,&
                3, 3, 6, 6, 6, 6, 6, 1, 3, 3, 3, 3, 3, 3, 3, 3, 6,&
                6, 6, 6, 6, 6 /
  DATA AW /             1.000000000000000_DP,  0.333333333333333_DP, &
-0.562500000000000_DP,  0.520833333333333_DP,  0.223381589678011_DP, &
 0.109951743655322_DP,  0.225000000000000_DP,  0.132394152788506_DP, &
 0.125939180544827_DP,  0.116786275726379_DP,  0.050844906370207_DP, &
 0.082851075618374_DP, -0.149570044467682_DP,  0.175615257433208_DP, &
 0.053347235608838_DP,  0.077113760890257_DP,  0.144315607677787_DP, &
 0.095091634267285_DP,  0.103217370534718_DP,  0.032458497623198_DP, &
 0.027230314174435_DP,  0.097135796282799_DP,  0.031334700227139_DP, &
 0.077827541004774_DP,  0.079647738927210_DP,  0.025577675658698_DP, &
 0.043283539377289_DP,  0.090817990382754_DP,  0.036725957756467_DP, &
 0.045321059435528_DP,  0.072757916845420_DP,  0.028327242531057_DP, &
 0.009421666963733_DP,  0.000927006328961_DP,  0.077149534914813_DP, &
 0.059322977380774_DP,  0.036184540503418_DP,  0.013659731002678_DP, &
 0.052337111962204_DP,  0.020707659639141_DP,  0.025731066440455_DP, &
 0.043692544538038_DP,  0.062858224217885_DP,  0.034796112930709_DP, &
 0.006166261051559_DP,  0.040371557766381_DP,  0.022356773202303_DP, &
 0.017316231108659_DP,  0.052520923400802_DP,  0.011280145209330_DP, &
 0.031423518362454_DP,  0.047072502504194_DP,  0.047363586536355_DP, &
 0.031167529045794_DP,  0.007975771465074_DP,  0.036848402728732_DP, &
 0.017401463303822_DP,  0.015521786839045_DP,  0.021883581369429_DP, &
 0.032788353544125_DP,  0.051774104507292_DP,  0.042162588736993_DP, &
 0.014433699669777_DP,  0.004923403602400_DP,  0.024665753212564_DP, &
 0.038571510787061_DP,  0.014436308113534_DP,  0.005010228838501_DP, &
 0.001916875642849_DP,  0.044249027271145_DP,  0.051186548718852_DP, &
 0.023687735870688_DP,  0.013289775690021_DP,  0.004748916608192_DP, &
 0.038550072599593_DP,  0.027215814320624_DP,  0.002182077366797_DP, &
 0.021505319847731_DP,  0.007673942631049_DP,  0.046875697427642_DP, &
 0.006405878578585_DP,  0.041710296739387_DP,  0.026891484250064_DP, &
 0.042132522761650_DP,  0.030000266842773_DP,  0.014200098925024_DP, &
 0.003582462351273_DP,  0.032773147460627_DP,  0.015298306248441_DP, &
 0.002386244192839_DP,  0.019084792755899_DP,  0.006850054546542_DP, &
 0.033437199290803_DP,  0.005093415440507_DP,  0.014670864527638_DP, &
 0.024350878353672_DP,  0.031107550868969_DP,  0.031257111218620_DP, &
 0.024815654339665_DP,  0.014056073070557_DP,  0.003194676173779_DP, &
 0.008119655318993_DP,  0.026805742283163_DP,  0.018459993210822_DP, &
 0.008476868534328_DP,  0.018292796770025_DP,  0.006665632004165_DP /
  DATA A1 / &
 0.333333333333333_DP,  0.666666666666667_DP,  0.333333333333333_DP, &
 0.600000000000000_DP,  0.108103018168070_DP,  0.816847572980459_DP, &
 0.333333333333333_DP,  0.059715871789770_DP,  0.797426985353087_DP, &
 0.501426509658179_DP,  0.873821971016996_DP,  0.053145049844817_DP, &
 0.333333333333333_DP,  0.479308067841920_DP,  0.869739794195568_DP, &
 0.048690315425316_DP,  0.333333333333333_DP,  0.081414823414554_DP, &
 0.658861384496480_DP,  0.898905543365938_DP,  0.008394777409958_DP, &
 0.333333333333333_DP,  0.020634961602525_DP,  0.125820817014127_DP, &
 0.623592928761935_DP,  0.910540973211095_DP,  0.036838412054736_DP, &
 0.333333333333333_DP,  0.028844733232685_DP,  0.781036849029926_DP, &
 0.141707219414880_DP,  0.025003534762686_DP,  0.009540815400299_DP, &
-0.069222096541517_DP,  0.202061394068290_DP,  0.593380199137435_DP, &
 0.761298175434837_DP,  0.935270103777448_DP,  0.050178138310495_DP, &
 0.021022016536166_DP,  0.023565220452390_DP,  0.120551215411079_DP, &
 0.457579229975768_DP,  0.744847708916828_DP,  0.957365299093579_DP, &
 0.115343494534698_DP,  0.022838332222257_DP,  0.025734050548330_DP, &
 0.333333333333333_DP,  0.009903630120591_DP,  0.062566729780852_DP, &
 0.170957326397447_DP,  0.541200855914337_DP,  0.771151009607340_DP, &
 0.950377217273082_DP,  0.094853828379579_DP,  0.018100773278807_DP, &
 0.022233076674090_DP,  0.022072179275643_DP,  0.164710561319092_DP, &
 0.453044943382323_DP,  0.645588935174913_DP,  0.876400233818255_DP, &
 0.961218077502598_DP,  0.057124757403648_DP,  0.092916249356972_DP, &
 0.014646950055654_DP,  0.001268330932872_DP, -0.013945833716486_DP, &
 0.137187291433955_DP,  0.444612710305711_DP,  0.747070217917492_DP, &
 0.858383228050628_DP,  0.962069659517853_DP,  0.133734161966621_DP, &
 0.036366677396917_DP, -0.010174883126571_DP,  0.036843869875878_DP, &
 0.012459809331199_DP,  0.333333333333333_DP,  0.005238916103123_DP, &
 0.173061122901295_DP,  0.059082801866017_DP,  0.518892500060958_DP, &
 0.704068411554854_DP,  0.849069624685052_DP,  0.966807194753950_DP, &
 0.103575692245252_DP,  0.020083411655416_DP, -0.004341002614139_DP, &
 0.041941786468010_DP,  0.014317320230681_DP,  0.333333333333333_DP, &
 0.005658918886452_DP,  0.035647354750751_DP,  0.099520061958437_DP, &
 0.199467521245206_DP,  0.495717464058095_DP,  0.675905990683077_DP, &
 0.848248235478508_DP,  0.968690546064356_DP,  0.010186928826919_DP, &
 0.135440871671036_DP,  0.054423924290583_DP,  0.012868560833637_DP, &
 0.067165782413524_DP,  0.014663182224828_DP /
  DATA A2 /  &
 0.333333333333333_DP, 0.166666666666667_DP, 0.333333333333333_DP, &
 0.200000000000000_DP, 0.445948490915965_DP, 0.091576213509771_DP, &
 0.333333333333333_DP, 0.470142064105115_DP, 0.101286507323456_DP, &
 0.249286745170910_DP, 0.063089014491502_DP, 0.310352451033784_DP, &
 0.333333333333333_DP, 0.260345966079040_DP, 0.065130102902216_DP, &
 0.312865496004874_DP, 0.333333333333333_DP, 0.459292588292723_DP, &
 0.170569307751760_DP, 0.050547228317031_DP, 0.263112829634638_DP, &
 0.333333333333333_DP, 0.489682519198738_DP, 0.437089591492937_DP, &
 0.188203535619033_DP, 0.044729513394453_DP, 0.221962989160766_DP, &
 0.333333333333333_DP, 0.485577633383657_DP, 0.109481575485037_DP, &
 0.307939838764121_DP, 0.246672560639903_DP, 0.066803251012200_DP, &
 0.534611048270758_DP, 0.398969302965855_DP, 0.203309900431282_DP, &
 0.119350912282581_DP, 0.032364948111276_DP, 0.356620648261293_DP, &
 0.171488980304042_DP, 0.488217389773805_DP, 0.439724392294460_DP, &
 0.271210385012116_DP, 0.127576145541586_DP, 0.021317350453210_DP, &
 0.275713269685514_DP, 0.281325580989940_DP, 0.116251915907597_DP, &
 0.333333333333333_DP, 0.495048184939705_DP, 0.468716635109574_DP, &
 0.414521336801277_DP, 0.229399572042831_DP, 0.114424495196330_DP, &
 0.024811391363459_DP, 0.268794997058761_DP, 0.291730066734288_DP, &
 0.126357385491669_DP, 0.488963910362179_DP, 0.417644719340454_DP, &
 0.273477528308839_DP, 0.177205532412543_DP, 0.061799883090873_DP, &
 0.019390961248701_DP, 0.172266687821356_DP, 0.336861459796345_DP, &
 0.298372882136258_DP, 0.118974497696957_DP, 0.506972916858243_DP, &
 0.431406354283023_DP, 0.277693644847144_DP, 0.126464891041254_DP, &
 0.070808385974686_DP, 0.018965170241073_DP, 0.261311371140087_DP, &
 0.388046767090269_DP, 0.285712220049916_DP, 0.215599664072284_DP, &
 0.103575616576386_DP, 0.333333333333333_DP, 0.497380541948438_DP, &
 0.413469438549352_DP, 0.470458599066991_DP, 0.240553749969521_DP, &
 0.147965794222573_DP, 0.075465187657474_DP, 0.016596402623025_DP, &
 0.296555596579887_DP, 0.337723063403079_DP, 0.204748281642812_DP, &
 0.189358492130623_DP, 0.085283615682657_DP, 0.333333333333333_DP, &
 0.497170540556774_DP, 0.482176322624625_DP, 0.450239969020782_DP, &
 0.400266239377397_DP, 0.252141267970953_DP, 0.162047004658461_DP, &
 0.075875882260746_DP, 0.015654726967822_DP, 0.334319867363658_DP, &
 0.292221537796944_DP, 0.319574885423190_DP, 0.190704224192292_DP, &
 0.180483211648746_DP, 0.080711313679564_DP /
  DATA A3 /  &
 0.333333333333333_DP, 0.166666666666667_DP, 0.333333333333333_DP, &
 0.200000000000000_DP, 0.445948490915965_DP, 0.091576213509771_DP, &
 0.333333333333333_DP, 0.470142064105115_DP, 0.101286507323456_DP, &
 0.249286745170910_DP, 0.063089014491502_DP, 0.636502499121399_DP, &
 0.333333333333333_DP, 0.260345966079040_DP, 0.065130102902216_DP, &
 0.638444188569810_DP, 0.333333333333333_DP, 0.459292588292723_DP, &
 0.170569307751760_DP, 0.050547228317031_DP, 0.728492392955404_DP, &
 0.333333333333333_DP, 0.489682519198738_DP, 0.437089591492937_DP, &
 0.188203535619033_DP, 0.044729513394453_DP, 0.741198598784498_DP, &
 0.333333333333333_DP, 0.485577633383657_DP, 0.109481575485037_DP, &
 0.550352941820999_DP, 0.728323904597411_DP, 0.923655933587500_DP, &
 0.534611048270758_DP, 0.398969302965855_DP, 0.203309900431282_DP, &
 0.119350912282581_DP, 0.032364948111276_DP, 0.593201213428213_DP, &
 0.807489003159792_DP, 0.488217389773805_DP, 0.439724392294460_DP, &
 0.271210385012116_DP, 0.127576145541586_DP, 0.021317350453210_DP, &
 0.608943235779788_DP, 0.695836086787803_DP, 0.858014033544073_DP, &
 0.333333333333333_DP, 0.495048184939705_DP, 0.468716635109574_DP, &
 0.414521336801277_DP, 0.229399572042831_DP, 0.114424495196330_DP, &
 0.024811391363459_DP, 0.636351174561660_DP, 0.690169159986905_DP, &
 0.851409537834241_DP, 0.488963910362179_DP, 0.417644719340454_DP, &
 0.273477528308839_DP, 0.177205532412543_DP, 0.061799883090873_DP, &
 0.019390961248701_DP, 0.770608554774996_DP, 0.570222290846683_DP, &
 0.686980167808088_DP, 0.879757171370171_DP, 0.506972916858243_DP, &
 0.431406354283023_DP, 0.277693644847144_DP, 0.126464891041254_DP, &
 0.070808385974686_DP, 0.018965170241073_DP, 0.604954466893291_DP, &
 0.575586555512814_DP, 0.724462663076655_DP, 0.747556466051838_DP, &
 0.883964574092416_DP, 0.333333333333333_DP, 0.497380541948438_DP, &
 0.413469438549352_DP, 0.470458599066991_DP, 0.240553749969521_DP, &
 0.147965794222573_DP, 0.075465187657474_DP, 0.016596402623025_DP, &
 0.599868711174861_DP, 0.642193524941505_DP, 0.799592720971327_DP, &
 0.768699721401368_DP, 0.900399064086661_DP, 0.333333333333333_DP, &
 0.497170540556774_DP, 0.482176322624625_DP, 0.450239969020782_DP, &
 0.400266239377397_DP, 0.252141267970953_DP, 0.162047004658461_DP, &
 0.075875882260746_DP, 0.015654726967822_DP, 0.655493203809423_DP, &
 0.572337590532020_DP, 0.626001190286228_DP, 0.796427214974071_DP, &
 0.752351005937729_DP, 0.904625504095608_DP /
!
!!  CHECK FOR I_DEG OR M_QP CONTROL:
!  LDEG = I_DEG
!  IF ( M_QP == 0) THEN
!!    USE DEGREE CONTROL
!    IF ( I_DEG == 0) M_QP = 1
!    IF ( I_DEG < 0 .OR. I_DEG > MAXDEG ) THEN
!      STOP 'INVALID I_DEG ARGUMENT, D_Q_RULE'
!    ELSE
!      M_QP = M_QP_DEG (I_DEG)
!    END IF
!  ELSE

!    USE M_QP CONTROL
    LDEG = 0
    DO I = 1, MAXDEG
      IF ( M_QP == M_QP_DEG (I) ) LDEG = I
    END DO
    IF ( LDEG == 0) THEN
      PRINT *,'WARNING: D_Q_RULE, INVALID RULE', M_QP
      PRINT *,'CHECK IF shape 2 IS INCORRECT IN KEYWORD CONTROL'
      N_WARN = N_WARN + 1
      STOP 'INVALID M_QP ARGUMENT, D_Q_RULE'
    END IF
!  END IF
  I_DEG = LDEG
!  FOUND VALID RULE, NOW EXPAND TABLE TO FULL RULE
  IPT   = ISTART (LDEG) - 1
  IRULE = 0
  SUM   = 0.0_DP
  DO I = 1, LINES (LDEG)
    J     = IPT + I
    KOUNT = KOUNTS (J)
    IRULE = IRULE + 1
    SUM   = SUM + AW (J) * KOUNT
    WT (IRULE)    = AW (J)
    PT (1, IRULE) = A1 (J)
    PT (2, IRULE) = A2 (J)
    IF ( NPARM == 3 ) PT (3, IRULE) = A3 (J)
    IF ( KOUNT >= 3 ) THEN
      IRULE = IRULE + 1
      WT (IRULE)    = AW (J)
      PT (1, IRULE) = A3 (J)
      PT (2, IRULE) = A1 (J)
      IF ( NPARM == 3 ) PT (3, IRULE) = A2 (J)
      IRULE = IRULE + 1
      WT (IRULE)    = AW (J)
      PT (1, IRULE) = A2 (J)
      PT (2, IRULE) = A3 (J)
      IF ( NPARM == 3 ) PT (3, IRULE) = A1 (J)
    END IF
    IF ( KOUNT == 6 ) THEN
      IRULE = IRULE + 1
      WT (IRULE)    = AW (J)
      PT (1, IRULE) = A1 (J)
      PT (2, IRULE) = A3 (J)
      IF ( NPARM == 3 ) PT (3, IRULE) = A2 (J)
      IRULE = IRULE + 1
      WT (IRULE)    = AW (J)
      PT (1, IRULE) = A3 (J)
      PT (2, IRULE) = A2 (J)
      IF ( NPARM == 3 ) PT (3, IRULE) = A1 (J)
      IRULE = IRULE + 1
      WT (IRULE)    = AW (J)
      PT (1, IRULE) = A2 (J)
      PT (2, IRULE) = A1 (J)
      IF ( NPARM == 3 ) PT (3, IRULE) = A3 (J)
    END IF
  END DO
!  CHECK VALIDITY OF RESULTS
  IF ( SUM /= 1.D0 ) WRITE (6,  * ) &
       'WARNING, UNITY NOT =', SUM, ', IN D_Q_RULE'
       N_WARN = N_WARN + 1 ! INCREMENT WARNING
  IF ( NPARM == 2 ) THEN
    DO I = 1, M_QP
      WT (I) = WT (I) / 2.0_DP
    END DO
  END IF
END SUBROUTINE D_Q_RULE

SUBROUTINE K_Q_RULE (IDEG, M_QP, NPARM, PT, WT) 
! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
!        KEAST QUADRATURE RULE FOR TETRAHEDRA, DEGREE 4 TO 8           
! C.M.A.M.E. VOL. 55, PP. 339-348, 1986 [WITH SIGN & SCALE CORRECTION]
!  IN VOLUME COORDINATES (NPARM=4), OR UNIT COORDINATES (NPARM=3)   
!    GIVEN M_QP        = 11, 15, 24, 31, 45 ; COPYRIGHT 1998            
!    EXACT FOR DEGREE =  4,  5,  6,  7,  8 ; J. E. AKIN
! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Use System_Constants
!b Use Precision_Module
  IMPLICIT NONE
  INTEGER,  PARAMETER    :: MAXDEG = 5, MAXDAT = 24
  INTEGER,  INTENT (IN)  :: M_QP, NPARM
  INTEGER,  INTENT (OUT) :: IDEG
  REAL(DP), INTENT (OUT) :: PT (NPARM, M_QP), WT (M_QP) 
  REAL(DP) :: VW (MAXDAT), A1 (MAXDAT), A2 (MAXDAT), A3 (MAXDAT), &
              A4 (MAXDAT), SUM
  INTEGER  :: M_QP_DEG (MAXDEG), ISTART (MAXDEG), LINES (MAXDEG),   &
              KOUNTS (MAXDAT), I, IPT, J, I_RULE, KOUNT, LDEG
! IDEG     = DEGREE OF POLYNOMIAL TO BE INTEGRATED, 0 TO MAXDEG     
! M_QP     = NUMBER OF QUADRATURE POINTS, USE 0 IF IDEG GOVERNS     
! NPARM    = NUMBER OF PARAMETRIC DIMENSIONS: 4-VOL, 3-UNIT CORD    
! PT       = RETURNED QUADRATURE COORDINATES, PT (NPARM,M_QP)         
! WT       = RETURNED QUADRATURE WEIGHTS,     WT (M_QP)               
!                                                                       
! M_QP_DEG = NUMBER QUADRATURE PTS FOR POLYNOMIAL DEGREE            
! ISTART   = WHERE IDEG RULE DATA STARTS IN DATA TABLES             
! LINES    = NUMBER OF LINES OF DATA FOR EACH RULE                  
! KOUNTS   = NUMBER OF TIMES THAT A RULE LINE IS USED
! A1--A4   = VOLUME COORDINATES OF TABLE POINT                      
! VW       = VOLUME WEIGHT OF TABLE POINT, SUM = 1./6.              
  DATA M_QP_DEG / 11, 15, 24, 31, 45 / 
  DATA LINES  /  3,  4,  4,  6,  7 / 
  DATA ISTART / 1, 4, 8, 12, 18 / 
  DATA KOUNTS / 1, 4, 6,              & 
                4, 1, 4, 6,           &       
                4, 4, 4, 12,          & 
                6, 1, 4, 4, 4, 12,    & 
                1, 4, 4, 6, 6, 12, 12 / 
      DATA  VW / & ! NOTE SIGN CORRECTION IN DEG = 8      
-0.131555555555555556E-1_DP,  0.762222222222222222E-2_DP, &
 0.248888888888888889E-1_DP,                              &

 0.602678571428571597E-2_DP,  0.302836780970891856E-1_DP, &
 0.116452490860289742E-1_DP,  0.109491415613864534E-1_DP, &

 0.665379170969464506E-2_DP,  0.167953517588677620E-2_DP, &
 0.922619692394239843E-2_DP,  0.803571428571428248E-2_DP, &

 0.970017636684296702E-3_DP,  0.182642234661087939E-1_DP, &
 0.105999415244141609E-1_DP, -0.625177401143299494E-1_DP, &
 0.489142526307353653E-2_DP,  0.275573192239850917E-1_DP, &
 
-0.393270066412926145E-1_DP,  0.408131605934270525E-2_DP, &
 0.658086773304341943E-3_DP,  0.438425882512284693E-2_DP, &
 0.138300638425098166E-1_DP,  0.424043742468372453E-2_DP, &
 0.223873973961420164E-2_DP /

      DATA  A1 /                                          &
 0.250000000000000000E+0_DP, 0.714285714285714285E-1_DP, &
 0.399403576166799219E+0_DP,                             &

 0.333333333333333333E+0_DP, 0.250000000000000000E+0_DP, &
 0.909090909090909091E-1_DP, 0.665501535736642813E-1_DP, &

 0.214602871259151684E+0_DP, 0.406739585346113397E-1_DP, &
 0.322337890142275646E+0_DP, 0.636610018750175299E-1_DP, &

 0.500000000000000000E+0_DP, 0.250000000000000000E+0_DP, &
 0.782131923303186549E-1_DP, 0.121843216663904411E+0_DP, &
 0.332539164446420554E+0_DP, 0.100000000000000000E+0_DP, &

 0.250000000000000000E+0_DP, 0.127470936566639015E+0_DP, &
 0.320788303926322960E-1_DP, 0.497770956432810185E-1_DP, &
 0.183730447398549945E+0_DP, 0.231901089397150906E+0_DP, &
 0.379700484718286102E-1_DP /
      DATA  A2 /                                                                    &
 0.250000000000000000E+0_DP, 0.714285714285714285E-1_DP, &
 0.399403576166799219E+0_DP,                             &

 0.333333333333333333E+0_DP, 0.250000000000000000E+0_DP, &
 0.909090909090909091E-1_DP, 0.665501535736642813E-1_DP, &

 0.214602871259151684E+0_DP, 0.406739585346113397E-1_DP, &
 0.322337890142275646E+0_DP, 0.636610018750175299E-1_DP, &

 0.500000000000000000E+0_DP, 0.250000000000000000E+0_DP, &
 0.782131923303186549E-1_DP, 0.121843216663904411E+0_DP, &
 0.332539164446420554E+0_DP, 0.100000000000000000E+0_DP, &

 0.250000000000000000E+0_DP, 0.127470936566639015E+0_DP, &
 0.320788303926322960E-1_DP, 0.497770956432810185E-1_DP, &
 0.183730447398549945E+0_DP, 0.231901089397150906E+0_DP, &
 0.379700484718286102E-1_DP /
      DATA  A3 /                                         &
 0.250000000000000000E+0_DP, 0.714285714285714285E-1_DP, &
 0.100596423833200785E+0_DP,                             &

 0.333333333333333333E+0_DP, 0.250000000000000000E+0_DP, &
 0.909090909090909091E-1_DP, 0.433449846426335728E+0_DP, &

 0.214602871259151684E+0_DP, 0.406739585346113397E-1_DP, &
 0.322337890142275646E+0_DP, 0.269672331458315867E+0_DP, &

 0.000000000000000000E+0_DP, 0.250000000000000000E+0_DP, &
 0.782131923303186549E-1_DP, 0.121843216663904411E+0_DP, &
 0.332539164446420554E+0_DP, 0.200000000000000000E+0_DP, &

 0.250000000000000000E+0_DP, 0.127470936566639015E+0_DP, &
 0.320788303926322960E-1_DP, 0.450222904356718978E+0_DP, &
 0.316269552601450060E+0_DP, 0.229177878448171174E-1_DP, &
 0.730313427807538396E+0_DP /
      DATA  A4 /                                         &
 0.250000000000000000E+0_DP, 0.785714285714285714E+0_DP, &
 0.100596423833200785E+0_DP,                             &

 0.000000000000000000E+0_DP, 0.250000000000000000E+0_DP, &
 0.727272727272727273E+0_DP, 0.433449846426335728E+0_DP, &

 0.356191386222544953E+0_DP, 0.877978124396165982E+0_DP, &
 0.329863295731730594E-1_DP, 0.603005664791649076E+0_DP, & 

 0.000000000000000000E+0_DP, 0.250000000000000000E+0_DP, &
 0.765360423009044044E+0_DP, 0.634470350008286765E+0_DP, &
 0.238250666073834549E-2_DP, 0.600000000000000000E+0_DP, &

 0.250000000000000000E+0_DP, 0.617587190300082967E+0_DP, &
 0.903763508822103123E+0_DP, 0.450222904356718978E+0_DP, &
 0.316269552601450060E+0_DP, 0.513280033360881072E+0_DP, &
 0.193746475248804382E+0_DP /
    LDEG = 0                                              
    DO I = 1, MAXDEG                                           
      IF ( M_QP  ==  M_QP_DEG(I) )  LDEG = I                  
    END DO                                                  
    IF ( LDEG  ==  0 )  THEN
      PRINT *,'WARNING: K_Q_RULE, INVALID RULE', M_QP
      PRINT *,'CHECK IF shape 5 IS INCORRECT IN KEYWORD CONTROL'
      N_WARN = N_WARN + 1
      STOP 'INVALID M_QP ARGUMENT, K_Q_RULE'
    END IF
    IDEG = LDEG !b
!      FOUND VALID RULE, NOW EXPAND TABLE TO FULL RULE  
    IPT   = ISTART (LDEG) - 1            
    I_RULE = 0                            
    SUM   = 0.D0                           
    DO I = 1, LINES (LDEG)                  
      J     = IPT + I                        
      KOUNT = KOUNTS (J)                      
      I_RULE = I_RULE + 1                      
      SUM   = SUM + VW (J) * KOUNT              
      IF ( KOUNT >= 1 ) THEN
        WT (I_RULE)   = VW (J)                   
        PT (1,I_RULE) = A1 (J)                    
        PT (2,I_RULE) = A2 (J)                     
        PT (3,I_RULE) = A3 (J)                      
        IF ( NPARM  ==  4 )  PT (4,I_RULE) = A4 (J) 
        IF ( KOUNT == 1 ) CYCLE ! TO NEXT I
      END IF
      IF ( KOUNT >= 4 ) THEN                    
        I_RULE = I_RULE + 1                      
        WT (I_RULE)   = VW (J)                    
        PT (1,I_RULE) = A2 (J)                     
        PT (2,I_RULE) = A3 (J)                      
        PT (3,I_RULE) = A4 (J)                       
        IF ( NPARM  ==  4 )  PT (4,I_RULE) = A1 (J)  
        I_RULE = I_RULE + 1                     
        WT (I_RULE)   = VW (J)                   
        PT (1,I_RULE) = A3 (J)                    
        PT (2,I_RULE) = A4 (J)                     
        PT (3,I_RULE) = A1 (J)                      
        IF ( NPARM  ==  4 )  PT (4,I_RULE) = A2 (J) 
        I_RULE = I_RULE + 1                        
        WT (I_RULE)   = VW (J)                      
        PT (1,I_RULE) = A4 (J)                       
        PT (2,I_RULE) = A1 (J)                        
        PT (3,I_RULE) = A2 (J)                         
        IF ( NPARM  ==  4 )  PT (4,I_RULE) = A3 (J)    
        IF ( KOUNT == 4 ) CYCLE ! TO NEXT I
      END IF
      IF ( KOUNT  >=  6 ) THEN                 
        I_RULE = I_RULE + 1                     
        WT (I_RULE)   = VW (J)                   
        PT (1,I_RULE) = A2 (J)                    
        PT (2,I_RULE) = A4 (J)                     
        PT (3,I_RULE) = A1 (J)                      
        IF ( NPARM  ==  4 )  PT (4,I_RULE) = A3 (J) 
        I_RULE = I_RULE + 1                        
        WT (I_RULE)   = VW (J)                      
        PT (1,I_RULE) = A4 (J)                       
        PT (2,I_RULE) = A2 (J)                        
        PT (3,I_RULE) = A3 (J)                         
        IF ( NPARM  ==  4 )  PT (4,I_RULE) = A1 (J)    
        IF ( KOUNT == 6 ) CYCLE ! TO NEXT I
      END IF
      IF ( KOUNT == 12 ) THEN                  
        I_RULE = I_RULE + 1                     
        WT (I_RULE)   = VW (J)                   
        PT (1,I_RULE) = A1 (J)                    
        PT (2,I_RULE) = A3 (J)                     
        PT (3,I_RULE) = A2 (J)                      
        IF ( NPARM  ==  4 )  PT (4,I_RULE) = A4 (J) 
        I_RULE = I_RULE + 1                           
        WT (I_RULE)   = VW (J)                         
        PT (1,I_RULE) = A2 (J)                          
        PT (2,I_RULE) = A4 (J)                           
        PT (3,I_RULE) = A3 (J)                            
        IF ( NPARM  ==  4 )  PT (4,I_RULE) = A1 (J)       
        IF ( KOUNT == 6 ) CYCLE ! TO NEXT I
        I_RULE = I_RULE + 1                     
        WT (I_RULE)   = VW (J)                   
        PT (1,I_RULE) = A3 (J)                    
        PT (2,I_RULE) = A1 (J)                     
        PT (3,I_RULE) = A4 (J)                      
        IF ( NPARM  ==  4 )  PT (4,I_RULE) = A2 (J) 
        I_RULE = I_RULE + 1                    
        WT (I_RULE)   = VW (J)                  
        PT (1,I_RULE) = A4 (J)                   
        PT (2,I_RULE) = A3 (J)                    
        PT (3,I_RULE) = A1 (J)                     
        IF ( NPARM  ==  4 )  PT (4,I_RULE) = A2 (J)
        I_RULE = I_RULE + 1                          
        WT (I_RULE)   = VW (J)                        
        PT (1,I_RULE) = A3 (J)                         
        PT (2,I_RULE) = A2 (J)                          
        PT (3,I_RULE) = A1 (J)                           
        IF ( NPARM  ==  4 )  PT (4,I_RULE) = A4 (J)      
        I_RULE = I_RULE + 1                      
        WT (I_RULE)   = VW (J)                    
        PT (1,I_RULE) = A2 (J)                     
        PT (2,I_RULE) = A1 (J)                      
        PT (3,I_RULE) = A4 (J)                       
        IF ( NPARM  ==  4 )  PT (4,I_RULE) = A3 (J)  
      ENDIF                                            
    END DO                                              
!      CHECK VALIDITY OF RESULTS                         
    IF ( SUM /= (1.0_DP / 6.0_DP) )  WRITE (6,*)        &
      'WARNING, WEIGHT SUM NOT 1/6, BUT ', SUM,', K_Q_RULE'
      N_WARN = N_WARN + 1 ! INCREMENT WARNING
    IF ( NPARM  ==  4 )  THEN ! CORRECT PUBLISHED WEIGHTS   
      WT = WT * 6.0_DP
    ENDIF
END SUBROUTINE K_Q_RULE 

SUBROUTINE DUNAVANT_AREA_TRIANGLE_RULE (M_QP, PT, WT)
! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
! DUNAVANT QUADRATURE RULE FOR TRIANGLES, TO DEGREE = 17, IN
!  AREA COORDINATES, I.J.N.M.E. VOL. 21, PP.1129-1148, 1985
! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
! FOR  M_QP = 1,3,4,6,7,12,13,16,19,25,27,33,37,42,48,52,61
!    DEGREE = 1,2,3,4,5, 6, 7, 8, 9,10,11,12,13,14,15,16,17
Use Precision_Module
 IMPLICIT NONE
 INTEGER,  INTENT(IN)  :: M_QP
 REAL(DP), INTENT(OUT) :: PT (3, M_QP), WT (M_QP)

 REAL(DP) :: WT_1  ( 1), WT_3  ( 3), WT_4  ( 4)
 REAL(DP) :: WT_6  ( 6), WT_7  ( 7), WT_12 (12)
 REAL(DP) :: WT_13 (13), WT_16 (16), WT_19 (19)
 REAL(DP) :: WT_25 (25), WT_27 (27), WT_33 (33)
 REAL(DP) :: WT_37 (37), WT_42 (42), WT_48 (48)
 REAL(DP) :: WT_52 (52), WT_61 (61)
 REAL(DP) :: PT_1  (3, 1), PT_3  (3, 3), PT_4  (3, 4)
 REAL(DP) :: PT_6  (3, 6), PT_7  (3, 7), PT_12 (3,12)
 REAL(DP) :: PT_13 (3,13), PT_16 (3,16), PT_19 (3,19)
 REAL(DP) :: PT_25 (3,25), PT_27 (3,27), PT_33 (3,33)
 REAL(DP) :: PT_37 (3,37), PT_42 (3,42), PT_48 (3,48)
 REAL(DP) :: PT_52 (3,52), PT_61 (3,61)

! M_QP     = NUMBER OF QUADRATURE POINTS
! PT       = RETURNED QUADRATURE COORDINATES
! WT       = RETURNED QUADRATURE WEIGHTS
DATA  WT_1  /               1.00000000000000000E+00_DP / 
DATA  PT_1  /                                           &
 3.33333333333333333E-01_DP, 3.33333333333333333E-01_DP,&
 3.33333333333333333E-01_DP / 
DATA  WT_3  /                                           &
 3.33333333333333333E-01_DP, 3.33333333333333333E-01_DP,&
 3.33333333333333333E-01_DP / 
DATA  PT_3  /                                           &
 6.66666666666666667E-01_DP, 1.66666666666666667E-01_DP,&
 1.66666666666666667E-01_DP, 1.66666666666666667E-01_DP,&
 6.66666666666666667E-01_DP, 1.66666666666666667E-01_DP,&
 1.66666666666666667E-01_DP, 1.66666666666666667E-01_DP,&
 6.66666666666666667E-01_DP / 
DATA  WT_4  /                                           &
-5.62500000000000000E-01_DP, 5.20833333333333333E-01_DP,&
 5.20833333333333333E-01_DP, 5.20833333333333333E-01_DP / 
DATA  PT_4  /                                           &
 3.33333333333333333E-01_DP, 3.33333333333333333E-01_DP,&
 3.33333333333333333E-01_DP, 6.00000000000000000E-01_DP,&
 2.00000000000000000E-01_DP, 2.00000000000000000E-01_DP,&
 2.00000000000000000E-01_DP, 6.00000000000000000E-01_DP,&
 2.00000000000000000E-01_DP, 2.00000000000000000E-01_DP,&
 2.00000000000000000E-01_DP, 6.00000000000000000E-01_DP / 
DATA  WT_6  /                                     &
 2.23381589678011E-01_DP, 2.23381589678011E-01_DP,&
 2.23381589678011E-01_DP, 1.09951743655322E-01_DP,&
 1.09951743655322E-01_DP, 1.09951743655322E-01_DP / 
DATA  PT_6  /                                     &
 1.08103018168070E-01_DP, 4.45948490915965E-01_DP,&
 4.45948490915965E-01_DP, 4.45948490915965E-01_DP,&
 1.08103018168070E-01_DP, 4.45948490915965E-01_DP,&
 4.45948490915965E-01_DP, 4.45948490915965E-01_DP,&
 1.08103018168070E-01_DP, 8.16847572980459E-01_DP,&
 9.15762135097710E-02_DP, 9.15762135097710E-02_DP,&
 9.15762135097710E-02_DP, 8.16847572980459E-01_DP,&
 9.15762135097710E-02_DP, 9.15762135097710E-02_DP,&
 9.15762135097710E-02_DP, 8.16847572980459E-01_DP / 
DATA  WT_7  /                                     &
 2.25000000000000E-01_DP, 1.32394152788506E-01_DP,&
 1.32394152788506E-01_DP, 1.32394152788506E-01_DP,&
 1.25939180544827E-01_DP, 1.25939180544827E-01_DP,&
 1.25939180544827E-01_DP / 
DATA  PT_7  /                                     &
 3.33333333333333E-01_DP, 3.33333333333333E-01_DP,&
 3.33333333333333E-01_DP, 5.97158717897700E-02_DP,&
 4.70142064105115E-01_DP, 4.70142064105115E-01_DP,&
 4.70142064105115E-01_DP, 5.97158717897700E-02_DP,&
 4.70142064105115E-01_DP, 4.70142064105115E-01_DP,&
 4.70142064105115E-01_DP, 5.97158717897700E-02_DP,&
 7.97426985353087E-01_DP, 1.01286507323456E-01_DP,&
 1.01286507323456E-01_DP, 1.01286507323456E-01_DP,&
 7.97426985353087E-01_DP, 1.01286507323456E-01_DP,&
 1.01286507323456E-01_DP, 1.01286507323456E-01_DP,&
 7.97426985353087E-01_DP / 
DATA  WT_12  /                                    &
 1.16786275726379E-01_DP, 1.16786275726379E-01_DP,&
 1.16786275726379E-01_DP, 5.08449063702070E-02_DP,&
 5.08449063702070E-02_DP, 5.08449063702070E-02_DP,&
 8.28510756183740E-02_DP, 8.28510756183740E-02_DP,&
 8.28510756183740E-02_DP, 8.28510756183740E-02_DP,&
 8.28510756183740E-02_DP, 8.28510756183740E-02_DP / 
DATA  PT_12  /                                    &
 5.01426509658179E-01_DP, 2.49286745170910E-01_DP,&
 2.49286745170910E-01_DP, 2.49286745170910E-01_DP,&
 5.01426509658179E-01_DP, 2.49286745170910E-01_DP,&
 2.49286745170910E-01_DP, 2.49286745170910E-01_DP,&
 5.01426509658179E-01_DP, 8.73821971016996E-01_DP,&
 6.30890144915020E-02_DP, 6.30890144915020E-02_DP,&
 6.30890144915020E-02_DP, 8.73821971016996E-01_DP,&
 6.30890144915020E-02_DP, 6.30890144915020E-02_DP,&
 6.30890144915020E-02_DP, 8.73821971016996E-01_DP,&
 5.31450498448170E-02_DP, 3.10352451033784E-01_DP,&
 6.36502499121399E-01_DP, 6.36502499121399E-01_DP,&
 5.31450498448170E-02_DP, 3.10352451033784E-01_DP,&
 3.10352451033784E-01_DP, 6.36502499121399E-01_DP,&
 5.31450498448170E-02_DP, 5.31450498448170E-02_DP,&
 6.36502499121399E-01_DP, 3.10352451033784E-01_DP,&
 6.36502499121399E-01_DP, 3.10352451033784E-01_DP,&
 5.31450498448170E-02_DP, 3.10352451033784E-01_DP,&
 5.31450498448170E-02_DP, 6.36502499121399E-01_DP / 
DATA  WT_13  /                                    &
-1.49570044467682E-01_DP, 1.75615257433208E-01_DP,&
 1.75615257433208E-01_DP, 1.75615257433208E-01_DP,&
 5.33472356088380E-02_DP, 5.33472356088380E-02_DP,&
 5.33472356088380E-02_DP, 7.71137608902570E-02_DP,&
 7.71137608902570E-02_DP, 7.71137608902570E-02_DP,&
 7.71137608902570E-02_DP, 7.71137608902570E-02_DP,&
 7.71137608902570E-02_DP / 
DATA  PT_13  /                                    &
 3.33333333333333E-01_DP, 3.33333333333333E-01_DP,&
 3.33333333333333E-01_DP, 4.79308067841920E-01_DP,&
 2.60345966079040E-01_DP, 2.60345966079040E-01_DP,&
 2.60345966079040E-01_DP, 4.79308067841920E-01_DP,&
 2.60345966079040E-01_DP, 2.60345966079040E-01_DP,&
 2.60345966079040E-01_DP, 4.79308067841920E-01_DP,&
 8.69739794195568E-01_DP, 6.51301029022160E-02_DP,&
 6.51301029022160E-02_DP, 6.51301029022160E-02_DP,&
 8.69739794195568E-01_DP, 6.51301029022160E-02_DP,&
 6.51301029022160E-02_DP, 6.51301029022160E-02_DP,&
 8.69739794195568E-01_DP, 4.86903154253160E-02_DP,&
 3.12865496004874E-01_DP, 6.38444188569810E-01_DP,&
 6.38444188569810E-01_DP, 4.86903154253160E-02_DP,&
 3.12865496004874E-01_DP, 3.12865496004874E-01_DP,&
 6.38444188569810E-01_DP, 4.86903154253160E-02_DP,&
 4.86903154253160E-02_DP, 6.38444188569810E-01_DP,&
 3.12865496004874E-01_DP, 6.38444188569810E-01_DP,&
 3.12865496004874E-01_DP, 4.86903154253160E-02_DP,&
 3.12865496004874E-01_DP, 4.86903154253160E-02_DP,&
 6.38444188569810E-01_DP / 
DATA  WT_16  /                                    &
 1.44315607677787E-01_DP, 9.50916342672850E-02_DP,&
 9.50916342672850E-02_DP, 9.50916342672850E-02_DP,&
 1.03217370534718E-01_DP, 1.03217370534718E-01_DP,&
 1.03217370534718E-01_DP, 3.24584976231980E-02_DP,&
 3.24584976231980E-02_DP, 3.24584976231980E-02_DP,&
 2.72303141744350E-02_DP, 2.72303141744350E-02_DP,&
 2.72303141744350E-02_DP, 2.72303141744350E-02_DP,&
 2.72303141744350E-02_DP, 2.72303141744350E-02_DP / 
DATA  PT_16  /                                    &
 3.33333333333333E-01_DP, 3.33333333333333E-01_DP,&
 3.33333333333333E-01_DP, 8.14148234145540E-02_DP,&
 4.59292588292723E-01_DP, 4.59292588292723E-01_DP,&
 4.59292588292723E-01_DP, 8.14148234145540E-02_DP,&
 4.59292588292723E-01_DP, 4.59292588292723E-01_DP,&
 4.59292588292723E-01_DP, 8.14148234145540E-02_DP,&
 6.58861384496480E-01_DP, 1.70569307751760E-01_DP,&
 1.70569307751760E-01_DP, 1.70569307751760E-01_DP,&
 6.58861384496480E-01_DP, 1.70569307751760E-01_DP,&
 1.70569307751760E-01_DP, 1.70569307751760E-01_DP,&
 6.58861384496480E-01_DP, 8.98905543365938E-01_DP,&
 5.05472283170310E-02_DP, 5.05472283170310E-02_DP,&
 5.05472283170310E-02_DP, 8.98905543365938E-01_DP,&
 5.05472283170310E-02_DP, 5.05472283170310E-02_DP,&
 5.05472283170310E-02_DP, 8.98905543365938E-01_DP,&
 8.39477740995800E-03_DP, 2.63112829634638E-01_DP,&
 7.28492392955404E-01_DP, 7.28492392955404E-01_DP,&
 8.39477740995800E-03_DP, 2.63112829634638E-01_DP,&
 2.63112829634638E-01_DP, 7.28492392955404E-01_DP,&
 8.39477740995800E-03_DP, 8.39477740995800E-03_DP,&
 7.28492392955404E-01_DP, 2.63112829634638E-01_DP,&
 7.28492392955404E-01_DP, 2.63112829634638E-01_DP,&
 8.39477740995800E-03_DP, 2.63112829634638E-01_DP,&
 8.39477740995800E-03_DP, 7.28492392955404E-01_DP / 
DATA  WT_19  /                                    &
 9.71357962827990E-02_DP, 3.13347002271390E-02_DP,&
 3.13347002271390E-02_DP, 3.13347002271390E-02_DP,&
 7.78275410047740E-02_DP, 7.78275410047740E-02_DP,&
 7.78275410047740E-02_DP, 7.96477389272100E-02_DP,&
 7.96477389272100E-02_DP, 7.96477389272100E-02_DP,&
 2.55776756586980E-02_DP, 2.55776756586980E-02_DP,&
 2.55776756586980E-02_DP, 4.32835393772890E-02_DP,&
 4.32835393772890E-02_DP, 4.32835393772890E-02_DP,&
 4.32835393772890E-02_DP, 4.32835393772890E-02_DP,&
 4.32835393772890E-02_DP / 
DATA  PT_19  /                                    &
 3.33333333333333E-01_DP, 3.33333333333333E-01_DP,&
 3.33333333333333E-01_DP, 2.06349616025250E-02_DP,&
 4.89682519198738E-01_DP, 4.89682519198738E-01_DP,&
 4.89682519198738E-01_DP, 2.06349616025250E-02_DP,&
 4.89682519198738E-01_DP, 4.89682519198738E-01_DP,&
 4.89682519198738E-01_DP, 2.06349616025250E-02_DP,&
 1.25820817014127E-01_DP, 4.37089591492937E-01_DP,&
 4.37089591492937E-01_DP, 4.37089591492937E-01_DP,&
 1.25820817014127E-01_DP, 4.37089591492937E-01_DP,&
 4.37089591492937E-01_DP, 4.37089591492937E-01_DP,&
 1.25820817014127E-01_DP, 6.23592928761935E-01_DP,&
 1.88203535619033E-01_DP, 1.88203535619033E-01_DP,&
 1.88203535619033E-01_DP, 6.23592928761935E-01_DP,&
 1.88203535619033E-01_DP, 1.88203535619033E-01_DP,&
 1.88203535619033E-01_DP, 6.23592928761935E-01_DP,&
 9.10540973211095E-01_DP, 4.47295133944530E-02_DP,&
 4.47295133944530E-02_DP, 4.47295133944530E-02_DP,&
 9.10540973211095E-01_DP, 4.47295133944530E-02_DP,&
 4.47295133944530E-02_DP, 4.47295133944530E-02_DP,&
 9.10540973211095E-01_DP, 3.68384120547360E-02_DP,&
 2.21962989160766E-01_DP, 7.41198598784498E-01_DP,&
 7.41198598784498E-01_DP, 3.68384120547360E-02_DP,&
 2.21962989160766E-01_DP, 2.21962989160766E-01_DP,&
 7.41198598784498E-01_DP, 3.68384120547360E-02_DP,&
 3.68384120547360E-02_DP, 7.41198598784498E-01_DP,&
 2.21962989160766E-01_DP, 7.41198598784498E-01_DP,&
 2.21962989160766E-01_DP, 3.68384120547360E-02_DP,&
 2.21962989160766E-01_DP, 3.68384120547360E-02_DP,&
 7.41198598784498E-01_DP / 
DATA  WT_25  /                                    &
 9.08179903827540E-02_DP, 3.67259577564670E-02_DP,&
 3.67259577564670E-02_DP, 3.67259577564670E-02_DP,&
 4.53210594355280E-02_DP, 4.53210594355280E-02_DP,&
 4.53210594355280E-02_DP, 7.27579168454200E-02_DP,&
 7.27579168454200E-02_DP, 7.27579168454200E-02_DP,&
 7.27579168454200E-02_DP, 7.27579168454200E-02_DP,&
 7.27579168454200E-02_DP, 2.83272425310570E-02_DP,&
 2.83272425310570E-02_DP, 2.83272425310570E-02_DP,&
 2.83272425310570E-02_DP, 2.83272425310570E-02_DP,&
 2.83272425310570E-02_DP, 9.42166696373300E-03_DP,&
 9.42166696373300E-03_DP, 9.42166696373300E-03_DP,&
 9.42166696373300E-03_DP, 9.42166696373300E-03_DP,&
 9.42166696373300E-03_DP / 
DATA  PT_25  /                                    &
 3.33333333333333E-01_DP, 3.33333333333333E-01_DP,&
 3.33333333333333E-01_DP, 2.88447332326850E-02_DP,&
 4.85577633383657E-01_DP, 4.85577633383657E-01_DP,&
 4.85577633383657E-01_DP, 2.88447332326850E-02_DP,&
 4.85577633383657E-01_DP, 4.85577633383657E-01_DP,&
 4.85577633383657E-01_DP, 2.88447332326850E-02_DP,&
 7.81036849029926E-01_DP, 1.09481575485037E-01_DP,&
 1.09481575485037E-01_DP, 1.09481575485037E-01_DP,&
 7.81036849029926E-01_DP, 1.09481575485037E-01_DP,&
 1.09481575485037E-01_DP, 1.09481575485037E-01_DP,&
 7.81036849029926E-01_DP, 1.41707219414880E-01_DP,&
 3.07939838764121E-01_DP, 5.50352941820999E-01_DP,&
 5.50352941820999E-01_DP, 1.41707219414880E-01_DP,&
 3.07939838764121E-01_DP, 3.07939838764121E-01_DP,&
 5.50352941820999E-01_DP, 1.41707219414880E-01_DP,&
 1.41707219414880E-01_DP, 5.50352941820999E-01_DP,&
 3.07939838764121E-01_DP, 5.50352941820999E-01_DP,&
 3.07939838764121E-01_DP, 1.41707219414880E-01_DP,&
 3.07939838764121E-01_DP, 1.41707219414880E-01_DP,&
 5.50352941820999E-01_DP, 2.50035347626860E-02_DP,&
 2.46672560639903E-01_DP, 7.28323904597411E-01_DP,&
 7.28323904597411E-01_DP, 2.50035347626860E-02_DP,&
 2.46672560639903E-01_DP, 2.46672560639903E-01_DP,&
 7.28323904597411E-01_DP, 2.50035347626860E-02_DP,&
 2.50035347626860E-02_DP, 7.28323904597411E-01_DP,&
 2.46672560639903E-01_DP, 7.28323904597411E-01_DP,&
 2.46672560639903E-01_DP, 2.50035347626860E-02_DP,&
 2.46672560639903E-01_DP, 2.50035347626860E-02_DP,&
 7.28323904597411E-01_DP, 9.54081540029900E-03_DP,&
 6.68032510122000E-02_DP, 9.23655933587500E-01_DP,&
 9.23655933587500E-01_DP, 9.54081540029900E-03_DP,&
 6.68032510122000E-02_DP, 6.68032510122000E-02_DP,&
 9.23655933587500E-01_DP, 9.54081540029900E-03_DP,&
 9.54081540029900E-03_DP, 9.23655933587500E-01_DP,&
 6.68032510122000E-02_DP, 9.23655933587500E-01_DP,&
 6.68032510122000E-02_DP, 9.54081540029900E-03_DP,&
 6.68032510122000E-02_DP, 9.54081540029900E-03_DP,&
 9.23655933587500E-01_DP / 
DATA  WT_27  /                                    &
 9.27006328961000E-04_DP, 9.27006328961000E-04_DP,&
 9.27006328961000E-04_DP, 7.71495349148130E-02_DP,&
 7.71495349148130E-02_DP, 7.71495349148130E-02_DP,&
 5.93229773807740E-02_DP, 5.93229773807740E-02_DP,&
 5.93229773807740E-02_DP, 3.61845405034180E-02_DP,&
 3.61845405034180E-02_DP, 3.61845405034180E-02_DP,&
 1.36597310026780E-02_DP, 1.36597310026780E-02_DP,&
 1.36597310026780E-02_DP, 5.23371119622040E-02_DP,&
 5.23371119622040E-02_DP, 5.23371119622040E-02_DP,&
 5.23371119622040E-02_DP, 5.23371119622040E-02_DP,&
 5.23371119622040E-02_DP, 2.07076596391410E-02_DP,&
 2.07076596391410E-02_DP, 2.07076596391410E-02_DP,&
 2.07076596391410E-02_DP, 2.07076596391410E-02_DP,&
 2.07076596391410E-02_DP / 
DATA  PT_27  /                                    &
-6.92220965415170E-02_DP, 5.34611048270758E-01_DP,&
 5.34611048270758E-01_DP, 5.34611048270758E-01_DP,&
-6.92220965415170E-02_DP, 5.34611048270758E-01_DP,&
 5.34611048270758E-01_DP, 5.34611048270758E-01_DP,&
-6.92220965415170E-02_DP, 2.02061394068290E-01_DP,&
 3.98969302965855E-01_DP, 3.98969302965855E-01_DP,&
 3.98969302965855E-01_DP, 2.02061394068290E-01_DP,&
 3.98969302965855E-01_DP, 3.98969302965855E-01_DP,&
 3.98969302965855E-01_DP, 2.02061394068290E-01_DP,&
 5.93380199137435E-01_DP, 2.03309900431282E-01_DP,&
 2.03309900431282E-01_DP, 2.03309900431282E-01_DP,&
 5.93380199137435E-01_DP, 2.03309900431282E-01_DP,&
 2.03309900431282E-01_DP, 2.03309900431282E-01_DP,&
 5.93380199137435E-01_DP, 7.61298175434837E-01_DP,&
 1.19350912282581E-01_DP, 1.19350912282581E-01_DP,&
 1.19350912282581E-01_DP, 7.61298175434837E-01_DP,&
 1.19350912282581E-01_DP, 1.19350912282581E-01_DP,&
 1.19350912282581E-01_DP, 7.61298175434837E-01_DP,&
 9.35270103777448E-01_DP, 3.23649481112760E-02_DP,&
 3.23649481112760E-02_DP, 3.23649481112760E-02_DP,&
 9.35270103777448E-01_DP, 3.23649481112760E-02_DP,&
 3.23649481112760E-02_DP, 3.23649481112760E-02_DP,&
 9.35270103777448E-01_DP, 5.01781383104950E-02_DP,&
 3.56620648261293E-01_DP, 5.93201213428213E-01_DP,&
 5.93201213428213E-01_DP, 5.01781383104950E-02_DP,&
 3.56620648261293E-01_DP, 3.56620648261293E-01_DP,&
 5.93201213428213E-01_DP, 5.01781383104950E-02_DP,&
 5.01781383104950E-02_DP, 5.93201213428213E-01_DP,&
 3.56620648261293E-01_DP, 5.93201213428213E-01_DP,&
 3.56620648261293E-01_DP, 5.01781383104950E-02_DP,&
 3.56620648261293E-01_DP, 5.01781383104950E-02_DP,&
 5.93201213428213E-01_DP, 2.10220165361660E-02_DP,&
 1.71488980304042E-01_DP, 8.07489003159792E-01_DP,&
 8.07489003159792E-01_DP, 2.10220165361660E-02_DP,&
 1.71488980304042E-01_DP, 1.71488980304042E-01_DP,&
 8.07489003159792E-01_DP, 2.10220165361660E-02_DP,&
 2.10220165361660E-02_DP, 8.07489003159792E-01_DP,&
 1.71488980304042E-01_DP, 8.07489003159792E-01_DP,&
 1.71488980304042E-01_DP, 2.10220165361660E-02_DP,&
 1.71488980304042E-01_DP, 2.10220165361660E-02_DP,&
 8.07489003159792E-01_DP / 
DATA  WT_33  /                                    &
 2.57310664404550E-02_DP, 2.57310664404550E-02_DP,&
 2.57310664404550E-02_DP, 4.36925445380380E-02_DP,&
 4.36925445380380E-02_DP, 4.36925445380380E-02_DP,&
 6.28582242178850E-02_DP, 6.28582242178850E-02_DP,&
 6.28582242178850E-02_DP, 3.47961129307090E-02_DP,&
 3.47961129307090E-02_DP, 3.47961129307090E-02_DP,&
 6.16626105155900E-03_DP, 6.16626105155900E-03_DP,&
 6.16626105155900E-03_DP, 4.03715577663810E-02_DP,&
 4.03715577663810E-02_DP, 4.03715577663810E-02_DP,&
 4.03715577663810E-02_DP, 4.03715577663810E-02_DP,&
 4.03715577663810E-02_DP, 2.23567732023030E-02_DP,&
 2.23567732023030E-02_DP, 2.23567732023030E-02_DP,&
 2.23567732023030E-02_DP, 2.23567732023030E-02_DP,&
 2.23567732023030E-02_DP, 1.73162311086590E-02_DP,&
 1.73162311086590E-02_DP, 1.73162311086590E-02_DP,&
 1.73162311086590E-02_DP, 1.73162311086590E-02_DP,&
 1.73162311086590E-02_DP / 
DATA  PT_33  /                                    &
 2.35652204523900E-02_DP, 4.88217389773805E-01_DP,&
 4.88217389773805E-01_DP, 4.88217389773805E-01_DP,&
 2.35652204523900E-02_DP, 4.88217389773805E-01_DP,&
 4.88217389773805E-01_DP, 4.88217389773805E-01_DP,&
 2.35652204523900E-02_DP, 1.20551215411079E-01_DP,&
 4.39724392294460E-01_DP, 4.39724392294460E-01_DP,&
 4.39724392294460E-01_DP, 1.20551215411079E-01_DP,&
 4.39724392294460E-01_DP, 4.39724392294460E-01_DP,&
 4.39724392294460E-01_DP, 1.20551215411079E-01_DP,&
 4.57579229975768E-01_DP, 2.71210385012116E-01_DP,&
 2.71210385012116E-01_DP, 2.71210385012116E-01_DP,&
 4.57579229975768E-01_DP, 2.71210385012116E-01_DP,&
 2.71210385012116E-01_DP, 2.71210385012116E-01_DP,&
 4.57579229975768E-01_DP, 7.44847708916828E-01_DP,&
 1.27576145541586E-01_DP, 1.27576145541586E-01_DP,&
 1.27576145541586E-01_DP, 7.44847708916828E-01_DP,&
 1.27576145541586E-01_DP, 1.27576145541586E-01_DP,&
 1.27576145541586E-01_DP, 7.44847708916828E-01_DP,&
 9.57365299093579E-01_DP, 2.13173504532100E-02_DP,&
 2.13173504532100E-02_DP, 2.13173504532100E-02_DP,&
 9.57365299093579E-01_DP, 2.13173504532100E-02_DP,&
 2.13173504532100E-02_DP, 2.13173504532100E-02_DP,&
 9.57365299093579E-01_DP, 1.15343494534698E-01_DP,&
 2.75713269685514E-01_DP, 6.08943235779788E-01_DP,&
 6.08943235779788E-01_DP, 1.15343494534698E-01_DP,&
 2.75713269685514E-01_DP, 2.75713269685514E-01_DP,&
 6.08943235779788E-01_DP, 1.15343494534698E-01_DP,&
 1.15343494534698E-01_DP, 6.08943235779788E-01_DP,&
 2.75713269685514E-01_DP, 6.08943235779788E-01_DP,&
 2.75713269685514E-01_DP, 1.15343494534698E-01_DP,&
 2.75713269685514E-01_DP, 1.15343494534698E-01_DP,&
 6.08943235779788E-01_DP, 2.28383322222570E-02_DP,&
 2.81325580989940E-01_DP, 6.95836086787803E-01_DP,&
 6.95836086787803E-01_DP, 2.28383322222570E-02_DP,&
 2.81325580989940E-01_DP, 2.81325580989940E-01_DP,&
 6.95836086787803E-01_DP, 2.28383322222570E-02_DP,&
 2.28383322222570E-02_DP, 6.95836086787803E-01_DP,&
 2.81325580989940E-01_DP, 6.95836086787803E-01_DP,&
 2.81325580989940E-01_DP, 2.28383322222570E-02_DP,&
 2.81325580989940E-01_DP, 2.28383322222570E-02_DP,&
 6.95836086787803E-01_DP, 2.57340505483300E-02_DP,&
 1.16251915907597E-01_DP, 8.58014033544073E-01_DP,&
 8.58014033544073E-01_DP, 2.57340505483300E-02_DP,&
 1.16251915907597E-01_DP, 1.16251915907597E-01_DP,&
 8.58014033544073E-01_DP, 2.57340505483300E-02_DP,&
 2.57340505483300E-02_DP, 8.58014033544073E-01_DP,&
 1.16251915907597E-01_DP, 8.58014033544073E-01_DP,&
 1.16251915907597E-01_DP, 2.57340505483300E-02_DP,&
 1.16251915907597E-01_DP, 2.57340505483300E-02_DP,&
 8.58014033544073E-01_DP / 
DATA  WT_37  /                                    &
 5.25209234008020E-02_DP, 1.12801452093300E-02_DP,&
 1.12801452093300E-02_DP, 1.12801452093300E-02_DP,&
 3.14235183624540E-02_DP, 3.14235183624540E-02_DP,&
 3.14235183624540E-02_DP, 4.70725025041940E-02_DP,&
 4.70725025041940E-02_DP, 4.70725025041940E-02_DP,&
 4.73635865363550E-02_DP, 4.73635865363550E-02_DP,&
 4.73635865363550E-02_DP, 3.11675290457940E-02_DP,&
 3.11675290457940E-02_DP, 3.11675290457940E-02_DP,&
 7.97577146507400E-03_DP, 7.97577146507400E-03_DP,&
 7.97577146507400E-03_DP, 3.68484027287320E-02_DP,&
 3.68484027287320E-02_DP, 3.68484027287320E-02_DP,&
 3.68484027287320E-02_DP, 3.68484027287320E-02_DP,&
 3.68484027287320E-02_DP, 1.74014633038220E-02_DP,&
 1.74014633038220E-02_DP, 1.74014633038220E-02_DP,&
 1.74014633038220E-02_DP, 1.74014633038220E-02_DP,&
 1.74014633038220E-02_DP, 1.55217868390450E-02_DP,&
 1.55217868390450E-02_DP, 1.55217868390450E-02_DP,&
 1.55217868390450E-02_DP, 1.55217868390450E-02_DP,&
 1.55217868390450E-02_DP / 
DATA  PT_37  /                                    &
 3.33333333333333E-01_DP, 3.33333333333333E-01_DP,&
 3.33333333333333E-01_DP, 9.90363012059100E-03_DP,&
 4.95048184939705E-01_DP, 4.95048184939705E-01_DP,&
 4.95048184939705E-01_DP, 9.90363012059100E-03_DP,&
 4.95048184939705E-01_DP, 4.95048184939705E-01_DP,&
 4.95048184939705E-01_DP, 9.90363012059100E-03_DP,&
 6.25667297808520E-02_DP, 4.68716635109574E-01_DP,&
 4.68716635109574E-01_DP, 4.68716635109574E-01_DP,&
 6.25667297808520E-02_DP, 4.68716635109574E-01_DP,&
 4.68716635109574E-01_DP, 4.68716635109574E-01_DP,&
 6.25667297808520E-02_DP, 1.70957326397447E-01_DP,&
 4.14521336801277E-01_DP, 4.14521336801277E-01_DP,&
 4.14521336801277E-01_DP, 1.70957326397447E-01_DP,&
 4.14521336801277E-01_DP, 4.14521336801277E-01_DP,&
 4.14521336801277E-01_DP, 1.70957326397447E-01_DP,&
 5.41200855914337E-01_DP, 2.29399572042831E-01_DP,&
 2.29399572042831E-01_DP, 2.29399572042831E-01_DP,&
 5.41200855914337E-01_DP, 2.29399572042831E-01_DP,&
 2.29399572042831E-01_DP, 2.29399572042831E-01_DP,&
 5.41200855914337E-01_DP, 7.71151009607340E-01_DP,&
 1.14424495196330E-01_DP, 1.14424495196330E-01_DP,&
 1.14424495196330E-01_DP, 7.71151009607340E-01_DP,&
 1.14424495196330E-01_DP, 1.14424495196330E-01_DP,&
 1.14424495196330E-01_DP, 7.71151009607340E-01_DP,&
 9.50377217273082E-01_DP, 2.48113913634590E-02_DP,&
 2.48113913634590E-02_DP, 2.48113913634590E-02_DP,&
 9.50377217273082E-01_DP, 2.48113913634590E-02_DP,&
 2.48113913634590E-02_DP, 2.48113913634590E-02_DP,&
 9.50377217273082E-01_DP, 9.48538283795790E-02_DP,&
 2.68794997058761E-01_DP, 6.36351174561660E-01_DP,&
 6.36351174561660E-01_DP, 9.48538283795790E-02_DP,&
 2.68794997058761E-01_DP, 2.68794997058761E-01_DP,&
 6.36351174561660E-01_DP, 9.48538283795790E-02_DP,&
 9.48538283795790E-02_DP, 6.36351174561660E-01_DP,&
 2.68794997058761E-01_DP, 6.36351174561660E-01_DP,&
 2.68794997058761E-01_DP, 9.48538283795790E-02_DP,&
 2.68794997058761E-01_DP, 9.48538283795790E-02_DP,&
 6.36351174561660E-01_DP, 1.81007732788070E-02_DP,&
 2.91730066734288E-01_DP, 6.90169159986905E-01_DP,&
 6.90169159986905E-01_DP, 1.81007732788070E-02_DP,&
 2.91730066734288E-01_DP, 2.91730066734288E-01_DP,&
 6.90169159986905E-01_DP, 1.81007732788070E-02_DP,&
 1.81007732788070E-02_DP, 6.90169159986905E-01_DP,&
 2.91730066734288E-01_DP, 6.90169159986905E-01_DP,&
 2.91730066734288E-01_DP, 1.81007732788070E-02_DP,&
 2.91730066734288E-01_DP, 1.81007732788070E-02_DP,&
 6.90169159986905E-01_DP, 2.22330766740900E-02_DP,&
 1.26357385491669E-01_DP, 8.51409537834241E-01_DP,&
 8.51409537834241E-01_DP, 2.22330766740900E-02_DP,&
 1.26357385491669E-01_DP, 1.26357385491669E-01_DP,&
 8.51409537834241E-01_DP, 2.22330766740900E-02_DP,&
 2.22330766740900E-02_DP, 8.51409537834241E-01_DP,&
 1.26357385491669E-01_DP, 8.51409537834241E-01_DP,&
 1.26357385491669E-01_DP, 2.22330766740900E-02_DP,&
 1.26357385491669E-01_DP, 2.22330766740900E-02_DP,&
 8.51409537834241E-01_DP / 
DATA  WT_42  /                                    &
 2.18835813694290E-02_DP, 2.18835813694290E-02_DP,&
 2.18835813694290E-02_DP, 3.27883535441250E-02_DP,&
 3.27883535441250E-02_DP, 3.27883535441250E-02_DP,&
 5.17741045072920E-02_DP, 5.17741045072920E-02_DP,&
 5.17741045072920E-02_DP, 4.21625887369930E-02_DP,&
 4.21625887369930E-02_DP, 4.21625887369930E-02_DP,&
 1.44336996697770E-02_DP, 1.44336996697770E-02_DP,&
 1.44336996697770E-02_DP, 4.92340360240000E-03_DP,&
 4.92340360240000E-03_DP, 4.92340360240000E-03_DP,&
 2.46657532125640E-02_DP, 2.46657532125640E-02_DP,&
 2.46657532125640E-02_DP, 2.46657532125640E-02_DP,&
 2.46657532125640E-02_DP, 2.46657532125640E-02_DP,&
 3.85715107870610E-02_DP, 3.85715107870610E-02_DP,&
 3.85715107870610E-02_DP, 3.85715107870610E-02_DP,&
 3.85715107870610E-02_DP, 3.85715107870610E-02_DP,&
 1.44363081135340E-02_DP, 1.44363081135340E-02_DP,&
 1.44363081135340E-02_DP, 1.44363081135340E-02_DP,&
 1.44363081135340E-02_DP, 1.44363081135340E-02_DP,&
 5.01022883850100E-03_DP, 5.01022883850100E-03_DP,&
 5.01022883850100E-03_DP, 5.01022883850100E-03_DP,&
 5.01022883850100E-03_DP, 5.01022883850100E-03_DP / 
DATA  PT_42  /                                    &
 2.20721792756430E-02_DP, 4.88963910362179E-01_DP,&
 4.88963910362179E-01_DP, 4.88963910362179E-01_DP,&
 2.20721792756430E-02_DP, 4.88963910362179E-01_DP,&
 4.88963910362179E-01_DP, 4.88963910362179E-01_DP,&
 2.20721792756430E-02_DP, 1.64710561319092E-01_DP,&
 4.17644719340454E-01_DP, 4.17644719340454E-01_DP,&
 4.17644719340454E-01_DP, 1.64710561319092E-01_DP,&
 4.17644719340454E-01_DP, 4.17644719340454E-01_DP,&
 4.17644719340454E-01_DP, 1.64710561319092E-01_DP,&
 4.53044943382323E-01_DP, 2.73477528308839E-01_DP,&
 2.73477528308839E-01_DP, 2.73477528308839E-01_DP,&
 4.53044943382323E-01_DP, 2.73477528308839E-01_DP,&
 2.73477528308839E-01_DP, 2.73477528308839E-01_DP,&
 4.53044943382323E-01_DP, 6.45588935174913E-01_DP,&
 1.77205532412543E-01_DP, 1.77205532412543E-01_DP,&
 1.77205532412543E-01_DP, 6.45588935174913E-01_DP,&
 1.77205532412543E-01_DP, 1.77205532412543E-01_DP,&
 1.77205532412543E-01_DP, 6.45588935174913E-01_DP,&
 8.76400233818255E-01_DP, 6.17998830908730E-02_DP,&
 6.17998830908730E-02_DP, 6.17998830908730E-02_DP,&
 8.76400233818255E-01_DP, 6.17998830908730E-02_DP,&
 6.17998830908730E-02_DP, 6.17998830908730E-02_DP,&
 8.76400233818255E-01_DP, 9.61218077502598E-01_DP,&
 1.93909612487010E-02_DP, 1.93909612487010E-02_DP,&
 1.93909612487010E-02_DP, 9.61218077502598E-01_DP,&
 1.93909612487010E-02_DP, 1.93909612487010E-02_DP,&
 1.93909612487010E-02_DP, 9.61218077502598E-01_DP,&
 5.71247574036480E-02_DP, 1.72266687821356E-01_DP,&
 7.70608554774996E-01_DP, 7.70608554774996E-01_DP,&
 5.71247574036480E-02_DP, 1.72266687821356E-01_DP,&
 1.72266687821356E-01_DP, 7.70608554774996E-01_DP,&
 5.71247574036480E-02_DP, 5.71247574036480E-02_DP,&
 7.70608554774996E-01_DP, 1.72266687821356E-01_DP,&
 7.70608554774996E-01_DP, 1.72266687821356E-01_DP,&
 5.71247574036480E-02_DP, 1.72266687821356E-01_DP,&
 5.71247574036480E-02_DP, 7.70608554774996E-01_DP,&
 9.29162493569720E-02_DP, 3.36861459796345E-01_DP,&
 5.70222290846683E-01_DP, 5.70222290846683E-01_DP,&
 9.29162493569720E-02_DP, 3.36861459796345E-01_DP,&
 3.36861459796345E-01_DP, 5.70222290846683E-01_DP,&
 9.29162493569720E-02_DP, 9.29162493569720E-02_DP,&
 5.70222290846683E-01_DP, 3.36861459796345E-01_DP,&
 5.70222290846683E-01_DP, 3.36861459796345E-01_DP,&
 9.29162493569720E-02_DP, 3.36861459796345E-01_DP,&
 9.29162493569720E-02_DP, 5.70222290846683E-01_DP,&
 1.46469500556540E-02_DP, 2.98372882136258E-01_DP,&
 6.86980167808088E-01_DP, 6.86980167808088E-01_DP,&
 1.46469500556540E-02_DP, 2.98372882136258E-01_DP,&
 2.98372882136258E-01_DP, 6.86980167808088E-01_DP,&
 1.46469500556540E-02_DP, 1.46469500556540E-02_DP,&
 6.86980167808088E-01_DP, 2.98372882136258E-01_DP,&
 6.86980167808088E-01_DP, 2.98372882136258E-01_DP,&
 1.46469500556540E-02_DP, 2.98372882136258E-01_DP,&
 1.46469500556540E-02_DP, 6.86980167808088E-01_DP,&
 1.26833093287200E-03_DP, 1.18974497696957E-01_DP,&
 8.79757171370171E-01_DP, 8.79757171370171E-01_DP,&
 1.26833093287200E-03_DP, 1.18974497696957E-01_DP,&
 1.18974497696957E-01_DP, 8.79757171370171E-01_DP,&
 1.26833093287200E-03_DP, 1.26833093287200E-03_DP,&
 8.79757171370171E-01_DP, 1.18974497696957E-01_DP,&
 8.79757171370171E-01_DP, 1.18974497696957E-01_DP,&
 1.26833093287200E-03_DP, 1.18974497696957E-01_DP,&
 1.26833093287200E-03_DP, 8.79757171370171E-01_DP / 
DATA  WT_48  /                                    &
 1.91687564284900E-03_DP, 1.91687564284900E-03_DP,&
 1.91687564284900E-03_DP, 4.42490272711450E-02_DP,&
 4.42490272711450E-02_DP, 4.42490272711450E-02_DP,&
 5.11865487188520E-02_DP, 5.11865487188520E-02_DP,&
 5.11865487188520E-02_DP, 2.36877358706880E-02_DP,&
 2.36877358706880E-02_DP, 2.36877358706880E-02_DP,&
 1.32897756900210E-02_DP, 1.32897756900210E-02_DP,&
 1.32897756900210E-02_DP, 4.74891660819200E-03_DP,&
 4.74891660819200E-03_DP, 4.74891660819200E-03_DP,&
 3.85500725995930E-02_DP, 3.85500725995930E-02_DP,&
 3.85500725995930E-02_DP, 3.85500725995930E-02_DP,&
 3.85500725995930E-02_DP, 3.85500725995930E-02_DP,&
 2.72158143206240E-02_DP, 2.72158143206240E-02_DP,&
 2.72158143206240E-02_DP, 2.72158143206240E-02_DP,&
 2.72158143206240E-02_DP, 2.72158143206240E-02_DP,&
 2.18207736679700E-03_DP, 2.18207736679700E-03_DP,&
 2.18207736679700E-03_DP, 2.18207736679700E-03_DP,&
 2.18207736679700E-03_DP, 2.18207736679700E-03_DP,&
 2.15053198477310E-02_DP, 2.15053198477310E-02_DP,&
 2.15053198477310E-02_DP, 2.15053198477310E-02_DP,&
 2.15053198477310E-02_DP, 2.15053198477310E-02_DP,&
 7.67394263104900E-03_DP, 7.67394263104900E-03_DP,&
 7.67394263104900E-03_DP, 7.67394263104900E-03_DP,&
 7.67394263104900E-03_DP, 7.67394263104900E-03_DP / 
DATA  PT_48  /                                    &
-1.39458337164860E-02_DP, 5.06972916858243E-01_DP,&
 5.06972916858243E-01_DP, 5.06972916858243E-01_DP,&
-1.39458337164860E-02_DP, 5.06972916858243E-01_DP,&
 5.06972916858243E-01_DP, 5.06972916858243E-01_DP,&
-1.39458337164860E-02_DP, 1.37187291433955E-01_DP,&
 4.31406354283023E-01_DP, 4.31406354283023E-01_DP,&
 4.31406354283023E-01_DP, 1.37187291433955E-01_DP,&
 4.31406354283023E-01_DP, 4.31406354283023E-01_DP,&
 4.31406354283023E-01_DP, 1.37187291433955E-01_DP,&
 4.44612710305711E-01_DP, 2.77693644847144E-01_DP,&
 2.77693644847144E-01_DP, 2.77693644847144E-01_DP,&
 4.44612710305711E-01_DP, 2.77693644847144E-01_DP,&
 2.77693644847144E-01_DP, 2.77693644847144E-01_DP,&
 4.44612710305711E-01_DP, 7.47070217917492E-01_DP,&
 1.26464891041254E-01_DP, 1.26464891041254E-01_DP,&
 1.26464891041254E-01_DP, 7.47070217917492E-01_DP,&
 1.26464891041254E-01_DP, 1.26464891041254E-01_DP,&
 1.26464891041254E-01_DP, 7.47070217917492E-01_DP,&
 8.58383228050628E-01_DP, 7.08083859746860E-02_DP,&
 7.08083859746860E-02_DP, 7.08083859746860E-02_DP,&
 8.58383228050628E-01_DP, 7.08083859746860E-02_DP,&
 7.08083859746860E-02_DP, 7.08083859746860E-02_DP,&
 8.58383228050628E-01_DP, 9.62069659517853E-01_DP,&
 1.89651702410730E-02_DP, 1.89651702410730E-02_DP,&
 1.89651702410730E-02_DP, 9.62069659517853E-01_DP,&
 1.89651702410730E-02_DP, 1.89651702410730E-02_DP,&
 1.89651702410730E-02_DP, 9.62069659517853E-01_DP,&
 1.33734161966621E-01_DP, 2.61311371140087E-01_DP,&
 6.04954466893291E-01_DP, 6.04954466893291E-01_DP,&
 1.33734161966621E-01_DP, 2.61311371140087E-01_DP,&
 2.61311371140087E-01_DP, 6.04954466893291E-01_DP,&
 1.33734161966621E-01_DP, 1.33734161966621E-01_DP,&
 6.04954466893291E-01_DP, 2.61311371140087E-01_DP,&
 6.04954466893291E-01_DP, 2.61311371140087E-01_DP,&
 1.33734161966621E-01_DP, 2.61311371140087E-01_DP,&
 1.33734161966621E-01_DP, 6.04954466893291E-01_DP,&
 3.63666773969170E-02_DP, 3.88046767090269E-01_DP,&
 5.75586555512814E-01_DP, 5.75586555512814E-01_DP,&
 3.63666773969170E-02_DP, 3.88046767090269E-01_DP,&
 3.88046767090269E-01_DP, 5.75586555512814E-01_DP,&
 3.63666773969170E-02_DP, 3.63666773969170E-02_DP,&
 5.75586555512814E-01_DP, 3.88046767090269E-01_DP,&
 5.75586555512814E-01_DP, 3.88046767090269E-01_DP,&
 3.63666773969170E-02_DP, 3.88046767090269E-01_DP,&
 3.63666773969170E-02_DP, 5.75586555512814E-01_DP,&
-1.01748831265710E-02_DP, 2.85712220049916E-01_DP,&
 7.24462663076655E-01_DP, 7.24462663076655E-01_DP,&
-1.01748831265710E-02_DP, 2.85712220049916E-01_DP,&
 2.85712220049916E-01_DP, 7.24462663076655E-01_DP,&
-1.01748831265710E-02_DP,-1.01748831265710E-02_DP,&
 7.24462663076655E-01_DP, 2.85712220049916E-01_DP,&
 7.24462663076655E-01_DP, 2.85712220049916E-01_DP,&
-1.01748831265710E-02_DP, 2.85712220049916E-01_DP,&
-1.01748831265710E-02_DP, 7.24462663076655E-01_DP,&
 3.68438698758780E-02_DP, 2.15599664072284E-01_DP,&
 7.47556466051838E-01_DP, 7.47556466051838E-01_DP,&
 3.68438698758780E-02_DP, 2.15599664072284E-01_DP,&
 2.15599664072284E-01_DP, 7.47556466051838E-01_DP,&
 3.68438698758780E-02_DP, 3.68438698758780E-02_DP,&
 7.47556466051838E-01_DP, 2.15599664072284E-01_DP,&
 7.47556466051838E-01_DP, 2.15599664072284E-01_DP,&
 3.68438698758780E-02_DP, 2.15599664072284E-01_DP,&
 3.68438698758780E-02_DP, 7.47556466051838E-01_DP,&
 1.24598093311990E-02_DP, 1.03575616576386E-01_DP,&
 8.83964574092416E-01_DP, 8.83964574092416E-01_DP,&
 1.24598093311990E-02_DP, 1.03575616576386E-01_DP,&
 1.03575616576386E-01_DP, 8.83964574092416E-01_DP,&
 1.24598093311990E-02_DP, 1.24598093311990E-02_DP,&
 8.83964574092416E-01_DP, 1.03575616576386E-01_DP,&
 8.83964574092416E-01_DP, 1.03575616576386E-01_DP,&
 1.24598093311990E-02_DP, 1.03575616576386E-01_DP,&
 1.24598093311990E-02_DP, 8.83964574092416E-01_DP / 
DATA  WT_52  /                                    &
 4.68756974276420E-02_DP, 6.40587857858500E-03_DP,&
 6.40587857858500E-03_DP, 6.40587857858500E-03_DP,&
 4.17102967393870E-02_DP, 4.17102967393870E-02_DP,&
 4.17102967393870E-02_DP, 2.68914842500640E-02_DP,&
 2.68914842500640E-02_DP, 2.68914842500640E-02_DP,&
 4.21325227616500E-02_DP, 4.21325227616500E-02_DP,&
 4.21325227616500E-02_DP, 3.00002668427730E-02_DP,&
 3.00002668427730E-02_DP, 3.00002668427730E-02_DP,&
 1.42000989250240E-02_DP, 1.42000989250240E-02_DP,&
 1.42000989250240E-02_DP, 3.58246235127300E-03_DP,&
 3.58246235127300E-03_DP, 3.58246235127300E-03_DP,&
 3.27731474606270E-02_DP, 3.27731474606270E-02_DP,&
 3.27731474606270E-02_DP, 3.27731474606270E-02_DP,&
 3.27731474606270E-02_DP, 3.27731474606270E-02_DP,&
 1.52983062484410E-02_DP, 1.52983062484410E-02_DP,&
 1.52983062484410E-02_DP, 1.52983062484410E-02_DP,&
 1.52983062484410E-02_DP, 1.52983062484410E-02_DP,&
 2.38624419283900E-03_DP, 2.38624419283900E-03_DP,&
 2.38624419283900E-03_DP, 2.38624419283900E-03_DP,&
 2.38624419283900E-03_DP, 2.38624419283900E-03_DP,&
 1.90847927558990E-02_DP, 1.90847927558990E-02_DP,&
 1.90847927558990E-02_DP, 1.90847927558990E-02_DP,&
 1.90847927558990E-02_DP, 1.90847927558990E-02_DP,&
 6.85005454654200E-03_DP, 6.85005454654200E-03_DP,&
 6.85005454654200E-03_DP, 6.85005454654200E-03_DP,&
 6.85005454654200E-03_DP, 6.85005454654200E-03_DP / 
DATA  PT_52  /                                    &
 3.33333333333333E-01_DP, 3.33333333333333E-01_DP,&
 3.33333333333333E-01_DP, 5.23891610312300E-03_DP,&
 4.97380541948438E-01_DP, 4.97380541948438E-01_DP,&
 4.97380541948438E-01_DP, 5.23891610312300E-03_DP,&
 4.97380541948438E-01_DP, 4.97380541948438E-01_DP,&
 4.97380541948438E-01_DP, 5.23891610312300E-03_DP,&
 1.73061122901295E-01_DP, 4.13469438549352E-01_DP,&
 4.13469438549352E-01_DP, 4.13469438549352E-01_DP,&
 1.73061122901295E-01_DP, 4.13469438549352E-01_DP,&
 4.13469438549352E-01_DP, 4.13469438549352E-01_DP,&
 1.73061122901295E-01_DP, 5.90828018660170E-02_DP,&
 4.70458599066991E-01_DP, 4.70458599066991E-01_DP,&
 4.70458599066991E-01_DP, 5.90828018660170E-02_DP,&
 4.70458599066991E-01_DP, 4.70458599066991E-01_DP,&
 4.70458599066991E-01_DP, 5.90828018660170E-02_DP,&
 5.18892500060958E-01_DP, 2.40553749969521E-01_DP,&
 2.40553749969521E-01_DP, 2.40553749969521E-01_DP,&
 5.18892500060958E-01_DP, 2.40553749969521E-01_DP,&
 2.40553749969521E-01_DP, 2.40553749969521E-01_DP,&
 5.18892500060958E-01_DP, 7.04068411554854E-01_DP,&
 1.47965794222573E-01_DP, 1.47965794222573E-01_DP,&
 1.47965794222573E-01_DP, 7.04068411554854E-01_DP,&
 1.47965794222573E-01_DP, 1.47965794222573E-01_DP,&
 1.47965794222573E-01_DP, 7.04068411554854E-01_DP,&
 8.49069624685052E-01_DP, 7.54651876574740E-02_DP,&
 7.54651876574740E-02_DP, 7.54651876574740E-02_DP,&
 8.49069624685052E-01_DP, 7.54651876574740E-02_DP,&
 7.54651876574740E-02_DP, 7.54651876574740E-02_DP,&
 8.49069624685052E-01_DP, 9.66807194753950E-01_DP,&
 1.65964026230250E-02_DP, 1.65964026230250E-02_DP,&
 1.65964026230250E-02_DP, 9.66807194753950E-01_DP,&
 1.65964026230250E-02_DP, 1.65964026230250E-02_DP,&
 1.65964026230250E-02_DP, 9.66807194753950E-01_DP,&
 1.03575692245252E-01_DP, 2.96555596579887E-01_DP,&
 5.99868711174861E-01_DP, 5.99868711174861E-01_DP,&
 1.03575692245252E-01_DP, 2.96555596579887E-01_DP,&
 2.96555596579887E-01_DP, 5.99868711174861E-01_DP,&
 1.03575692245252E-01_DP, 1.03575692245252E-01_DP,&
 5.99868711174861E-01_DP, 2.96555596579887E-01_DP,&
 5.99868711174861E-01_DP, 2.96555596579887E-01_DP,&
 1.03575692245252E-01_DP, 2.96555596579887E-01_DP,&
 1.03575692245252E-01_DP, 5.99868711174861E-01_DP,&
 2.00834116554160E-02_DP, 3.37723063403079E-01_DP,&
 6.42193524941505E-01_DP, 6.42193524941505E-01_DP,&
 2.00834116554160E-02_DP, 3.37723063403079E-01_DP,&
 3.37723063403079E-01_DP, 6.42193524941505E-01_DP,&
 2.00834116554160E-02_DP, 2.00834116554160E-02_DP,&
 6.42193524941505E-01_DP, 3.37723063403079E-01_DP,&
 6.42193524941505E-01_DP, 3.37723063403079E-01_DP,&
 2.00834116554160E-02_DP, 3.37723063403079E-01_DP,&
 2.00834116554160E-02_DP, 6.42193524941505E-01_DP,&
-4.34100261413900E-03_DP, 2.04748281642812E-01_DP,&
 7.99592720971327E-01_DP, 7.99592720971327E-01_DP,&
-4.34100261413900E-03_DP, 2.04748281642812E-01_DP,&
 2.04748281642812E-01_DP, 7.99592720971327E-01_DP,&
-4.34100261413900E-03_DP,-4.34100261413900E-03_DP,&
 7.99592720971327E-01_DP, 2.04748281642812E-01_DP,&
 7.99592720971327E-01_DP, 2.04748281642812E-01_DP,&
-4.34100261413900E-03_DP, 2.04748281642812E-01_DP,&
-4.34100261413900E-03_DP, 7.99592720971327E-01_DP,&
 4.19417864680100E-02_DP, 1.89358492130623E-01_DP,&
 7.68699721401368E-01_DP, 7.68699721401368E-01_DP,&
 4.19417864680100E-02_DP, 1.89358492130623E-01_DP,&
 1.89358492130623E-01_DP, 7.68699721401368E-01_DP,&
 4.19417864680100E-02_DP, 4.19417864680100E-02_DP,&
 7.68699721401368E-01_DP, 1.89358492130623E-01_DP,&
 7.68699721401368E-01_DP, 1.89358492130623E-01_DP,&
 4.19417864680100E-02_DP, 1.89358492130623E-01_DP,&
 4.19417864680100E-02_DP, 7.68699721401368E-01_DP,&
 1.43173202306810E-02_DP, 8.52836156826570E-02_DP,&
 9.00399064086661E-01_DP, 9.00399064086661E-01_DP,&
 1.43173202306810E-02_DP, 8.52836156826570E-02_DP,&
 8.52836156826570E-02_DP, 9.00399064086661E-01_DP,&
 1.43173202306810E-02_DP, 1.43173202306810E-02_DP,&
 9.00399064086661E-01_DP, 8.52836156826570E-02_DP,&
 9.00399064086661E-01_DP, 8.52836156826570E-02_DP,&
 1.43173202306810E-02_DP, 8.52836156826570E-02_DP,&
 1.43173202306810E-02_DP, 9.00399064086661E-01_DP / 
DATA  WT_61  /                                    &
 3.34371992908030E-02_DP, 5.09341544050700E-03_DP,&
 5.09341544050700E-03_DP, 5.09341544050700E-03_DP,&
 1.46708645276380E-02_DP, 1.46708645276380E-02_DP,&
 1.46708645276380E-02_DP, 2.43508783536720E-02_DP,&
 2.43508783536720E-02_DP, 2.43508783536720E-02_DP,&
 3.11075508689690E-02_DP, 3.11075508689690E-02_DP,&
 3.11075508689690E-02_DP, 3.12571112186200E-02_DP,&
 3.12571112186200E-02_DP, 3.12571112186200E-02_DP,&
 2.48156543396650E-02_DP, 2.48156543396650E-02_DP,&
 2.48156543396650E-02_DP, 1.40560730705570E-02_DP,&
 1.40560730705570E-02_DP, 1.40560730705570E-02_DP,&
 3.19467617377900E-03_DP, 3.19467617377900E-03_DP,&
 3.19467617377900E-03_DP, 8.11965531899300E-03_DP,&
 8.11965531899300E-03_DP, 8.11965531899300E-03_DP,&
 8.11965531899300E-03_DP, 8.11965531899300E-03_DP,&
 8.11965531899300E-03_DP, 2.68057422831630E-02_DP,&
 2.68057422831630E-02_DP, 2.68057422831630E-02_DP,&
 2.68057422831630E-02_DP, 2.68057422831630E-02_DP,&
 2.68057422831630E-02_DP, 1.84599932108220E-02_DP,&
 1.84599932108220E-02_DP, 1.84599932108220E-02_DP,&
 1.84599932108220E-02_DP, 1.84599932108220E-02_DP,&
 1.84599932108220E-02_DP, 8.47686853432800E-03_DP,&
 8.47686853432800E-03_DP, 8.47686853432800E-03_DP,&
 8.47686853432800E-03_DP, 8.47686853432800E-03_DP,&
 8.47686853432800E-03_DP, 1.82927967700250E-02_DP,&
 1.82927967700250E-02_DP, 1.82927967700250E-02_DP,&
 1.82927967700250E-02_DP, 1.82927967700250E-02_DP,&
 1.82927967700250E-02_DP, 6.66563200416500E-03_DP,&
 6.66563200416500E-03_DP, 6.66563200416500E-03_DP,&
 6.66563200416500E-03_DP, 6.66563200416500E-03_DP,&
 6.66563200416500E-03_DP / 
DATA  PT_61  /                                    &
 3.33333333333333E-01_DP, 3.33333333333333E-01_DP,&
 3.33333333333333E-01_DP, 5.65891888645200E-03_DP,&
 4.97170540556774E-01_DP, 4.97170540556774E-01_DP,&
 4.97170540556774E-01_DP, 5.65891888645200E-03_DP,&
 4.97170540556774E-01_DP, 4.97170540556774E-01_DP,&
 4.97170540556774E-01_DP, 5.65891888645200E-03_DP,&
 3.56473547507510E-02_DP, 4.82176322624625E-01_DP,&
 4.82176322624625E-01_DP, 4.82176322624625E-01_DP,&
 3.56473547507510E-02_DP, 4.82176322624625E-01_DP,&
 4.82176322624625E-01_DP, 4.82176322624625E-01_DP,&
 3.56473547507510E-02_DP, 9.95200619584370E-02_DP,&
 4.50239969020782E-01_DP, 4.50239969020782E-01_DP,&
 4.50239969020782E-01_DP, 9.95200619584370E-02_DP,&
 4.50239969020782E-01_DP, 4.50239969020782E-01_DP,&
 4.50239969020782E-01_DP, 9.95200619584370E-02_DP,&
 1.99467521245206E-01_DP, 4.00266239377397E-01_DP,&
 4.00266239377397E-01_DP, 4.00266239377397E-01_DP,&
 1.99467521245206E-01_DP, 4.00266239377397E-01_DP,&
 4.00266239377397E-01_DP, 4.00266239377397E-01_DP,&
 1.99467521245206E-01_DP, 4.95717464058095E-01_DP,&
 2.52141267970953E-01_DP, 2.52141267970953E-01_DP,&
 2.52141267970953E-01_DP, 4.95717464058095E-01_DP,&
 2.52141267970953E-01_DP, 2.52141267970953E-01_DP,&
 2.52141267970953E-01_DP, 4.95717464058095E-01_DP,&
 6.75905990683077E-01_DP, 1.62047004658461E-01_DP,&
 1.62047004658461E-01_DP, 1.62047004658461E-01_DP,&
 6.75905990683077E-01_DP, 1.62047004658461E-01_DP,&
 1.62047004658461E-01_DP, 1.62047004658461E-01_DP,&
 6.75905990683077E-01_DP, 8.48248235478508E-01_DP,&
 7.58758822607460E-02_DP, 7.58758822607460E-02_DP,&
 7.58758822607460E-02_DP, 8.48248235478508E-01_DP,&
 7.58758822607460E-02_DP, 7.58758822607460E-02_DP,&
 7.58758822607460E-02_DP, 8.48248235478508E-01_DP,&
 9.68690546064356E-01_DP, 1.56547269678220E-02_DP,&
 1.56547269678220E-02_DP, 1.56547269678220E-02_DP,&
 9.68690546064356E-01_DP, 1.56547269678220E-02_DP,&
 1.56547269678220E-02_DP, 1.56547269678220E-02_DP,&
 9.68690546064356E-01_DP, 1.01869288269190E-02_DP,&
 3.34319867363658E-01_DP, 6.55493203809423E-01_DP,&
 6.55493203809423E-01_DP, 1.01869288269190E-02_DP,&
 3.34319867363658E-01_DP, 3.34319867363658E-01_DP,&
 6.55493203809423E-01_DP, 1.01869288269190E-02_DP,&
 1.01869288269190E-02_DP, 6.55493203809423E-01_DP,&
 3.34319867363658E-01_DP, 6.55493203809423E-01_DP,&
 3.34319867363658E-01_DP, 1.01869288269190E-02_DP,&
 3.34319867363658E-01_DP, 1.01869288269190E-02_DP,&
 6.55493203809423E-01_DP, 1.35440871671036E-01_DP,&
 2.92221537796944E-01_DP, 5.72337590532020E-01_DP,&
 5.72337590532020E-01_DP, 1.35440871671036E-01_DP,&
 2.92221537796944E-01_DP, 2.92221537796944E-01_DP,&
 5.72337590532020E-01_DP, 1.35440871671036E-01_DP,&
 1.35440871671036E-01_DP, 5.72337590532020E-01_DP,&
 2.92221537796944E-01_DP, 5.72337590532020E-01_DP,&
 2.92221537796944E-01_DP, 1.35440871671036E-01_DP,&
 2.92221537796944E-01_DP, 1.35440871671036E-01_DP,&
 5.72337590532020E-01_DP, 5.44239242905830E-02_DP,&
 3.19574885423190E-01_DP, 6.26001190286228E-01_DP,&
 6.26001190286228E-01_DP, 5.44239242905830E-02_DP,&
 3.19574885423190E-01_DP, 3.19574885423190E-01_DP,&
 6.26001190286228E-01_DP, 5.44239242905830E-02_DP,&
 5.44239242905830E-02_DP, 6.26001190286228E-01_DP,&
 3.19574885423190E-01_DP, 6.26001190286228E-01_DP,&
 3.19574885423190E-01_DP, 5.44239242905830E-02_DP,&
 3.19574885423190E-01_DP, 5.44239242905830E-02_DP,&
 6.26001190286228E-01_DP, 1.28685608336370E-02_DP,&
 1.90704224192292E-01_DP, 7.96427214974071E-01_DP,&
 7.96427214974071E-01_DP, 1.28685608336370E-02_DP,&
 1.90704224192292E-01_DP, 1.90704224192292E-01_DP,&
 7.96427214974071E-01_DP, 1.28685608336370E-02_DP,&
 1.28685608336370E-02_DP, 7.96427214974071E-01_DP,&
 1.90704224192292E-01_DP, 7.96427214974071E-01_DP,&
 1.90704224192292E-01_DP, 1.28685608336370E-02_DP,&
 1.90704224192292E-01_DP, 1.28685608336370E-02_DP,&
 7.96427214974071E-01_DP, 6.71657824135240E-02_DP,&
 1.80483211648746E-01_DP, 7.52351005937729E-01_DP,&
 7.52351005937729E-01_DP, 6.71657824135240E-02_DP,&
 1.80483211648746E-01_DP, 1.80483211648746E-01_DP,&
 7.52351005937729E-01_DP, 6.71657824135240E-02_DP,&
 6.71657824135240E-02_DP, 7.52351005937729E-01_DP,&
 1.80483211648746E-01_DP, 7.52351005937729E-01_DP,&
 1.80483211648746E-01_DP, 6.71657824135240E-02_DP,&
 1.80483211648746E-01_DP, 6.71657824135240E-02_DP,&
 7.52351005937729E-01_DP, 1.46631822248280E-02_DP,&
 8.07113136795640E-02_DP, 9.04625504095608E-01_DP,&
 9.04625504095608E-01_DP, 1.46631822248280E-02_DP,&
 8.07113136795640E-02_DP, 8.07113136795640E-02_DP,&
 9.04625504095608E-01_DP, 1.46631822248280E-02_DP,&
 1.46631822248280E-02_DP, 9.04625504095608E-01_DP,&
 8.07113136795640E-02_DP, 9.04625504095608E-01_DP,&
 8.07113136795640E-02_DP, 1.46631822248280E-02_DP,&
 8.07113136795640E-02_DP, 1.46631822248280E-02_DP,&
 9.04625504095608E-01_DP / 

 SELECT CASE (M_QP)
   CASE ( 1) ; WT = WT_1  ; PT = PT_1
   CASE ( 3) ; WT = WT_3  ; PT = PT_3
   CASE ( 4) ; WT = WT_4  ; PT = PT_4
   CASE ( 6) ; WT = WT_6  ; PT = PT_6
   CASE ( 7) ; WT = WT_7  ; PT = PT_7
   CASE (12) ; WT = WT_12 ; PT = PT_12
   CASE (13) ; WT = WT_13 ; PT = PT_13
   CASE (16) ; WT = WT_16 ; PT = PT_16
   CASE (19) ; WT = WT_19 ; PT = PT_19
   CASE (25) ; WT = WT_25 ; PT = PT_25
   CASE (27) ; WT = WT_27 ; PT = PT_27
   CASE (33) ; WT = WT_33 ; PT = PT_33
   CASE (37) ; WT = WT_37 ; PT = PT_37
   CASE (42) ; WT = WT_42 ; PT = PT_42
   CASE (48) ; WT = WT_48 ; PT = PT_48
   CASE (52) ; WT = WT_52 ; PT = PT_52
   CASE (61) ; WT = WT_61 ; PT = PT_61
   CASE DEFAULT
     PRINT *,'WARNING: DUNAVANT_AREA_TRIANGLE_RULE, INVALID RULE', M_QP
     PRINT *,'CHECK IF shape 2 IS INCORRECT IN KEYWORD CONTROL'
     !b N_WARN = N_WARN + 1
     STOP 'INVALID RULE DUNAVANT_AREA_TRIANGLE_RULE'
 END SELECT
END SUBROUTINE DUNAVANT_AREA_TRIANGLE_RULE 
