1 subroutine da_patch_to_global_2d (grid, vlocal, vglobal)
3 !---------------------------------------------------------------------
4 ! Purpose: Gathers local 2D array vlocal into global array vglobal.
6 ! Must be called by all MPI tasks.
7 !---------------------------------------------------------------------
11 type(domain), intent(in) :: grid
12 real, intent(in) :: vlocal(:,:)
13 real, intent(out) :: vglobal(:,:)
15 real, allocatable :: vlocal3d(:,:,:), vglobal3d(:,:,:)
17 if (trace_use_frequent) call da_trace_entry("da_patch_to_global_2d")
19 allocate(vlocal3d (ims:ime, jms:jme, 1:1))
20 allocate(vglobal3d(ids:ide, jds:jde, 1:1))
22 vlocal3d(:,:,1) = vlocal(:,:)
23 call da_patch_to_global_3d(grid, vlocal3d, vglobal3d, 1)
25 vglobal(:,:) = vglobal3d(:,:,1)
31 if (trace_use_frequent) call da_trace_exit("da_patch_to_global_2d")
33 end subroutine da_patch_to_global_2d