-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replaces pointers which are allocated with allocatables #1208
base: main
Are you sure you want to change the base?
Replaces pointers which are allocated with allocatables #1208
Conversation
Do not check iarray2 and jarray2
Allocatables iarray and jarray are reverted to pointers.
@@ -287,17 +287,17 @@ module xgrid_mod | |||
!> Type to hold pointers for grid boxes | |||
!> @ingroup xgrid_mod | |||
type grid_box_type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This type is public and so are it's fields so we're gonna have to check the component's code to make sure these fields aren't used as pointers anywhere else besides internally (unless we want to make them private now but doubt that'll work).
This applies to xmap_type as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. You are right. If component codes are using them, this change certainly breaks something.
@@ -2257,7 +2254,7 @@ end subroutine set_comm_get1_repro | |||
|
|||
!####################################################################### | |||
subroutine set_comm_get1(xmap) | |||
type (xmap_type), intent(inout) :: xmap | |||
type (xmap_type), intent(inout), target :: xmap | |||
type (grid_type), pointer, save :: grid1 =>NULL() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
guess we can't do much about these saved pointers right? might be less memory to save them as pointers anyway
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pointers which are used as pointers should not be upgraded.
Description
Updates member pointers of grid_box_type, grid_type, comm_type, and xmap_type to allocatables, which were previously allocated, to handle better memory management and to prevent memory leaks. Some local pointers in subroutine load_xgrid() are also updated to allocatables for the same reason.
Fixes #1099
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Please also note
any relevant details for your test configuration (e.g. compiler, OS). Include
enough information so someone can reproduce your tests.
Checklist:
make distcheck
passes