Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions mpp/include/mpp_gather.fh
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,15 @@ subroutine MPP_GATHER_PELIST_GEN_2D_(is, ie, js, je, pelist, array_seg, gather_d

MPP_TYPE_, pointer :: arr3D(:,:,:)
MPP_TYPE_, pointer :: data3D(:,:,:)
MPP_TYPE_, allocatable, target :: empty3D(:,:,:)

arr3D(1:size(array_seg,1),1:size(array_seg,2),1:1) => array_seg

if (is_root_pe) then
data3D(1:size(gather_data,1),1:size(gather_data,2),1:1) => gather_data
data3D(1:size(gather_data,1),1:size(gather_data,2),1:1) => gather_data
else
data3D => null()
allocate(empty3D(0,0,0))
data3D => empty3D
endif

call mpp_gather(is, ie, js, je, 1, pelist, arr3D, data3D, [dim_order, 3], is_root_pe, &
Expand Down
4 changes: 3 additions & 1 deletion mpp/include/mpp_scatter.fh
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,14 @@ subroutine MPP_SCATTER_PELIST_GEN_2D_(is, ie, js, je, pelist, array_seg, input_d

MPP_TYPE_, pointer :: arr3D(:,:,:)
MPP_TYPE_, pointer :: data3D(:,:,:)
MPP_TYPE_, allocatable, target :: empty3D(:,:,:)

arr3D(1:size(array_seg,1),1:size(array_seg,2),1:1) => array_seg
if (is_root_pe) then
data3D(1:size(input_data,1),1:size(input_data,2),1:1) => input_data
else
data3D => null()
allocate(empty3D(0,0,0))
data3D => empty3D
endif

call mpp_scatter(is, ie, js, je, 1, pelist, arr3D, data3D, [dim_order, 3], is_root_pe)
Expand Down
2 changes: 0 additions & 2 deletions test_fms/mpp/test_mpp_pelist_gatscat_gen_ind.F90
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,6 @@ subroutine alloc_field(field, dim_order, dims_logical, pe, root, is_global)
allocate(field(dims(dim_order(1)), &
dims(dim_order(2)), &
dims(dim_order(3))))
else
allocate(field(1,1,1))
endif
else
dims = dims_logical
Expand Down
Loading