	program GetLSMCVs
c get non-zero LSM command verifications
c **17-Oct-17**rev. 4-Jun-18**
	character filen*29,day*3,cr*1,tf*1,df*1,time*21
	integer*2 in(15,45)
	integer sf(4)
	parameter (cr='0d'x)
	data time(1:15)/'1975-***T**:**:'/
&	,filen/'a16_lsm_1975_l1_arcsav_cv.tab'/
c
	open(7,file='../lsml1aPDSs/'//filen)
	write(7,"(a36,a1)") 
&	'year-dayThr:mn:sc.ms  f stat cmd m f',cr
	write(*,"('days: '$)")
	read(*,*) id1,id2
	do id=id1,id2
	 write(day,'(i3)') id
	 if (day(1:1).eq.' ') day(1:1)='0'
	 open(1,file='../lsml1b16s/lsml1b.'//day,access='direct'
&	 ,form='unformatted',recl=1350,status='old',err=29)
	 write(*,*) day
	 nr=1
10	 read(1,rec=nr,end=19) in
	 do k=1,45
	  if (in(1,k).eq.0) go to 17
c get ALSEP word 46
	  in8=in(8,k)
	  kv=and(in8,'ff'x)
	  if (kv.ne.0) then
	   kc=rshift(kv,1)
	   if((kc.ge.83.and.kc.le.92).and.kc.ne.86.and.kc.ne.88) then
c get time
	    in2=in(2,k)
	    in3=in(3,k)
	    in4=in(4,k)
	    it=or(or(and(lshift(in2,28),'70000000'x)
&	    ,and(lshift(in3,12),'ffff000'x)),and(rshift(in4,4),'fff'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,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='-'
	    if (and(in2,'4008'x).ne.0) tf='*'
	    isf=in(1,k)
	    do i=4,1,-1
	     sf(i)=and(isf,7)
	     isf=rshift(isf,4)
	     end do
	    map=and(kv,1)
	    df='-'
	    in5=in(5,k)
	    in6=in(6,k)
	    ksyn=or(and(lshift(in5,8),'3fff00'x),and(rshift(in6,8),'ff'x))
	    if (ksyn.ne.'3890ed'x.or.and(in(8,k),'8000'x).ne.0) df='*'
c output
	    write(7,'(a21,1xa1,1x4i1,o4,o2,1x2a1)') 
&	     time,tf,sf,kc,map,df,cr
	    end if
	   end if
17	  end do
	 nr=nr+1
	 go to 10
19	 close(1)
29	 end do
	close(7)
	stop
	end

