Hi Dalini,
I see a few points to fix.
First, the fortran code must be included in a locally modified version of fluscw.f, not in the input file. You then need to recompile FLUKA with the updated version of fluscw.f (this can be done with flair from the ‘compile’ tab, simply giving it the path to your local fluscw.f) and run the simulation with the new executable that gets produced.
Focusing on the code, this call:
IF (ABS(PLA) .LT. 200D-12) LSCZER = .TRUE.
actually removes from the scoring all particles with abs(PLA) < 200meV (LSCZER = .TRUE. means ‘do not score the particle’).
The fortran code that I would add to fluscw.f to select only particles below 200 meV would be the following:
INCLUDE 'paprop.inc'
INCLUDE 'usrbin.inc'
ENEPAR = -PLA
IF (PLA .GT. 0) THEN
ENEPAR = SQRT (PLA**2 + AM (IJ)**2) - AM (IJ)
ENDIF
FLUSCW = ONEONE
LSCZER = .FALSE.
IF (ISCRNG.EQ.2 .AND. JSCRNG.EQ.1) THEN
IF (ABS(ENEPAR) .GT. 200D-12) LSCZER = .TRUE.
ENDIF
Note that this will be applied only to the first USRBIN card in your input file (due to the JSCRNG.EQ.1 requirement) so you must make sure that the corresponding USRBIN in your input is in the correct position (i.e. the first). Also, please note that the routine a priori applies to any particle type: it’s in the USRBIN card in the input file that you select neutrons or something else.
If you want to have a second USRBIN where you score neutrons between 0.5eV and 10keV, you can then add this extra piece of code:
IF (ISCRNG.EQ.2 .AND. JSCRNG.EQ.2) THEN
IF (ABS(ENEPAR) .LT. 500D-12 .OR. ABS(ENEPAR) .GT. 10D-6) LSCZER = .TRUE.
ENDIF
Again here, note that because of JSCRNG.EQ.2 FLUKA will only apply this requirement to your second USRBIN card in the input file.
Lastly, the USERWEIG card in your input file is correct.
I hope this helps!
Cheers
Giuseppe