LCOV - code coverage report
Current view: top level - src - qs_oce_types.F (source / functions) Coverage Total Hit
Test: CP2K Regtests (git:123285f) Lines: 93.8 % 16 15
Test Date: 2026-11-04 00:58:17 Functions: 75.0 % 4 3

            Line data    Source code
       1              : !--------------------------------------------------------------------------------------------------!
       2              : !   CP2K: A general program to perform molecular dynamics simulations                              !
       3              : !   Copyright 2000-2026 CP2K developers group <https://cp2k.org>                                   !
       4              : !                                                                                                  !
       5              : !   SPDX-License-Identifier: GPL-2.0-or-later                                                      !
       6              : !--------------------------------------------------------------------------------------------------!
       7              : ! **************************************************************************************************
       8              : MODULE qs_oce_types
       9              : 
      10              :    USE sap_kind_types,                  ONLY: release_sap_int,&
      11              :                                               sap_int_type
      12              : #include "./base/base_uses.f90"
      13              : 
      14              :    IMPLICIT NONE
      15              : 
      16              :    PRIVATE
      17              : 
      18              : ! *** Global parameters (only in this module)
      19              : 
      20              :    CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'qs_oce_types'
      21              : 
      22              : ! *** Define a oce matrix type ***
      23              : 
      24              : ! **************************************************************************************************
      25              :    TYPE oce_matrix_type
      26              :       TYPE(sap_int_type), DIMENSION(:), POINTER        :: intac => NULL()
      27              :    END TYPE oce_matrix_type
      28              : 
      29              : ! *** Public data types ***
      30              : 
      31              :    PUBLIC :: oce_matrix_type
      32              : 
      33              : ! *** Public subroutines ***
      34              : 
      35              :    PUBLIC :: allocate_oce_set, &
      36              :              create_oce_set, &
      37              :              deallocate_oce_set
      38              : 
      39              : CONTAINS
      40              : 
      41              : ! **************************************************************************************************
      42              : !> \brief   Allocate and initialize the matrix set of oce coefficients.
      43              : !> \param oce_set ...
      44              : !> \param nkind ...
      45              : !> \version 1.0
      46              : ! **************************************************************************************************
      47         4122 :    SUBROUTINE allocate_oce_set(oce_set, nkind)
      48              :       TYPE(oce_matrix_type), POINTER                     :: oce_set
      49              :       INTEGER, INTENT(IN)                                :: nkind
      50              : 
      51              :       INTEGER                                            :: i
      52              : 
      53        29360 :       ALLOCATE (oce_set%intac(nkind*nkind))
      54        21116 :       DO i = 1, nkind*nkind
      55        16994 :          NULLIFY (oce_set%intac(i)%alist)
      56        16994 :          NULLIFY (oce_set%intac(i)%asort)
      57        21116 :          NULLIFY (oce_set%intac(i)%aindex)
      58              :       END DO
      59              : 
      60         4122 :    END SUBROUTINE allocate_oce_set
      61              : 
      62              : ! **************************************************************************************************
      63              : !> \brief ...
      64              : !> \param oce_set ...
      65              : ! **************************************************************************************************
      66         4122 :    SUBROUTINE create_oce_set(oce_set)
      67              : 
      68              :       TYPE(oce_matrix_type), POINTER                     :: oce_set
      69              : 
      70         4122 :       IF (ASSOCIATED(oce_set)) CALL deallocate_oce_set(oce_set)
      71              : 
      72         4122 :       ALLOCATE (oce_set)
      73              : 
      74              :       NULLIFY (oce_set%intac)
      75              : 
      76         4122 :    END SUBROUTINE create_oce_set
      77              : 
      78              : ! **************************************************************************************************
      79              : !> \brief  Deallocate the matrix set of oce coefficients
      80              : !> \param oce_set ...
      81              : !> \date
      82              : !> \author
      83              : !> \version 1.0
      84              : ! **************************************************************************************************
      85         4122 :    SUBROUTINE deallocate_oce_set(oce_set)
      86              :       TYPE(oce_matrix_type), POINTER                     :: oce_set
      87              : 
      88         4122 :       IF (.NOT. ASSOCIATED(oce_set)) RETURN
      89              : 
      90         4122 :       IF (ASSOCIATED(oce_set%intac)) CALL release_sap_int(oce_set%intac)
      91              : 
      92         4122 :       DEALLOCATE (oce_set)
      93              : 
      94              :    END SUBROUTINE deallocate_oce_set
      95              : 
      96              : ! **************************************************************************************************
      97              : 
      98            0 : END MODULE qs_oce_types
        

Generated by: LCOV version 2.0-1