c======================================================================= c PROGRAM c f1.NO19.get_list_orbit_files_new.f c c LANGUAGE c Fortran77 c c----------------------------------------------------------------------- c PURPOSE c to get list of new orbit files (orbit files whose names are in the c current list but not in the previous list). c c----------------------------------------------------------------------- c INPUT FILES c NO19_list_orbit_files_previous : previous list of orbit files c NO19_list_orbit_files_current : current list of orbit files c c OUTPUT FILES c NO19_list_orbit_files_new : list of new orbit files c c=====|==|=========|=========|=========|=========|=========|=========|== c program f1_NO19_get_list_orbit_files_new implicit none integer NF parameter( NF=9999 ) character*80 fnames(NF), fname1, list_pre, list_cur, list_new integer ff, cp, cc, cn logical pre_there, cur_there c----------------------------------------------------------------------- c construct file names c----------------------------------------------------------------------- c-------------->123456789|123456789|123456789|12345678<-- list_pre='../work/NO19_list_orbit_files_previous' list_cur='../work/NO19_list_orbit_files_current' list_new='../work/NO19_list_orbit_files_new' c----------------------------------------------------------------------- c read in previous list of orbit files c----------------------------------------------------------------------- cp=0 inquire(file=list_pre, exist=pre_there) if( pre_there ) then open(10, file=list_pre, status='old', form='formatted') 100 read(10, '(a80)', end=190) fname1 cp=cp+1 if( cp.gt.NF ) then write(*, *) write(*, *) '#### NF too small: ', NF write(*, *) stop endif fnames(cp)=trim(fname1) goto 100 190 close(10) write(*, *) ' <-- ', list_pre, cp endif cn=0 open(20, file=list_new, form='formatted') c----------------------------------------------------------------------- c output if file name is in current list but not in previous list c----------------------------------------------------------------------- cc=0 inquire(file=list_cur, exist=cur_there) if( cur_there ) then open(11, file=list_cur, status='old', form='formatted') 200 read(11, '(a80)', end=290) fname1 cc=cc+1 do ff=1, cp if( trim(fnames(ff)).eq.trim(fname1) ) then goto 200 endif enddo cn=cn+1 write(20, '(a80)'), fname1 goto 200 290 close(11) write(*, *) ' <-- ', list_cur, cc endif close(20) write(*, *) ' ==> ', list_new, cn stop end c c=====|==|=========|=========|=========|=========|=========|=========|==