C
C     **************************************************
C     **                                              **
C     **          受給者の件数，年金額の集計          **
C     **      (年金種別(I),年齢(X),繰上年数(XX))      **
C     **                                              **
C     **************************************************
C
C
      SUBROUTINE   SHKEJUK(I,X,XX)
C
C
      IMPLICIT INTEGER (A-Z)
      INCLUDE 'seps.inc'
      INCLUDE 'shke.inc'
C
      COMMON /K/ K
      COMMON /S/ S,S2
C
      REAL*8 TMX,TMY,TMY2,TMZ
      REAL*8 AB,ABA,ABB,KK
      REAL*8 TMP(0:24)
C
      DO 1000 JJ=1,2
C
        IF(PAHOSEI1.EQ.0 .OR. S.LE.3 .OR.
     &     (I.GE.5 .AND. I.LE.10) .OR. I.GE.12) THEN
          IF(JJ.EQ.1) TMP(0)=T4K(X,XX,I)
          IF(JJ.EQ.2) TMP(0)=T4(X,XX,I)
          DO 2000 J=1,23
            IF(JJ.EQ.1) TMP(J)=T6K(X,XX,I,J)
            IF(JJ.EQ.2) TMP(J)=T6(X,XX,I,J)
 2000     CONTINUE
          IF(JJ.EQ.1) TMP(24)=T6DK(X,XX,I)
          IF(JJ.EQ.2) TMP(24)=T6D(X,XX,I)
        ELSE IF(PAHOSEI1.EQ.1 .AND. S.GE.4 .AND.
     &          (I.EQ.1 .OR. I.EQ.2)           ) THEN
          IF(JJ.EQ.1) TMP(0)=T4K(X,XX,I)*PARRATER(S2)
     &                        +T4K(X,XX,I+2)
     &                         *(1.0D0-PARRATER(S2))*PARRATET(S2)
          IF(JJ.EQ.2) TMP(0)=T4(X,XX,I)*PARRATER(S2)
     &                        +T4(X,XX,I+2)
     &                         *(1.0D0-PARRATER(S2))*PARRATET(S2)
          DO 2010 J=1,23
            IF(JJ.EQ.1) TMP(J)=T6K(X,XX,I,J)
     &                          +T6K(X,XX,I+2,J)
     &                           *(1.0D0-PARRATER(S2))*PARRATET(S2)
            IF(JJ.EQ.2) TMP(J)=T6(X,XX,I,J)
     &                          +T6(X,XX,I+2,J)
     &                           *(1.0D0-PARRATER(S2))*PARRATET(S2)
 2010     CONTINUE
          IF(JJ.EQ.1) TMP(24)=T6DK(X,XX,I)
     &                         +T6DK(X,XX,I+2)
     &                          *(1.0D0-PARRATER(S2))*PARRATET(S2)
          IF(JJ.EQ.2) TMP(24)=T6D(X,XX,I)
     &                         +T6D(X,XX,I+2)
     &                          *(1.0D0-PARRATER(S2))*PARRATET(S2)
        ELSE IF(PAHOSEI1.EQ.1 .AND. S.GE.4 .AND.
     &          (I.EQ.3 .OR. I.EQ.4)           ) THEN
          IF(JJ.EQ.1) TMP(0)=T4K(X,XX,I)*PARRATER(S2)
     &                        -T4K(X,XX,I)
     &                         *(1.0D0-PARRATER(S2))*PARRATET(S2)
          IF(JJ.EQ.2) TMP(0)=T4(X,XX,I)*PARRATER(S2)
     &                        -T4(X,XX,I)
     &                         *(1.0D0-PARRATER(S2))*PARRATET(S2)
          DO 2020 J=1,23
            IF(JJ.EQ.1) TMP(J)=T6K(X,XX,I,J)
     &                          *(PARRATER(S2)
     &                           +(1.0D0-PARRATER(S2))
     &                            *(1.0D0-PARRATET(S2)))
            IF(JJ.EQ.2) TMP(J)=T6(X,XX,I,J)
     &                          *(PARRATER(S2)
     &                           +(1.0D0-PARRATER(S2))
     &                            *(1.0D0-PARRATET(S2)))
 2020     CONTINUE
          IF(JJ.EQ.1) TMP(24)=T6DK(X,XX,I)
     &                        *(PARRATER(S2)
     &                          +(1.0D0-PARRATER(S2))
     &                           *(1.0D0-PARRATET(S2)))
          IF(JJ.EQ.2) TMP(24)=T6D(X,XX,I)
     &                        *(PARRATER(S2)
     &                          +(1.0D0-PARRATER(S2))
     &                           *(1.0D0-PARRATET(S2)))
        ELSE IF(PAHOSEI1.EQ.1 .AND. S.EQ.4 .AND. I.EQ.11) THEN
          IF(JJ.EQ.1) TMP(0)=T4K(X,XX,I)*PARRATER(2)
          IF(JJ.EQ.2) TMP(0)=T4(X,XX,I) *PARRATER(2)
          DO 2030 J=1,23
            IF(JJ.EQ.1) TMP(J)=T6K(X,XX,I,J)
            IF(JJ.EQ.2) TMP(J)=T6(X,XX,I,J)
 2030     CONTINUE
          IF(JJ.EQ.1) TMP(24)=T6DK(X,XX,I)
          IF(JJ.EQ.2) TMP(24)=T6D(X,XX,I)
        ELSE IF(PAHOSEI1.EQ.1 .AND. S.EQ.5 .AND. I.EQ.11) THEN
          IF(JJ.EQ.1) TMP(0)=T4K(X,XX,I)*PARRATER(1)
          IF(JJ.EQ.2) TMP(0)=T4(X,XX,I) *PARRATER(1)
          DO 2040 J=1,23
            IF(JJ.EQ.1) TMP(J)=T6K(X,XX,I,J)
            IF(JJ.EQ.2) TMP(J)=T6(X,XX,I,J)
 2040     CONTINUE
          IF(JJ.EQ.1) TMP(24)=T6DK(X,XX,I)
          IF(JJ.EQ.2) TMP(24)=T6D(X,XX,I)
        ELSE
          WRITE(6,*) '想定外の組み合わせです PAHOSEI1,S,I'
          STOP
        END IF
C
        IF(JJ.EQ.1) ABA=HN2K(X,XX,I,1)
        IF(JJ.EQ.1) ABB=HN2K(X,XX,I,1)+HN2K(X,XX,I,2)
        IF(JJ.EQ.2) ABA=HN2(X,XX,I,1)
        IF(JJ.EQ.2) ABB=HN2(X,XX,I,1)+HN2(X,XX,I,2)
C
        IF(S.NE.3) THEN
          KK=EE(1)
        ELSE
          KK=EE(2)
        END IF
C
        IF((I.EQ.2 .OR. I.EQ.4 .OR. I.EQ.6 .OR. I.EQ.8).AND.
     &      X.LT.65) THEN
          KK=0.0D0
        END IF
C
        IF(ABB.GT.1.0D-6 .AND. ABA.GE.1.0D-6) THEN
          AB=ABA/ABB
        ELSE
          AB=0.0D0
        END IF
C
        IF(KONEN.EQ.1) THEN
          AB=AB*0.9342D0
        ELSE IF(PSEID.EQ.1) THEN
          AB=AB*0.8571D0
        ELSE IF(PSEID.EQ.4) THEN
          AB=AB*0.5373D3
        ELSE IF(PSEID.EQ.5) THEN
          AB=AB*0.8061D0
        END IF
C
C--------------------------------------------------------------------
C       集計
C--------------------------------------------------------------------
C       件数(受給権者数又は受給者数)
        D3(K,S2,I,0,JJ)=D3(K,S2,I,0,JJ)+TMP(0)
        IF(JJ.EQ.2) THEN
          D3X(K,X,S2,I,0)=D3X(K,X,S2,I,0)+TMP(0)
        ELSE
          D3XS(K,X,S2,I,0)=D3XS(K,X,S2,I,0)+TMP(0)
        END IF
C
        IF(NENBE65.EQ.1 .AND. X.GE.65) THEN
          D3(K,S2,I,34,JJ)=D3(K,S2,I,34,JJ)+TMP(0)
          IF(JJ.EQ.2) THEN
            D3X(K,X,S2,I,34)=D3X(K,X,S2,I,34)+TMP(0)
          ELSE
            D3XS(K,X,S2,I,34)=D3XS(K,X,S2,I,34)+TMP(0)
          END IF
        END IF
C
C       基礎年金
        D3(K,S2,I,19,JJ)=D3(K,S2,I,19,JJ)+TMP(14)
        IF(JJ.EQ.2) THEN
          D3X(K,X,S2,I,19)=D3X(K,X,S2,I,19)+TMP(14)
        ELSE
          D3XS(K,X,S2,I,19)=D3XS(K,X,S2,I,19)+TMP(14)
        END IF
C
C       基礎年金(加給)
        D3(K,S2,I,20,JJ)=D3(K,S2,I,20,JJ)+TMP(21)
        IF(JJ.EQ.2) THEN
          D3X(K,X,S2,I,20)=D3X(K,X,S2,I,20)+TMP(21)
        ELSE
          D3XS(K,X,S2,I,20)=D3XS(K,X,S2,I,20)+TMP(21)
        END IF
C
C       基礎年金(振替加算)
        D3(K,S2,I,21,JJ)=D3(K,S2,I,21,JJ)+TMP(6)
        IF(JJ.EQ.2) THEN
          D3X(K,X,S2,I,21)=D3X(K,X,S2,I,21)+TMP(6)
        ELSE
          D3XS(K,X,S2,I,21)=D3XS(K,X,S2,I,21)+TMP(6)
        END IF
C
C       みなし基礎(基本＋かさ上げの３／４)
        D3(K,S2,I,22,JJ)=D3(K,S2,I,22,JJ)
     &                    +TMP(15)+TMP(16)*3.0D0/4.0D0+TMP(17)
        IF(JJ.EQ.2) THEN
          D3X(K,X,S2,I,22)=D3X(K,X,S2,I,22)
     &                      +TMP(15)+TMP(16)*3.0D0/4.0D0+TMP(17)
        ELSE
          D3XS(K,X,S2,I,22)=D3XS(K,X,S2,I,22)
     &                      +TMP(15)+TMP(16)*3.0D0/4.0D0+TMP(17)
        END IF
C
        D3(K,S2,I,28,JJ)=D3(K,S2,I,28,JJ)+TMP(17)
        IF(JJ.EQ.2) THEN
          D3X(K,X,S2,I,28)=D3X(K,X,S2,I,28)+TMP(17)
        ELSE
          D3XS(K,X,S2,I,28)=D3XS(K,X,S2,I,28)+TMP(17)
        END IF
C
C       みなし基礎(加給)
        D3(K,S2,I,23,JJ)=D3(K,S2,I,23,JJ)+TMP(19)+TMP(20)
        IF(JJ.EQ.2) THEN
          D3X(K,X,S2,I,23)=D3X(K,X,S2,I,23)+TMP(19)+TMP(20)
        ELSE
          D3XS(K,X,S2,I,23)=D3XS(K,X,S2,I,23)+TMP(19)+TMP(20)
        END IF
C
C       みなし基礎(振替加算相当)
        D3(K,S2,I,24,JJ)=D3(K,S2,I,24,JJ)+TMP(18)
        IF(JJ.EQ.2) THEN
          D3X(K,X,S2,I,24)=D3X(K,X,S2,I,24)+TMP(18)
        ELSE
          D3XS(K,X,S2,I,24)=D3XS(K,X,S2,I,24)+TMP(18)
        END IF
C
C       かさ上げの１／４(独自国庫負担)
        D3(K,S2,I,25,JJ)=D3(K,S2,I,25,JJ)+TMP(16)/4.0D0
        IF(JJ.EQ.2) THEN
          D3X(K,X,S2,I,25)=D3X(K,X,S2,I,25)+TMP(16)/4.0D0
        ELSE
          D3XS(K,X,S2,I,25)=D3XS(K,X,S2,I,25)+TMP(16)/4.0D0
        END IF
C
C       代行相当給付
        IF(I.LE.8) THEN
          D3(K,S2,I,31,JJ)=D3(K,S2,I,31,JJ)+TMP(24)*(1-AB*KK) 
          D3(K,S2,I,32,JJ)=D3(K,S2,I,32,JJ)+TMP(24)*AB
          IF(JJ.EQ.2) THEN
            D3X(K,X,S2,I,31)=D3X(K,X,S2,I,31)+TMP(24)*(1-AB*KK)
            D3X(K,X,S2,I,32)=D3X(K,X,S2,I,32)+TMP(24)*AB
          ELSE
            D3XS(K,X,S2,I,31)=D3XS(K,X,S2,I,31)+TMP(24)*(1-AB*KK)
            D3XS(K,X,S2,I,32)=D3XS(K,X,S2,I,32)+TMP(24)*AB
          END IF
        END IF
C
C       報酬比例部分
        TMX=TMP(1)+TMP(10)
        TMY=0.0D0
        IF(I.EQ.11) TMY=TMP(18)
C       総給付額(比例)
        D3(K,S2,I,1,JJ)=D3(K,S2,I,1,JJ)+TMX
        IF(JJ.EQ.2) THEN
          D3X(K,X,S2,I,1)=D3X(K,X,S2,I,1)+TMX
        ELSE
          D3XS(K,X,S2,I,1)=D3XS(K,X,S2,I,1)+TMX
        END IF
C       独自給付(比例)
        D3(K,S2,I,7,JJ)=D3(K,S2,I,7,JJ)+TMX-TMY
        IF(JJ.EQ.2) THEN
          D3X(K,X,S2,I,7)=D3X(K,X,S2,I,7)+TMX-TMY
        ELSE
          D3XS(K,X,S2,I,7)=D3XS(K,X,S2,I,7)+TMX-TMY
        END IF
C
        IF(X.GE.65) THEN
          D3(K,S2,I,35,JJ)=D3(K,S2,I,35,JJ)+TMX-TMY
          IF(JJ.EQ.2) THEN
            D3X(K,X,S2,I,35)=D3X(K,X,S2,I,35)+TMX-TMY
          ELSE
            D3XS(K,X,S2,I,35)=D3XS(K,X,S2,I,35)+TMX-TMY
          END IF
        END IF
C
        IF(NENBE65.EQ.1 .AND. X.GE.65 .AND. X.LE.69) THEN
          D3(K,S2,I,47,JJ)=D3(K,S2,I,47,JJ)+TMX-TMY
          IF(JJ.EQ.2) THEN
            D3X(K,X,S2,I,47)=D3X(K,X,S2,I,47)+TMX-TMY
          ELSE
            D3XS(K,X,S2,I,47)=D3XS(K,X,S2,I,47)+TMX-TMY
          END IF
        END IF
C
        D3(K,S2,I,13,JJ)=D3(K,S2,I,13,JJ)+(TMX-TMY)*AB
        IF(JJ.EQ.2) THEN
          D3X(K,X,S2,I,13)=D3X(K,X,S2,I,13)+(TMX-TMY)*AB
        ELSE
          D3XS(K,X,S2,I,13)=D3XS(K,X,S2,I,13)+(TMX-TMY)*AB
        END IF
C
        IF(NENBE65.EQ.1 .AND. X.GE.65) THEN
          D3(K,S2,I,41,JJ)=D3(K,S2,I,41,JJ)+(TMX-TMY)*AB
          IF(JJ.EQ.2) THEN
            D3X(K,X,S2,I,41)=D3X(K,X,S2,I,41)+(TMX-TMY)*AB
          ELSE
            D3XS(K,X,S2,I,41)=D3XS(K,X,S2,I,41)+(TMX-TMY)*AB
          END IF
        END IF
C
        IF(NENBE65.EQ.1 .AND. X.GE.65 .AND. X.LE.69) THEN
          D3(K,S2,I,53,JJ)=D3(K,S2,I,53,JJ)+(TMX-TMY)*AB
          IF(JJ.EQ.2) THEN
            D3X(K,X,S2,I,53)=D3X(K,X,S2,I,53)+(TMX-TMY)*AB
          ELSE
            D3XS(K,X,S2,I,53)=D3XS(K,X,S2,I,53)+(TMX-TMY)*AB
          END IF
        END IF
C
        D3(K,S2,I,26,JJ)=D3(K,S2,I,26,JJ)+(TMX-TMY)*AB*KK
        IF(JJ.EQ.2) THEN
          D3X(K,X,S2,I,26)=D3X(K,X,S2,I,26)+(TMX-TMY)*AB*KK
        ELSE
          D3XS(K,X,S2,I,26)=D3XS(K,X,S2,I,26)+(TMX-TMY)*AB*KK
        END IF
C
C       定額給付部分
        TMX=TMP(2)+TMP(11)
        TMY=TMP(15)+TMP(16)*3.0D0/4.0D0+TMP(17)
        IF(I.NE.11) TMY=TMY+TMP(18)
        TMY2=TMP(17)
        IF(I.NE.11) TMY2=TMY2+TMP(18)
        TMZ=0.0D0
        IF(I.LE.4) TMZ=TMP(14)
C
        D3(K,S2,I,2,JJ)=D3(K,S2,I,2,JJ)+TMX
        IF(JJ.EQ.2) THEN
          D3X(K,X,S2,I,2)=D3X(K,X,S2,I,2)+TMX
        ELSE
          D3XS(K,X,S2,I,2)=D3XS(K,X,S2,I,2)+TMX
        END IF
C
        D3(K,S2,I,8,JJ)=D3(K,S2,I,8,JJ)+TMX-TMY
        IF(JJ.EQ.2) THEN
          D3X(K,X,S2,I,8)=D3X(K,X,S2,I,8)+TMX-TMY
        ELSE
          D3XS(K,X,S2,I,8)=D3XS(K,X,S2,I,8)+TMX-TMY
        END IF
C
        IF(NENBE65.EQ.1 .AND. X.GE.65) THEN
          D3(K,S2,I,36,JJ)=D3(K,S2,I,36,JJ)+TMX-TMY
          IF(JJ.EQ.2) THEN
            D3X(K,X,S2,I,36)=D3X(K,X,S2,I,36)+TMX-TMY
          ELSE
            D3XS(K,X,S2,I,36)=D3XS(K,X,S2,I,36)+TMX-TMY
          END IF
        END IF
C
        IF(NENBE65.EQ.1 .AND. X.GE.65 .AND. X.LE.69) THEN
          D3(K,S2,I,48,JJ)=D3(K,S2,I,48,JJ)+TMX-TMY
          IF(JJ.EQ.2) THEN
            D3X(K,X,S2,I,48)=D3X(K,X,S2,I,48)+TMX-TMY
          ELSE
            D3XS(K,X,S2,I,48)=D3XS(K,X,S2,I,48)+TMX-TMY
          END IF
        END IF
C
        D3(K,S2,I,14,JJ)=D3(K,S2,I,14,JJ)+(TMX-TMY2+TMZ)*AB
        IF(JJ.EQ.2) THEN
          D3X(K,X,S2,I,14)=D3X(K,X,S2,I,14)+(TMX-TMY2+TMZ)*AB
        ELSE
          D3XS(K,X,S2,I,14)=D3XS(K,X,S2,I,14)+(TMX-TMY2+TMZ)*AB
        END IF
C
        IF(NENBE65.EQ.1 .AND. X.GE.65) THEN
          D3(K,S2,I,42,JJ)=D3(K,S2,I,42,JJ)+(TMX-TMY2+TMZ)*AB
          IF(JJ.EQ.2) THEN
            D3X(K,X,S2,I,42)=D3X(K,X,S2,I,42)+(TMX-TMY2+TMZ)*AB
          ELSE
            D3XS(K,X,S2,I,42)=D3XS(K,X,S2,I,42)+(TMX-TMY2+TMZ)*AB
          END IF
        END IF
C
        IF(NENBE65.EQ.1 .AND. X.GE.65 .AND. X.LE.69) THEN
          D3(K,S2,I,54,JJ)=D3(K,S2,I,54,JJ)+(TMX-TMY2+TMZ)*AB
          IF(JJ.EQ.2) THEN
            D3X(K,X,S2,I,54)=D3X(K,X,S2,I,54)+(TMX-TMY2+TMZ)*AB
          ELSE
            D3XS(K,X,S2,I,54)=D3XS(K,X,S2,I,54)+(TMX-TMY2+TMZ)*AB
          END IF
        END IF
C
        D3(K,S2,I,27,JJ)=D3(K,S2,I,27,JJ)+(TMX-TMY2+TMZ)*AB*KK
        IF(JJ.EQ.2) THEN
          D3X(K,X,S2,I,27)=D3X(K,X,S2,I,27)+(TMX-TMY2+TMZ)*AB*KK
        ELSE
          D3XS(K,X,S2,I,27)=D3XS(K,X,S2,I,27)+(TMX-TMY2+TMZ)*AB*KK
        END IF
C
C       経過的加算部分
        TMX=TMP(3)
C
        D3(K,S2,I,3,JJ)=D3(K,S2,I,3,JJ)+TMX
        IF(JJ.EQ.2) THEN
          D3X(K,X,S2,I,3)=D3X(K,X,S2,I,3)+TMX
        ELSE
          D3XS(K,X,S2,I,3)=D3XS(K,X,S2,I,3)+TMX
        END IF
C
        D3(K,S2,I,9,JJ)=D3(K,S2,I,9,JJ)+TMX
        IF(JJ.EQ.2) THEN
          D3X(K,X,S2,I,9)=D3X(K,X,S2,I,9)+TMX
        ELSE
          D3XS(K,X,S2,I,9)=D3XS(K,X,S2,I,9)+TMX
        END IF
C
        IF(NENBE65.EQ.1 .AND. X.GE.65) THEN
          D3(K,S2,I,37,JJ)=D3(K,S2,I,37,JJ)+TMX
          IF(JJ.EQ.2) THEN
            D3X(K,X,S2,I,37)=D3X(K,X,S2,I,37)+TMX
          ELSE
            D3XS(K,X,S2,I,37)=D3XS(K,X,S2,I,37)+TMX
          END IF
        END IF
C
        IF(NENBE65.EQ.1 .AND. X.GE.65 .AND. X.LE.69) THEN
          D3(K,S2,I,49,JJ)=D3(K,S2,I,49,JJ)+TMX
          IF(JJ.EQ.2) THEN
            D3X(K,X,S2,I,49)=D3X(K,X,S2,I,49)+TMX
          ELSE
            D3XS(K,X,S2,I,49)=D3XS(K,X,S2,I,49)+TMX
          END IF
        END IF
C
        D3(K,S2,I,15,JJ)=D3(K,S2,I,15,JJ)+TMX*AB
        IF(JJ.EQ.2) THEN
          D3X(K,X,S2,I,15)=D3X(K,X,S2,I,15)+TMX*AB
        ELSE
          D3XS(K,X,S2,I,15)=D3XS(K,X,S2,I,15)+TMX*AB
        END IF
C
        IF(NENBE65.EQ.1 .AND. X.GE.65) THEN
          D3(K,S2,I,43,JJ)=D3(K,S2,I,43,JJ)+TMX*AB
          IF(JJ.EQ.2) THEN
            D3X(K,X,S2,I,43)=D3X(K,X,S2,I,43)+TMX*AB
          ELSE
            D3XS(K,X,S2,I,43)=D3XS(K,X,S2,I,43)+TMX*AB
          END IF
        END IF
C
        IF(NENBE65.EQ.1 .AND. X.GE.65 .AND. X.LE.69) THEN
          D3(K,S2,I,55,JJ)=D3(K,S2,I,55,JJ)+TMX*AB
          IF(JJ.EQ.2) THEN
            D3X(K,X,S2,I,55)=D3X(K,X,S2,I,55)+TMX*AB
          ELSE
            D3XS(K,X,S2,I,55)=D3XS(K,X,S2,I,55)+TMX*AB
          END IF
        END IF
C
        D3(K,S2,I,27,JJ)=D3(K,S2,I,27,JJ)+TMX*AB*KK
        IF(JJ.EQ.2) THEN
          D3X(K,X,S2,I,27)=D3X(K,X,S2,I,27)+TMX*AB*KK
        ELSE
          D3XS(K,X,S2,I,27)=D3XS(K,X,S2,I,27)+TMX*AB*KK
        END IF
C
C       加給給付部分
        TMX=TMP(4)+TMP(5)+TMP(23)
        TMY=TMP(19)+TMP(20)
C
        D3(K,S2,I,4,JJ)=D3(K,S2,I,4,JJ)+TMX
        IF(JJ.EQ.2) THEN
          D3X(K,X,S2,I,4)=D3X(K,X,S2,I,4)+TMX
        ELSE
          D3XS(K,X,S2,I,4)=D3XS(K,X,S2,I,4)+TMX
        END IF
C
        D3(K,S2,I,10,JJ)=D3(K,S2,I,10,JJ)+TMX-TMY
        IF(JJ.EQ.2) THEN
          D3X(K,X,S2,I,10)=D3X(K,X,S2,I,10)+TMX-TMY
        ELSE
          D3XS(K,X,S2,I,10)=D3XS(K,X,S2,I,10)+TMX-TMY
        END IF
C
        IF(NENBE65.EQ.1 .AND. X.GE.65) THEN
          D3(K,S2,I,38,JJ)=D3(K,S2,I,38,JJ)+TMX-TMY
          IF(JJ.EQ.2) THEN
            D3X(K,X,S2,I,38)=D3X(K,X,S2,I,38)+TMX-TMY
          ELSE
            D3XS(K,X,S2,I,38)=D3XS(K,X,S2,I,38)+TMX-TMY
          END IF
        END IF
C
        IF(NENBE65.EQ.1 .AND. X.GE.65 .AND. X.LE.69) THEN
          D3(K,S2,I,50,JJ)=D3(K,S2,I,50,JJ)+TMX-TMY
          IF(JJ.EQ.2) THEN
            D3X(K,X,S2,I,50)=D3X(K,X,S2,I,50)+TMX-TMY
          ELSE
            D3XS(K,X,S2,I,50)=D3XS(K,X,S2,I,50)+TMX-TMY
          END IF
        END IF
C
        D3(K,S2,I,16,JJ)=D3(K,S2,I,16,JJ)+(TMX-TMY)*AB
        IF(JJ.EQ.2) THEN
          D3X(K,X,S2,I,16)=D3X(K,X,S2,I,16)+(TMX-TMY)*AB
        ELSE
          D3XS(K,X,S2,I,16)=D3XS(K,X,S2,I,16)+(TMX-TMY)*AB
        END IF
C
        IF(NENBE65.EQ.1 .AND. X.GE.65) THEN
          D3(K,S2,I,44,JJ)=D3(K,S2,I,44,JJ)+(TMX-TMY)*AB
          IF(JJ.EQ.2) THEN
            D3X(K,X,S2,I,44)=D3X(K,X,S2,I,44)+(TMX-TMY)*AB
          ELSE
            D3XS(K,X,S2,I,44)=D3XS(K,X,S2,I,44)+(TMX-TMY)*AB
          END IF
        END IF
C
        IF(NENBE65.EQ.1 .AND. X.GE.65 .AND. X.LE.69) THEN
          D3(K,S2,I,56,JJ)=D3(K,S2,I,56,JJ)+(TMX-TMY)*AB
          IF(JJ.EQ.2) THEN
            D3X(K,X,S2,I,56)=D3X(K,X,S2,I,56)+(TMX-TMY)*AB
          ELSE
            D3XS(K,X,S2,I,56)=D3XS(K,X,S2,I,56)+(TMX-TMY)*AB
          END IF
        END IF
C
        D3(K,S2,I,27,JJ)=D3(K,S2,I,27,JJ)+(TMX-TMY)*AB*KK
        IF(JJ.EQ.2) THEN
          D3X(K,X,S2,I,27)=D3X(K,X,S2,I,27)+(TMX-TMY)*AB*KK
        ELSE
          D3XS(K,X,S2,I,27)=D3XS(K,X,S2,I,27)+(TMX-TMY)*AB*KK
        END IF
C
C       遺族加算部分
        TMX=TMP(7)+TMP(8)+TMP(9)
C
        D3(K,S2,I,5,JJ)=D3(K,S2,I,5,JJ)+TMX
        IF(JJ.EQ.2) THEN
          D3X(K,X,S2,I,5)=D3X(K,X,S2,I,5)+TMX
        ELSE
          D3XS(K,X,S2,I,5)=D3XS(K,X,S2,I,5)+TMX
        END IF
C
        D3(K,S2,I,11,JJ)=D3(K,S2,I,11,JJ)+TMX
        IF(JJ.EQ.2) THEN
          D3X(K,X,S2,I,11)=D3X(K,X,S2,I,11)+TMX
        ELSE
          D3XS(K,X,S2,I,11)=D3XS(K,X,S2,I,11)+TMX
        END IF
C
        IF(NENBE65.EQ.1 .AND. X.GE.65) THEN
          D3(K,S2,I,39,JJ)=D3(K,S2,I,39,JJ)+TMX
          IF(JJ.EQ.2) THEN
            D3X(K,X,S2,I,39)=D3X(K,X,S2,I,39)+TMX
          ELSE
            D3XS(K,X,S2,I,39)=D3XS(K,X,S2,I,39)+TMX
          END IF
        END IF
C
        IF(NENBE65.EQ.1 .AND. X.GE.65 .AND. X.LE.69) THEN
          D3(K,S2,I,51,JJ)=D3(K,S2,I,51,JJ)+TMX
          IF(JJ.EQ.2) THEN
            D3X(K,X,S2,I,51)=D3X(K,X,S2,I,51)+TMX
          ELSE
            D3XS(K,X,S2,I,51)=D3XS(K,X,S2,I,51)+TMX
          END IF
        END IF
C
        D3(K,S2,I,17,JJ)=D3(K,S2,I,17,JJ)+TMX*AB
        IF(JJ.EQ.2) THEN
          D3X(K,X,S2,I,17)=D3X(K,X,S2,I,17)+TMX*AB
        ELSE
          D3XS(K,X,S2,I,17)=D3XS(K,X,S2,I,17)+TMX*AB
        END IF
C
        IF(NENBE65.EQ.1 .AND. X.GE.65) THEN
          D3(K,S2,I,45,JJ)=D3(K,S2,I,45,JJ)+TMX*AB
          IF(JJ.EQ.2) THEN
            D3X(K,X,S2,I,45)=D3X(K,X,S2,I,45)+TMX*AB
          ELSE
            D3XS(K,X,S2,I,45)=D3XS(K,X,S2,I,45)+TMX*AB
          END IF
        END IF
C
        IF(NENBE65.EQ.1 .AND. X.GE.65 .AND. X.LE.69) THEN
          D3(K,S2,I,57,JJ)=D3(K,S2,I,57,JJ)+TMX*AB
          IF(JJ.EQ.2) THEN
            D3X(K,X,S2,I,57)=D3X(K,X,S2,I,57)+TMX*AB
          ELSE
            D3XS(K,X,S2,I,57)=D3XS(K,X,S2,I,57)+TMX*AB
          END IF
        END IF
C
        D3(K,S2,I,27,JJ)=D3(K,S2,I,27,JJ)+TMX*AB*KK
        IF(JJ.EQ.2) THEN
          D3X(K,X,S2,I,27)=D3X(K,X,S2,I,27)+TMX*AB*KK
        ELSE
          D3XS(K,X,S2,I,27)=D3XS(K,X,S2,I,27)+TMX*AB*KK
        END IF
C
C       最低保障部分
        TMX=TMP(12)
C
        D3(K,S2,I,6,JJ)=D3(K,S2,I,6,JJ)+TMX
        IF(JJ.EQ.2) THEN
          D3X(K,X,S2,I,6)=D3X(K,X,S2,I,6)+TMX
        ELSE
          D3XS(K,X,S2,I,6)=D3XS(K,X,S2,I,6)+TMX
        END IF
C
        D3(K,S2,I,12,JJ)=D3(K,S2,I,12,JJ)+TMX
        IF(JJ.EQ.2) THEN
          D3X(K,X,S2,I,12)=D3X(K,X,S2,I,12)+TMX
        ELSE
          D3XS(K,X,S2,I,12)=D3XS(K,X,S2,I,12)+TMX
        END IF
C
        IF(NENBE65.EQ.1 .AND. X.GE.65) THEN
          D3(K,S2,I,40,JJ)=D3(K,S2,I,40,JJ)+TMX
          IF(JJ.EQ.2) THEN
            D3X(K,X,S2,I,40)=D3X(K,X,S2,I,40)+TMX
          ELSE
            D3XS(K,X,S2,I,40)=D3XS(K,X,S2,I,40)+TMX
          END IF
        END IF
C
        IF(NENBE65.EQ.1 .AND. X.GE.65 .AND. X.LE.69) THEN
          D3(K,S2,I,52,JJ)=D3(K,S2,I,52,JJ)+TMX
          IF(JJ.EQ.2) THEN
            D3X(K,X,S2,I,52)=D3X(K,X,S2,I,52)+TMX
          ELSE
            D3XS(K,X,S2,I,52)=D3XS(K,X,S2,I,52)+TMX
          END IF
        END IF
C
        D3(K,S2,I,18,JJ)=D3(K,S2,I,18,JJ)+TMX*AB
        IF(JJ.EQ.2) THEN
          D3X(K,X,S2,I,18)=D3X(K,X,S2,I,18)+TMX*AB
        ELSE
          D3XS(K,X,S2,I,18)=D3XS(K,X,S2,I,18)+TMX*AB
        END IF
C
        IF(NENBE65.EQ.1 .AND. X.GE.65) THEN
          D3(K,S2,I,46,JJ)=D3(K,S2,I,46,JJ)+TMX*AB
          IF(JJ.EQ.2) THEN
            D3X(K,X,S2,I,46)=D3X(K,X,S2,I,46)+TMX*AB
          ELSE
            D3XS(K,X,S2,I,46)=D3XS(K,X,S2,I,46)+TMX*AB
          END IF
        END IF
C
        IF(NENBE65.EQ.1 .AND. X.GE.65 .AND. X.LE.69) THEN
          D3(K,S2,I,58,JJ)=D3(K,S2,I,58,JJ)+TMX*AB
          IF(JJ.EQ.2) THEN
            D3X(K,X,S2,I,58)=D3X(K,X,S2,I,58)+TMX*AB
          ELSE
            D3XS(K,X,S2,I,58)=D3XS(K,X,S2,I,58)+TMX*AB
          END IF
        END IF
C
        D3(K,S2,I,27,JJ)=D3(K,S2,I,27,JJ)+TMX*AB*KK
        IF(JJ.EQ.2) THEN
          D3X(K,X,S2,I,27)=D3X(K,X,S2,I,27)+TMX*AB*KK
        ELSE
          D3XS(K,X,S2,I,27)=D3XS(K,X,S2,I,27)+TMX*AB*KK
        END IF
C
 1000 CONTINUE
C
C
      RETURN
C
      END
C
