SUBROUTINE Extract_INE c Subroutine to extract INE data (both 1 & 2) c into a local arrays, adjusting for 39/41 samples. c Everything is stored in common, so no passed parameters IMPLICIT none INCLUDE "FastCom.ftni" C Local storage INTEGER idx, i, j, Cnt_lcl, Ptr_lcl INTEGER*2 SingInt(2) ! 2 16-bit #s INTEGER*4 DblInt ! convert to 1 32-bit EQUIVALENCE (SingInt,DblInt) C Start by setting up Cnt_lcl = Dig_Size(1)/20 Ptr_lcl = Dig_Start(1) C If there was leftover, move to 1st loc IF (INE_Over1(1).NE.0) THEN DO i = 1,10 Raw_INE1(i,1) = INE_Over1(i) INE_Over1(i) = 0 ! show empty END DO INE_Cnt1 = 1 ELSE ! no leftover INE_Cnt1 = 0 ! always init this each sec ENDIF C move the new stuff DO WHILE(INE_Cnt1.LT.40 .AND. ! stay in INE_Raw array limit & Cnt_lcl.GT.0) ! and more to move INE_Cnt1 = INE_Cnt1 + 1 ! filling the next burst DO i = 1,10 ! double word values SingInt(2) = IB(Ptr_lcl) ! Intel backward SingInt(1) = IB(Ptr_lcl+1) Raw_INE1(i,INE_Cnt1) = DblInt ! store 32 bits Ptr_lcl = Ptr_lcl + 2 ! bump in-array ptr END DO ! end of loop to move 1 burst Cnt_lcl = Cnt_lcl - 1 ! show we moved a burst END DO C If Cnt_lcl is not zero, we have at least 1 burst left IF (Cnt_lcl.GT.0) THEN ! move the next burst to overflow DO i = 1,10 ! double word values SingInt(2) = IB(Ptr_lcl) SingInt(1) = IB(Ptr_lcl+1) INE_Over1(i) = DblInt ! store 32 bits Ptr_lcl = Ptr_lcl + 2 ! bump in-array ptr END DO ! end of loop to move the overflow ENDIF C If INE_Cnt is less than 40, try to ride through IF (INE_Cnt1.EQ.39) THEN ! just missing one DO i = 1,10 ! duplicate 39 Raw_INE1(i,40) = Raw_INE1(i,39) END DO INE_Cnt1 = 40 ! show that we've go 40 filled c ELSEIF (INE_Cnt1.EQ.38) THEN ! we can put in 2 c DO j = 19,38 ! move 2nd half by 1 c DO i = 1,10 c Raw_INE1(i,j) = Raw_INE1(i,j) c END DO c END DO ! now (20) and (40) are empty c DO i = 1,10 ! duplicate 19 & 39 c Raw_INE1(i,20) = Raw_INE1(i,19) c Raw_INE1(i,40) = Raw_INE1(i,39) c END DO c INE_Cnt1 = 40 ! show that we've go 40 filled c ELSEIF (INE_Cnt1.LT.38) THEN ! too many to fill c VzLast = -999. ! flag to reset ENDIF C Do the same for INE2 Cnt_lcl = Dig_Size(2)/20 ! # of bursts Ptr_lcl = Dig_Start(2) C If there was leftover, move to 1st loc IF (INE_Over2(1).NE.0) THEN DO i = 1,10 Raw_INE2(i,1) = INE_Over2(i) INE_Over2(i) = 0 ! show empty END DO INE_Cnt2 = 1 ELSE ! no leftover INE_Cnt2 = 0 ! always init this each sec ENDIF C move the new stuff DO WHILE(INE_Cnt2.LT.40 .AND. ! stay in INE_Raw array limit & Cnt_lcl.GT.0) ! and more to move INE_Cnt2 = INE_Cnt2 + 1 ! filling the next burst DO i = 1,10 ! double word values SingInt(2) = IB(Ptr_lcl) ! Intel backward SingInt(1) = IB(Ptr_lcl+1) Raw_INE2(i,INE_Cnt2) = DblInt ! store 32 bits Ptr_lcl = Ptr_lcl + 2 ! bump in-array ptr END DO ! end of loop to move 1 burst Cnt_lcl = Cnt_lcl - 1 ! show we moved a burst END DO C If Cnt_lcl is not zero, we have at least 1 burst left IF (Cnt_lcl.GT.0) THEN ! move the next burst to overflow DO i = 1,10 ! double word values SingInt(2) = IB(Ptr_lcl) SingInt(1) = IB(Ptr_lcl+1) INE_Over2(i) = DblInt ! store 32 bits Ptr_lcl = Ptr_lcl + 2 ! bump in-array ptr END DO ! end of loop to move the overflow ENDIF C If INE_Cnt2 is less than 40, try to ride through IF (INE_Cnt2.EQ.39) THEN ! just missing one DO i = 1,10 ! duplicate 39 Raw_INE2(i,40) = Raw_INE2(i,39) END DO INE_Cnt2 = 40 ! show that we've go 40 filled c ELSEIF (INE_Cnt2.EQ.38) THEN ! we can put in 2 c DO j = 19,38 ! move 2nd half by 1 c DO i = 1,10 c Raw_INE2(i,j) = Raw_INE2(i,j) c END DO c END DO ! now (20) and (40) are empty c DO i = 1,10 ! duplicate 19 & 39 c Raw_INE2(i,20) = Raw_INE2(i,19) c Raw_INE2(i,40) = Raw_INE2(i,39) c END DO c INE_Cnt2 = 40 ! show that we've go 40 filled c ELSEIF (INE_Cnt2.LT.38) THEN ! too many to fill c VzLast = -999. ! flag to reset ENDIF RETURN ! INE_Cnt's already set END