- 75 名前:デフォルトの名無しさん mailto:sage [2009/02/22(日) 13:30:21 ]
- >>74
やりたいのはこんな感じかな? MODULE m_test CONTAINS subroutine alloc4i(imem, msize) integer, allocatable, INTENT(OUT) :: imem(:) integer, INTENT(IN) :: msize if ( .not. allocated(imem) ) then allocate( imem(msize), stat=ier ) if (ier .ne. 0) stop else stop endif return end subroutine alloc4i END MODULE m_test program mtest USE m_test integer, allocatable :: imem1(:), imem2(:) msize = 1000*1000 * 200 call alloc4i(imem1, msize) call alloc4i(imem2, msize) stop end
|

|