buffer2(i+imax*(9-1)) = buffer2(i+imax*(9-1)) + buffer1(1+(i-1)*kmax) * sphi_b(1,9+s_offset_b1)
buffer2(i+imax*(11-1)) = buffer2(i+imax*(11-1)) + buffer1(1+(i-1)*kmax) * sphi_b(1,11+s_offset_b1)
buffer2(i+imax*(13-1)) = buffer2(i+imax*(13-1)) + buffer1(1+(i-1)*kmax) * sphi_b(1,13+s_offset_b1)
buffer2(i+imax*(15-1)) = buffer2(i+imax*(15-1)) + buffer1(1+(i-1)*kmax) * sphi_b(1,15+s_offset_b1)
buffer2(i+imax*(17-1)) = buffer2(i+imax*(17-1)) + buffer1(1+(i-1)*kmax) * sphi_b(1,17+s_offset_b1)
buffer2(i+imax*(1-1)) = buffer2(i+imax*(1-1)) + buffer1(2+(i-1)*kmax) * sphi_b(2,1+s_offset_b1)
buffer2(i+imax*(3-1)) = buffer2(i+imax*(3-1)) + buffer1(2+(i-1)*kmax) * sphi_b(2,3+s_offset_b1)
buffer2(i+imax*(5-1)) = buffer2(i+imax*(5-1)) + buffer1(2+(i-1)*kmax) * sphi_b(2,5+s_offset_b1)
buffer2(i+imax*(7-1)) = buffer2(i+imax*(7-1)) + buffer1(2+(i-1)*kmax) * sphi_b(2,7+s_offset_b1)
buffer2(i+imax*(10-1)) = buffer2(i+imax*(10-1)) + buffer1(3+(i-1)*kmax) * sphi_b(3,10+s_offset_b1)
buffer2(i+imax*(12-1)) = buffer2(i+imax*(12-1)) + buffer1(3+(i-1)*kmax) * sphi_b(3,12+s_offset_b1)
buffer2(i+imax*(14-1)) = buffer2(i+imax*(14-1)) + buffer1(3+(i-1)*kmax) * sphi_b(3,14+s_offset_b1)
buffer2(i+imax*(16-1)) = buffer2(i+imax*(16-1)) + buffer1(3+(i-1)*kmax) * sphi_b(3,16+s_offset_b1)
buffer2(i+imax*(9-1)) = buffer2(i+imax*(9-1)) + buffer1(4+(i-1)*kmax) * sphi_b(4,9+s_offset_b1)
buffer2(i+imax*(11-1)) = buffer2(i+imax*(11-1)) + buffer1(4+(i-1)*kmax) * sphi_b(4,11+s_offset_b1)
buffer2(i+imax*(13-1)) = buffer2(i+imax*(13-1)) + buffer1(4+(i-1)*kmax) * sphi_b(4,13+s_offset_b1)
buffer2(i+imax*(15-1)) = buffer2(i+imax*(15-1)) + buffer1(4+(i-1)*kmax) * sphi_b(4,15+s_offset_b1)
buffer2(i+imax*(17-1)) = buffer2(i+imax*(17-1)) + buffer1(4+(i-1)*kmax) * sphi_b(4,17+s_offset_b1)
buffer2(i+imax*(2-1)) = buffer2(i+imax*(2-1)) + buffer1(5+(i-1)*kmax) * sphi_b(5,2+s_offset_b1)
buffer2(i+imax*(4-1)) = buffer2(i+imax*(4-1)) + buffer1(5+(i-1)*kmax) * sphi_b(5,4+s_offset_b1)
buffer2(i+imax*(6-1)) = buffer2(i+imax*(6-1)) + buffer1(5+(i-1)*kmax) * sphi_b(5,6+s_offset_b1)
buffer2(i+imax*(8-1)) = buffer2(i+imax*(8-1)) + buffer1(5+(i-1)*kmax) * sphi_b(5,8+s_offset_b1)
buffer2(i+imax*(9-1)) = buffer2(i+imax*(9-1)) + buffer1(6+(i-1)*kmax) * sphi_b(6,9+s_offset_b1)
buffer2(i+imax*(11-1)) = buffer2(i+imax*(11-1)) + buffer1(6+(i-1)*kmax) * sphi_b(6,11+s_offset_b1)
buffer2(i+imax*(13-1)) = buffer2(i+imax*(13-1)) + buffer1(6+(i-1)*kmax) * sphi_b(6,13+s_offset_b1)
buffer2(i+imax*(15-1)) = buffer2(i+imax*(15-1)) + buffer1(6+(i-1)*kmax) * sphi_b(6,15+s_offset_b1)
buffer2(i+imax*(1-1)) = buffer2(i+imax*(1-1)) + buffer1(7+(i-1)*kmax) * sphi_b(7,1+s_offset_b1)
buffer2(i+imax*(3-1)) = buffer2(i+imax*(3-1)) + buffer1(7+(i-1)*kmax) * sphi_b(7,3+s_offset_b1)
buffer2(i+imax*(5-1)) = buffer2(i+imax*(5-1)) + buffer1(7+(i-1)*kmax) * sphi_b(7,5+s_offset_b1)
buffer2(i+imax*(7-1)) = buffer2(i+imax*(7-1)) + buffer1(7+(i-1)*kmax) * sphi_b(7,7+s_offset_b1)
buffer2(i+imax*(10-1)) = buffer2(i+imax*(10-1)) + buffer1(8+(i-1)*kmax) * sphi_b(8,10+s_offset_b1)
buffer2(i+imax*(12-1)) = buffer2(i+imax*(12-1)) + buffer1(8+(i-1)*kmax) * sphi_b(8,12+s_offset_b1)
buffer2(i+imax*(14-1)) = buffer2(i+imax*(14-1)) + buffer1(8+(i-1)*kmax) * sphi_b(8,14+s_offset_b1)
buffer2(i+imax*(16-1)) = buffer2(i+imax*(16-1)) + buffer1(8+(i-1)*kmax) * sphi_b(8,16+s_offset_b1)
buffer2(i+imax*(3-1)) = buffer2(i+imax*(3-1)) + buffer1(9+(i-1)*kmax) * sphi_b(9,3+s_offset_b1)
buffer2(i+imax*(5-1)) = buffer2(i+imax*(5-1)) + buffer1(9+(i-1)*kmax) * sphi_b(9,5+s_offset_b1)
buffer2(i+imax*(7-1)) = buffer2(i+imax*(7-1)) + buffer1(9+(i-1)*kmax) * sphi_b(9,7+s_offset_b1)
buffer2(i+imax*(10-1)) = buffer2(i+imax*(10-1)) + buffer1(10+(i-1)*kmax) * sphi_b(10,10+s_offset_b1)
buffer2(i+imax*(12-1)) = buffer2(i+imax*(12-1)) + buffer1(10+(i-1)*kmax) * sphi_b(10,12+s_offset_b1)
buffer2(i+imax*(14-1)) = buffer2(i+imax*(14-1)) + buffer1(10+(i-1)*kmax) * sphi_b(10,14+s_offset_b1)
buffer2(i+imax*(9-1)) = buffer2(i+imax*(9-1)) + buffer1(11+(i-1)*kmax) * sphi_b(11,9+s_offset_b1)
buffer2(i+imax*(13-1)) = buffer2(i+imax*(13-1)) + buffer1(11+(i-1)*kmax) * sphi_b(11,13+s_offset_b1)
buffer2(i+imax*(17-1)) = buffer2(i+imax*(17-1)) + buffer1(11+(i-1)*kmax) * sphi_b(11,17+s_offset_b1)
buffer2(i+imax*(2-1)) = buffer2(i+imax*(2-1)) + buffer1(12+(i-1)*kmax) * sphi_b(12,2+s_offset_b1)
buffer2(i+imax*(4-1)) = buffer2(i+imax*(4-1)) + buffer1(12+(i-1)*kmax) * sphi_b(12,4+s_offset_b1)
buffer2(i+imax*(6-1)) = buffer2(i+imax*(6-1)) + buffer1(12+(i-1)*kmax) * sphi_b(12,6+s_offset_b1)
buffer2(i+imax*(8-1)) = buffer2(i+imax*(8-1)) + buffer1(12+(i-1)*kmax) * sphi_b(12,8+s_offset_b1)
buffer2(i+imax*(9-1)) = buffer2(i+imax*(9-1)) + buffer1(13+(i-1)*kmax) * sphi_b(13,9+s_offset_b1)
buffer2(i+imax*(11-1)) = buffer2(i+imax*(11-1)) + buffer1(13+(i-1)*kmax) * sphi_b(13,11+s_offset_b1)
buffer2(i+imax*(13-1)) = buffer2(i+imax*(13-1)) + buffer1(13+(i-1)*kmax) * sphi_b(13,13+s_offset_b1)
buffer2(i+imax*(15-1)) = buffer2(i+imax*(15-1)) + buffer1(13+(i-1)*kmax) * sphi_b(13,15+s_offset_b1)
buffer2(i+imax*(4-1)) = buffer2(i+imax*(4-1)) + buffer1(14+(i-1)*kmax) * sphi_b(14,4+s_offset_b1)
buffer2(i+imax*(6-1)) = buffer2(i+imax*(6-1)) + buffer1(14+(i-1)*kmax) * sphi_b(14,6+s_offset_b1)
buffer2(i+imax*(8-1)) = buffer2(i+imax*(8-1)) + buffer1(14+(i-1)*kmax) * sphi_b(14,8+s_offset_b1)
buffer2(i+imax*(9-1)) = buffer2(i+imax*(9-1)) + buffer1(15+(i-1)*kmax) * sphi_b(15,9+s_offset_b1)
buffer2(i+imax*(11-1)) = buffer2(i+imax*(11-1)) + buffer1(15+(i-1)*kmax) * sphi_b(15,11+s_offset_b1)
buffer2(i+imax*(13-1)) = buffer2(i+imax*(13-1)) + buffer1(15+(i-1)*kmax) * sphi_b(15,13+s_offset_b1)
buffer2(i+imax*(1-1)) = buffer2(i+imax*(1-1)) + buffer1(16+(i-1)*kmax) * sphi_b(16,1+s_offset_b1)
buffer2(i+imax*(3-1)) = buffer2(i+imax*(3-1)) + buffer1(16+(i-1)*kmax) * sphi_b(16,3+s_offset_b1)
buffer2(i+imax*(5-1)) = buffer2(i+imax*(5-1)) + buffer1(16+(i-1)*kmax) * sphi_b(16,5+s_offset_b1)
buffer2(i+imax*(7-1)) = buffer2(i+imax*(7-1)) + buffer1(16+(i-1)*kmax) * sphi_b(16,7+s_offset_b1)
buffer2(i+imax*(10-1)) = buffer2(i+imax*(10-1)) + buffer1(17+(i-1)*kmax) * sphi_b(17,10+s_offset_b1)
buffer2(i+imax*(12-1)) = buffer2(i+imax*(12-1)) + buffer1(17+(i-1)*kmax) * sphi_b(17,12+s_offset_b1)
buffer2(i+imax*(14-1)) = buffer2(i+imax*(14-1)) + buffer1(17+(i-1)*kmax) * sphi_b(17,14+s_offset_b1)
buffer2(i+imax*(16-1)) = buffer2(i+imax*(16-1)) + buffer1(17+(i-1)*kmax) * sphi_b(17,16+s_offset_b1)
buffer2(i+imax*(3-1)) = buffer2(i+imax*(3-1)) + buffer1(18+(i-1)*kmax) * sphi_b(18,3+s_offset_b1)
buffer2(i+imax*(7-1)) = buffer2(i+imax*(7-1)) + buffer1(18+(i-1)*kmax) * sphi_b(18,7+s_offset_b1)
buffer2(i+imax*(10-1)) = buffer2(i+imax*(10-1)) + buffer1(19+(i-1)*kmax) * sphi_b(19,10+s_offset_b1)
buffer2(i+imax*(12-1)) = buffer2(i+imax*(12-1)) + buffer1(19+(i-1)*kmax) * sphi_b(19,12+s_offset_b1)
buffer2(i+imax*(14-1)) = buffer2(i+imax*(14-1)) + buffer1(19+(i-1)*kmax) * sphi_b(19,14+s_offset_b1)
buffer2(i+imax*(5-1)) = buffer2(i+imax*(5-1)) + buffer1(20+(i-1)*kmax) * sphi_b(20,5+s_offset_b1)
buffer2(i+imax*(7-1)) = buffer2(i+imax*(7-1)) + buffer1(20+(i-1)*kmax) * sphi_b(20,7+s_offset_b1)
buffer2(i+imax*(10-1)) = buffer2(i+imax*(10-1)) + buffer1(21+(i-1)*kmax) * sphi_b(21,10+s_offset_b1)
buffer2(i+imax*(12-1)) = buffer2(i+imax*(12-1)) + buffer1(21+(i-1)*kmax) * sphi_b(21,12+s_offset_b1)
buffer2(i+imax*(9-1)) = buffer2(i+imax*(9-1)) + buffer1(22+(i-1)*kmax) * sphi_b(22,9+s_offset_b1)
buffer2(i+imax*(11-1)) = buffer2(i+imax*(11-1)) + buffer1(22+(i-1)*kmax) * sphi_b(22,11+s_offset_b1)
buffer2(i+imax*(13-1)) = buffer2(i+imax*(13-1)) + buffer1(22+(i-1)*kmax) * sphi_b(22,13+s_offset_b1)
buffer2(i+imax*(15-1)) = buffer2(i+imax*(15-1)) + buffer1(22+(i-1)*kmax) * sphi_b(22,15+s_offset_b1)
buffer2(i+imax*(17-1)) = buffer2(i+imax*(17-1)) + buffer1(22+(i-1)*kmax) * sphi_b(22,17+s_offset_b1)
buffer2(i+imax*(2-1)) = buffer2(i+imax*(2-1)) + buffer1(23+(i-1)*kmax) * sphi_b(23,2+s_offset_b1)
buffer2(i+imax*(4-1)) = buffer2(i+imax*(4-1)) + buffer1(23+(i-1)*kmax) * sphi_b(23,4+s_offset_b1)
buffer2(i+imax*(6-1)) = buffer2(i+imax*(6-1)) + buffer1(23+(i-1)*kmax) * sphi_b(23,6+s_offset_b1)
buffer2(i+imax*(8-1)) = buffer2(i+imax*(8-1)) + buffer1(23+(i-1)*kmax) * sphi_b(23,8+s_offset_b1)
buffer2(i+imax*(9-1)) = buffer2(i+imax*(9-1)) + buffer1(24+(i-1)*kmax) * sphi_b(24,9+s_offset_b1)
buffer2(i+imax*(11-1)) = buffer2(i+imax*(11-1)) + buffer1(24+(i-1)*kmax) * sphi_b(24,11+s_offset_b1)
buffer2(i+imax*(13-1)) = buffer2(i+imax*(13-1)) + buffer1(24+(i-1)*kmax) * sphi_b(24,13+s_offset_b1)
buffer2(i+imax*(15-1)) = buffer2(i+imax*(15-1)) + buffer1(24+(i-1)*kmax) * sphi_b(24,15+s_offset_b1)
buffer2(i+imax*(4-1)) = buffer2(i+imax*(4-1)) + buffer1(25+(i-1)*kmax) * sphi_b(25,4+s_offset_b1)
buffer2(i+imax*(6-1)) = buffer2(i+imax*(6-1)) + buffer1(25+(i-1)*kmax) * sphi_b(25,6+s_offset_b1)
buffer2(i+imax*(8-1)) = buffer2(i+imax*(8-1)) + buffer1(25+(i-1)*kmax) * sphi_b(25,8+s_offset_b1)
buffer2(i+imax*(9-1)) = buffer2(i+imax*(9-1)) + buffer1(26+(i-1)*kmax) * sphi_b(26,9+s_offset_b1)
buffer2(i+imax*(13-1)) = buffer2(i+imax*(13-1)) + buffer1(26+(i-1)*kmax) * sphi_b(26,13+s_offset_b1)
buffer2(i+imax*(6-1)) = buffer2(i+imax*(6-1)) + buffer1(27+(i-1)*kmax) * sphi_b(27,6+s_offset_b1)
buffer2(i+imax*(8-1)) = buffer2(i+imax*(8-1)) + buffer1(27+(i-1)*kmax) * sphi_b(27,8+s_offset_b1)
buffer2(i+imax*(9-1)) = buffer2(i+imax*(9-1)) + buffer1(28+(i-1)*kmax) * sphi_b(28,9+s_offset_b1)
buffer2(i+imax*(11-1)) = buffer2(i+imax*(11-1)) + buffer1(28+(i-1)*kmax) * sphi_b(28,11+s_offset_b1)
buffer2(i+imax*(1-1)) = buffer2(i+imax*(1-1)) + buffer1(29+(i-1)*kmax) * sphi_b(29,1+s_offset_b1)
buffer2(i+imax*(3-1)) = buffer2(i+imax*(3-1)) + buffer1(29+(i-1)*kmax) * sphi_b(29,3+s_offset_b1)
buffer2(i+imax*(5-1)) = buffer2(i+imax*(5-1)) + buffer1(29+(i-1)*kmax) * sphi_b(29,5+s_offset_b1)
buffer2(i+imax*(7-1)) = buffer2(i+imax*(7-1)) + buffer1(29+(i-1)*kmax) * sphi_b(29,7+s_offset_b1)
buffer2(i+imax*(10-1)) = buffer2(i+imax*(10-1)) + buffer1(30+(i-1)*kmax) * sphi_b(30,10+s_offset_b1)
buffer2(i+imax*(12-1)) = buffer2(i+imax*(12-1)) + buffer1(30+(i-1)*kmax) * sphi_b(30,12+s_offset_b1)
buffer2(i+imax*(14-1)) = buffer2(i+imax*(14-1)) + buffer1(30+(i-1)*kmax) * sphi_b(30,14+s_offset_b1)
buffer2(i+imax*(16-1)) = buffer2(i+imax*(16-1)) + buffer1(30+(i-1)*kmax) * sphi_b(30,16+s_offset_b1)
buffer2(i+imax*(3-1)) = buffer2(i+imax*(3-1)) + buffer1(31+(i-1)*kmax) * sphi_b(31,3+s_offset_b1)
buffer2(i+imax*(5-1)) = buffer2(i+imax*(5-1)) + buffer1(31+(i-1)*kmax) * sphi_b(31,5+s_offset_b1)
buffer2(i+imax*(7-1)) = buffer2(i+imax*(7-1)) + buffer1(31+(i-1)*kmax) * sphi_b(31,7+s_offset_b1)
buffer2(i+imax*(10-1)) = buffer2(i+imax*(10-1)) + buffer1(32+(i-1)*kmax) * sphi_b(32,10+s_offset_b1)
buffer2(i+imax*(12-1)) = buffer2(i+imax*(12-1)) + buffer1(32+(i-1)*kmax) * sphi_b(32,12+s_offset_b1)
buffer2(i+imax*(14-1)) = buffer2(i+imax*(14-1)) + buffer1(32+(i-1)*kmax) * sphi_b(32,14+s_offset_b1)
buffer2(i+imax*(5-1)) = buffer2(i+imax*(5-1)) + buffer1(33+(i-1)*kmax) * sphi_b(33,5+s_offset_b1)
buffer2(i+imax*(7-1)) = buffer2(i+imax*(7-1)) + buffer1(33+(i-1)*kmax) * sphi_b(33,7+s_offset_b1)
buffer2(i+imax*(10-1)) = buffer2(i+imax*(10-1)) + buffer1(34+(i-1)*kmax) * sphi_b(34,10+s_offset_b1)
buffer2(i+imax*(12-1)) = buffer2(i+imax*(12-1)) + buffer1(34+(i-1)*kmax) * sphi_b(34,12+s_offset_b1)
buffer2(i+imax*(7-1)) = buffer2(i+imax*(7-1)) + buffer1(35+(i-1)*kmax) * sphi_b(35,7+s_offset_b1)
buffer2(i+imax*(10-1)) = buffer2(i+imax*(10-1)) + buffer1(36+(i-1)*kmax) * sphi_b(36,10+s_offset_b1)
buffer2(i+imax*(9-1)) = buffer2(i+imax*(9-1)) + buffer1(37+(i-1)*kmax) * sphi_b(37,9+s_offset_b1)
buffer2(i+imax*(11-1)) = buffer2(i+imax*(11-1)) + buffer1(37+(i-1)*kmax) * sphi_b(37,11+s_offset_b1)
buffer2(i+imax*(13-1)) = buffer2(i+imax*(13-1)) + buffer1(37+(i-1)*kmax) * sphi_b(37,13+s_offset_b1)
buffer2(i+imax*(15-1)) = buffer2(i+imax*(15-1)) + buffer1(37+(i-1)*kmax) * sphi_b(37,15+s_offset_b1)
buffer2(i+imax*(17-1)) = buffer2(i+imax*(17-1)) + buffer1(37+(i-1)*kmax) * sphi_b(37,17+s_offset_b1)
buffer2(i+imax*(2-1)) = buffer2(i+imax*(2-1)) + buffer1(38+(i-1)*kmax) * sphi_b(38,2+s_offset_b1)
buffer2(i+imax*(4-1)) = buffer2(i+imax*(4-1)) + buffer1(38+(i-1)*kmax) * sphi_b(38,4+s_offset_b1)
buffer2(i+imax*(6-1)) = buffer2(i+imax*(6-1)) + buffer1(38+(i-1)*kmax) * sphi_b(38,6+s_offset_b1)
buffer2(i+imax*(8-1)) = buffer2(i+imax*(8-1)) + buffer1(38+(i-1)*kmax) * sphi_b(38,8+s_offset_b1)
buffer2(i+imax*(9-1)) = buffer2(i+imax*(9-1)) + buffer1(39+(i-1)*kmax) * sphi_b(39,9+s_offset_b1)
buffer2(i+imax*(11-1)) = buffer2(i+imax*(11-1)) + buffer1(39+(i-1)*kmax) * sphi_b(39,11+s_offset_b1)
buffer2(i+imax*(13-1)) = buffer2(i+imax*(13-1)) + buffer1(39+(i-1)*kmax) * sphi_b(39,13+s_offset_b1)
buffer2(i+imax*(15-1)) = buffer2(i+imax*(15-1)) + buffer1(39+(i-1)*kmax) * sphi_b(39,15+s_offset_b1)
buffer2(i+imax*(4-1)) = buffer2(i+imax*(4-1)) + buffer1(40+(i-1)*kmax) * sphi_b(40,4+s_offset_b1)
buffer2(i+imax*(6-1)) = buffer2(i+imax*(6-1)) + buffer1(40+(i-1)*kmax) * sphi_b(40,6+s_offset_b1)
buffer2(i+imax*(8-1)) = buffer2(i+imax*(8-1)) + buffer1(40+(i-1)*kmax) * sphi_b(40,8+s_offset_b1)
buffer2(i+imax*(9-1)) = buffer2(i+imax*(9-1)) + buffer1(41+(i-1)*kmax) * sphi_b(41,9+s_offset_b1)
buffer2(i+imax*(11-1)) = buffer2(i+imax*(11-1)) + buffer1(41+(i-1)*kmax) * sphi_b(41,11+s_offset_b1)
buffer2(i+imax*(13-1)) = buffer2(i+imax*(13-1)) + buffer1(41+(i-1)*kmax) * sphi_b(41,13+s_offset_b1)
buffer2(i+imax*(6-1)) = buffer2(i+imax*(6-1)) + buffer1(42+(i-1)*kmax) * sphi_b(42,6+s_offset_b1)
buffer2(i+imax*(8-1)) = buffer2(i+imax*(8-1)) + buffer1(42+(i-1)*kmax) * sphi_b(42,8+s_offset_b1)
buffer2(i+imax*(9-1)) = buffer2(i+imax*(9-1)) + buffer1(43+(i-1)*kmax) * sphi_b(43,9+s_offset_b1)
buffer2(i+imax*(11-1)) = buffer2(i+imax*(11-1)) + buffer1(43+(i-1)*kmax) * sphi_b(43,11+s_offset_b1)
buffer2(i+imax*(8-1)) = buffer2(i+imax*(8-1)) + buffer1(44+(i-1)*kmax) * sphi_b(44,8+s_offset_b1)
buffer2(i+imax*(9-1)) = buffer2(i+imax*(9-1)) + buffer1(45+(i-1)*kmax) * sphi_b(45,9+s_offset_b1)
