 program sodcig_rot
 use sep
 use teste02

 implicit none

 complex, allocatable				:: Ccig(:,:,:),temp(:,:,:)
 real, allocatable				:: sodcig(:,:,:), rodcig(:,:,:)
 integer					:: stat
 type(axis)					:: x,z,h

 call sep_init()
 call sep_begin_prog()

 call from_history("n1",z%n); call from_history("d1",z%d); call from_history("o1",z%o)
 call from_history("n2",x%n); call from_history("d2",x%d); call from_history("o2",x%o)
 call from_history("n3",h%n); call from_history("d3",h%d); call from_history("o3",h%o)

 call to_history("n1",z%n,"Rot_s_cig"); call to_history("d1",z%d,"Rot_s_cig"); call to_history("o1",z%o,"Rot_s_cig")
 call to_history("n2",x%n,"Rot_s_cig"); call to_history("d2",h%d,"Rot_s_cig"); call to_history("o2",h%o,"Rot_s_cig")
 call to_history("n3",h%n,"Rot_s_cig"); call to_history("d3",x%d,"Rot_s_cig"); call to_history("o3",x%o,"Rot_s_cig")

 call to_history("n1",z%n,"Rot_g_cig"); call to_history("d1",z%d,"Rot_g_cig"); call to_history("o1",z%o,"Rot_g_cig")
 call to_history("n2",x%n,"Rot_g_cig"); call to_history("d2",x%d,"Rot_g_cig"); call to_history("o2",x%o,"Rot_g_cig")
 call to_history("n3",h%n,"Rot_g_cig"); call to_history("d3",h%d,"Rot_g_cig"); call to_history("o3",h%o,"Rot_g_cig")

 open(unit=2,file='lixo')

 stat = fftvar_init(x, z, h)

 allocate(sodcig(z%n,x%n,h%n),Ccig(kz%n,kx%n,kh%n),temp(kz%n,kx%n,kh%n))
 allocate(rodcig(z%n,x%n,h%n))
 sodcig=0.;Ccig=0.
 rodcig=0.

 call sreed("in", sodcig, 4*z%n*h%n*x%n)

 rodcig=sodcig

 call Rot(sodcig,1)
 call srite("Rot_s_cig",sodcig, 4*z%n*h%n*x%n)

 call Rot(rodcig,-1)
 call srite("Rot_g_cig",rodcig, 4*z%n*h%n*x%n)

 close(2)

 call sep_end_prog()
 end program sodcig_rot
