program copy_maf1 c c----------------------------------------------------------------------- c----------------------------------------------------------------------- c c integer*4 kode, read_err, write_err integer*4 start_hhmmss, current_hhmmss, stop_hhmmss, hh, mm, ss, * ms integer*4 icollect_times(4), idur, inc, irun_times(4), it, iyd common /blktim/iyd, it, * /com_times/irun_times, icollect_times, idur, inc c external close_maf1 !$pragma C( close_maf1 ) external close_output !$pragma C( close_output ) external open_maf1 !$pragma C( open_maf1 ) external open_output !$pragma C( open_output ) external write_maf1 !$pragma C( write_maf1 ) c c------------------------------------------------------------------- c *** initialization data collection parameters *** c------------------------------------------------------------------- c call open_maf1 (ieof) if (ieof .eq. 1) go to 9000 call open_output (ieof) if (ieof .eq. 1) go to 9000 call lmsset (kode) if (kode .eq. -1) go to 9000 call mshmsm (irun_times(2), hh, mm, ss, ms) start_hhmmss = (hh * 10000) + (mm * 100) + ss call mshmsm (irun_times(4), hh, mm, ss, ms) stop_hhmmss = (hh * 10000) + (mm * 100) + ss c c--------------------------------------------------------------------- c *** copy the data *** c--------------------------------------------------------------------- c num_rec = 0 25 continue call getmf1 (read_err) if (read_err .lt. 0) go to 100 call mshmsm (it, hh, mm, ss, ms) current_hhmmss = (hh * 10000) + (mm * 100) + ss call is_between (iyd, it, irun_times(1), irun_times(2), * irun_times(3), irun_times(4), kode) write (*,'(3(i7, i8.6), i4)') * irun_times(1), start_hhmmss, * iyd, current_hhmmss, * irun_times(3), stop_hhmmss, * kode if (kode .eq. -1) then ! prior to start time go to 25 else if (kode .eq. 1) then ! after stop time go to 300 else call write_maf1 (write_err) num_rec = num_rec + 1 if (write_err .lt. 0) go to 200 go to 25 end if c c--------------------------------------------------------------------- c *** read was not a normal read *** c--------------------------------------------------------------------- c 100 continue if (read_err .eq. -1) then write (*, '('' MAF1 read error: END OF JOB'')') go to 9000 else write (*, '('' MAF1 end of file, need next file'')') call open_maf1 (ieof) go to 25 end if c c--------------------------------------------------------------------- c *** read was not a normal write *** c--------------------------------------------------------------------- c 200 continue if (write_err .eq. -1) then write (*, '(''OUTPUT error: END OF JOB'')') go to 9000 end if c c--------------------------------------------------------------------- c *** reached stop time *** c--------------------------------------------------------------------- c 300 continue write (*, '(''records written = '', i)'), num_rec write (*, '('' Finished copying MAF1 data'')') c c--------------------------------------------------------------------- c *** normal exit *** c--------------------------------------------------------------------- c 9000 continue call close_maf1 call close_output stop end