      subroutine hec_runh_replace
c
c if requested, replace values in runh with values
c from datacard
c
      implicit none
c
c datacard values common
c
      include'hec_par.inc'      !shared parameters
      include'hec_datacard.inc'
c
c run header common
c
      include'hec_runh.inc'
c
c if replacement switch is on, replace runh values
c with datacard values
c
      if (run_no_cr .gt. 0) then
        print *, ' **********************************************'
        print *,' *** run header data are changed by user cards'
        print *,' *** value of run_no from data is ', run_no
        print *,' *** new value of run_no is ', run_no_cr
        print *, ' **********************************************'
        run_no = run_no_cr
      endif
c
      if (e_beam_cr .gt. 0.) then
        print *, ' **********************************************'
        print *,' *** run header data are changed from user cards'
        print *,' *** value of e_beam from data is ', e_beam
        print *,' *** new value of e_beam is ', e_beam_cr
        print *, ' **********************************************'
        e_beam = e_beam_cr
      endif
c
      if (i_part_cr .gt. 0) then
        print *, ' **********************************************'
        print *,' *** run header data are changed by user cards'
        print *,' *** value of i_part from data is ', i_part
        print *,' *** new value of i_part is ', i_part_cr
        print *, ' **********************************************'
        i_part = i_part_cr
      endif
c
      if (x_cryo_cr .lt. 10000.) then
        print *, ' **********************************************'
        print *,' *** run header data are changed from user cards'
        print *,' *** value of x_cryo from data is ', x_cryo
        print *,' *** new value of x_cryo is ', x_cryo_cr
        print *, ' **********************************************'
        x_cryo = x_cryo_cr
      endif
c
      if (y_tabl_cr .lt. 10000.) then
        y_tabl = y_tabl_cr
        print *, ' **********************************************'
        print *,' *** run header data are changed from user cards'
        print *,' *** value of y_tabl from data is ', y_tabl
        print *,' *** new value of y_tabl is ', y_tabl_cr
        print *, ' **********************************************'
        y_tabl = y_tabl_cr
      endif
c
c transform x_cryo and y_tabl from [mm] to [cm]
c
      x_cryo = 0.1*x_cryo
      y_tabl = 0.1*y_tabl
c
      end
