	program WTLEAMCVsS
c get non-zero LEAM command verifications from WT files;in sync only
c **24-Dec-18**
	character filen*26,flx*5,cr*1,tf*1,df*1,time*21
	integer*2 in(10)
	integer in4(5)
	parameter (cr='0d'x)
	equivalence(in(1),in4(1))
	data time(1:15)/'1976-***T**:**:'/
&	,filen/'a17_leam_1976_l1_wt_cv.tab'/
c
	open(2,file='../WT-N-LEAM.txt',status='old')
	open(7,file='../leaml1aPDSs/'//filen)
	write(7,"(a31,a1)") 'year-dayThr:mn:sc.ms  f cmd m f',cr
c
100	read(2,*,end=29) nt,nf
	write(flx,'(i2,a1,i2)') nt,'.',nf
	do i=4,1,-1
	 if (flx(i:i).eq.' ') flx(i:5)=flx(i+1:5)//' '
	 end do
	open(1,file='../wtleaml1bs/wtleaml1b.'//flx,access='direct'
&	,form='unformatted',recl=20,status='old',err=100)
	write(*,*) flx
c
	nr=1
10	read(1,rec=nr,end=19) in
	if (in4(1).eq.0.or.in4(2).eq.0.or.
&	 and(in4(3),'ffffff00'x).ne.'3890ed00'x) go to 17
c get ALSEP word 7
	kv=and(in(8),'ff'x)
	if (kv.ne.0) then
	 kc=rshift(kv,1)
	 if(kc.eq.73.or.kc.eq.74.or.kc.eq.76.or.kc.eq.79) then
c get time
	  it=or(and(lshift(in4(1),28),'70000000'x),
&	  and(rshift(in4(2),4),'fffffff'x))
	  kd=it/5400000
	  it=mod(it,5400000)
	  kh=it/225000
	  it=mod(it,225000)
	  km=it/3750
	  sec=(mod(it,3750)*16+and(in4(2),15))/1000.
	  write(time(6:8),'(i3)')kd
	  if (time(6:6).eq.' ') time(6:6)='0'
	  if (time(7:7).eq.' ') time(7:7)='0'
	  write(time(10:11),'(i2)') kh
	  write(time(13:14),'(i2)') km
	  write(time(16:21),'(f6.3)') sec
	  do i=10,16,3
	   if (time(i:i).eq.' ') time(i:i)='0'
	   end do
	  tf='-'
	  df='-'
	  if (and(in4(1),8).ne.0) tf='*'
	  map=and(kv,1)
	  if (and(in4(4),'8000'x).ne.0) df='*'
c output
	  write(7,'(a21,1xa1,o4,o2,1x2a1)') 
&	   time,tf,kc,map,df,cr
	  end if
	 end if
17	nr=nr+1
	go to 10
19	close(1)
	go to 100
29	close(2)
	close(7)
	stop
	end

