Skip to content

Commit

Permalink
fix: mpp_check_field fix for test_mpp_domains2 (#1292)
Browse files Browse the repository at this point in the history
  • Loading branch information
laurenchilutti authored Aug 8, 2023
1 parent a13de5b commit 01d73fb
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions mpp/include/mpp_domains_misc.inc
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,13 @@ end subroutine init_nonblock_type
field2(isd:ied, jsd:jed) = field_in(:,:)
endif
! allocate field1 on pelist1
! if field1 is left unallocated, the code will try to access unallocated memory
! when field1 is set to 0 in mpp_redistribute
if(any(pelist1 == pe)) then
allocate(field1(1,1))
endif
! broadcast domain
call mpp_broadcast_domain(domain1)
call mpp_broadcast_domain(domain2)
Expand All @@ -443,6 +450,8 @@ end subroutine init_nonblock_type
if(any(pelist2 == pe)) deallocate(field1, field2)
if(any(pelist1 == pe)) deallocate(field1)
call mpp_sync()
return
Expand Down

0 comments on commit 01d73fb

Please sign in to comment.