integer function slip(harray) C Function returns the number of slipped samples for RSC-11-6 data. integer*4 count_h ! sample count from header (words 27-28)(biased by 2500) integer*4 count_r ! calculated sample count (biased by 2500) integer*4 dec_ratio ! decimation ratio integer*4 harray(42) ! array of header values C If sample count in header is not valid, return if (harray(4) .eq. 0 ) return C Otherwise, figure out what the new value should be dec_ratio = 8 - harray(41) count_h = mod(harray(42)+2499,300000) + 1 if (count_h .le. 0) count_h = count_h + 300000 count_r = mod(5000*(harray(7) - 1)*dec_ratio + 2500,300000) + 1 if (count_r .le. 0) count_r = count_r + 300000 slip = count_h - count_r if (dec_ratio .eq. 3) then slip = (slip+isign(1,slip))/dec_ratio else if (dec_ratio .ne. 1) then write(*,'("SLIP:unexpected dec_ratio = ",i4)') dec_ratio stop end if end if return end