Source routine - Reading external spectrum

hello please help me to define a source with this energy spectrum:
file source.datlsource.dat (402 Bytes)

i cant write code with fortran or … but i want to define a source.f file for a energy spectrum
Is there a ready-made file for this that I can easily do?
please help me.

Dear Hassan,

you can use the following source routine to read your spectrum file: source_spectrum.f (10.5 KB)

A couple things to note:

  1. You need to change the file name on line 68.
  2. If the energy unit in the spectrum file is not GeV, then enable and modify line 74 to convert it to GeV
  3. The comments (first line) in your spectrum file has to be removed
  4. The routine uses a linear interpolation between the specified energy points