module parametros_mod
use sep
use tipo_mod

implicit none
logical,public,save                                   :: chop,secgr
real,public,save                               	      :: axkd, aykd, azkd, axko, ayko, azko, chophi,choplo,expgrad,minvel
integer,public,save                            	      :: axkn, aykn, azkn, node
type(axis),public,save             		      :: axk, ayk, azk
type (axis),public,save				      :: xm, ym, z
type (velo),public,save				      :: v

contains

subroutine parametro()

write(0,*) "param01"
 call from_param("oxk", axko, 0.); call from_param("dxk", axkd, 1.); call from_param("nxk", axkn, 99999 )
 call from_param("oyk", ayko, 0.); call from_param("dyk", aykd, 1.); call from_param("nyk", aykn, 99999 )
 call from_param("ozk", azko, 0.); call from_param("dzk", azkd, 1.); call from_param("nzk", azkn, 99999 )
 call from_param("node",node,9999)
 axk%n=axkn; ayk%n=aykn; azk%n=azkn; axk%d=axkd; ayk%d=aykd; azk%d=azkd; axk%o=axko; ayk%o=ayko; azk%o=azko
 call from_param("chop",chop,.true.)
 call from_param("secgr",secgr,.true.)
 if (chop) then
   call from_param("chophi",chophi,.1)
   call from_param("choplo",choplo,.1)
   if (choplo > 1) choplo=choplo/100
   if (chophi > 1) chophi=chophi/100
 end if
 call from_param("expgrad",expgrad,0.125)
 call from_param("minvel",minvel,0.0002)
write(0,*) "param02"
 write(0,*) axkn,aykn,azkn; write(0,*) axkd,aykd,azkd; write(0,*) axko,ayko,azko
 call from_aux("vel","n1",v%xm%n);	call from_aux("vel","d1",v%xm%d);	call from_aux("vel","o1",v%xm%o)
 call from_aux("vel","n2",v%ym%n);	call from_aux("vel","d2",v%ym%d);	call from_aux("vel","o2",v%ym%o)
 call from_aux("vel","n3",v%z%n);	call from_aux("vel","d3",v%z%d);	call from_aux("vel","o3",v%z%o)

write(0,*) "param03"
 call to_history("n1",v%xm%n,"vspl"); call to_history("d1",v%xm%d,"vspl"); call to_history("o1",v%xm%o,"vspl")  
 call to_history("n2",v%ym%n,"vspl"); call to_history("d2",v%ym%d,"vspl"); call to_history("o2",v%ym%o,"vspl")
 call to_history("n3",v%z%n,"vspl") ; call to_history("d3",v%z%d,"vspl") ; call to_history("o3",v%z%o,"vspl")
 call to_history("esize",4,"vspl")
write(0,*) "param04"

end subroutine
end module
