# Exploring pointers in Fortran: When and how to use them

**URL:** <https://fortran-lang.discourse.group/t/exploring-pointers-in-fortran-when-and-how-to-use-them/7599>\
**Category:** Help\
**Created:** [March 12, 2024, 4:34pm UTC](https://fortran-lang.discourse.group/t/exploring-pointers-in-fortran-when-and-how-to-use-them/7599 "2024-03-12T16:34:14Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![btrettel](https://avatars.discourse-cdn.com/v4/letter/b/5f9b8f/32.png) [@btrettel](https://fortran-lang.discourse.group/u/btrettel)\
**Post date:** [March 13, 2024, 2:29am UTC](https://fortran-lang.discourse.group/t/exploring-pointers-in-fortran-when-and-how-to-use-them/7599/7 "2024-03-13T02:29:32Z")

</div>

This linked thread discusses one way pointers are often used in unsteady partial differential equation solvers. However, seems like the best approach to the problem discussed uses `move_alloc` instead of pointers.

> [@Swapping arrays during time-stepping](https://fortran-lang.discourse.group/t/swapping-arrays-during-time-stepping/7354):
>
> For time-stepping large PDE problems, it’s common to read from one array (the previous time step), and write to a second array (the result at the new time step). Afterward the arrays are swapped. This is also known as the “flip-flop” approach, or ping-ponging. The separate arrays also make the update step easier to parallelise (no race conditions). What is your favourite implementation approach? (Scroll down for examples) [poll](https://fortran-lang.discourse.group/t/swapping-arrays-during-time-stepping/7354/1)Separate arrays with parity flag real, allocatable :: f1(:), f2(slight_smile…

---

_[View the full topic](https://fortran-lang.discourse.group/t/exploring-pointers-in-fortran-when-and-how-to-use-them/7599)._
