program alfill

! Fills in missing traces by a specified factor

use sep

implicit none

real, dimension(:,:), allocatable	:: data, data_fill
integer					:: n1, n2, i2, factor 

call sep_init()

call from_history("n1", n1)
call from_history("n2", n2)
call from_param("factor", factor, 2)

allocate(data(n1,n2), data_fill(n1,n2*factor))
call sep_read(data)

data_fill = 0.0
		do i2=2,factor*n2,2 
				data_fill(:,i2) = data(:,i2/2)
		end do

	
call to_history("n2", n2*factor)		
call sep_write(data_fill)
call sep_close()

end program alfill			

