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 : ! ************************************************************************************************** 9 : !> \par History 10 : !> JGH (11.08.2002) exchange and correlation energy now in exc 11 : !> \author MK (13.06.2002) 12 : ! ************************************************************************************************** 13 : MODULE fist_energy_types 14 : 15 : USE kinds, ONLY: dp 16 : #include "./base/base_uses.f90" 17 : 18 : IMPLICIT NONE 19 : CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'fist_energy_types' 20 : 21 : PRIVATE 22 : 23 : ! ************************************************************************************************** 24 : TYPE fist_energy_type 25 : REAL(kind=dp) :: kin, pot, e_gspace, e_self, e_neut, e_bonded, e_induction 26 : REAL(kind=dp) :: kin_shell, harm_shell 27 : END TYPE fist_energy_type 28 : 29 : ! *** Public data types *** 30 : 31 : PUBLIC :: fist_energy_type 32 : 33 : ! *** Public subroutines *** 34 : 35 : PUBLIC :: allocate_fist_energy, & 36 : deallocate_fist_energy 37 : 38 : CONTAINS 39 : 40 : ! ************************************************************************************************** 41 : !> \brief Allocate and/or initialise a Fist energy data structure. 42 : !> \param fist_energy ... 43 : !> \date 13.06.2002 44 : !> \author MK 45 : !> \version 1.0 46 : ! ************************************************************************************************** 47 2639 : SUBROUTINE allocate_fist_energy(fist_energy) 48 : TYPE(fist_energy_type), POINTER :: fist_energy 49 : 50 2639 : IF (.NOT. ASSOCIATED(fist_energy)) THEN 51 2639 : ALLOCATE (fist_energy) 52 : END IF 53 : 54 2639 : CALL init_fist_energy(fist_energy) 55 : 56 2639 : END SUBROUTINE allocate_fist_energy 57 : 58 : ! ************************************************************************************************** 59 : !> \brief Deallocate a Fist energy data structure. 60 : !> \param fist_energy ... 61 : !> \date 13.06.2002 62 : !> \author MK 63 : !> \version 1.0 64 : ! ************************************************************************************************** 65 2639 : SUBROUTINE deallocate_fist_energy(fist_energy) 66 : TYPE(fist_energy_type), POINTER :: fist_energy 67 : 68 2639 : IF (ASSOCIATED(fist_energy)) THEN 69 2639 : DEALLOCATE (fist_energy) 70 : ELSE 71 : CALL cp_abort(__LOCATION__, & 72 : "The fist_energy pointer is not associated "// & 73 0 : "and cannot be deallocated.") 74 : END IF 75 : 76 2639 : END SUBROUTINE deallocate_fist_energy 77 : 78 : ! ************************************************************************************************** 79 : !> \brief Initialise a Fist energy data structure. 80 : !> \param fist_energy ... 81 : !> \date 13.06.2002 82 : !> \author MK 83 : !> \version 1.0 84 : ! ************************************************************************************************** 85 2639 : SUBROUTINE init_fist_energy(fist_energy) 86 : TYPE(fist_energy_type), POINTER :: fist_energy 87 : 88 2639 : IF (ASSOCIATED(fist_energy)) THEN 89 2639 : fist_energy%kin = 0.0_dp 90 2639 : fist_energy%pot = 0.0_dp 91 2639 : fist_energy%e_gspace = 0.0_dp 92 2639 : fist_energy%e_self = 0.0_dp 93 2639 : fist_energy%e_neut = 0.0_dp 94 2639 : fist_energy%e_bonded = 0.0_dp 95 2639 : fist_energy%e_induction = 0.0_dp 96 2639 : fist_energy%kin_shell = 0.0_dp 97 2639 : fist_energy%harm_shell = 0.0_dp 98 : ELSE 99 : CALL cp_abort(__LOCATION__, & 100 : "The fist_energy pointer is not associated "// & 101 0 : "and cannot be initialised.") 102 : END IF 103 : 104 2639 : END SUBROUTINE init_fist_energy 105 : 106 0 : END MODULE fist_energy_types