12.メモリー管理(work領域初期化) type block_1d real(8), dimension(:), pointer:: ptr integer :: linked !いくつの変数がpointer参照しているか logical :: saved !保存されるべきか(uとか)否か(計算途中結果) end type block_1d type(block_1d), allocatable, save :: b1(:) contains subroutine init_memory_manager_1d(max_address) integer, intent(in) :: max_address integer :: i allocate( b1(max_address) ) do i = 1, max_address allocate( b1(i)%ptr(lb_axis1:ub_axis1) ) b1(i)%saved = .false. b1(i)%linked = 0 end do max_addr_1d = max_address end subroutine init_memory_manager_1d