Source_newgen.f vs old format

I am thinking of rewriting my custom source file in the new format but there are a few things that are not clear to me.

In the old format, I had full controll of e.g. the direction of the primary by setting e.g. TXFLK (NPFLKA) to a specific value. In the new source format, I have the option to change the beam divergence (divergence_x = …) which suggests that some rng will decide the direction of each primary within that divergence later on. Is it still possible to have full controll of all parameters?

I need the particle energy set in the BEAM card to calculate the beam distribution. Somehow I doubt that setting energy_logical_flag = .true. will allow me to use momentum_energy if I didn’t set it myself. Can I still access TKEFLK (NPFLKA) like before?

Best regards,
Roman

Hi @rmartin,

yes, you can still access those variables. Actually the new source routine is just a more cleaned up and simpler to use version providing a lot of very useful functionalities that previously the user had to implement by himself. Have a look at the file include/source_library.inc where you can see that this simplified interface uses the original variables while removing some complexity for the user.

If you want then you can also use the “old” source as a starting point. The standard template can be found in the directory src/user/source.f

Cheers
Chris

1 Like