# Pure functions not deterministic in serial and parallel loops

**URL:** <https://fortran-lang.discourse.group/t/pure-functions-not-deterministic-in-serial-and-parallel-loops/4668>\
**Category:** Uncategorized\
**Created:** [November 6, 2022, 4:11am UTC](https://fortran-lang.discourse.group/t/pure-functions-not-deterministic-in-serial-and-parallel-loops/4668 "2022-11-06T04:11:35Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![certik](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/certik/32/4_2.png) [@certik](https://fortran-lang.discourse.group/u/certik)\
**Post date:** [November 7, 2022, 3:15am UTC](https://fortran-lang.discourse.group/t/pure-functions-not-deterministic-in-serial-and-parallel-loops/4668/13 "2022-11-07T03:15:39Z")

</div>

@mecej4 you can follow the thread I linked: [What is a pure function?](https://fortran-lang.discourse.group/t/what-is-a-pure-function/4654), in particular, go here: [Pure function - Wikipedia](https://en.wikipedia.org/wiki/Pure_function). The “pure” attribute in Fortran means no side-effects (roughly speaking no writing to global variables), but you can still read from global variables, which is what the function `f()` does. The reason it surprises you is because you probably expect “pure” to mean both side-effect-free _and_ deterministic (no reading from global variables). That’s why I did the survey, and as of now, 74% of people who voted also expect that (myself included). The meaning of “pure” is subjective, so it’s better to just talk about the two properties (side-effect-free and deterministic) and just keep in mind that the Fortran “pure” keyword just means side-effect-free, but does not enforce deterministic.

---

_[View the full topic](https://fortran-lang.discourse.group/t/pure-functions-not-deterministic-in-serial-and-parallel-loops/4668)._
