1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140
|
!
! Copyright (C) 2004-2013 Quantum ESPRESSO group
! This file is distributed under the terms of the
! GNU General Public License. See the file `License'
! in the root directory of the present distribution,
! or http://www.gnu.org/copyleft/gpl.txt .
!
!--------------------------------------------------------------------------
!
! This module contains fortran wrapper to BEEF library functions.
!
MODULE beef_interface
!
IMPLICIT NONE
!
PRIVATE
!
!
PUBLIC :: beefx, beeflocalcorr, beeflocalcorrspin, beefsetmode, &
beefrandinit, beefrandinitdef, beefensemble, beef_set_type
!
#if !defined(__NOBEEF)
INTERFACE
!
SUBROUTINE beefx( r, g, e, dr, dg, addlda ) BIND(C, NAME="beefx_")
USE iso_c_binding
REAL (C_DOUBLE) :: r, g, e, dr, dg
INTEGER(C_INT), INTENT(IN) :: addlda
END SUBROUTINE beefx
!
SUBROUTINE beeflocalcorr( r, g, e, dr, dg, addlda) &
BIND(C, NAME="beeflocalcorr_")
USE iso_c_binding
REAL (C_DOUBLE), INTENT(INOUT) :: r, g, e, dr, dg
INTEGER(C_INT), INTENT(IN) :: addlda
END SUBROUTINE beeflocalcorr
!
SUBROUTINE beeflocalcorrspin(r, z, g, e, drup, drdown, dg, addlda) &
BIND(C, NAME="beeflocalcorrspin_")
USE iso_c_binding
REAL (C_DOUBLE), INTENT(INOUT) :: r, z, g, e, drup, drdown, dg
INTEGER(C_INT), INTENT(IN) :: addlda
END SUBROUTINE beeflocalcorrspin
!
SUBROUTINE beefsetmode(mode) BIND(C, NAME="beefsetmode_")
USE iso_c_binding
INTEGER(C_INT), INTENT(IN) :: mode
END SUBROUTINE beefsetmode
!
SUBROUTINE beefrandinit(seed) BIND(C, NAME="beefrandinit_")
USE iso_c_binding
INTEGER(C_INT), INTENT(IN) :: seed
END SUBROUTINE beefrandinit
!
SUBROUTINE beefrandinitdef() BIND(C, NAME="beefrandinitdef_")
END SUBROUTINE beefrandinitdef
!
SUBROUTINE beefensemble(beefxc, ensemble) BIND(C, NAME="beefensemble_")
USE iso_c_binding
REAL (C_DOUBLE), INTENT(INOUT) :: beefxc(*), ensemble(*)
END SUBROUTINE beefensemble
!
FUNCTION beef_set_type_interface(tbeef, ionode) &
BIND(C,name="beef_set_type_") RESULT(r)
USE iso_c_binding
INTEGER(C_INT), INTENT(IN) :: tbeef, ionode
INTEGER(C_INT) :: r
END FUNCTION beef_set_type_interface
!
END INTERFACE
!
CONTAINS
! ====================================================================
!
FUNCTION beef_set_type(tbeef, ionode) RESULT(r)
INTEGER, INTENT(IN) :: tbeef
LOGICAL, INTENT(IN) :: ionode
LOGICAL :: r
! ... local variables ...
INTEGER :: ionode_ = 0
INTEGER :: r_
!
IF ( ionode ) ionode_ = 1
!
r_ = beef_set_type_interface(tbeef, ionode_)
!
IF ( r_ /= 0 ) THEN
r = .TRUE.
ELSE
r = .FALSE.
END IF
!
END FUNCTION beef_set_type
!
#else
CONTAINS
! empty routines to prevent compilation errors
SUBROUTINE beefx( r, g, e, dr, dg, addlda )
USE kinds, ONLY : dp
REAL (dp) :: r, g, e, dr, dg
INTEGER :: addlda
END SUBROUTINE beefx
!
SUBROUTINE beeflocalcorr( r, g, e, dr, dg, addlda)
USE kinds, ONLY : dp
REAL (dp), INTENT(INOUT) :: r, g, e, dr, dg
INTEGER :: addlda
END SUBROUTINE beeflocalcorr
!
SUBROUTINE beeflocalcorrspin(r, z, g, e, drup, drdown, dg, addlda)
USE kinds, ONLY : dp
REAL (dp), INTENT(INOUT) :: r, z, g, e, drup, drdown, dg
INTEGER :: addlda
END SUBROUTINE beeflocalcorrspin
!
SUBROUTINE beefsetmode(mode)
INTEGER :: mode
END SUBROUTINE beefsetmode
!
SUBROUTINE beefrandinit(seed)
INTEGER :: seed
END SUBROUTINE beefrandinit
!
SUBROUTINE beefrandinitdef()
END SUBROUTINE beefrandinitdef
!
SUBROUTINE beefensemble(beefxc, ensemble)
USE kinds, ONLY : dp
REAL (dp) :: beefxc(:), ensemble(:)
END SUBROUTINE beefensemble
!
LOGICAL FUNCTION beef_set_type(tbeef, ionode)
INTEGER :: tbeef
LOGICAL :: ionode
CALL errore('beef_set_type','no beef! support for BEEF not compiled',1)
END FUNCTION beef_set_type
#endif
!
END MODULE beef_interface
!
|