program dataprep


use sep

implicit none

real, dimension(:,:), allocatable	:: data, data_mis
integer					:: n1, n2, i2, h, prep

call sep_init()

call from_history("n1", n1)
call from_history("n2", n2)
call from_param("prep", prep, 1)
call from_param("h", h, 10)

allocate(data(n1,n2), data_mis(n1,n2))
call sep_read(data)
if (prep==1) then 
		data_mis = 0.0
		do i2=1,n2,2 
				data_mis(:,i2) = data(:,i2)
		end do
end if		
if (prep==2) then
		data_mis = data 
		do i2 = n2/2,n2/2+h 
				data_mis(:,i2) = 0
		end do
end if
	
		
call sep_write(data_mis)
call sep_close()

end program dataprep			

