Octopus
xc_cam.F90
Go to the documentation of this file.
1!! Copyright (C) 2025. A Buccheri
2!!
3!! This program is free software; you can redistribute it and/or modify
4!! it under the terms of the GNU General Public License as published by
5!! the Free Software Foundation; either version 2, or (at your option)
6!! any later version.
7!!
8!! This program is distributed in the hope that it will be useful,
9!! but WITHOUT ANY WARRANTY; without even the implied warranty of
10!! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11!! GNU General Public License for more details.
12!!
13!! You should have received a copy of the GNU General Public License
14!! along with this program; if not, write to the Free Software
15!! Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
16!! 02110-1301, USA.
17!!
18#include "global.h"
19
20module xc_cam_oct_m
21 use, intrinsic :: iso_fortran_env
22
23 use debug_oct_m
24 use global_oct_m
28
29 implicit none
30 private
31 public :: xc_cam_t, &
32 cam_null, &
34
46 type xc_cam_t
47 real(real64) :: omega = 0.0_real64
48 real(real64) :: alpha = 0.0_real64
49 real(real64) :: beta = 0.0_real64
50 contains
51 procedure :: print => xc_cam_print
52 procedure :: as_array => xc_cam_as_array
53 end type xc_cam_t
54
56 type(xc_cam_t), parameter :: cam_null = xc_cam_t(0.0_real64, 0.0_real64, 0.0_real64)
57
59 type(xc_cam_t), parameter :: cam_exact_exchange = xc_cam_t(0.0_real64, 1.0_real64, 0.0_real64)
60
61contains
62
64 subroutine xc_cam_print(this, namespace, msg)
65 class(xc_cam_t), intent(in) :: this
66 type(namespace_t), intent(in) :: namespace
67 character(len=*), optional, intent(in) :: msg
68
69 character(len=256) :: info_message
70
71 push_sub(xc_cam_print)
72
73 if (present(msg)) then
74 info_message = msg
75 else
76 info_message = "CAM parameters are:"
77 endif
78
79 write(message(1), '(1x)')
80 write(message(2), '(a)') "Info: " // trim(adjustl(info_message))
81 write(message(2), '(a,f8.5)') " alpha = ", this%alpha
82 write(message(3), '(a,f8.5)') " beta = ", this%beta
83 write(message(4), '(a,f8.5)') " omega = ", this%omega
84 call messages_info(4, namespace=namespace)
85
86 pop_sub(xc_cam_print)
87
88 end subroutine xc_cam_print
89
98 pure function xc_cam_as_array(this) result(params)
99 class(xc_cam_t), intent(in) :: this
100
101 real(real64) :: params(3)
102
103 params = [this%alpha, this%beta, this%omega]
104
105 end function xc_cam_as_array
106
107end module xc_cam_oct_m
character(len=256), dimension(max_lines), public message
to be output by fatal, warning
Definition: messages.F90:162
subroutine, public messages_info(no_lines, iunit, debug_only, stress, all_nodes, namespace)
Definition: messages.F90:594
type(xc_cam_t), parameter, public cam_null
All CAM parameters set to zero.
Definition: xc_cam.F90:151
pure real(real64) function, dimension(3) xc_cam_as_array(this)
@ brief Return attributes as an array of reals. LibXC interface expects an array of reals,...
Definition: xc_cam.F90:194
type(xc_cam_t), parameter, public cam_exact_exchange
Use only Hartree Fock exact exchange.
Definition: xc_cam.F90:154
subroutine xc_cam_print(this, namespace, msg)
Print attribute values.
Definition: xc_cam.F90:160
Coulomb-attenuating method parameters, used in the partitioning of the Coulomb potential into a short...
Definition: xc_cam.F90:141