Skip to content

Commit

Permalink
common/memory_utilities: suppress some conventions checks, fix others
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-zero committed Nov 6, 2020
1 parent bba320d commit f202247
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/common/memory_utilities_unittest.F
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ PROGRAM memory_utilities_TEST

CONTAINS
! **************************************************************************************************
!> \brief ...
!> \brief Check that an allocated r1 array can be extended
! **************************************************************************************************
SUBROUTINE check_real_rank1_allocated()
INTEGER :: idx
Expand All @@ -42,10 +42,12 @@ SUBROUTINE check_real_rank1_allocated()
END SUBROUTINE

! **************************************************************************************************
!> \brief ...
!> \brief Check that an unallocated and unassociated (null) r1 array can be extended
! **************************************************************************************************
SUBROUTINE check_real_rank1_unallocated()
REAL(KIND=dp), DIMENSION(:), POINTER :: real_arr => NULL()
REAL(KIND=dp), DIMENSION(:), POINTER :: real_arr

real_arr => NULL()

CALL reallocate(real_arr, 1, 20)

Expand All @@ -58,7 +60,7 @@ SUBROUTINE check_real_rank1_unallocated()
END SUBROUTINE

! **************************************************************************************************
!> \brief ...
!> \brief Check that an allocated r2 array can be extended
! **************************************************************************************************
SUBROUTINE check_real_rank2_allocated()
INTEGER :: idx
Expand All @@ -81,10 +83,12 @@ SUBROUTINE check_real_rank2_allocated()
END SUBROUTINE

! **************************************************************************************************
!> \brief ...
!> \brief Check that an unallocated and unassociated (null) r2 array can be extended
! **************************************************************************************************
SUBROUTINE check_real_rank2_unallocated()
REAL(KIND=dp), DIMENSION(:, :), POINTER :: real_arr => NULL()
REAL(KIND=dp), DIMENSION(:, :), POINTER :: real_arr

real_arr => NULL()

CALL reallocate(real_arr, 1, 10, 1, 5)

Expand Down
4 changes: 4 additions & 0 deletions tools/conventions/conventions.supp
Original file line number Diff line number Diff line change
Expand Up @@ -247,3 +247,7 @@ xyz2dcd.F: Found WRITE statement with hardcoded unit in "print_help"
xyz2dcd.F: Found WRITE statement with hardcoded unit in "xyz2dcd"
Flag GRID_DO_COLLOCATE not mentioned in INSTALL.md
Flag GRID_DO_COLLOCATE not mentioned in cp2k_flags()
memory_utilities_unittest.F: Found WRITE statement with hardcoded unit in "check_real_rank1_allocated"
memory_utilities_unittest.F: Found WRITE statement with hardcoded unit in "check_real_rank1_unallocated"
memory_utilities_unittest.F: Found WRITE statement with hardcoded unit in "check_real_rank2_allocated"
memory_utilities_unittest.F: Found WRITE statement with hardcoded unit in "check_real_rank2_unallocated"

0 comments on commit f202247

Please sign in to comment.