# OpenACC copy Fortran user defined data types

**URL:** <https://forums.developer.nvidia.com/t/openacc-copy-fortran-user-defined-data-types/134281>\
**Category:** Legacy PGI Compilers (archived)\
**Created:** [October 13, 2014, 4:02am UTC](https://forums.developer.nvidia.com/t/openacc-copy-fortran-user-defined-data-types/134281 "2014-10-13T04:02:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![guanfeng](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@guanfeng](https://forums.developer.nvidia.com/u/guanfeng)\
**Post date:** [October 13, 2014, 4:02am UTC](https://forums.developer.nvidia.com/t/openacc-copy-fortran-user-defined-data-types/134281/1 "2014-10-13T04:02:29Z")

</div>

Hi,

I am getting errors while try to copy data.  
In my fortran code, I have a data type defined like this:

```nohighlight
type node
			integer(4) :: id
			real(dp), allocatable :: pos(:)
			real(dp), allocatable :: veloc(:)
			real(dp), allocatable :: accel(:)
end type node

```

I got this error:

```nohighlight
Lowering Error: bad ast optype in expression [ast=1438,asttype=12,datatype=0]

```

while try to copy data into device memory:

```nohighlight
!$acc data copyin(nodes(:)%pos(:))

```

How to copy this kind of data?

Thanks,  
Guanfeng

---

<div class="post-metadata">

**Author:** ![MatColgrove](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/matcolgrove/32/14047_2.png) [@MatColgrove](https://forums.developer.nvidia.com/u/MatColgrove)\
**Post date:** [October 14, 2014, 1:09am UTC](https://forums.developer.nvidia.com/t/openacc-copy-fortran-user-defined-data-types/134281/2 "2014-10-14T01:09:08Z")

</div>

Hi Guanfeng,

OpenACC doesn’t yet support Fortran derived types that include allocatables or pointer members (See section 1.9 of the OpenACC 2.0 standard). It’s something the OpenACC language committee is working on defining in the next major OpenACC standard.

A potential work around is to create pointers to each of the “pos” arrays and mange them separately on the device.

- Mat

---

<div class="post-metadata">

**Author:** ![guanfeng](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@guanfeng](https://forums.developer.nvidia.com/u/guanfeng)\
**Post date:** [October 14, 2014, 5:15am UTC](https://forums.developer.nvidia.com/t/openacc-copy-fortran-user-defined-data-types/134281/3 "2014-10-14T05:15:05Z")

</div>

Hi Mat,

Thanks for your reply.

-Guanfeng

> [@mkcolg](#):
>
> Hi Guanfeng,
> 
> OpenACC doesn’t yet support Fortran derived types that include allocatables or pointer members (See section 1.9 of the OpenACC 2.0 standard). It’s something the OpenACC language committee is working on defining in the next major OpenACC standard.
> 
> A potential work around is to create pointers to each of the “pos” arrays and mange them separately on the device.
> 
> - Mat
