
program Inter_3D

use sep
use inter_filt_3D2x
use inter_fill_3D2x
use inter_patch_3D2x 
implicit none
integer				:: axis, niter, n1, n2, n3, nw1, nw2, nw3, npatch1, npatch2, npatch3,  alias
real, dimension(:,:,:), pointer	:: x_interp, x_mis 		 
 
call sep_init()



call from_param("nw1", nw1, 1)
call from_param("nw2", nw2, 1)
call from_param("nw3", nw3, 1)
call from_param("npatch1", npatch1, 1)
call from_param("npatch2", npatch2, 1) 
call from_param("npatch3", npatch3, 1)
call from_param("niter", niter, 100)
call from_param("alias", alias, 0)
call from_param("axis", axis, 1)
call from_history( "n1", n1)
call from_history( "n2", n2)
call from_history("n3", n3)
allocate (x_interp(n1,n2,n3), x_mis(n1,n2,n3))

call sep_read(x_mis)


! Calling the main filling program
call inter_patch_3Dx(nw1, nw2, nw3, niter, x_mis, x_interp, npatch1, npatch2, npatch3, n1, n2, n3, alias, axis) 

call sep_write(x_interp)


call sep_close()


end program Inter_3D
