[Fortran] 纯文本查看 复制代码
type blocks
integer*4 :: row1,row2,coL1,coL2
integer*4 :: rowm,coLm
integer*4 :: dad
integer*4 :: son(4)
integer*4 :: bnum
type(Subblocks), allocatable :: iSubblocks(:)
end type blocks
[Fortran] 纯文本查看 复制代码
type Subblocks
integer*4 :: row
integer*4 :: coL
end type Subblocks
type blocks
integer*4 :: row1,row2,coL1,coL2
integer*4 :: rowm,coLm
integer*4 :: dad
integer*4 :: son(4)
integer*4 :: bnum
type(Subblocks), allocatable :: iSubblocks(:)
end type blocks
type(blocks), allocatable :: iblocks(:)
type(Subblocks), allocatable :: iSubblocks(:)
integer :: i, n, m
n = 10
m = 20
allocate(iblocks(n))
do i = 1, n
allocate(iblocks(i) % isubblocks(m))
end do
allocate(isubblocks(m))
print *, iblocks(3) % colm, iblocks % isubblocks(2) % col, isubblocks(3) % col