module brute_general
use sep
implicit none
real,   public,save             :: os1,os2,os3,os4,ds1,ds2,ds3,ds4,eps1,eps2
integer,public,save             :: ns1,ns2,ns3,ns4,ntot,jx,jz,node
! corridor
logical,public,save             :: corridor
real,   public,save             :: perc1,perc2,tgt1,tgt2
integer,public,save             :: nfunc
contains
!================================================
subroutine parameters()
 integer    :: n1,n2
 real       :: d1,d2,o1,o2

 call from_aux("scan","n1",ns1);call from_aux("scan","d1",ds1);call from_aux("scan","o1",os1);
 call from_aux("scan","n2",ns2);call from_aux("scan","d2",ds2);call from_aux("scan","o2",os2);
 call from_aux("scan","n3",ns3);call from_aux("scan","d3",ds3);call from_aux("scan","o3",os3);
 call from_aux("scan","n4",ns4);call from_aux("scan","d4",ds4);call from_aux("scan","o4",os4);
 call from_param("jx",jx,11); call from_param("jz",jz,11);call from_param("node",node,99999)
 call from_param("eps1",eps1,1.); call from_param("eps2",eps2,10.)
 ntot=ns1*ns3
 call from_param("corridor",corridor,.false.)
 if (corridor) then
    call from_aux("rho0","n1",n1);call from_aux("rho0","d1",d1);call from_aux("rho0","o1",o1);
    call from_aux("rho0","n2",n2);call from_aux("rho0","d2",d2);call from_aux("rho0","o2",o2);
    if (ns1.ne.n1) call seperr("1st dimension of scan and rho0 does not conform")
    if (ns3.ne.n2) call seperr("3rd dimension of scan and 2nd rho0 do not conform")    
    if (ds1.ne.d1) call seperr("Spacing of 1st dimension of scan and rho0 does not conform")
    if (ds3.ne.d2) call seperr("Spacing of 3rd dimension of scan and 2nd rho0 do not conform")    
    if (os1.ne.o1) call seperr("Origin of 1st dimension of scan and rho0 does not conform")
    if (os3.ne.o2) call seperr("Origin of 3rd dimension of scan and 2nd rho0 do not conform")    
    call from_param("perc1",perc1,5.); call from_param("perc2",perc2,20.)
    call from_param("tgt1",tgt1,0.); call from_param("tgt2",tgt2,(n1-1)*d1+o1)
    call from_param("nfunc",nfunc,41)
 end if 
end subroutine
!================================================
end module
