primitives(s_offset_a1+i3, s_offset_b1+i2, s_offset_c1+i1, s_offset_d1+5)= &
primitives(s_offset_a1+i3, s_offset_b1+i2, s_offset_c1+i1, s_offset_d1+5)+ &
buffer1(1+(i-1)*kmax) * sphi_d(1,5 +s_offset_d1)
primitives(s_offset_a1+i3, s_offset_b1+i2, s_offset_c1+i1, s_offset_d1+7)= &
primitives(s_offset_a1+i3, s_offset_b1+i2, s_offset_c1+i1, s_offset_d1+7)+ &
buffer1(1+(i-1)*kmax) * sphi_d(1,7 +s_offset_d1)
primitives(s_offset_a1+i3, s_offset_b1+i2, s_offset_c1+i1, s_offset_d1+1)= &
primitives(s_offset_a1+i3, s_offset_b1+i2, s_offset_c1+i1, s_offset_d1+1)+ &
buffer1(2+(i-1)*kmax) * sphi_d(2,1 +s_offset_d1)
primitives(s_offset_a1+i3, s_offset_b1+i2, s_offset_c1+i1, s_offset_d1+3)= &
primitives(s_offset_a1+i3, s_offset_b1+i2, s_offset_c1+i1, s_offset_d1+3)+ &
buffer1(2+(i-1)*kmax) * sphi_d(2,3 +s_offset_d1)
primitives(s_offset_a1+i3, s_offset_b1+i2, s_offset_c1+i1, s_offset_d1+4)= &
primitives(s_offset_a1+i3, s_offset_b1+i2, s_offset_c1+i1, s_offset_d1+4)+ &
buffer1(3+(i-1)*kmax) * sphi_d(3,4 +s_offset_d1)
primitives(s_offset_a1+i3, s_offset_b1+i2, s_offset_c1+i1, s_offset_d1+6)= &
primitives(s_offset_a1+i3, s_offset_b1+i2, s_offset_c1+i1, s_offset_d1+6)+ &
buffer1(3+(i-1)*kmax) * sphi_d(3,6 +s_offset_d1)
primitives(s_offset_a1+i3, s_offset_b1+i2, s_offset_c1+i1, s_offset_d1+5)= &
primitives(s_offset_a1+i3, s_offset_b1+i2, s_offset_c1+i1, s_offset_d1+5)+ &
buffer1(4+(i-1)*kmax) * sphi_d(4,5 +s_offset_d1)
primitives(s_offset_a1+i3, s_offset_b1+i2, s_offset_c1+i1, s_offset_d1+7)= &
primitives(s_offset_a1+i3, s_offset_b1+i2, s_offset_c1+i1, s_offset_d1+7)+ &
buffer1(4+(i-1)*kmax) * sphi_d(4,7 +s_offset_d1)
primitives(s_offset_a1+i3, s_offset_b1+i2, s_offset_c1+i1, s_offset_d1+2)= &
primitives(s_offset_a1+i3, s_offset_b1+i2, s_offset_c1+i1, s_offset_d1+2)+ &
buffer1(5+(i-1)*kmax) * sphi_d(5,2 +s_offset_d1)
primitives(s_offset_a1+i3, s_offset_b1+i2, s_offset_c1+i1, s_offset_d1+5)= &
primitives(s_offset_a1+i3, s_offset_b1+i2, s_offset_c1+i1, s_offset_d1+5)+ &
buffer1(6+(i-1)*kmax) * sphi_d(6,5 +s_offset_d1)
primitives(s_offset_a1+i3, s_offset_b1+i2, s_offset_c1+i1, s_offset_d1+1)= &
primitives(s_offset_a1+i3, s_offset_b1+i2, s_offset_c1+i1, s_offset_d1+1)+ &
buffer1(7+(i-1)*kmax) * sphi_d(7,1 +s_offset_d1)
primitives(s_offset_a1+i3, s_offset_b1+i2, s_offset_c1+i1, s_offset_d1+3)= &
primitives(s_offset_a1+i3, s_offset_b1+i2, s_offset_c1+i1, s_offset_d1+3)+ &
buffer1(7+(i-1)*kmax) * sphi_d(7,3 +s_offset_d1)
primitives(s_offset_a1+i3, s_offset_b1+i2, s_offset_c1+i1, s_offset_d1+4)= &
primitives(s_offset_a1+i3, s_offset_b1+i2, s_offset_c1+i1, s_offset_d1+4)+ &
buffer1(8+(i-1)*kmax) * sphi_d(8,4 +s_offset_d1)
primitives(s_offset_a1+i3, s_offset_b1+i2, s_offset_c1+i1, s_offset_d1+6)= &
primitives(s_offset_a1+i3, s_offset_b1+i2, s_offset_c1+i1, s_offset_d1+6)+ &
buffer1(8+(i-1)*kmax) * sphi_d(8,6 +s_offset_d1)
primitives(s_offset_a1+i3, s_offset_b1+i2, s_offset_c1+i1, s_offset_d1+3)= &
primitives(s_offset_a1+i3, s_offset_b1+i2, s_offset_c1+i1, s_offset_d1+3)+ &
buffer1(9+(i-1)*kmax) * sphi_d(9,3 +s_offset_d1)
primitives(s_offset_a1+i3, s_offset_b1+i2, s_offset_c1+i1, s_offset_d1+4)= &
primitives(s_offset_a1+i3, s_offset_b1+i2, s_offset_c1+i1, s_offset_d1+4)+ &
buffer1(10+(i-1)*kmax) * sphi_d(10,4 +s_offset_d1)
