Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix memory leaks identified by a PGI compiler (#2139)
TYPE: bug fix KEYWORDS: Memory Leaks SOURCE: Charlie Li - Software developer from lakes environmental Canada DESCRIPTION OF CHANGES: Problem: Memory leaks are detected in wrf_timeseries.F and start_em.F when use PGI option: -g -O0 -traceback -Mchkptr -Mbounds -Ktrap=fp -Msave -tp=px It will failed for: "0: ALLOCATE: array already allocated" 1. In dyn_em/start_em.F, dz8w is allocated, but not deallocated. 2. In share/wrf_timeseries.F, two arrays, earth_u_profile and earth_v_profile, are allocated without being deallocated when time series is not computed. Solution: Calls to deallocate the array dz8w is added in start_em.F, and move the return statement before array allocation in wrf_timeseries.F. LIST OF MODIFIED FILES: M share/wrf_timeseries.F M dyn_em/start_em.F TESTS CONDUCTED: The Jenkins tests are all passing. RELEASE NOTE: This PR fixed memory leaks related to arrays being allocated without being deallocated in start_em and time series calculation subroutines.
- Loading branch information