SUBROUTINE instdates(sat2lc,from,to,instdir) c c This subroutine finds the entire data range for the satellite with the c two-letter designation sat2lc . Results are returned in from and c to , which are character variables of length at least 7 c c The subroutine must be able to open the file inst.index. c IMPLICIT NONE CHARACTER*(*) sat2lc,from,to,instdir CHARACTER*2 s2lcf, s2lc INTEGER*1 s2lci(2) EQUIVALENCE(s2lc,s2lci) CHARACTER*80 fname, lname CHARACTER*7 vf, vt INTEGER*4 lun, instdir_l, str_text_len from= '9999999' to= '0000000' CALL get_lun(lun) instdir_l= str_text_len(instdir) lname= instdir(1:instdir_l)//'/'//'inst.index' OPEN(UNIT=lun,FILE=lname, & FORM='formatted',STATUS='old', ERR=901) s2lc=sat2lc(1:2) IF((97.LE.s2lci(1)).AND.(s2lci(1).LE.122))s2lci(1)=s2lci(1)-32 IF((97.LE.s2lci(2)).AND.(s2lci(2).LE.122))s2lci(2)=s2lci(2)-32 100 READ(lun,2,END=902,ERR=903) s2lcf, vf, vt, fname IF(s2lc .EQ. s2lcf) THEN IF(vf .LT. from) from= vf IF(vt .GT. to) to= vt END IF GOTO 100 902 CONTINUE CLOSE(lun) CALL unget_lun(lun) RETURN 901 CONTINUE WRITE(6,*)'!!! Subroutine instdates could not read index file.' WRITE(6,1)lname STOP 903 CONTINUE WRITE(6,*)'Error reading the instrument data index file' WRITE(6,1)lname STOP 1 FORMAT(A) 2 FORMAT(A2,2X,A7,1X,A7,1X,A) END