09/02/22 09:30:19
>>73
module malloc
integer, allocatable :: imem(:)
contains
subroutine alloc4i(imem, msize)
integer::imem(:)
integer::msize
allocate ( imem(msize), stat=ier )
if (ier .ne. 0) stop
return
end subroutine
end module
program memtest
use malloc
integer::msize
msize = 1000*1000 * 200
call alloc4i(imem, msize)
stop
end program
う~ん・・・ f90に疎くて、こんなコードしか書けませんでしたorz
ホントは、下みたいな感じで、program側で複数の配列確保に使える
サブルーチンが欲しいのですが・・・
program memtest
:
call alloc4i(imem1,msize)
call alloc4i(imem2,msize)
: