diff --git a/CHANGELOG.md b/CHANGELOG.md index f5f5062e2..8c8fe9094 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/Headers/phot_container_mod.F90 b/Headers/phot_container_mod.F90 index 681034bf1..e317b4de9 100644 --- a/Headers/phot_container_mod.F90 +++ b/Headers/phot_container_mod.F90 @@ -758,6 +758,7 @@ SUBROUTINE Cleanup_Phot_Container( Phot, RC ) IF (ALLOCATED(Phot%RTASYMAER )) DEALLOCATE(Phot%RTASYMAER ) #endif + DEALLOCATE( Phot ) Phot => NULL() ENDIF diff --git a/Headers/state_chm_mod.F90 b/Headers/state_chm_mod.F90 index 2bdaeeed4..e45089f91 100644 --- a/Headers/state_chm_mod.F90 +++ b/Headers/state_chm_mod.F90 @@ -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 !--------------------------------------------------------------------- @@ -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 @@ -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