
program Inter

use sep
use inter_filt2x
use inter_fill2x
use inter_patch2x 
implicit none
integer				:: prep, f, niter, n1, n2, h, ct, size, nw1, nw2, npatch1, npatch2,  alias
real, dimension(:,:), pointer	:: x_interp, x_mis 		 
 
call sep_init()


call from_param("prep", prep, 1)
call from_param("nw1", nw1, 1)
call from_param("nw2", nw2, 1)
call from_param("npatch1", npatch1, 1)
call from_param("npatch2", npatch2, 1) 
call from_param("f", f, 1)
call from_param("niter", niter, 100)
call from_param("h", h, 1)
call from_param("size", size, 1) 
call from_param("ct", ct, 1)
call from_param("alias", alias, 0)
call from_history( "n1", n1)
call from_history( "n2", n2)

allocate (x_interp(n1,n2), x_mis(n1,n2))

call sep_read(x_mis)


! Calling the main filling program
call inter_patchx(nw1, nw2, niter, f, size, prep, h, ct, x_mis, x_interp, npatch1, npatch2, n1, n2, alias) 

call sep_write(x_interp)


call sep_close()


end program Inter
