 program kwrite

 use sep

 implicit none

 real, allocatable				:: sism(:,:,:),sism0(:,:,:)
 integer					:: kn,ik,ix,ih,iz,ip
 real						:: kd,ko,kall,dx,pi

 call sep_init()
 call sep_begin_prog()

 call to_history("n1",501); call to_history("d1",10.); call to_history("o1",0.)
 call to_history("n2",81); call to_history("d2",10.); call to_history("o2",-400.)
 call to_history("n3",181); call to_history("d3",10.); call to_history("o3",0.)

 allocate(sism(501,81,181),sism0(501,81,181))

do ip=1,1
 sism=0;
 do ix=1,181
    do iz=1,501
       do ih=1,81
	  if (iz==int(0.577*ip*(ix-1))+(ip-1)*ih+100) then
!	  if ((iz==ip*(ix-1)+(ip-1)*ih+50).and.(ih.ge.31.and.ih.le.51)) then
!	  if ((iz==ip*int(0.5*(ix-1))+(ip-1)*ih+50)) then
!	  if ((iz==ip*int(0.176*(ix-1))+ih+50)) then
	      if(iz .lt. 501)  sism(iz,ih,ix)=1.!exp(float(-(ih-41)**2/(10)))
	  end if
      end do
    end do
 end do
 sism0=sism0+sism
 end do
 call srite("out",sism0,4*501*81*181)

 call sep_end_prog()
 end program 
