TABLE OF CONTENTS
ABINIT/mlwfovlp_seedname [ Functions ]
NAME
mlwfovlp_seedname
FUNCTION
Get seed name and file names of all wannier90 related files
COPYRIGHT
Copyright (C) 2009-2018 ABINIT group (T Rangel, DRH) This file is distributed under the terms of the GNU General Public License, see ~abinit/COPYING or http://www.gnu.org/copyleft/gpl.txt .
INPUTS
fname_w90=root name of file appended with _w90
OUTPUT
filew90_win= main input file for Wannier90 filew90_wout= main output file for Wannier90 filew90_amn= file containing Amn matrix filew90_ramn= file containing Amn matrix (random initial projections) filew90_mmn= file containing Mmn matrix filew90_eig= file containing eigenvalues nsppol= number of spin polarizations seed_name= common seed name for all wannier90 related files
SIDE EFFECTS
NOTES
PARENTS
mlwfovlp
CHILDREN
wrtout
SOURCE
40 #if defined HAVE_CONFIG_H 41 #include "config.h" 42 #endif 43 44 #include "abi_common.h" 45 46 47 subroutine mlwfovlp_seedname(fname_w90,filew90_win,filew90_wout,filew90_amn,& 48 & filew90_ramn,filew90_mmn,filew90_eig,nsppol,seed_name) 49 50 use defs_basis 51 use m_errors 52 use m_profiling_abi 53 54 !This section has been created automatically by the script Abilint (TD). 55 !Do not modify the following lines by hand. 56 #undef ABI_FUNC 57 #define ABI_FUNC 'mlwfovlp_seedname' 58 use interfaces_14_hidewrite 59 !End of the abilint section 60 61 implicit none 62 63 !Arguments ------------------------------------ 64 integer,intent(in) :: nsppol 65 character(len=fnlen),intent(out) :: filew90_win(nsppol),filew90_wout(nsppol),filew90_amn(nsppol),filew90_ramn(nsppol) 66 character(len=fnlen),intent(out) :: filew90_mmn(nsppol),filew90_eig(nsppol),seed_name(nsppol) 67 character(len=fnlen),intent(in) :: fname_w90 68 69 !Local variables------------------------------- 70 integer::isppol 71 character(len=fnlen) :: test_win1,test_win2,test_win3 72 logical :: lfile 73 character(len=500) :: message ! to be uncommented, if needed 74 character(len=10)::postfix 75 ! ************************************************************************* 76 77 seed_name(:)=trim(fname_w90) 78 do isppol=1,nsppol 79 if(nsppol==1)postfix='.win' 80 if(nsppol==2 .and. isppol==1)postfix='_up.win' 81 if(nsppol==2 .and. isppol==2)postfix='_down.win' 82 ! 83 filew90_win(isppol)=trim(seed_name(isppol))//trim(postfix) 84 test_win1=filew90_win(isppol) 85 inquire(file=filew90_win(isppol),exist=lfile) 86 87 if(.not.lfile) then 88 seed_name(isppol)='wannier90' 89 filew90_win(isppol)=trim(seed_name(isppol))//trim(postfix) 90 test_win2=filew90_win(isppol) 91 inquire(file=filew90_win(isppol),exist=lfile) 92 end if 93 94 if(.not.lfile) then 95 seed_name(isppol)='w90' 96 filew90_win=trim(seed_name(isppol))//trim(postfix) 97 test_win3=filew90_win(isppol) 98 inquire(file=filew90_win(isppol),exist=lfile) 99 end if 100 101 if(.not.lfile) then 102 write(message,'(17a)')ch10,& 103 & ' mlwfovlp_seedname : ERROR - ',ch10,& 104 & ' wannier90 interface needs one of the following files:',ch10,& 105 & ' ',trim(test_win1),ch10,& 106 & ' ',trim(test_win2),ch10,& 107 & ' ',trim(test_win3),ch10,& 108 & ' Action: read wannier90 tutorial and/or user manual',ch10,& 109 & ' and supply proper *.win file' 110 MSG_ERROR(message) 111 end if 112 end do !isppol 113 114 115 !Files having different names for 116 !different spin polarizations 117 if(nsppol==1) then 118 filew90_win(1) =trim(seed_name(1))//'.win' 119 filew90_wout(1)=trim(seed_name(1))//'.wout' 120 filew90_ramn(1)=trim(seed_name(1))//'random.amn' 121 filew90_amn(1) =trim(seed_name(1))//'.amn' 122 filew90_mmn(1) =trim(seed_name(1))//'.mmn' 123 filew90_eig(1) =trim(seed_name(1))//'.eig' 124 elseif(nsppol==2) then 125 filew90_win(1) =trim(seed_name(1))//'_up.win' 126 filew90_win(2) =trim(seed_name(2))//'_down.win' 127 ! 128 filew90_wout(1)=trim(seed_name(1))//'_up.wout' 129 filew90_wout(2)=trim(seed_name(2))//'_down.wout' 130 ! 131 filew90_ramn(1)=trim(seed_name(1))//'random_up.amn' 132 filew90_ramn(2)=trim(seed_name(2))//'random_down.amn' 133 ! 134 filew90_amn(1)=trim(seed_name(1))//'_up.amn' 135 filew90_amn(2)=trim(seed_name(2))//'_down.amn' 136 ! 137 filew90_mmn(1)=trim(seed_name(1))//'_up.mmn' 138 filew90_mmn(2)=trim(seed_name(2))//'_down.mmn' 139 ! 140 filew90_eig(1)=trim(seed_name(1))//'_up.eig' 141 filew90_eig(2)=trim(seed_name(2))//'_down.eig' 142 end if 143 !change also seed_name for nsppol=2 144 if(nsppol==2) then 145 seed_name(1)=trim(seed_name(1))//'_up' 146 seed_name(2)=trim(seed_name(2))//'_down' 147 end if 148 !End file-name section 149 150 write(message, '(a,a)' ) ch10,& 151 & '---------------------------------------------------------------' 152 call wrtout(ab_out,message,'COLL') 153 call wrtout(std_out, message,'COLL') 154 write(message, '(5a)' ) ch10,& 155 & ' Calculation of overlap and call to wannier90 library ',ch10,& 156 & ' to obtain maximally localized wannier functions ',ch10 157 158 call wrtout(std_out, message,'COLL') 159 call wrtout(ab_out,message,'COLL') 160 161 if(nsppol==1) then 162 write(message, '(23a)' ) & 163 & ' - ',trim(filew90_win(1)),' is a mandatory secondary input',ch10,& 164 & ' - ',trim(filew90_wout(1)),' is the output for the library',ch10,& 165 & ' - ',trim(filew90_ramn(1)),' contains random projections',ch10,& 166 & ' - ',trim(filew90_amn(1)),' contains projections',ch10,& 167 & ' - ',trim(filew90_mmn(1)),' contains the overlap',ch10,& 168 & ' - ',trim(filew90_eig(1)),' contains the eigenvalues' 169 elseif(nsppol==2) then 170 write(message, '(41a)' ) & 171 & ' - ',trim(filew90_win(1)),& 172 & ' and ',trim(filew90_win(2)),ch10,'are mandatory secondary input',ch10,& 173 & ' - ',trim(filew90_wout(1)),& 174 & ' and ',trim(filew90_wout(2)),ch10,' are the output for the library',ch10,& 175 & ' - ',trim(filew90_ramn(1)),& 176 & ' and ',trim(filew90_ramn(2)),ch10,' contain random projections',ch10,& 177 & ' - ',trim(filew90_amn(1)),& 178 & ' and ',trim(filew90_amn(2)),ch10,' contain projections',ch10,& 179 & ' - ',trim(filew90_mmn(1)),& 180 & ' and ',trim(filew90_mmn(2)),ch10,' contain the overlap',ch10,& 181 & ' - ',trim(filew90_eig(1)),& 182 & ' and ',trim(filew90_eig(2)),ch10,' contain the eigenvalues' 183 end if 184 call wrtout(std_out, message,'COLL') 185 call wrtout(ab_out,message,'COLL') 186 187 write(message, '(a,a)' ) ch10,& 188 & '---------------------------------------------------------------' 189 call wrtout(ab_out,message,'COLL') 190 call wrtout(std_out, message,'COLL') 191 192 end subroutine mlwfovlp_seedname