Multiple particles using source.f

Dear professors:
I am using source.f to define beam sources with either positive or negative muon. The particle information is read from another file named muon.txt. The first column in this file indicates its particle type. I want the source routine to automatically recognize this. I have defined a variable called ‘particle’ and given its value to IJBEAM, which does not work. I wonder how to achieve this purpose. Thank you!
newsource.f (7.3 KB)
Te-LS.flair (4.9 KB)
muon.txt (41.1 KB)

Dear @hanhechong,

The particle type should be provided using the FLUKA’s particle ID. Please see 5.1. Particles codes — FLUKA Manual. That would be 10 and 11 for positive and negative muons respectively. Currently you are providing the PDG numbers (-13 and 13).

Hope this helps,

Thank you! It works after I have revised accordingly.