TABLE OF CONTENTS
ABINIT/flib_pwscf [ Modules ]
NAME
flib_pwscf
FUNCTION
the following is a partial import of the flib directory of espresso provides small routines for other pwscf-imported subroutines
COPYRIGHT
Copyright (C) 2008-2018 ABINIT group (MVer) This file is distributed under the terms of the GNU General Public License, see ~abinit/COPYING or http://www.gnu.org/copyleft/gpl.txt .
PARENTS
SOURCE
21 #if defined HAVE_CONFIG_H 22 #include "config.h" 23 #endif 24 25 module flib_pwscf 26 27 implicit none 28 29 contains 30 31 !----------------------------------------------------------------------- 32 FUNCTION matches( string1, string2 ) 33 !----------------------------------------------------------------------- 34 ! 35 ! ... .TRUE. if string1 is contained in string2, .FALSE. otherwise 36 ! 37 38 !This section has been created automatically by the script Abilint (TD). 39 !Do not modify the following lines by hand. 40 #undef ABI_FUNC 41 #define ABI_FUNC 'matches' 42 !End of the abilint section 43 44 IMPLICIT NONE 45 ! 46 CHARACTER (LEN=*), INTENT(IN) :: string1, string2 47 LOGICAL :: matches 48 INTEGER :: len1, len2, l 49 ! 50 ! 51 len1 = LEN_TRIM( string1 ) 52 len2 = LEN_TRIM( string2 ) 53 ! 54 DO l = 1, ( len2 - len1 + 1 ) 55 ! 56 IF ( string1(1:len1) == string2(l:(l+len1-1)) ) THEN 57 ! 58 matches = .TRUE. 59 ! 60 RETURN 61 ! 62 END IF 63 ! 64 END DO 65 ! 66 matches = .FALSE. 67 ! 68 RETURN 69 ! 70 END FUNCTION matches 71 ! 72 ! Copyright (C) 2001-2004 Carlo Cavazzoni and PWSCF group 73 ! This file is distributed under the terms of the 74 ! GNU General Public License. See the file `License' 75 ! in the root directory of the present distribution, 76 ! or http://www.gnu.org/copyleft/gpl.txt . 77 ! 78 !----------------------------------------------------------------------- 79 FUNCTION capital( in_char ) 80 !----------------------------------------------------------------------- 81 ! 82 ! ... converts character to capital if lowercase 83 ! ... copy character to output in all other cases 84 ! 85 86 !This section has been created automatically by the script Abilint (TD). 87 !Do not modify the following lines by hand. 88 #undef ABI_FUNC 89 #define ABI_FUNC 'capital' 90 !End of the abilint section 91 92 IMPLICIT NONE 93 ! 94 CHARACTER(LEN=1), INTENT(IN) :: in_char 95 CHARACTER(LEN=1) :: capital 96 CHARACTER(LEN=26), PARAMETER :: lower = 'abcdefghijklmnopqrstuvwxyz', & 97 upper = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 98 INTEGER :: i 99 ! 100 ! 101 DO i=1, 26 102 ! 103 IF ( in_char == lower(i:i) ) THEN 104 ! 105 capital = upper(i:i) 106 ! 107 RETURN 108 ! 109 END IF 110 ! 111 END DO 112 ! 113 capital = in_char 114 ! 115 RETURN 116 ! 117 END FUNCTION capital 118 ! 119 !----------------------------------------------------------------------- 120 FUNCTION lowercase( in_char ) 121 !----------------------------------------------------------------------- 122 ! 123 ! ... converts character to lowercase if capital 124 ! ... copy character to output in all other cases 125 ! 126 127 !This section has been created automatically by the script Abilint (TD). 128 !Do not modify the following lines by hand. 129 #undef ABI_FUNC 130 #define ABI_FUNC 'lowercase' 131 !End of the abilint section 132 133 IMPLICIT NONE 134 ! 135 CHARACTER(LEN=1), INTENT(IN) :: in_char 136 CHARACTER(LEN=1) :: lowercase 137 CHARACTER(LEN=26), PARAMETER :: lower = 'abcdefghijklmnopqrstuvwxyz', & 138 upper = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 139 INTEGER :: i 140 ! 141 ! 142 DO i=1, 26 143 ! 144 IF ( in_char == upper(i:i) ) THEN 145 ! 146 lowercase = lower(i:i) 147 ! 148 RETURN 149 ! 150 END IF 151 ! 152 END DO 153 ! 154 lowercase = in_char 155 ! 156 RETURN 157 ! 158 END FUNCTION lowercase 159 160 subroutine errore (routine, error, code) 161 162 use defs_basis, only: std_out,std_out_default 163 164 !This section has been created automatically by the script Abilint (TD). 165 !Do not modify the following lines by hand. 166 #undef ABI_FUNC 167 #define ABI_FUNC 'errore' 168 !End of the abilint section 169 170 implicit none 171 172 !args 173 character(*), intent(in) :: routine 174 character(*), intent(in) :: error 175 integer, intent(in) :: code 176 177 if (code == 0) return 178 179 write(std_out,*) ' in subroutine : ', trim(routine) 180 write(std_out,*) error 181 write(std_out,*) 'error code ', code 182 stop 183 end subroutine errore 184 185 end module flib_pwscf