#	<geosat.int.HH Geosat2trip.x  > triplets.H
#		Transpose and pass only columns 3,4,5
#%
integer n1,n2, n3, seven, nd
from history:	integer n1:seven, n2:nd, n3=1
if( seven !=7 ) call erexit( 'seven!= ')

subroutine doit( nd)
integer  id,     nd
real 	           x,y,v
temporary integer  data( 7,nd)
temporary real      xyz(nd, 3)

call sreed('in', data, 4*7*nd)

do id= 1, nd {
        x = data(3,id)/1.e6
        y = data(4,id)/1.e6
        v = data(5,id)
	xyz(id,1) =   x
	xyz(id,2) =   y
	xyz(id,3) =   v
#write(0,*) 'x,y,v',id,':',x,y,v        
}
call putch('n1','i',nd)
call putch('n2','i',3)
call hclose()
call srite('out', xyz, 4*3*nd)
return; end
