くだすれFORTRAN(超初心者用)その4
■ このスレッドは過去ログ倉庫に格納されています
007469
2009/02/22(日) 09:30:19module 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)
:
■ このスレッドは過去ログ倉庫に格納されています