C
C     ****************************************************************
C     **                                                            **
C     **    庴媼幰儀乕僗(巟媼掆巭屻)偺審悢丆婜娫媦傃擭嬥妟偺嶼掕    **
C     **            (擭嬥庬暿(俬),擭楊(倃),孞忋擭悢(XX))            **
C     **                                                            **
C     ****************************************************************
C
C
      SUBROUTINE   SHKEJSHA(I,X,XX)
C
C
      IMPLICIT INTEGER (A-Z)
      INCLUDE 'seps.inc'
      INCLUDE 'shke.inc'
C
      COMMON /K/ K
      COMMON /S/ S,S2
      COMMON /GV/ GV,GVR,GVK,GVKK
      COMMON /COJIKO/ TMSII
C
      REAL*8 GV,GVR,GVK,GVKK
      REAL*8 TMSII(1:13)
C
C-------------------------------------------------
C      庴媼幰儀乕僗偺擭嬥妟摍偺嶼掕
C                                (巟媼妟)
C        審悢          丟T4K  仺 T4
C        婜娫          丟HN2K 仺 HN2
C        擭嬥妟        丟T6K  仺 T6
C        戙峴憡摉擭嬥妟丟T6DK 仺 T6D
C-------------------------------------------------
C
      CALL SIKU(S2,K,X,I)
C
      CALL SET_JIKOUTOU
C
C------------------------------------------------------------
C     庴媼幰偺擭嬥妟摍偺愝掕(巟媼妟儀乕僗) T4,HN2,T6,T6D
C------------------------------------------------------------
C
C     擭搙枛庴媼幰悢
C
      T4(X,XX,I)=T4K(X,XX,I)*GVR
C
C     旐曐尟幰婜娫
C
      HN2(X,XX,I,1)=HN2K(X,XX,I,1)*GVR
      HN2(X,XX,I,2)=HN2K(X,XX,I,2)*GVR
C
C     庴媼幰擭嬥憤妟
C
      DO 290 J=1,23
        IF(J.EQ. 6 .OR. J.EQ.14 .OR. J.EQ.21) THEN
          T6(X,XX,I,J)=T6K(X,XX,I,J)*GVK
        ELSE
          T6(X,XX,I,J)=T6K(X,XX,I,J)*GV
        END IF
C
        IF(PSEID.EQ.0 .AND. ((J.LE.12 .AND. J.NE.6) .OR. J.EQ.23)) THEN
          IF(K.LE.KIJUN+1) THEN
            T6(X,XX,I,J)=T6(X,XX,I,J)*(1.0D0+TMSII(I))
          ELSE IF(K.LT.KIJUN+6) THEN
            T6(X,XX,I,J)=T6(X,XX,I,J)
     &                   *(1.0D0+TMSII(I)*DBLE(KIJUN+6-K)/5.0D0)
          END IF
        ELSE IF(PSEID.EQ.1 .OR. PSEID.EQ.4 .OR. PSEID.EQ.5) THEN
C         *** 嫟嵪媽朄偺挷惍 ***
          IF((J.EQ.1 .OR. J.EQ.2 .OR. J.EQ.3 .OR.
     &        (J.GE.7 .AND. J.LE.12 )            ) .AND.
     &       (I.GE.5 .AND. I.NE.9 .AND. I.NE.11  )      ) THEN
            T6(X,XX,I,J) =T6(X,XX,I,J) *TMSII(I)
            T6K(X,XX,I,J)=T6K(X,XX,I,J)*TMSII(I)
          END IF
        END IF
  290 CONTINUE
C
C     戙峴憡摉媼晅
C
      T6D(X,XX,I)=T6DK(X,XX,I)*GVKK
C
      IF(K.LE.KIJUN+5 .AND. (PSEID.NE.2 .AND. PSEID.NE.3) .AND.
     &   X.GE.60 .AND. X.LE.69 .AND. I.LE.4) THEN
        SS=S
        IF(S.EQ.3) SS=1 
        T4K(X,XX,I)=T4K(X,XX,I)*NOS(K,X,SS,I,2)
        DO 1000 J=1,23
          T6K(X,XX,I,J)=T6K(X,XX,I,J)*NOS(K,X,SS,I,1)
 1000   CONTINUE
      END IF
C
      IF(S.NE.2 .AND. X.GE.18 .AND. I.EQ.11 .AND. 
     &   1.0D0-RC(S,K,X).GE.1.0D-6                 ) THEN
        T6K(X,XX,I,7)=T6K(X,XX,I,7)/(1.0D0-RC(S,KIJUN,X))
        T6K(X,XX,I,8)=T6K(X,XX,I,8)/(1.0D0-RC(S,KIJUN,X))
      END IF
C
      RETURN
C
      END
C
C
      SUBROUTINE   SET_JIKOUTOU
C
      IMPLICIT INTEGER (A-Z)
      INCLUDE 'seps.inc'
      INCLUDE 'shke.inc'
C
      COMMON /K/ K
      COMMON /S/ S,S2
      COMMON /COJIKO/ TMSII
C
      REAL*8 TMSII(1:13)
C
      DO 1000 I=1,13
        IF(PSEID.EQ.0) THEN
          TMSII(I)=0.0D0
        ELSE
          TMSII(I)=1.0D0
        END IF
 1000 CONTINUE
C
      KEY_JIKOUT=1
      KEY_KYOSAI=1
      IF(PSEID.EQ.0 .AND. KEY_JIKOUT.EQ.1) THEN
C       帪岠摿椺梡愝掕
        TMSII(1) =0.0065D0
        TMSII(2) =0.0065D0
        TMSII(3) =0.0065D0
        TMSII(4) =0.0065D0
        TMSII(5) =0.0127D0
        TMSII(6) =0.0127D0
        TMSII(7) =0.0808D0
        TMSII(8) =0.0808D0
        TMSII(9) =0.0011D0
        TMSII(10)=0.0079D0
        TMSII(11)=0.0000D0
        TMSII(12)=0.0076D0
        TMSII(13)=0.0239D0
      ELSE IF(KEY_KYOSAI.EQ.1) THEN
        IF(PSEID.EQ.1) THEN
          TMSII(5) =0.8570D0
          TMSII(6) =0.8570D0
          TMSII(7) =0.9076D0
          TMSII(8) =0.9076D0
C
          TMSII(10)=0.9914D0
C
          TMSII(12)=0.8764D0
          TMSII(13)=0.7569D0
        ELSE IF(PSEID.EQ.4) THEN
          TMSII(5) =0.8833D0
          TMSII(6) =1.2065D0
          TMSII(7) =0.9355D0
          TMSII(8) =1.0000D0
C
          TMSII(10)=1.1056D0
C
          TMSII(12)=0.9828D0
          TMSII(13)=1.0414D0
        ELSE IF(PSEID.EQ.5) THEN
          TMSII(5) =1.0917D0
          TMSII(6) =1.0000D0
          TMSII(7) =1.9459D0
          TMSII(8) =1.0000D0
C
          TMSII(10)=1.0558D0
C
          TMSII(12)=0.9056D0
          TMSII(13)=1.0726D0
        END IF
      END IF

C
      RETURN
C
      END
C
