Skip to content

Commit

Permalink
Merge pull request #2104 for branch 'bugfix/memory-leaks' into dev/14…
Browse files Browse the repository at this point in the history
….3.0

Signed-off-by: Melissa Sulprizio <[email protected]>
  • Loading branch information
msulprizio committed Jan 9, 2024
2 parents bd165ad + 78fc204 commit ceda1a5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
### Fixed
- Fixed bug in stratospheric aerosols optical depths passed to Fast-JX
- Restored consideration of both isSnow and isIce in dry deposition
- Fixed calculation of FRLAND_NOSNO_NOICE in `calc_met_mod.F90`
- Fixed calculation of `FRLAND_NOSNO_NOICE` in `calc_met_mod.F90`
- Added missing units in comments of `KPP/fullchem/commonIncludeVars.H`
- Use run directory (not absolute path) to determine the executable file name in integration & parallel tests.
- Fixed memory leaks in `State_Chm%AerMass` and `State_Chm%Phot` containers

### Removed
- Removed references to unused met-fields RADLWG and LWGNT
Expand Down
1 change: 1 addition & 0 deletions Headers/phot_container_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,7 @@ SUBROUTINE Cleanup_Phot_Container( Phot, RC )
IF (ALLOCATED(Phot%RTASYMAER )) DEALLOCATE(Phot%RTASYMAER )
#endif

DEALLOCATE( Phot )
Phot => NULL()
ENDIF

Expand Down
7 changes: 4 additions & 3 deletions Headers/state_chm_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1020,7 +1020,7 @@ SUBROUTINE Init_State_Chm( Input_Opt, State_Chm, State_Grid, RC )
! Save nAerosol to State_Chm
State_Chm%nAeroType = nAerosol

!---------------------------------------------------------------------
!---------------------------------------------------------------------
! Aerosol object
! NOTE: content is currently not registered
!---------------------------------------------------------------------
Expand Down Expand Up @@ -3063,8 +3063,8 @@ SUBROUTINE Cleanup_State_Chm( State_Chm, RC )
!=======================================================================
! Deallocate and nullify pointer fields of State_Chm
!=======================================================================
IF ( ASSOCIATED ( State_Chm%Phot ) ) THEN
CALL Cleanup_Phot_Container(State_Chm%Phot, RC )
IF ( ASSOCIATED( State_Chm%Phot ) ) THEN
CALL Cleanup_Phot_Container( State_Chm%Phot, RC )
State_Chm%Phot => NULL()
ENDIF

Expand Down Expand Up @@ -3212,6 +3212,7 @@ SUBROUTINE Cleanup_State_Chm( State_Chm, RC )

IF ( ASSOCIATED( State_Chm%AerMass ) ) THEN
CALL Cleanup_AerMass_Container(State_Chm%AerMass, RC )
DEALLOCATE( State_Chm%AerMass )
State_Chm%AerMass => NULL()
ENDIF

Expand Down

0 comments on commit ceda1a5

Please sign in to comment.