楼主:
iohan (iohan)
2014-09-28 10:47:00原始宣告如下
type :: abc
integer :: a
real :: b
read :: c
end type abc
type(abc) :: GG
假设现在我需要3组不同的变量GG
第一组GG的a,b,c各要2,3,4个数字
第二组GG的a,b,c各要3,4,5个数字
第三组GG的a,b,c各要7,8,9个数字
请问我allocate的格式该怎么打才是正确的?
或者...type根本不能allocate ?
感谢赐教
type(abc),dimension(:),allocatable :: GGallocate(GG(3))GG=(/abc(1,2.,3.),abc(4,5.,6.),abc(7,8.,9.)/)write(*,*) GG(1)%a, GG(1)%b, GG(1)%c