***********************************************************************
*     ---------------------------------------------------
      SUBROUTINE RSASUMG(AM,GAMBW,RESSGN,ASUM)
*     ---------------------------------------------------
*
*     ( purpose )
*       Calculate sum of amplitude of each resonance
*
*     ( input )
*       am(6,31)    : amplitude for each state
*       gambw(31)   : elasticity(decay probability)
*       ressgn(31)  : decay sign
*
*     ( output )
*       asum(2,6,14): amplitude of each resonance
*
*     ( creation date and author )
*       1993.Dec. ; for Super-Kamioka by Y.Hayato
*                   (Based on Rein and Sehgal's code)
*       2007.08.23 ; G.Mitsuka add delta->gamma decay
*
*     ( comment )
*       Reference:Rein and Sehgal,Ann. of Phys. 133(1981),79-153
*                 Rein           ,Z.Phys.C 35(1987),43-64
***********************************************************************

      IMPLICIT NONE

      REAL AM(6,31)
      COMPLEX GAMBW(28)
      REAL RESSGN(31)
      COMPLEX ASUM(2,6,14)
      REAL  AP1C(50),AP3C(50),AM1C(50),AM3C(50),A0PC(50),A0MC(50)
      
      INTEGER NCTR

      DO 61 NCTR=1,31
          AM3C(NCTR) = AM(1,NCTR)
          AM1C(NCTR) = AM(2,NCTR)
          AP3C(NCTR) = AM(3,NCTR)
          AP1C(NCTR) = AM(4,NCTR)
          A0PC(NCTR) = AM(5,NCTR)
          A0MC(NCTR) = AM(6,NCTR)
 61   CONTINUE


      ASUM( 1 , 1 , 1 ) = AM3C( 6)*GAMBW( 6)*RESSGN( 6)
      ASUM( 1 , 1 , 2 ) = AM3C( 4)*GAMBW( 4)*RESSGN( 4)
     $                  + AM3C( 7)*GAMBW( 7)*RESSGN( 7)
      ASUM( 1 , 1 , 3 ) = AM3C(23)*GAMBW(23)*RESSGN(23)
      ASUM( 1 , 1 , 4 ) = AM3C(14)*GAMBW(14)*RESSGN(14)
     $                  + AM3C(19)*GAMBW(19)*RESSGN(19)
      ASUM( 1 , 1 , 5 ) = AM3C( 1)*GAMBW( 1)*RESSGN( 1)
     $                  + AM3C(16)*GAMBW(16)*RESSGN(16)
     $                  + AM3C(26)*GAMBW(26)*RESSGN(26)                  
      ASUM( 1 , 1 , 6 ) = AM3C(21)*GAMBW(21)*RESSGN(21)
      ASUM( 1 , 1 , 7 ) = AM3C(13)*GAMBW(13)*RESSGN(13)
      ASUM( 1 , 1 , 9 ) = 0.
      ASUM( 1 , 1 , 8 ) = AM3C( 2)*GAMBW( 2)*RESSGN( 2)
     $                  + AM3C( 9)*GAMBW( 9)*RESSGN( 9)
      ASUM( 1 , 1 , 10 ) = AM3C(11)*GAMBW(11)*RESSGN(11)
      ASUM( 1 , 1 , 11 ) = AM3C(24)*GAMBW(24)*RESSGN(24)
      ASUM( 1 , 1 , 12 ) = AM3C(17)*GAMBW(17)*RESSGN(17)
      ASUM( 1 , 1 , 13 ) = AM3C(25)*GAMBW(25)*RESSGN(25)
      ASUM( 1 , 1 , 14 ) = AM3C(27)*GAMBW(27)*RESSGN(27)
      
      ASUM( 1 , 2 , 1 ) = AM1C( 6)*GAMBW( 6)*RESSGN( 6)
      ASUM( 1 , 2 , 2 ) = AM1C( 4)*GAMBW( 4)*RESSGN( 4)
     $                  + AM1C( 7)*GAMBW( 7)*RESSGN( 7)
      ASUM( 1 , 2 , 3 ) = AM1C(23)*GAMBW(23)*RESSGN(23)
      ASUM( 1 , 2 , 4 ) = AM1C(14)*GAMBW(14)*RESSGN(14)
     $                  + AM1C(19)*GAMBW(19)*RESSGN(19)
      ASUM( 1 , 2 , 5 ) = AM1C( 1)*GAMBW( 1)*RESSGN( 1)
     $                  + AM1C(16)*GAMBW(16)*RESSGN(16)
     $                  + AM1C(26)*GAMBW(26)*RESSGN(26)                  
      ASUM( 1 , 2 , 6 ) = AM1C(21)*GAMBW(21)*RESSGN(21)
      ASUM( 1 , 2 , 7 ) = AM1C(13)*GAMBW(13)*RESSGN(13)
      ASUM( 1 , 2 , 9 ) = 0.
      ASUM( 1 , 2 , 8 ) = AM1C( 2)*GAMBW( 2)*RESSGN( 2)
     $                  + AM1C( 9)*GAMBW( 9)*RESSGN( 9)
      ASUM( 1 , 2 , 10 ) = AM1C(11)*GAMBW(11)*RESSGN(11)
      ASUM( 1 , 2 , 11 ) = AM1C(24)*GAMBW(24)*RESSGN(24)
      ASUM( 1 , 2 , 12 ) = AM1C(17)*GAMBW(17)*RESSGN(17)
      ASUM( 1 , 2 , 13 ) = AM1C(25)*GAMBW(25)*RESSGN(25)
      ASUM( 1 , 2 , 14 ) = AM1C(27)*GAMBW(27)*RESSGN(27)

      ASUM( 1 , 3 , 1 ) = AP3C( 6)*GAMBW( 6)*RESSGN( 6)
      ASUM( 1 , 3 , 2 ) = AP3C( 4)*GAMBW( 4)*RESSGN( 4)
     $                  + AP3C( 7)*GAMBW( 7)*RESSGN( 7)
      ASUM( 1 , 3 , 3 ) = AP3C(23)*GAMBW(23)*RESSGN(23)
      ASUM( 1 , 3 , 4 ) = AP3C(14)*GAMBW(14)*RESSGN(14)
     $                  + AP3C(19)*GAMBW(19)*RESSGN(19)
      ASUM( 1 , 3 , 5 ) = AP3C( 1)*GAMBW( 1)*RESSGN( 1)
     $                  + AP3C(16)*GAMBW(16)*RESSGN(16)
     $                  + AP3C(26)*GAMBW(26)*RESSGN(26)                  
      ASUM( 1 , 3 , 6 ) = AP3C(21)*GAMBW(21)*RESSGN(21)
      ASUM( 1 , 3 , 7 ) = AP3C(13)*GAMBW(13)*RESSGN(13)
      ASUM( 1 , 3 , 9 ) = 0.
      ASUM( 1 , 3 , 8 ) = AP3C( 2)*GAMBW( 2)*RESSGN( 2)
     $                  + AP3C( 9)*GAMBW( 9)*RESSGN( 9)
      ASUM( 1 , 3 , 10 ) = AP3C(11)*GAMBW(11)*RESSGN(11)
      ASUM( 1 , 3 , 11 ) = AP3C(24)*GAMBW(24)*RESSGN(24)
      ASUM( 1 , 3 , 12 ) = AP3C(17)*GAMBW(17)*RESSGN(17)
      ASUM( 1 , 3 , 13 ) = AP3C(25)*GAMBW(25)*RESSGN(25)
      ASUM( 1 , 3 , 14 ) = AP3C(27)*GAMBW(27)*RESSGN(27)

      ASUM( 1 , 4 , 1 ) = AP1C( 6)*GAMBW( 6)*RESSGN( 6)
      ASUM( 1 , 4 , 2 ) = AP1C( 4)*GAMBW( 4)*RESSGN( 4)
     $                  + AP1C( 7)*GAMBW( 7)*RESSGN( 7)
      ASUM( 1 , 4 , 3 ) = AP1C(23)*GAMBW(23)*RESSGN(23)
      ASUM( 1 , 4 , 4 ) = AP1C(14)*GAMBW(14)*RESSGN(14)
     $                  + AP1C(19)*GAMBW(19)*RESSGN(19)
      ASUM( 1 , 4 , 5 ) = AP1C( 1)*GAMBW( 1)*RESSGN( 1)
     $                  + AP1C(16)*GAMBW(16)*RESSGN(16)
     $                  + AP1C(26)*GAMBW(26)*RESSGN(26)                  
      ASUM( 1 , 4 , 6 ) = AP1C(21)*GAMBW(21)*RESSGN(21)
      ASUM( 1 , 4 , 7 ) = AP1C(13)*GAMBW(13)*RESSGN(13)
      ASUM( 1 , 4 , 9 ) = 0.
      ASUM( 1 , 4 , 8 ) = AP1C( 2)*GAMBW( 2)*RESSGN( 2)
     $                  + AP1C( 9)*GAMBW( 9)*RESSGN( 9)
      ASUM( 1 , 4 , 10 ) = AP1C(11)*GAMBW(11)*RESSGN(11)
      ASUM( 1 , 4 , 11 ) = AP1C(24)*GAMBW(24)*RESSGN(24)
      ASUM( 1 , 4 , 12 ) = AP1C(17)*GAMBW(17)*RESSGN(17)
      ASUM( 1 , 4 , 13 ) = AP1C(25)*GAMBW(25)*RESSGN(25)
      ASUM( 1 , 4 , 14 ) = AP1C(27)*GAMBW(27)*RESSGN(27)

      ASUM( 1 , 5 , 1 ) = A0PC( 6)*GAMBW( 6)*RESSGN( 6)
      ASUM( 1 , 5 , 2 ) = A0PC( 4)*GAMBW( 4)*RESSGN( 4)
     $                  + A0PC( 7)*GAMBW( 7)*RESSGN( 7)
      ASUM( 1 , 5 , 3 ) = A0PC(23)*GAMBW(23)*RESSGN(23)
      ASUM( 1 , 5 , 4 ) = A0PC(14)*GAMBW(14)*RESSGN(14)
     $                  + A0PC(19)*GAMBW(19)*RESSGN(19)
      ASUM( 1 , 5 , 5 ) = A0PC( 1)*GAMBW( 1)*RESSGN( 1)
     $                  + A0PC(16)*GAMBW(16)*RESSGN(16)
     $                  + A0PC(26)*GAMBW(26)*RESSGN(26)                  
      ASUM( 1 , 5 , 6 ) = A0PC(21)*GAMBW(21)*RESSGN(21)
      ASUM( 1 , 5 , 7 ) = A0PC(13)*GAMBW(13)*RESSGN(13)
      ASUM( 1 , 5 , 9 ) = 0.
      ASUM( 1 , 5 , 8 ) = A0PC( 2)*GAMBW( 2)*RESSGN( 2)
     $                  + A0PC( 9)*GAMBW( 9)*RESSGN( 9)
      ASUM( 1 , 5 , 10 ) = A0PC(11)*GAMBW(11)*RESSGN(11)
      ASUM( 1 , 5 , 11 ) = A0PC(24)*GAMBW(24)*RESSGN(24)
      ASUM( 1 , 5 , 12 ) = A0PC(17)*GAMBW(17)*RESSGN(17)
      ASUM( 1 , 5 , 13 ) = A0PC(25)*GAMBW(25)*RESSGN(25)
      ASUM( 1 , 5 , 14 ) = A0PC(27)*GAMBW(27)*RESSGN(27)

      ASUM( 1 , 6 , 1 ) = A0MC( 6)*GAMBW( 6)*RESSGN( 6)
      ASUM( 1 , 6 , 2 ) = A0MC( 4)*GAMBW( 4)*RESSGN( 4)
     $                  + A0MC( 7)*GAMBW( 7)*RESSGN( 7)
      ASUM( 1 , 6 , 3 ) = A0MC(23)*GAMBW(23)*RESSGN(23)
      ASUM( 1 , 6 , 4 ) = A0MC(14)*GAMBW(14)*RESSGN(14)
     $                  + A0MC(19)*GAMBW(19)*RESSGN(19)
      ASUM( 1 , 6 , 5 ) = A0MC( 1)*GAMBW( 1)*RESSGN( 1)
     $                  + A0MC(16)*GAMBW(16)*RESSGN(16)
     $                  + A0MC(26)*GAMBW(26)*RESSGN(26)                  
      ASUM( 1 , 6 , 6 ) = A0MC(21)*GAMBW(21)*RESSGN(21)
      ASUM( 1 , 6 , 7 ) = A0MC(13)*GAMBW(13)*RESSGN(13)
      ASUM( 1 , 6 , 9 ) = 0.
      ASUM( 1 , 6 , 8 ) = A0MC( 2)*GAMBW( 2)*RESSGN( 2)
     $                  + A0MC( 9)*GAMBW( 9)*RESSGN( 9)
      ASUM( 1 , 6 , 10 ) = A0MC(11)*GAMBW(11)*RESSGN(11)
      ASUM( 1 , 6 , 11 ) = A0MC(24)*GAMBW(24)*RESSGN(24)
      ASUM( 1 , 6 , 12 ) = A0MC(17)*GAMBW(17)*RESSGN(17)
      ASUM( 1 , 6 , 13 ) = A0MC(25)*GAMBW(25)*RESSGN(25)
      ASUM( 1 , 6 , 14 ) = A0MC(27)*GAMBW(27)*RESSGN(27)

      ASUM( 2 , 1 , 1 ) = AM3C( 6)*GAMBW( 6)*RESSGN( 6)
      ASUM( 2 , 1 , 2 ) = AM3C( 5)*GAMBW( 5)*RESSGN( 5)
     $                  + AM3C( 8)*GAMBW( 8)*RESSGN( 8)
      ASUM( 2 , 1 , 3 ) = AM3C(23)*GAMBW(23)*RESSGN(23)
      ASUM( 2 , 1 , 4 ) = AM3C(15)*GAMBW(15)*RESSGN(15)
     $                  + AM3C(20)*GAMBW(20)*RESSGN(20)
      ASUM( 2 , 1 , 5 ) = AM3C( 1)*GAMBW( 1)*RESSGN( 1)
     $                  + AM3C(16)*GAMBW(16)*RESSGN(16)
     $                  + AM3C(26)*GAMBW(26)*RESSGN(26)                  
      ASUM( 2 , 1 , 6 ) = AM3C(22)*GAMBW(22)*RESSGN(22)
      ASUM( 2 , 1 , 7 ) = AM3C(13)*GAMBW(13)*RESSGN(13)
      ASUM( 2 , 1 , 9 ) = 0.
      ASUM( 2 , 1 , 8 ) = AM3C( 3)*GAMBW( 3)*RESSGN( 3)
     $                  + AM3C(10)*GAMBW(10)*RESSGN(10)
      ASUM( 2 , 1 , 10 ) = AM3C(12)*GAMBW(12)*RESSGN(12)
      ASUM( 2 , 1 , 11 ) = AM3C(24)*GAMBW(24)*RESSGN(24)
      ASUM( 2 , 1 , 12 ) = AM3C(17)*GAMBW(17)*RESSGN(17)
      ASUM( 2 , 1 , 13 ) = AM3C(25)*GAMBW(25)*RESSGN(25)
      ASUM( 2 , 1 , 14 ) = AM3C(28)*GAMBW(28)*RESSGN(28)
      
      ASUM( 2 , 2 , 1 ) = AM1C( 6)*GAMBW( 6)*RESSGN( 6)
      ASUM( 2 , 2 , 2 ) = AM1C( 5)*GAMBW( 5)*RESSGN( 5)
     $                  + AM1C( 8)*GAMBW( 8)*RESSGN( 8)
      ASUM( 2 , 2 , 3 ) = AM1C(23)*GAMBW(23)*RESSGN(23)
      ASUM( 2 , 2 , 4 ) = AM1C(15)*GAMBW(15)*RESSGN(15)
     $                  + AM1C(20)*GAMBW(20)*RESSGN(20)
      ASUM( 2 , 2 , 5 ) = AM1C( 1)*GAMBW( 1)*RESSGN( 1)
     $                  + AM1C(16)*GAMBW(16)*RESSGN(16)
     $                  + AM1C(26)*GAMBW(26)*RESSGN(26)                  
      ASUM( 2 , 2 , 6 ) = AM1C(22)*GAMBW(22)*RESSGN(22)
      ASUM( 2 , 2 , 7 ) = AM1C(13)*GAMBW(13)*RESSGN(13)
      ASUM( 2 , 2 , 9 ) = 0.
      ASUM( 2 , 2 , 8 ) = AM1C( 3)*GAMBW( 3)*RESSGN( 3)
     $                  + AM1C(10)*GAMBW(10)*RESSGN(10)
      ASUM( 2 , 2 , 10 ) = AM1C(12)*GAMBW(12)*RESSGN(12)
      ASUM( 2 , 2 , 11 ) = AM1C(24)*GAMBW(24)*RESSGN(24)
      ASUM( 2 , 2 , 12 ) = AM1C(18)*GAMBW(18)*RESSGN(18)
      ASUM( 2 , 2 , 13 ) = AM1C(25)*GAMBW(25)*RESSGN(25)
      ASUM( 2 , 2 , 14 ) = AM1C(28)*GAMBW(28)*RESSGN(28)
      
      ASUM( 2 , 3 , 1 ) = AP3C( 6)*GAMBW( 6)*RESSGN( 6)
      ASUM( 2 , 3 , 2 ) = AP3C( 5)*GAMBW( 5)*RESSGN( 5)
     $                  + AP3C( 8)*GAMBW( 8)*RESSGN( 8)
      ASUM( 2 , 3 , 3 ) = AP3C(23)*GAMBW(23)*RESSGN(23)
      ASUM( 2 , 3 , 4 ) = AP3C(15)*GAMBW(15)*RESSGN(15)
     $                  + AP3C(20)*GAMBW(20)*RESSGN(20)
      ASUM( 2 , 3 , 5 ) = AP3C( 1)*GAMBW( 1)*RESSGN( 1)
     $                  + AP3C(16)*GAMBW(16)*RESSGN(16)
     $                  + AP3C(26)*GAMBW(26)*RESSGN(26)                  
      ASUM( 2 , 3 , 6 ) = AP3C(22)*GAMBW(22)*RESSGN(22)
      ASUM( 2 , 3 , 7 ) = AP3C(13)*GAMBW(13)*RESSGN(13)
      ASUM( 2 , 3 , 9 ) = 0.
      ASUM( 2 , 3 , 8 ) = AP3C( 3)*GAMBW( 3)*RESSGN( 3)
     $                  + AP3C(10)*GAMBW(10)*RESSGN(10)
      ASUM( 2 , 3 , 10 ) = AP3C(12)*GAMBW(12)*RESSGN(12)
      ASUM( 2 , 3 , 11 ) = AP3C(24)*GAMBW(24)*RESSGN(24)
      ASUM( 2 , 3 , 12 ) = AP3C(18)*GAMBW(18)*RESSGN(18)
      ASUM( 2 , 3 , 13 ) = AP3C(25)*GAMBW(25)*RESSGN(25)
      ASUM( 2 , 3 , 14 ) = AP3C(28)*GAMBW(28)*RESSGN(28)
      
      ASUM( 2 , 4 , 1 ) = AP1C( 6)*GAMBW( 6)*RESSGN( 6)
      ASUM( 2 , 4 , 2 ) = AP1C( 5)*GAMBW( 5)*RESSGN( 5)
     $                  + AP1C( 8)*GAMBW( 8)*RESSGN( 8)
      ASUM( 2 , 4 , 3 ) = AP1C(23)*GAMBW(23)*RESSGN(23)
      ASUM( 2 , 4 , 4 ) = AP1C(15)*GAMBW(15)*RESSGN(15)
     $                  + AP1C(20)*GAMBW(20)*RESSGN(20)
      ASUM( 2 , 4 , 5 ) = AP1C( 1)*GAMBW( 1)*RESSGN( 1)
     $                  + AP1C(16)*GAMBW(16)*RESSGN(16)
     $                  + AP1C(26)*GAMBW(26)*RESSGN(26)                  
      ASUM( 2 , 4 , 6 ) = AP1C(22)*GAMBW(22)*RESSGN(22)
      ASUM( 2 , 4 , 7 ) = AP1C(13)*GAMBW(13)*RESSGN(13)
      ASUM( 2 , 4 , 9 ) = 0.
      ASUM( 2 , 4 , 8 ) = AP1C( 3)*GAMBW( 3)*RESSGN( 3)
     $                  + AP1C(10)*GAMBW(10)*RESSGN(10)
      ASUM( 2 , 4 , 10 ) = AP1C(12)*GAMBW(12)*RESSGN(12)
      ASUM( 2 , 4 , 11 ) = AP1C(24)*GAMBW(24)*RESSGN(24)
      ASUM( 2 , 4 , 12 ) = AP1C(18)*GAMBW(18)*RESSGN(18)
      ASUM( 2 , 4 , 13 ) = AP1C(25)*GAMBW(25)*RESSGN(25)
      ASUM( 2 , 4 , 14 ) = AP1C(28)*GAMBW(28)*RESSGN(28)
      
      ASUM( 2 , 5 , 1 ) = A0PC( 6)*GAMBW( 6)*RESSGN( 6)
      ASUM( 2 , 5 , 2 ) = A0PC( 5)*GAMBW( 5)*RESSGN( 5)
     $                  + A0PC( 8)*GAMBW( 8)*RESSGN( 8)
      ASUM( 2 , 5 , 3 ) = A0PC(23)*GAMBW(23)*RESSGN(23)
      ASUM( 2 , 5 , 4 ) = A0PC(15)*GAMBW(15)*RESSGN(15)
     $                  + A0PC(20)*GAMBW(20)*RESSGN(20)
      ASUM( 2 , 5 , 5 ) = A0PC( 1)*GAMBW( 1)*RESSGN( 1)
     $                  + A0PC(16)*GAMBW(16)*RESSGN(16)
     $                  + A0PC(26)*GAMBW(26)*RESSGN(26)                  
      ASUM( 2 , 5 , 6 ) = A0PC(22)*GAMBW(22)*RESSGN(22)
      ASUM( 2 , 5 , 7 ) = A0PC(13)*GAMBW(13)*RESSGN(13)
      ASUM( 2 , 5 , 9 ) = 0.
      ASUM( 2 , 5 , 8 ) = A0PC( 3)*GAMBW( 3)*RESSGN( 3)
     $                  + A0PC(10)*GAMBW(10)*RESSGN(10)
      ASUM( 2 , 5 , 10 ) = A0PC(12)*GAMBW(12)*RESSGN(12)
      ASUM( 2 , 5 , 11 ) = A0PC(24)*GAMBW(24)*RESSGN(24)
      ASUM( 2 , 5 , 12 ) = A0PC(18)*GAMBW(18)*RESSGN(18)
      ASUM( 2 , 5 , 13 ) = A0PC(25)*GAMBW(25)*RESSGN(25)
      ASUM( 2 , 5 , 14 ) = A0PC(28)*GAMBW(28)*RESSGN(28)
      
      ASUM( 2 , 6 , 1 ) = A0MC( 6)*GAMBW( 6)*RESSGN( 6)
      ASUM( 2 , 6 , 2 ) = A0MC( 5)*GAMBW( 5)*RESSGN( 5)
     $                  + A0MC( 8)*GAMBW( 8)*RESSGN( 8)
      ASUM( 2 , 6 , 3 ) = A0MC(23)*GAMBW(23)*RESSGN(23)
      ASUM( 2 , 6 , 4 ) = A0MC(15)*GAMBW(15)*RESSGN(15)
     $                  + A0MC(20)*GAMBW(20)*RESSGN(20)
      ASUM( 2 , 6 , 5 ) = A0MC( 1)*GAMBW( 1)*RESSGN( 1)
     $                  + A0MC(16)*GAMBW(16)*RESSGN(16)
     $                  + A0MC(26)*GAMBW(26)*RESSGN(26)                  
      ASUM( 2 , 6 , 6 ) = A0MC(22)*GAMBW(22)*RESSGN(22)
      ASUM( 2 , 6 , 7 ) = A0MC(13)*GAMBW(13)*RESSGN(13)
      ASUM( 2 , 6 , 9 ) = 0.
      ASUM( 2 , 6 , 8 ) = A0MC( 3)*GAMBW( 3)*RESSGN( 3)
     $                  + A0MC(10)*GAMBW(10)*RESSGN(10)
      ASUM( 2 , 6 , 10 ) = A0MC(12)*GAMBW(12)*RESSGN(12)
      ASUM( 2 , 6 , 11 ) = A0MC(24)*GAMBW(24)*RESSGN(24)
      ASUM( 2 , 6 , 12 ) = A0MC(18)*GAMBW(18)*RESSGN(18)
      ASUM( 2 , 6 , 13 ) = A0MC(25)*GAMBW(25)*RESSGN(25)
      ASUM( 2 , 6 , 14 ) = A0MC(28)*GAMBW(28)*RESSGN(28)
                  
      END
      
