From 5b7ab32b6d1017624d21cd27da4a79820ae34522 Mon Sep 17 00:00:00 2001 From: Frank Freimuth Date: Mon, 16 Sep 2019 16:06:10 +0200 Subject: [PATCH] Update wann_read_inp.f90: CAll wann_read_inp already in fleur_init. Advantages: 1) Wannier users sometimes have special needs, e.g., the eig66 functionality. While new fleur-input-file-concepts are being developed some of these special needs might be ignored. It is then very convenient to modify the input-variable by wann_read_inp. For example wann_read_inp can be used to set eig66 (if the main input file does not serve this purpose), or one can adapt the number of states that are supposed to be computed automatically by comparing with the wannier-requirements computed in wann_read_inp (Previously the number of states had to be adjusted by hands)... 2) It seems logical to read all basic input files in fleur_init, because otherwise one might run into a stop due to wrong basic input after eigenvectors have been computed. Therefore, it makes sense to read all basic input at the beginning and check the consistency of the input at the beginning, rather than running into a stop caused by inconsistent input files after e.g. one hour of calculations.... 3) We are now able to remove the calls to wann_read_inp in all other wannier subroutines. --- wannier/wann_read_inp.f90 | 38 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/wannier/wann_read_inp.f90 b/wannier/wann_read_inp.f90 index eebc4647..8476bb0f 100644 --- a/wannier/wann_read_inp.f90 +++ b/wannier/wann_read_inp.f90 @@ -7,7 +7,7 @@ module m_wann_read_inp contains -subroutine wann_read_inp(input,l_p0,wann) +subroutine wann_read_inp(DIMENSION,input,noco,l_p0,wann) !******************************************** ! Read the Wannier input file 'wann_inp'. ! Frank Freimuth @@ -17,7 +17,9 @@ subroutine wann_read_inp(input,l_p0,wann) implicit none - TYPE(t_input), intent(in) :: input + TYPE(t_dimension), INTENT(INOUT) :: DIMENSION + TYPE(t_input),intent(inout) :: input + TYPE(t_noco), INTENT(INOUT) :: noco TYPE(t_wann), intent(inout) :: wann logical,intent(in) :: l_p0 @@ -178,6 +180,8 @@ subroutine wann_read_inp(input,l_p0,wann) wann%l_ndegen=.true. elseif(trim(task).eq.'unformatted')then wann%l_unformatted=.true. + elseif(trim(task).eq.'eig66')then + input%eig66(1)=.true. elseif(trim(task).eq.'orbcomp')then wann%l_orbcomp=.true. elseif(trim(task).eq.'orbcomprs')then @@ -462,6 +466,8 @@ subroutine wann_read_inp(input,l_p0,wann) wann%l_ndegen=.true. elseif(trim(task).eq.'unformatted')then wann%l_unformatted=.true. + elseif(trim(task).eq.'eig66')then + input%eig66(1)=.true. elseif(trim(task).eq.'orbcomp')then wann%l_orbcomp=.true. elseif(trim(task).eq.'orbcomprs')then @@ -726,6 +732,34 @@ subroutine wann_read_inp(input,l_p0,wann) enddo endif + +!---- check if we need to increase the neigd parameter + if(wann%l_byindex)then + if(noco%l_soc.OR.noco%l_noco)then + neigd_min=wann%band_max(1) + else + neigd_min=max(wann%band_max(1),wann%band_max(2)) + endif !noco,soc? + if(l_p0)then + write(*,*)"In wann_read_inp: input-neigd=",DIMENSION%neigd + write(*,*)"In wann_read_inp: we require at least neigd_min=",neigd_min + if(neigd_min>DIMENSION%neigd)then + write(*,*)"we increase neigd..." + else + write(*,*)"we leave neigd unchanged" + endif + endif !l_p0? + if(neigd_min>DIMENSION%neigd)then + DIMENSION%neigd=neigd_min + endif + if(l_p0)then + write(*,*)"In wann_read_inp: output-neigd=",DIMENSION%neigd + endif + + endif !l_byindex? + + + end subroutine wann_read_inp end module m_wann_read_inp -- GitLab