integer function tleChk( line ) ! ! Perform the checksum (mod 10) of the first 68 characters of a ! two-line element text line, and return the difference between ! the computed checksum and the recorded checksum (character 69). ! ! B. Knapp, 1999-08-11 ! implicit none ! ! Input character*69 line ! ! Local character*1 ch integer i, sum, chval ! sum = 0 do i=1,68 ch = line(i:i) if ( ch .eq. '-' ) then chval = 1 else if ( ch .lt. '0' .or. '9' .lt. ch ) then chval = 0 else read(ch,*) chval endif sum = sum+chval enddo ch = line(69:69) if ( ch .eq. ' ' ) then chval = 0 else read(ch,*) chval endif tlechk = mod(sum,10)-chval ! return end