* PACKAGE SVBKSB  !" $B@~7?2r@O(B : SVD $BJ,2r$K$h$kFC0[O"N)J}Dx<0$N2r(B
*
*"  [HIS] 93/08/12(takepiro) NUMERICAL RECIPIES $B$h$j0\?"(B
*
**********************************************************************
      SUBROUTINE SVBKSB
     I            (  U  ,
     W               W  , V  ,
     D               M  , N  , MP  , NP ,
     I               B  ,
     O               X                    )
*
*  [INPUT]
      REAL       U(MP,NP)
*
*  [WORK]
      REAL       W(NP) , V(NP,NP)
*
*  [INPUT]
      INTEGER    M  , N
      INTEGER    MP , NP
      REAL       B(MP)
*
*  [OUTPUT]
      REAL       X(NP)
*
*  [INTERNAL WORK]
      INTEGER    NMAX
        PARAMETER ( NMAX = 10000)
      REAL       TMP(NMAX)
*
      INTEGER    I , J , JJ
      REAL       S
*
      IF( N .GT. NMAX )THEN
         CALL MSGDMP('E','SVBKSB','WORK REGION NOT SUFFICIENT')
      ENDIF
*
      DO 12 J = 1, N
        S = 0.
        IF( W(J).NE.0. )THEN
          DO 11 I = 1 , M
            S = S + U(I,J)*B(I)
11        CONTINUE
          S = S / W(J)
        ENDIF
        TMP(J) = S
12    CONTINUE
      DO 14 J = 1, N
        S = 0.
        DO 13 JJ = 1 , N
          S = S + V(J,JJ)*TMP(JJ)
13      CONTINUE
        X(J) = S
14    CONTINUE
      RETURN
      END
