作者:
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