module triangle2_smooth { use triangle_smooth contains # smooth by convolving with triangle in two dimensions. # subroutine triangle2 ( rect1, rect2, n1, n2, xx, yy) { integer,intent(in) :: rect1, rect2, n1, n2 integer :: i1,i2 real, intent (in) :: xx(:,:) real, intent (out) :: yy(:,:) real, allocatable :: temp(:,:) allocate(temp(n1,n2)) do i2= 1, n2 { call triangle( rect1, n1, xx(1:,i2), temp(1:,i2)) } do i1= 1, n1 { call triangle( rect2, n2, temp(i1,1:), yy(i1,1:)) } deallocate(temp) } }