Question about LET score on carbon

Dear FLUKA experts
When I score the LET follow the topic Scoring both LETd and LETt of primary protons in water,I can get the same results. I want to konw how to score the LET on water for the carbon Ion. Becase I am Be unfamiliar with Fortran, so can you tell me how to edit the fluscw_proton.f.
fluscw_proton.f (5.9 KB)

Dear @xuchong ,

Thank you for your question. I suggest you have a look at the page Particle codes, where you can find how the particle of interest is identified in FLUKA under the variable JTRACK.

I understand you use carbon ions as primary particle, therefore you can modify the user routine so that JTRACK matches ion particles (ID: -2).

I hope this helps,
Mario Sacristan Barbero

Dear @msacrist
Thank you for your suggestion! There are some errors, when I change the JTRACK to match carbon ion. The error informations are shown as follows. How can I solve it?

fluscw_carbon_test.f (6.2 KB)

Thank you for message @xuchong,

From a quick inspection, I notice that you have started a new declaration of the GETLET function with: DOUBLE PRECISION FUNCTION GETLET (IJ, EKIN, PLA, TDELTA, MATLET)

That is not needed since the function is already included in the FLUKA library (libfluka.a). Besides, note that FORTRAN requires at least 6 spaces in every line - there is a line not meeting this.

Regards,

Mario

Dear @msacrist
Thank you for your prompt reply. I have delete the declaration of the GETLET function and adjust the line space. The fluscw_carbon_test.f file can be complied, but the new error about GETLET function appears as follows.


fluscw_carbon_test (1).f (6.2 KB)

Dear @xuchong ,

The problem may be due to the argument MATNO in GETLET, which is an undeclared variable. I suggest you use MEDFLK(NREG,1) instead, which is a function providing the material number as a function of the region number, which is a variable available in fluscw.f

I hope this helps,

Mario

Dear @msacrist
Thank you for your help. I have solved it.