Line data Source code
1 : !-------------------------------------------------------------------------------- 2 : ! Copyright (c) 2017 Peter Grünberg Institut, Forschungszentrum Jülich, Germany 3 : ! This file is part of FLEUR and available as free software under the conditions 4 : ! of the MIT license as expressed in the LICENSE file in more detail. 5 : !-------------------------------------------------------------------------------- 6 : 7 : MODULE m_make_xcpot 8 : use m_juDFT 9 : implicit none 10 : private 11 : public make_xcpot 12 : 13 : contains 14 160 : subroutine make_xcpot(fmpi,xcpot, atoms, input) 15 : use m_types_xcpot 16 : use m_types_atoms 17 : use m_types_input 18 : USE m_types_xcpot_libxc 19 : USE m_types_xcpot_inbuild 20 : USE m_types_xcpot_inbuild_nofunction 21 : USE m_types_mpi 22 : 23 : TYPE(t_mpi),INTENT(IN) :: fmpi 24 : TYPE(t_input), INTENT(IN) :: input 25 : TYPE(t_atoms), INTENT(IN) :: atoms 26 : CLASS(t_xcpot), ALLOCATABLE, INTENT(INOUT) :: xcpot 27 : 28 : INTEGER :: func_vxc_id_c, func_vxc_id_x, func_exc_id_c, func_exc_id_x 29 : REAL :: gmaxxc 30 : LOGICAL :: l_libxc 31 : LOGICAL :: l_inbuild 32 : CHARACTER(len=10) :: inbuild_name 33 : LOGICAL :: l_relativistic 34 : 35 : !Finish setup of xcpot 36 160 : xcpot%l_libxc = (xcpot%inbuild_name == "LibXC") 37 160 : IF (xcpot%l_libxc) THEN 38 6 : write (*,*) "func_ids", xcpot%func_vxc_id_c, xcpot%func_vxc_id_x, xcpot%func_exc_id_c, xcpot%func_exc_id_x 39 : 40 6 : func_vxc_id_c = xcpot%func_vxc_id_c 41 6 : func_vxc_id_x = xcpot%func_vxc_id_x 42 6 : func_exc_id_c = xcpot%func_exc_id_c 43 6 : func_exc_id_x = xcpot%func_exc_id_x 44 6 : gmaxxc = xcpot%gmaxxc 45 6 : l_libxc = .TRUE. 46 6 : l_inbuild = .FALSE. 47 6 : inbuild_name = xcpot%inbuild_name 48 6 : l_relativistic = xcpot%l_relativistic 49 : 50 6 : DEALLOCATE (xcpot) 51 6 : ALLOCATE (t_xcpot_libxc::xcpot) 52 : SELECT TYPE (xcpot) 53 : CLASS is (t_xcpot_libxc)!just allocated like this 54 6 : CALL xcpot%init(func_vxc_id_x, func_vxc_id_c, func_exc_id_x, func_exc_id_c, input%jspins) 55 : END SELECT 56 6 : xcpot%gmaxxc = gmaxxc 57 6 : xcpot%l_libxc = l_libxc 58 6 : xcpot%l_inbuild = l_inbuild 59 6 : xcpot%inbuild_name = inbuild_name 60 6 : xcpot%l_relativistic = l_relativistic 61 : ELSE 62 : SELECT TYPE (xcpot) 63 : CLASS is (t_xcpot_inbuild_nf) 64 154 : Call Xcpot%Init(Atoms%Ntype) 65 : CLASS DEFAULT 66 0 : CALL judft_error("Error in setup xcpot") 67 : END SELECT 68 : END IF 69 : 70 160 : end subroutine make_xcpot 71 160 : end MODULE m_make_xcpot