# Pointer to pointer - ALLOCATE - Undefined reference

**URL:** <https://fortran-lang.discourse.group/t/pointer-to-pointer-allocate-undefined-reference/4866>\
**Category:** Help\
**Created:** [December 7, 2022, 6:03am UTC](https://fortran-lang.discourse.group/t/pointer-to-pointer-allocate-undefined-reference/4866 "2022-12-07T06:03:57Z")\
**Posts on this page:** 7\
**Page:** 2

<div class="post-metadata">

**Author:** ![PierU](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/pieru/32/1848_2.png) [@PierU](https://fortran-lang.discourse.group/u/PierU)\
**Post date:** [December 10, 2022, 6:48pm UTC](https://fortran-lang.discourse.group/t/pointer-to-pointer-allocate-undefined-reference/4866/22 "2022-12-10T18:48:08Z")

</div>

> [@RonShepard](#):
>
> That is something that occurs all the time in fortran, and it should not be a problem. Modules in fortran are designed to allow that without the compiler being confused.

I agree. The compiler that is confused is just an hypothesis, and it would be a compiler bug.

---

<div class="post-metadata">

**Author:** ![dev](https://avatars.discourse-cdn.com/v4/letter/d/e8c25b/32.png) [@dev](https://fortran-lang.discourse.group/u/dev)\
**Post date:** [December 13, 2022, 8:38am UTC](https://fortran-lang.discourse.group/t/pointer-to-pointer-allocate-undefined-reference/4866/23 "2022-12-13T08:38:27Z")

</div>

Thanks for these answers.  
Indeed, removing USE grid\_ames does not solve this issue.  
Would you have some information about bug related to the migration from pgf90 13.10-0 to pgf90 (aka nvfortran) 21.9-0 ?  
Indeed, as explained previously, the compilation works well with pgf90 13.10-0 but not with pgf90 (aka nvfortran) 21.9-0, so it seems to be related to the compiler version.

---

<div class="post-metadata">

**Author:** ![PierU](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/pieru/32/1848_2.png) [@PierU](https://fortran-lang.discourse.group/u/PierU)\
**Post date:** [December 13, 2022, 8:57am UTC](https://fortran-lang.discourse.group/t/pointer-to-pointer-allocate-undefined-reference/4866/24 "2022-12-13T08:57:42Z")

</div>

Note once again that if you were posting a true MWE, we could confirm if it’s a compiler bug or not. At the point we can just say that _it looks like_ a compiler bug.

---

<div class="post-metadata">

**Author:** ![dev](https://avatars.discourse-cdn.com/v4/letter/d/e8c25b/32.png) [@dev](https://fortran-lang.discourse.group/u/dev)\
**Post date:** [December 13, 2022, 9:03am UTC](https://fortran-lang.discourse.group/t/pointer-to-pointer-allocate-undefined-reference/4866/25 "2022-12-13T09:03:13Z")

</div>

Would it be possible to define which details would be expected for this MWE ?

---

<div class="post-metadata">

**Author:** ![PierU](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/pieru/32/1848_2.png) [@PierU](https://fortran-lang.discourse.group/u/PierU)\
**Post date:** [December 13, 2022, 3:09pm UTC](https://fortran-lang.discourse.group/t/pointer-to-pointer-allocate-undefined-reference/4866/26 "2022-12-13T15:09:55Z")

</div>

In the case of this topic, a code for which the only error reported by the compiler is the one that you don’t understand. When I tried compiling the code you have posted, I got a lot of errors that were not related to that.

---

<div class="post-metadata">

**Author:** ![dev](https://avatars.discourse-cdn.com/v4/letter/d/e8c25b/32.png) [@dev](https://fortran-lang.discourse.group/u/dev)\
**Post date:** [December 13, 2022, 4:31pm UTC](https://fortran-lang.discourse.group/t/pointer-to-pointer-allocate-undefined-reference/4866/27 "2022-12-13T16:31:52Z")

</div>

Are you using pgf90 13.10-0 and pgf90 (aka nvfortran) 21.9-0 as specified for this compilation ?

---

<div class="post-metadata">

**Author:** ![PierU](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/pieru/32/1848_2.png) [@PierU](https://fortran-lang.discourse.group/u/PierU)\
**Post date:** [December 13, 2022, 6:51pm UTC](https://fortran-lang.discourse.group/t/pointer-to-pointer-allocate-undefined-reference/4866/28 "2022-12-13T18:51:50Z")

</div>

No, I am using gfortran or ifort, but that’s not the point. The code you have posted contains obvious errors, such as type definitions after `contains`, etc (I’ve listed them in a previous message) and I doubt you could compile it at all even with pgf90 13.

[Previous page](https://fortran-lang.discourse.group/t/pointer-to-pointer-allocate-undefined-reference/4866.md?page=1)
