buffer1(i+imax*(9-1)) = buffer1(i+imax*(9-1)) + buffer2(1+(i-1)*kmax) * sphi_c(1,9+s_offset_c1)
buffer1(i+imax*(11-1)) = buffer1(i+imax*(11-1)) + buffer2(1+(i-1)*kmax) * sphi_c(1,11+s_offset_c1)
buffer1(i+imax*(13-1)) = buffer1(i+imax*(13-1)) + buffer2(1+(i-1)*kmax) * sphi_c(1,13+s_offset_c1)
buffer1(i+imax*(15-1)) = buffer1(i+imax*(15-1)) + buffer2(1+(i-1)*kmax) * sphi_c(1,15+s_offset_c1)
buffer1(i+imax*(1-1)) = buffer1(i+imax*(1-1)) + buffer2(2+(i-1)*kmax) * sphi_c(2,1+s_offset_c1)
buffer1(i+imax*(3-1)) = buffer1(i+imax*(3-1)) + buffer2(2+(i-1)*kmax) * sphi_c(2,3+s_offset_c1)
buffer1(i+imax*(5-1)) = buffer1(i+imax*(5-1)) + buffer2(2+(i-1)*kmax) * sphi_c(2,5+s_offset_c1)
buffer1(i+imax*(7-1)) = buffer1(i+imax*(7-1)) + buffer2(2+(i-1)*kmax) * sphi_c(2,7+s_offset_c1)
buffer1(i+imax*(8-1)) = buffer1(i+imax*(8-1)) + buffer2(3+(i-1)*kmax) * sphi_c(3,8+s_offset_c1)
buffer1(i+imax*(10-1)) = buffer1(i+imax*(10-1)) + buffer2(3+(i-1)*kmax) * sphi_c(3,10+s_offset_c1)
buffer1(i+imax*(12-1)) = buffer1(i+imax*(12-1)) + buffer2(3+(i-1)*kmax) * sphi_c(3,12+s_offset_c1)
buffer1(i+imax*(14-1)) = buffer1(i+imax*(14-1)) + buffer2(3+(i-1)*kmax) * sphi_c(3,14+s_offset_c1)
buffer1(i+imax*(9-1)) = buffer1(i+imax*(9-1)) + buffer2(4+(i-1)*kmax) * sphi_c(4,9+s_offset_c1)
buffer1(i+imax*(11-1)) = buffer1(i+imax*(11-1)) + buffer2(4+(i-1)*kmax) * sphi_c(4,11+s_offset_c1)
buffer1(i+imax*(13-1)) = buffer1(i+imax*(13-1)) + buffer2(4+(i-1)*kmax) * sphi_c(4,13+s_offset_c1)
buffer1(i+imax*(15-1)) = buffer1(i+imax*(15-1)) + buffer2(4+(i-1)*kmax) * sphi_c(4,15+s_offset_c1)
buffer1(i+imax*(2-1)) = buffer1(i+imax*(2-1)) + buffer2(5+(i-1)*kmax) * sphi_c(5,2+s_offset_c1)
buffer1(i+imax*(4-1)) = buffer1(i+imax*(4-1)) + buffer2(5+(i-1)*kmax) * sphi_c(5,4+s_offset_c1)
buffer1(i+imax*(6-1)) = buffer1(i+imax*(6-1)) + buffer2(5+(i-1)*kmax) * sphi_c(5,6+s_offset_c1)
buffer1(i+imax*(9-1)) = buffer1(i+imax*(9-1)) + buffer2(6+(i-1)*kmax) * sphi_c(6,9+s_offset_c1)
buffer1(i+imax*(11-1)) = buffer1(i+imax*(11-1)) + buffer2(6+(i-1)*kmax) * sphi_c(6,11+s_offset_c1)
buffer1(i+imax*(13-1)) = buffer1(i+imax*(13-1)) + buffer2(6+(i-1)*kmax) * sphi_c(6,13+s_offset_c1)
buffer1(i+imax*(1-1)) = buffer1(i+imax*(1-1)) + buffer2(7+(i-1)*kmax) * sphi_c(7,1+s_offset_c1)
buffer1(i+imax*(3-1)) = buffer1(i+imax*(3-1)) + buffer2(7+(i-1)*kmax) * sphi_c(7,3+s_offset_c1)
buffer1(i+imax*(5-1)) = buffer1(i+imax*(5-1)) + buffer2(7+(i-1)*kmax) * sphi_c(7,5+s_offset_c1)
buffer1(i+imax*(7-1)) = buffer1(i+imax*(7-1)) + buffer2(7+(i-1)*kmax) * sphi_c(7,7+s_offset_c1)
buffer1(i+imax*(8-1)) = buffer1(i+imax*(8-1)) + buffer2(8+(i-1)*kmax) * sphi_c(8,8+s_offset_c1)
buffer1(i+imax*(10-1)) = buffer1(i+imax*(10-1)) + buffer2(8+(i-1)*kmax) * sphi_c(8,10+s_offset_c1)
buffer1(i+imax*(12-1)) = buffer1(i+imax*(12-1)) + buffer2(8+(i-1)*kmax) * sphi_c(8,12+s_offset_c1)
buffer1(i+imax*(14-1)) = buffer1(i+imax*(14-1)) + buffer2(8+(i-1)*kmax) * sphi_c(8,14+s_offset_c1)
buffer1(i+imax*(3-1)) = buffer1(i+imax*(3-1)) + buffer2(9+(i-1)*kmax) * sphi_c(9,3+s_offset_c1)
buffer1(i+imax*(5-1)) = buffer1(i+imax*(5-1)) + buffer2(9+(i-1)*kmax) * sphi_c(9,5+s_offset_c1)
buffer1(i+imax*(7-1)) = buffer1(i+imax*(7-1)) + buffer2(9+(i-1)*kmax) * sphi_c(9,7+s_offset_c1)
buffer1(i+imax*(8-1)) = buffer1(i+imax*(8-1)) + buffer2(10+(i-1)*kmax) * sphi_c(10,8+s_offset_c1)
buffer1(i+imax*(10-1)) = buffer1(i+imax*(10-1)) + buffer2(10+(i-1)*kmax) * sphi_c(10,10+s_offset_c1)
buffer1(i+imax*(12-1)) = buffer1(i+imax*(12-1)) + buffer2(10+(i-1)*kmax) * sphi_c(10,12+s_offset_c1)
buffer1(i+imax*(9-1)) = buffer1(i+imax*(9-1)) + buffer2(11+(i-1)*kmax) * sphi_c(11,9+s_offset_c1)
buffer1(i+imax*(11-1)) = buffer1(i+imax*(11-1)) + buffer2(11+(i-1)*kmax) * sphi_c(11,11+s_offset_c1)
buffer1(i+imax*(13-1)) = buffer1(i+imax*(13-1)) + buffer2(11+(i-1)*kmax) * sphi_c(11,13+s_offset_c1)
buffer1(i+imax*(15-1)) = buffer1(i+imax*(15-1)) + buffer2(11+(i-1)*kmax) * sphi_c(11,15+s_offset_c1)
buffer1(i+imax*(2-1)) = buffer1(i+imax*(2-1)) + buffer2(12+(i-1)*kmax) * sphi_c(12,2+s_offset_c1)
buffer1(i+imax*(6-1)) = buffer1(i+imax*(6-1)) + buffer2(12+(i-1)*kmax) * sphi_c(12,6+s_offset_c1)
buffer1(i+imax*(9-1)) = buffer1(i+imax*(9-1)) + buffer2(13+(i-1)*kmax) * sphi_c(13,9+s_offset_c1)
buffer1(i+imax*(11-1)) = buffer1(i+imax*(11-1)) + buffer2(13+(i-1)*kmax) * sphi_c(13,11+s_offset_c1)
buffer1(i+imax*(13-1)) = buffer1(i+imax*(13-1)) + buffer2(13+(i-1)*kmax) * sphi_c(13,13+s_offset_c1)
buffer1(i+imax*(4-1)) = buffer1(i+imax*(4-1)) + buffer2(14+(i-1)*kmax) * sphi_c(14,4+s_offset_c1)
buffer1(i+imax*(6-1)) = buffer1(i+imax*(6-1)) + buffer2(14+(i-1)*kmax) * sphi_c(14,6+s_offset_c1)
buffer1(i+imax*(9-1)) = buffer1(i+imax*(9-1)) + buffer2(15+(i-1)*kmax) * sphi_c(15,9+s_offset_c1)
buffer1(i+imax*(11-1)) = buffer1(i+imax*(11-1)) + buffer2(15+(i-1)*kmax) * sphi_c(15,11+s_offset_c1)
buffer1(i+imax*(1-1)) = buffer1(i+imax*(1-1)) + buffer2(16+(i-1)*kmax) * sphi_c(16,1+s_offset_c1)
buffer1(i+imax*(3-1)) = buffer1(i+imax*(3-1)) + buffer2(16+(i-1)*kmax) * sphi_c(16,3+s_offset_c1)
buffer1(i+imax*(5-1)) = buffer1(i+imax*(5-1)) + buffer2(16+(i-1)*kmax) * sphi_c(16,5+s_offset_c1)
buffer1(i+imax*(7-1)) = buffer1(i+imax*(7-1)) + buffer2(16+(i-1)*kmax) * sphi_c(16,7+s_offset_c1)
buffer1(i+imax*(8-1)) = buffer1(i+imax*(8-1)) + buffer2(17+(i-1)*kmax) * sphi_c(17,8+s_offset_c1)
buffer1(i+imax*(10-1)) = buffer1(i+imax*(10-1)) + buffer2(17+(i-1)*kmax) * sphi_c(17,10+s_offset_c1)
buffer1(i+imax*(12-1)) = buffer1(i+imax*(12-1)) + buffer2(17+(i-1)*kmax) * sphi_c(17,12+s_offset_c1)
buffer1(i+imax*(14-1)) = buffer1(i+imax*(14-1)) + buffer2(17+(i-1)*kmax) * sphi_c(17,14+s_offset_c1)
buffer1(i+imax*(3-1)) = buffer1(i+imax*(3-1)) + buffer2(18+(i-1)*kmax) * sphi_c(18,3+s_offset_c1)
buffer1(i+imax*(5-1)) = buffer1(i+imax*(5-1)) + buffer2(18+(i-1)*kmax) * sphi_c(18,5+s_offset_c1)
buffer1(i+imax*(7-1)) = buffer1(i+imax*(7-1)) + buffer2(18+(i-1)*kmax) * sphi_c(18,7+s_offset_c1)
buffer1(i+imax*(8-1)) = buffer1(i+imax*(8-1)) + buffer2(19+(i-1)*kmax) * sphi_c(19,8+s_offset_c1)
buffer1(i+imax*(12-1)) = buffer1(i+imax*(12-1)) + buffer2(19+(i-1)*kmax) * sphi_c(19,12+s_offset_c1)
buffer1(i+imax*(5-1)) = buffer1(i+imax*(5-1)) + buffer2(20+(i-1)*kmax) * sphi_c(20,5+s_offset_c1)
buffer1(i+imax*(7-1)) = buffer1(i+imax*(7-1)) + buffer2(20+(i-1)*kmax) * sphi_c(20,7+s_offset_c1)
buffer1(i+imax*(8-1)) = buffer1(i+imax*(8-1)) + buffer2(21+(i-1)*kmax) * sphi_c(21,8+s_offset_c1)
buffer1(i+imax*(10-1)) = buffer1(i+imax*(10-1)) + buffer2(21+(i-1)*kmax) * sphi_c(21,10+s_offset_c1)
buffer1(i+imax*(9-1)) = buffer1(i+imax*(9-1)) + buffer2(22+(i-1)*kmax) * sphi_c(22,9+s_offset_c1)
buffer1(i+imax*(11-1)) = buffer1(i+imax*(11-1)) + buffer2(22+(i-1)*kmax) * sphi_c(22,11+s_offset_c1)
buffer1(i+imax*(13-1)) = buffer1(i+imax*(13-1)) + buffer2(22+(i-1)*kmax) * sphi_c(22,13+s_offset_c1)
buffer1(i+imax*(15-1)) = buffer1(i+imax*(15-1)) + buffer2(22+(i-1)*kmax) * sphi_c(22,15+s_offset_c1)
buffer1(i+imax*(2-1)) = buffer1(i+imax*(2-1)) + buffer2(23+(i-1)*kmax) * sphi_c(23,2+s_offset_c1)
buffer1(i+imax*(4-1)) = buffer1(i+imax*(4-1)) + buffer2(23+(i-1)*kmax) * sphi_c(23,4+s_offset_c1)
buffer1(i+imax*(6-1)) = buffer1(i+imax*(6-1)) + buffer2(23+(i-1)*kmax) * sphi_c(23,6+s_offset_c1)
buffer1(i+imax*(9-1)) = buffer1(i+imax*(9-1)) + buffer2(24+(i-1)*kmax) * sphi_c(24,9+s_offset_c1)
buffer1(i+imax*(11-1)) = buffer1(i+imax*(11-1)) + buffer2(24+(i-1)*kmax) * sphi_c(24,11+s_offset_c1)
buffer1(i+imax*(13-1)) = buffer1(i+imax*(13-1)) + buffer2(24+(i-1)*kmax) * sphi_c(24,13+s_offset_c1)
buffer1(i+imax*(4-1)) = buffer1(i+imax*(4-1)) + buffer2(25+(i-1)*kmax) * sphi_c(25,4+s_offset_c1)
buffer1(i+imax*(6-1)) = buffer1(i+imax*(6-1)) + buffer2(25+(i-1)*kmax) * sphi_c(25,6+s_offset_c1)
buffer1(i+imax*(9-1)) = buffer1(i+imax*(9-1)) + buffer2(26+(i-1)*kmax) * sphi_c(26,9+s_offset_c1)
buffer1(i+imax*(11-1)) = buffer1(i+imax*(11-1)) + buffer2(26+(i-1)*kmax) * sphi_c(26,11+s_offset_c1)
buffer1(i+imax*(6-1)) = buffer1(i+imax*(6-1)) + buffer2(27+(i-1)*kmax) * sphi_c(27,6+s_offset_c1)
buffer1(i+imax*(9-1)) = buffer1(i+imax*(9-1)) + buffer2(28+(i-1)*kmax) * sphi_c(28,9+s_offset_c1)
buffer1(i+imax*(1-1)) = buffer1(i+imax*(1-1)) + buffer2(29+(i-1)*kmax) * sphi_c(29,1+s_offset_c1)
buffer1(i+imax*(3-1)) = buffer1(i+imax*(3-1)) + buffer2(29+(i-1)*kmax) * sphi_c(29,3+s_offset_c1)
buffer1(i+imax*(5-1)) = buffer1(i+imax*(5-1)) + buffer2(29+(i-1)*kmax) * sphi_c(29,5+s_offset_c1)
buffer1(i+imax*(7-1)) = buffer1(i+imax*(7-1)) + buffer2(29+(i-1)*kmax) * sphi_c(29,7+s_offset_c1)
buffer1(i+imax*(8-1)) = buffer1(i+imax*(8-1)) + buffer2(30+(i-1)*kmax) * sphi_c(30,8+s_offset_c1)
buffer1(i+imax*(10-1)) = buffer1(i+imax*(10-1)) + buffer2(30+(i-1)*kmax) * sphi_c(30,10+s_offset_c1)
buffer1(i+imax*(12-1)) = buffer1(i+imax*(12-1)) + buffer2(30+(i-1)*kmax) * sphi_c(30,12+s_offset_c1)
buffer1(i+imax*(14-1)) = buffer1(i+imax*(14-1)) + buffer2(30+(i-1)*kmax) * sphi_c(30,14+s_offset_c1)
buffer1(i+imax*(3-1)) = buffer1(i+imax*(3-1)) + buffer2(31+(i-1)*kmax) * sphi_c(31,3+s_offset_c1)
buffer1(i+imax*(5-1)) = buffer1(i+imax*(5-1)) + buffer2(31+(i-1)*kmax) * sphi_c(31,5+s_offset_c1)
buffer1(i+imax*(7-1)) = buffer1(i+imax*(7-1)) + buffer2(31+(i-1)*kmax) * sphi_c(31,7+s_offset_c1)
buffer1(i+imax*(8-1)) = buffer1(i+imax*(8-1)) + buffer2(32+(i-1)*kmax) * sphi_c(32,8+s_offset_c1)
buffer1(i+imax*(10-1)) = buffer1(i+imax*(10-1)) + buffer2(32+(i-1)*kmax) * sphi_c(32,10+s_offset_c1)
buffer1(i+imax*(12-1)) = buffer1(i+imax*(12-1)) + buffer2(32+(i-1)*kmax) * sphi_c(32,12+s_offset_c1)
buffer1(i+imax*(5-1)) = buffer1(i+imax*(5-1)) + buffer2(33+(i-1)*kmax) * sphi_c(33,5+s_offset_c1)
buffer1(i+imax*(7-1)) = buffer1(i+imax*(7-1)) + buffer2(33+(i-1)*kmax) * sphi_c(33,7+s_offset_c1)
buffer1(i+imax*(8-1)) = buffer1(i+imax*(8-1)) + buffer2(34+(i-1)*kmax) * sphi_c(34,8+s_offset_c1)
buffer1(i+imax*(10-1)) = buffer1(i+imax*(10-1)) + buffer2(34+(i-1)*kmax) * sphi_c(34,10+s_offset_c1)
buffer1(i+imax*(7-1)) = buffer1(i+imax*(7-1)) + buffer2(35+(i-1)*kmax) * sphi_c(35,7+s_offset_c1)
buffer1(i+imax*(8-1)) = buffer1(i+imax*(8-1)) + buffer2(36+(i-1)*kmax) * sphi_c(36,8+s_offset_c1)
