Fix memory leaks in GEOSlandassim and GEOSlandpert GridComps#180
Draft
weiyuan-jiang wants to merge 2 commits into
Draft
Fix memory leaks in GEOSlandassim and GEOSlandpert GridComps#180weiyuan-jiang wants to merge 2 commits into
weiyuan-jiang wants to merge 2 commits into
Conversation
- GEOSlandassim: add deallocate(Observations_lH) in non-MPI path of get_enkf_increments (clsm_ensupd_enkf_update.F90); pointer was allocated every assimilation cycle but never freed - GEOSlandassim: add deallocate(tmp_wFOV) to cleanup block of get_obs_pred (clsm_ensupd_upd_routines.F90); omitted alongside four sibling arrays that were already freed - GEOSlandassim: add comprehensive deallocate calls in Finalize() for all module-level variables allocated in Initialize() (GEOS_LandAssimGridComp.F90): tb_nodata, Pert_rseed, Pert_rseed_r8, N_catl_vec, low_ind, l2rf, rf2f, tile_coord_rf, rf2g, rf2l, obs_param - GEOSlandpert: add explicit deallocate(pert_rseed) before RETURN_ macro in GenerateRaw_ntrmdt, consistent with ApplyForcePert/ApplyPrognPert - GEOSlandpert: add deallocate(pert_iseed) + nullify in Finalize(); module-level pointer was never freed - GEOSlandpert: add deallocate(internal) + nullify(wrap%ptr) in Finalize(); T_LANDPERT_STATE struct itself was never freed - GEOSlandpert: nullify force_pert_param and progn_pert_param after their targets are deallocated in Finalize() to avoid dangling pointers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
24-member simulations with perturbations on the c360 tile space crash after a few data-days. The exact data-time of the crash is different for each run. The error messages suggests that insufficient memory is the problem.
This PR fixes missing deallocate and nullify statements. These fixes should help address the crashes, but it remains unclear if the changes are sufficient to resolve the problem.
Specifically, the following fixes are included:
cc: @gmao-qliu @biljanaorescanin @gmao-rreichle