Skip to content
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

Replaced pointers with allocatables in mpp modules #1232

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

ganganoaa
Copy link
Contributor

Description

  • Replaced pointers, which were allocated, with allocatables. The following pointers are affected:
  1. overPtr in mpp/include/mpp_do_update_nest.fh:MPP_DO_UPDATE_NEST_FINE_3D_()
  2. check_T in mpp/include/mpp_domains_define.inc:mpp_define_domains2D()
  3. update, check, overlapList, and checkList in mpp/include/mpp_domains_define.inc:compute_overlaps()
  4. overlapList and checkList in mpp/include/mpp_domains_define.inc:compute_overlaps_fold_south()
  5. overlapList and newlist in mpp/include/mpp_domains_define.inc: expand_update_overlap_list() and expand_check_overlap_list()
  6. search_update_overlap, update_ref, and check in mpp/include/mpp_domains_util.inc: search_update_overlap()
  7. overPtr, update_s, update_x, and update_y in mpp/include/mpp_domains_util.inc: set_group_update()
  8. update, and check in mpp/include/mpp_update_domains2D.fh:MPP_UPDATE_DOMAINS_3D_()
  9. updatex, updatey, checkx, and checky in mpp/include/mpp_update_domains2D.fh:MPP_UPDATE_DOMAINS_3D_V_()
  10. update in mpp/include/mpp_update_domains2D_ad.fh:MPP_UPDATE_DOMAINS_AD_3D_()
  11. updatex, and updatey in mpp/include/mpp_update_domains2D_ad.fh:MPP_UPDATE_DOMAINS_AD_3D_V_()
  12. update in mpp/include/mpp_update_domains2D_nonblock.fh:MPP_START_UPDATE_DOMAINS_3D_() and MPP_COMPLETE_UPDATE_DOMAINS_3D_()
  13. updatex, and updaty in mpp/include/mpp_update_domains2D_nonblock.fh:MPP_START_UPDATE_DOMAINS_3D_V_() and MPP_COMPLETE_UPDATE_DOMAINS_3D_V_()
  14. Members list, and events of type communicater in mpp/mpp.F90
  15. Members of type unstruct_overlap_type: i and j in mpp/mpp_domains.F90
  16. Members of type unstruct_pass_type: recv and send in mpp/mpp_domains.F90
  17. Members of type domainUG: list, io_domain, and grid_index in mpp/mpp_domains.F90
  18. Members of type domain2D_spec: x, y, and tile_id in mpp/mpp_domains.F90
  19. Members of type overlap_type: msgsize, tileMe, tileNbr, is, ie, js, je, dir, rotation, index, and from_contact in mpp/mpp_domains.F90
  20. Members of type overlapSpec: send, recv, and next in mpp/mpp_domains.F90
  21. Members of type domain2D: pearray, tile_id, tile_id_all, x, y, list, tileList, check_C, check_E, check_N, bound_C, bound_E, bound_N, update_T, update_E, update_C, update_N, and io_domain in mpp/mpp_domains.F90
  22. Members of type contact_type: tile, align2, refine1, refine2, is1, ie1, js1, je1, is2, ie2_, js2, and je2 in mpp/mpp_domains.F90
  23. Members of type nestSpec: send, recv, and next in mpp/mpp_domains.F90
  24. Members of type nest_domain_type: nest_level, nest, tile_fine, tile_coarse, istart_fine, iend_fine, jstart_fine, jend_fine, istart_coarse, iend_coarse, jstart_coarse, and jend_coarse in mpp/mpp_domains.F90
  25. Members of type nest_level_type: my_nest_id, tile_fine, tile_coarse, istart_fine, iend_fine, jstart_fine, jend_fine, istart_coarse, iend_coarse, jstart_coarse, jend_coarse, pelist, pelist_fine, pelist_coarse, C2F_T, C2F_C, C2F_E, C2F_N, F2C_T, F2C_C, F2C_E, F2C_N, domain_fine, domain_coarse in mpp/mpp_domains.F90
  26. Member of type domain1D: list in mpp/mpp_domains.F90
  • Attribute target added to several input arguments to functions/subroutines where pointees are no longer pointers.

Fixes #1099

How Has This Been Tested?
Tested locally with Intel oneAPI (v2023.1.0); intel ifort (v2021.9.0). Some tests failed

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules
  • New check tests, if applicable, are included
  • make distcheck passes

@bensonr
Copy link
Contributor

bensonr commented May 23, 2023

@ganganoaa - I don't believe we want to change how this code works as these pointers are serving their intended purpose here. The ones we wanted to clean-up were those defined with a macro _ALLOCATED and a corresponding _NULL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allocated Pointers: Potential Memory Leak Issue
2 participants