Remove finalise method from adjoint lookup tables#311
Remove finalise method from adjoint lookup tables#311DrTVockerodtMO wants to merge 7 commits intoMetOffice:mainfrom
Conversation
andrewcoughtrie
left a comment
There was a problem hiding this comment.
A couple of points that need addressing.
There was a problem hiding this comment.
For this to be called as destructor (i.e. when the object goes out of scope) because it isn't a finaliser (even though it is called finalise).
| final :: finalise => adj_lookup_table_finaliser |
There was a problem hiding this comment.
Actually on second look you don't need a finaliser at all, the default destructor would do the job fine so you can remove this and the subroutine as well.
| call self%lookup_field%clear() | ||
| call self%set_count_field%clear() |
There was a problem hiding this comment.
Make the subroutine a finaliser as described (see my other comment) and you shouldn't need to call any of this. In fact you shouldn't be calling clear (they are only for pFUnit tests - don't ask)
| call self%lookup_field%clear() | |
| call self%set_count_field%clear() |
There was a problem hiding this comment.
As mentioned earlier you don't need this subroutine at all.
|
Thank you for having a look. So in other words there isn't a memory leak, I was just confused since I thought I had to manually destruct the fields. I'll keep this PR open and change it into removing the finalise of the lookup tables. On the other hand, the lookup table caches do allocate data so their finalise methods can stay so that is properly taken care of. |
…tor handles everything
|
I renamed the branch which deleted this pull request. |
PR Summary
Sci/Tech Reviewer:
Code Reviewer: @andrewcoughtrie
Please ignore the branch name as this was meant to address #310 which was a false alarm.
Code Quality Checklist
Testing
trac.log
Test Suite Results - lfric_apps - remove_finaliser/run1
Suite Information
Task Information
✅ succeeded tasks - 1164
Security Considerations
Performance Impact
AI Assistance and Attribution
Documentation
PSyclone Approval
Sci/Tech Review
(Please alert the code reviewer via a tag when you have approved the SR)
Code Review