# Define a cylinder isotropic source by source\_newgen.f

**URL:** <https://fluka-forum.web.cern.ch/t/define-a-cylinder-isotropic-source-by-source-newgen-f/6541>\
**Category:** Source Definition\
**Created:** [8 October 2024 13:14 UTC](https://fluka-forum.web.cern.ch/t/define-a-cylinder-isotropic-source-by-source-newgen-f/6541 "2024-10-08T13:14:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![CSH](https://fluka-forum.web.cern.ch/letter_avatar_proxy/v4/letter/c/7bcc69/32.png) [@CSH](https://fluka-forum.web.cern.ch/u/CSH)\
**Post date:** [8 October 2024 13:14 UTC](https://fluka-forum.web.cern.ch/t/define-a-cylinder-isotropic-source-by-source-newgen-f/6541/1 "2024-10-08T13:14:06Z")

</div>

Hey, FLUKA users,

I want to define an isotropic cylindrical source using the method in `source_newgen.f`.

According to the [CYLI-VOL source and - Advanced Features and User Routines - FLUKA User Forum (cern.ch)](https://fluka-forum.web.cern.ch/t/cyli-vol-source-and/5203) and [How to properly design complex source items？ - Source Definition - FLUKA User Forum (cern.ch)](https://fluka-forum.web.cern.ch/t/how-to-properly-design-complex-source-items/3225), I modified version 5.1 in the `source_newgen_CYLI.f` file, but the compilation resulted in an error. Could you please let me know what the reason might be?

I look forward to your response.

[source\_newgen\_CYLI.f](https://fluka-forum.web.cern.ch/uploads/short-url/jzBC5zM0n94jzRNuRSraLN61oNe.f) (21.4 KB)  
[cyli.flair](https://fluka-forum.web.cern.ch/uploads/short-url/d4Be1lNtcLYTawYtFn7twKDUjda.flair) (3.8 KB)

---

<div class="post-metadata">

**Author:** ![Mihaela\_Parvu](https://fluka-forum.web.cern.ch/user_avatar/fluka-forum.web.cern.ch/mihaela_parvu/32/4005_2.png) [@Mihaela\_Parvu](https://fluka-forum.web.cern.ch/u/Mihaela_Parvu)\
**Post date:** [10 October 2024 06:42 UTC](https://fluka-forum.web.cern.ch/t/define-a-cylinder-isotropic-source-by-source-newgen-f/6541/3 "2024-10-10T06:42:33Z")

</div>

Dear @CSH,

If you check the output of your compilation you can see that some of the variables that you used are not defined. If you add this line, the compilation will work:

`double precision, save :: rmax, theta, zmax, zmin, r`

Cheers,  
Mihaela

---

<div class="post-metadata">

**Author:** ![CSH](https://fluka-forum.web.cern.ch/letter_avatar_proxy/v4/letter/c/7bcc69/32.png) [@CSH](https://fluka-forum.web.cern.ch/u/CSH)\
**Post date:** [10 October 2024 07:24 UTC](https://fluka-forum.web.cern.ch/t/define-a-cylinder-isotropic-source-by-source-newgen-f/6541/4 "2024-10-10T07:24:31Z")

</div>

Thanks your reply.

According to the suggestion： [Dose rate calculations for isotropic cylindrical sources - Source Definition - FLUKA User Forum (cern.ch)](https://fluka-forum.web.cern.ch/t/dose-rate-calculations-for-isotropic-cylindrical-sources/6472/10), I have modified my `source_newgan_CYLI.f` to perform isotropic sampling for `CYLI-VOL`, and it has been successfully built.

However, after plotting the projections of the source in the XYZ directions, the cylindrical source definition did not take effect, and it still shows as a point source. If it is a CYLI-VOL source, the projection at this time should be a straight line.  
Could you please tell me what might be the issue?"

 ![image](https://fluka-forum.web.cern.ch/uploads/default/original/2X/c/cc8567ee72f14fa273783b8ec6d48180ed865cd2.png)

 ![image](https://fluka-forum.web.cern.ch/uploads/default/original/2X/4/4cf564d43b214fc1b5e1869b8afb707dcb538180.jpeg)

[source\_newgen\_CYLI.f](https://fluka-forum.web.cern.ch/uploads/short-url/7so1lXtvJERUJceUGsWrXyV2fy1.f) (21.8 KB)

---

<div class="post-metadata">

**Author:** ![horvathd](https://fluka-forum.web.cern.ch/user_avatar/fluka-forum.web.cern.ch/horvathd/32/10584_2.png) [@horvathd](https://fluka-forum.web.cern.ch/u/horvathd)\
**Post date:** [15 October 2024 06:26 UTC](https://fluka-forum.web.cern.ch/t/define-a-cylinder-isotropic-source-by-source-newgen-f/6541/5 "2024-10-15T06:26:47Z")

</div>

Dear @CSH ,

it seems you uploaded a different source routine than the intended one, as this one doesn’t contain anything related to the cylindrical sampling.

Make sure when you run the simulation your compiled executable is selected, otherwise the default FLUKA executable is used.

Cheers,  
David

---

<div class="post-metadata">

**Author:** ![horvathd](https://fluka-forum.web.cern.ch/user_avatar/fluka-forum.web.cern.ch/horvathd/32/10584_2.png) [@horvathd](https://fluka-forum.web.cern.ch/u/horvathd)\
**Post date:** [4 November 2024 13:21 UTC](https://fluka-forum.web.cern.ch/t/define-a-cylinder-isotropic-source-by-source-newgen-f/6541/6 "2024-11-04T13:21:26Z")

</div>

Closed on 4 November 2024 13:21 UTC


