# Region source with new source file format

**URL:** <https://fluka-forum.web.cern.ch/t/region-source-with-new-source-file-format/2419>\
**Category:** Advanced Features and User Routines\
**Created:** [4 November 2021 16:05 UTC](https://fluka-forum.web.cern.ch/t/region-source-with-new-source-file-format/2419 "2021-11-04T16:05:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![lorenzo.mercolli](https://fluka-forum.web.cern.ch/user_avatar/fluka-forum.web.cern.ch/lorenzo.mercolli/32/98_2.png) [@lorenzo.mercolli](https://fluka-forum.web.cern.ch/u/lorenzo.mercolli)\
**Post date:** [4 November 2021 16:05 UTC](https://fluka-forum.web.cern.ch/t/region-source-with-new-source-file-format/2419/1 "2021-11-04T16:05:20Z")

</div>

Dear FLUKA experts  
I would like to define a source inside a user defined region (imagine a strangely shaped phantom filled with radioactive nuclides). In [this post](https://fluka-forum.web.cern.ch/t/volumetric-source-of-complex-geometry/940) an example with the old source file was provided. To simply copy the subroutine [REGIOUNSOURCE in this source.f file](https://fluka-forum.web.cern.ch/uploads/short-url/wSCh09DTzFOr4d4knlapF61O5uo.f) to the new source\_newgen.f file didn’t really work and due to my limited knowledge of Fortran and the use of the source file I would appreciate some help.  
Thanks!  
Lorenzo

---

<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:** [5 November 2021 07:52 UTC](https://fluka-forum.web.cern.ch/t/region-source-with-new-source-file-format/2419/3 "2021-11-05T07:52:36Z")

</div>

Dear Lorenzo,

I updated the **source\_newgen.f** user routine with the `regionsource` subroutine. You can activate it in the section 5.1.1.

[source\_newgen\_with\_regionsource.f](https://fluka-forum.web.cern.ch/uploads/short-url/nvkbNeILQxhdxEuV82I4tgY6YE0.f) (19.5 KB)

Cheers,  
David

---

<div class="post-metadata">

**Author:** ![lorenzo.mercolli](https://fluka-forum.web.cern.ch/user_avatar/fluka-forum.web.cern.ch/lorenzo.mercolli/32/98_2.png) [@lorenzo.mercolli](https://fluka-forum.web.cern.ch/u/lorenzo.mercolli)\
**Post date:** [5 November 2021 12:52 UTC](https://fluka-forum.web.cern.ch/t/region-source-with-new-source-file-format/2419/4 "2021-11-05T12:52:30Z")

</div>

Fantastic, thanks a lot!

---

<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:** [9 November 2021 08:15 UTC](https://fluka-forum.web.cern.ch/t/region-source-with-new-source-file-format/2419/5 "2021-11-09T08:15:55Z")

</div>

2 posts were split to a new topic: [Multiple region sources in one simulation](https://fluka-forum.web.cern.ch/t/multiple-region-sources-in-one-simulation/2430)

---

<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:** [9 November 2021 11:56 UTC](https://fluka-forum.web.cern.ch/t/region-source-with-new-source-file-format/2419/6 "2021-11-09T11:56:34Z")

</div>


