subroutine hec_beam_read(read_ok) c c read MWPC alignment constants from file c Created 27-jun-1997 A.Minaenko c implicit none logical read_ok c include'hec_par.inc' !shared parameters include'hec_beam_sys_shifts.inc' !MWPC alignment constants include'hec_datacard.inc' !datacard values include'hec_runh.inc' !run header c integer run_no_beam ! run number from align.const file c c open input file and read the constants c read_ok=.false. open (unit=io_beam(1), file='align.const', status='old', err=2) read (io_beam(1), *, err=1, end=1) run_no_beam, , SHIFTX,SHIFTY,BEAMX,BEAMY c c check run number validity c if (run_no_beam.ne.run_no) then print *,' *** current run_no ',run_no, , ', but run_no_beam in align.const file is ',run_no_beam stop endif c c print, close file and return c print *, ' ' print *, ' *** MWPC alignment constants have been read ' write (*,1001) SHIFTX 1001 format(' * SHIFTX: ',5(f8.3,2X)) write (*,1002) SHIFTY 1002 format(' * SHIFTY: ',5(f8.3,2X)) write (*,1003) BEAMX, BEAMY 1003 format(' * BEAMX, BEAMY: ', 2(f8.3,2x)) print *, ' ' close (unit=io_beam(1)) read_ok=.true. return c 1 continue print *, ' *** error reading align.const file ' stop c 2 continue print *, ' *** new MWPC alignment constants will be calculated' return c end