LCOV - code coverage report
Current view: top level - src/input - cp_parser_status_types.F (source / functions) Hit Total Coverage
Test: CP2K Regtests (git:f515968) Lines: 17 18 94.4 %
Date: 2022-07-03 19:52:34 Functions: 2 3 66.7 %

          Line data    Source code
       1             : !--------------------------------------------------------------------------------------------------!
       2             : !   CP2K: A general program to perform molecular dynamics simulations                              !
       3             : !   Copyright 2000-2022 CP2K developers group <https://cp2k.org>                                   !
       4             : !                                                                                                  !
       5             : !   SPDX-License-Identifier: GPL-2.0-or-later                                                      !
       6             : !--------------------------------------------------------------------------------------------------!
       7             : 
       8             : ! **************************************************************************************************
       9             : !> \brief a module to allow the storage of the parser status
      10             : !> \author Teodoro Laino [tlaino] - University of Zurich
      11             : !> \date 08.2008
      12             : ! **************************************************************************************************
      13             : MODULE cp_parser_status_types
      14             :    USE cp_parser_buffer_types,          ONLY: buffer_type,&
      15             :                                               create_buffer_type,&
      16             :                                               release_buffer_type
      17             :    USE kinds,                           ONLY: max_line_length
      18             : #include "../base/base_uses.f90"
      19             : 
      20             :    IMPLICIT NONE
      21             :    PRIVATE
      22             : 
      23             :    TYPE status_type
      24             :       LOGICAL                                        :: in_use
      25             :       INTEGER                                        :: old_input_line_number
      26             :       INTEGER                                        :: old_icol
      27             :       INTEGER                                        :: old_icol1
      28             :       INTEGER                                        :: old_icol2
      29             :       CHARACTER(LEN=max_line_length)                 :: old_input_line
      30             :       ! Store status of the buffer
      31             :       TYPE(buffer_type), POINTER                     :: buffer
      32             :    END TYPE status_type
      33             : 
      34             :    PUBLIC :: status_type, create_status_type, release_status_type
      35             :    CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'cp_parser_status_types'
      36             : 
      37             : CONTAINS
      38             : 
      39             : ! ****************************************************************************
      40             : !> \brief creates the parser status type
      41             : !> \param status ...
      42             : !> \date  08.2008
      43             : !> \author Teodoro Laino [tlaino] - University of Zurich
      44             : ! **************************************************************************************************
      45       46487 :    SUBROUTINE create_status_type(status)
      46             :       TYPE(status_type), POINTER                         :: status
      47             : 
      48       46487 :       CPASSERT(.NOT. ASSOCIATED(status))
      49       46487 :       ALLOCATE (status)
      50       46487 :       status%in_use = .FALSE.
      51       46487 :       status%old_input_line = ""
      52       46487 :       status%old_input_line_number = HUGE(0)
      53       46487 :       status%old_icol = HUGE(0)
      54       46487 :       status%old_icol1 = HUGE(0)
      55       46487 :       status%old_icol2 = HUGE(0)
      56       46487 :       NULLIFY (status%buffer)
      57       46487 :       CALL create_buffer_type(status%buffer)
      58       46487 :    END SUBROUTINE create_status_type
      59             : 
      60             : ! ****************************************************************************
      61             : !> \brief releases the parser status type
      62             : !> \param status ...
      63             : !> \date  08.2008
      64             : !> \author Teodoro Laino [tlaino] - University of Zurich
      65             : ! **************************************************************************************************
      66       46487 :    SUBROUTINE release_status_type(status)
      67             :       TYPE(status_type), POINTER                         :: status
      68             : 
      69       46487 :       CPASSERT(ASSOCIATED(status))
      70       46487 :       CALL release_buffer_type(status%buffer)
      71       46487 :       DEALLOCATE (status)
      72       46487 :    END SUBROUTINE release_status_type
      73             : 
      74           0 : END MODULE cp_parser_status_types

Generated by: LCOV version 1.15