How to create custom arrays in fortran?

邮差的信 提交于 2019-12-13 02:22:26

问题


I have been looking at porting a cuda library to fortran. PGI and EM Photonics seem to be two libraries that exist right now. However I have only found what I am looking for over here

real, device, allocatable :: adev(:), bdev(:)  ! device declaration

So my question is, is there a way to create custom arrays like the code sample mentioned above ? Or is it part of the propreitary compiler from PGI ?

Edited for further clarity
In other words can I do this

mycustomtype, allocatable :: tmp(:)

回答1:


No, that is standard Fortran. There are several ways to declare arrays; this one in particular is called declaring a deferred-shape allocatable array.

Your best shot would be to check out PGI's documentation under array declaration.



来源:https://stackoverflow.com/questions/5751000/how-to-create-custom-arrays-in-fortran

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!