How to properly design complex source items?

Dear Experts,

I am trying to implement two radioactive body sources.In the past study, I used the newly released custom source file to realize the equal probability volume source.

Currently I want to implement two radioactive body sources with emission probabilities of 0.4 and 0.6 respectively.I refer to the work of the forum[Multiple cylindrical source as shown in figure - #3 by ArghyaC]

Unfortunately, I don’t know fortran very well, I didn’t get the gist, and I didn’t realize this work.I hope to get help from experts in this work to help me better understand the design of complex source items!
Thanks in advance!
fengfeng
mul-box-xf.inp (1.3 KB)
source_newgen_with_regionsource.f (19.7 KB)

Dear @fengfengxu,

The problem with your routine is that you didn’t declare the variable “random”. You could have seen a clear error message in the output window after failing the compilation.
Once you declare the variable, the routine compile and the executable is generated.
If you run it, you would get this particle fluence distribution:

which seems to me reasonably in line with your expectations.

Dear Experts,

As you suggested, I stated the variables:
“double precision :: random”

This result is achieved. I think the results are OK. What do experts think?

Thanks in advance!
fengfeng

Considering the different statistics and binning, I would say that the results are in agreement.

Thanks to the expert’s answer, the post can be closed!