LCOV - code coverage report
Current view: top level - src - exclusion_types.F (source / functions) Hit Total Coverage
Test: CP2K Regtests (git:262480d) Lines: 13 14 92.9 %
Date: 2024-11-22 07:00:40 Functions: 1 2 50.0 %

          Line data    Source code
       1             : !--------------------------------------------------------------------------------------------------!
       2             : !   CP2K: A general program to perform molecular dynamics simulations                              !
       3             : !   Copyright 2000-2024 CP2K developers group <https://cp2k.org>                                   !
       4             : !                                                                                                  !
       5             : !   SPDX-License-Identifier: GPL-2.0-or-later                                                      !
       6             : !--------------------------------------------------------------------------------------------------!
       7             : ! **************************************************************************************************
       8             : !> \brief an exclusion type
       9             : ! **************************************************************************************************
      10             : MODULE exclusion_types
      11             : 
      12             : #include "./base/base_uses.f90"
      13             :    IMPLICIT NONE
      14             :    PRIVATE
      15             : 
      16             : ! **************************************************************************************************
      17             : !> \brief A type used to store lists of exclusions and onfos
      18             : !> \par History
      19             : !>      12.2010 created [Joost VandeVondele]
      20             : ! **************************************************************************************************
      21             :    TYPE exclusion_type
      22             :       INTEGER, POINTER, DIMENSION(:)        :: list_exclude_vdw => NULL()
      23             :       INTEGER, POINTER, DIMENSION(:)        :: list_exclude_ei => NULL()
      24             :       INTEGER, POINTER, DIMENSION(:)        :: list_onfo => NULL()
      25             :    END TYPE
      26             : 
      27             :    PUBLIC :: exclusion_type, &
      28             :              exclusion_release
      29             : 
      30             :    CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'exclusion_types'
      31             : 
      32             : CONTAINS
      33             : 
      34             : ! **************************************************************************************************
      35             : !> \brief Release exclusion type
      36             : !> \param exclusions ...
      37             : !> \par History
      38             : !>      12.2010 created [Teodoro Laino] - teodoro.laino@gmail.com
      39             : !> \author teo
      40             : ! **************************************************************************************************
      41        2642 :    SUBROUTINE exclusion_release(exclusions)
      42             :       TYPE(exclusion_type), DIMENSION(:), POINTER        :: exclusions
      43             : 
      44             :       INTEGER                                            :: iatom
      45             : 
      46        2642 :       IF (ASSOCIATED(exclusions)) THEN
      47      634860 :          DO iatom = 1, SIZE(exclusions)
      48      632366 :             IF (ASSOCIATED(exclusions(iatom)%list_exclude_vdw, &
      49             :                            exclusions(iatom)%list_exclude_ei)) THEN
      50      630596 :                DEALLOCATE (exclusions(iatom)%list_exclude_vdw)
      51             :             ELSE
      52        1770 :                IF (ASSOCIATED(exclusions(iatom)%list_exclude_vdw)) THEN
      53        1770 :                   DEALLOCATE (exclusions(iatom)%list_exclude_vdw)
      54             :                END IF
      55        1770 :                IF (ASSOCIATED(exclusions(iatom)%list_exclude_ei)) THEN
      56        1770 :                   DEALLOCATE (exclusions(iatom)%list_exclude_ei)
      57             :                END IF
      58             :             END IF
      59      634860 :             IF (ASSOCIATED(exclusions(iatom)%list_onfo)) THEN
      60      632366 :                DEALLOCATE (exclusions(iatom)%list_onfo)
      61             :             END IF
      62             :          END DO
      63        2494 :          DEALLOCATE (exclusions)
      64             :       END IF
      65        2642 :    END SUBROUTINE exclusion_release
      66             : 
      67           0 : END MODULE exclusion_types

Generated by: LCOV version 1.15