Skip to content

Commit

Permalink
Merge pull request #2571 from GEOS-ESM/hotfix/atrayano/mem_leak_masking
Browse files Browse the repository at this point in the history
Fixed a memory leak affecting regional masking
  • Loading branch information
mathomp4 authored Feb 6, 2024
2 parents ea78b36 + f26ef34 commit fd15ea5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed

### Fixed
- fixed memory leak affecting regional masking. Temporary ESMF field was created but never destroyed

### Removed

Expand Down
3 changes: 3 additions & 0 deletions gridcomps/ExtData2G/ExtDataMasking.F90
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ subroutine evaluate_region_mask(this,state,var_name,rc)
enddo
end if
deallocate( mask)
call ESMF_FieldDestroy(temp_field, noGarbage=.true., _RC)

_RETURN(_SUCCESS)
end subroutine evaluate_region_mask
Expand Down Expand Up @@ -256,6 +257,7 @@ subroutine evaluate_zone_mask(this,state,var_name,rc)
where(limitS <= lats .and. lats <=limitN) var3d(:,:,i) = rvar3d(:,:,i)
enddo
end if
call ESMF_FieldDestroy(temp_field, noGarbage=.true., _RC)

_RETURN(_SUCCESS)
end subroutine evaluate_zone_mask
Expand Down Expand Up @@ -424,6 +426,7 @@ subroutine evaluate_box_mask(this,state,var_name,rc)
end if
deallocate(temp2d)
end if
call ESMF_FieldDestroy(temp_field, noGarbage=.true., _RC)

_RETURN(_SUCCESS)
end subroutine evaluate_box_mask
Expand Down

0 comments on commit fd15ea5

Please sign in to comment.