perform_domain_deposition Subroutine

subroutine perform_domain_deposition()

perform_domain_deposition – Perfom the domain decomposition

Arguments

None

Calls

proc~~perform_domain_deposition~~CallsGraph proc~perform_domain_deposition perform_domain_deposition proc~decompose_dim decompose_dim proc~perform_domain_deposition->proc~decompose_dim proc~decompose_proc decompose_proc proc~perform_domain_deposition->proc~decompose_proc proc~mapping_domain mapping_domain proc~perform_domain_deposition->proc~mapping_domain

Called by

proc~~perform_domain_deposition~~CalledByGraph proc~perform_domain_deposition perform_domain_deposition program~main~9 main program~main~9->proc~perform_domain_deposition

Source Code

   subroutine perform_domain_deposition()
      integer, allocatable :: proc_sizes(:)
      !------------------------------------------------
      ! ---> Perform domain decomposition for the model
      !------------------------------------------------
      ! determine the number of processors in each direction
      ALLOCATE(proc_sizes(1:num_dims))
      call decompose_proc(npes, proc_sizes)
      NX = proc_sizes(1)
      NY = proc_sizes(2)
      DEALLOCATE(proc_sizes)

      ! determine the number of grid points each processor will have along the x-direction
      allocate(points_per_procX(0:NX-1))
      call decompose_dim(IM_WORLD, points_per_procX, NX)

      ! determine the number of grid points each processor will have along the y-direction
      allocate(points_per_procY(0:NY-1))
      call decompose_dim(JM_WORLD, points_per_procY, NY)

      allocate(map_proc(0:NX-1, 0:NY-1))
      allocate(map_domainX(0:NX-1, 0:NY-1, 2))
      allocate(map_domainY(0:NX-1, 0:NY-1, 2))

      ! determime the grid local domain corners with respect to the global domain
      call mapping_domain(map_proc, map_domainX, map_domainY, &
                           points_per_procX, points_per_procY, NX, NY, &
                           pe_id, global_indexX, global_indexY)

      i1 = global_indexX(1)
      i2 = global_indexX(2)
      j1 = global_indexY(1)
      j2 = global_indexY(2)
      k1 = 1
      k2 = KM_WORLD

      print '(a7,i5,a5,4i5)', 'pe_id: ', pe_id, '-->', i1, i2, j1, j2
   end subroutine perform_domain_deposition