Line data Source code
1 : !--------------------------------------------------------------------------------------------------! 2 : ! CP2K: A general program to perform molecular dynamics simulations ! 3 : ! Copyright 2000-2023 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 48931 : SUBROUTINE create_status_type(status) 46 : TYPE(status_type), POINTER :: status 47 : 48 48931 : CPASSERT(.NOT. ASSOCIATED(status)) 49 48931 : ALLOCATE (status) 50 48931 : status%in_use = .FALSE. 51 48931 : status%old_input_line = "" 52 48931 : status%old_input_line_number = HUGE(0) 53 48931 : status%old_icol = HUGE(0) 54 48931 : status%old_icol1 = HUGE(0) 55 48931 : status%old_icol2 = HUGE(0) 56 48931 : NULLIFY (status%buffer) 57 48931 : CALL create_buffer_type(status%buffer) 58 48931 : 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 48931 : SUBROUTINE release_status_type(status) 67 : TYPE(status_type), POINTER :: status 68 : 69 48931 : CPASSERT(ASSOCIATED(status)) 70 48931 : CALL release_buffer_type(status%buffer) 71 48931 : DEALLOCATE (status) 72 48931 : END SUBROUTINE release_status_type 73 : 74 0 : END MODULE cp_parser_status_types