	subroutine lpselect(in,lpp,nfmt)
c select packed LP data with time from PSE-format data
c *** 11-Feb-01 ***
	integer in(9,180),lpp(6,90),and,or,rshift,lshift
	logical nfmt
	parameter (mask1='ffc00000'x,mask2='1ff800'x,mask3='3ff'x)
c
	do k=1,90
	 if (nfmt) then
	  j=k
	 else
	  j=2*k-1
	  end if
	 lpp(1,k)=in(1,j)
	 ms=or(and(lshift(in(3,j),8),'100'x),and(rshift(in(3,j),1),'7f'x))
	 if (and(in(3,j),'ffdffb00'x).ne.'e241d900'x) ms=or(ms,'1000'x)
	 lpp(2,k)=or(and(in(2,j),'ffff0000'),ms)
	 if (nfmt) then
	  lpp(3,k)=in(4,j)
	  lpp(4,k)=in(5,j)
	  lpp(5,k)=in(7,j)
	  lpp(6,k)=or(and(lshift(in(8,j),11),'fffff800'x)
&	  ,and(rshift(in(9,j),22),mask3))
	 else
	  lpp(3,k)=or(or(and(in(5,j),mask1),and(lshift(in(5,j),11),mask2))
&	  ,and(rshift(in(6,j),11),mask3))
	  lpp(4,k)=or(or(and(lshift(in(8,j),22),mask1),and(in(9,j),mask2))
&	  ,and(rshift(in(10,j),22),mask3))
	  lpp(5,k)=or(or(and(lshift(in(13,j),11),mask1)
&	  ,and(rshift(in(14,j),11),mask2)),and(in(14,j),mask3))
	  lpp(6,k)=or(or(and(lshift(in(16,j),22),mask1),and(in(17,j),mask2))
&	  ,and(rshift(in(18,j),22),mask3))
	  end if
	 end do
	return
	end


