Fortran Coder

查看: 11071|回复: 3
打印 上一主题 下一主题

[求助] union不能用allocatable的问题

[复制链接]

23

帖子

10

主题

0

精华

熟手

F 币
145 元
贡献
90 点
跳转到指定楼层
楼主
发表于 2015-3-13 12:58:50 | 显示全部楼层 回帖奖励 |倒序浏览 |阅读模式
type T_client_server_message
                union
                     map
                        character*(500) buffer
                     end map
                     map
                        real,allocatable :: matrix1(:,:)
                        real,allocatable :: matrix2(:,:)
                        real,allocatable :: matrix3(:,:)
                     end map
                end union
         end type

想如此定义一个新的数据类型
但是出现错误
错误        3         error #7897: A UNION may not contain an ALLOCATABLE component   [MATRIX3]        C:\Users\Administrator\Desktop\add server.f90        25       

错误        2         error #7897: A UNION may not contain an ALLOCATABLE component   [MATRIX2]        C:\Users\Administrator\Desktop\add server.f90        24       

错误        1         error #7897: A UNION may not contain an ALLOCATABLE component   [MATRIX1]        C:\Users\Administrator\Desktop\add server.f90        23       


要怎么才能解决呢??难道不能用动态数组了吗

分享到:  微信微信
收藏收藏 点赞点赞 点踩点踩

23

帖子

10

主题

0

精华

熟手

F 币
145 元
贡献
90 点
沙发
 楼主| 发表于 2015-3-17 13:56:46 | 显示全部楼层
fcode 发表于 2015-3-13 18:00
能用,但不能跟  union   map 一起用

可是我想把这个参数放在union map 里,如何在外部定义,然后在定义到里面呢?
您需要登录后才可以回帖 登录 | 极速注册

本版积分规则

捐赠本站|Archiver|关于我们 About Us|小黑屋|Fcode ( 京ICP备18005632-2号 )

GMT+8, 2024-6-1 12:59

Powered by Tencent X3.4

© 2013-2024 Tencent

快速回复 返回顶部 返回列表