From ba8c21c7562661ce2dbeb711a94533b65c0c5362 Mon Sep 17 00:00:00 2001 From: stepan-tsirkin Date: Thu, 19 Oct 2017 19:57:29 +0200 Subject: [PATCH 1/3] fixed a bug with the "uHu_formatted" input parameter --- src/parameters.F90 | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/parameters.F90 b/src/parameters.F90 index 23ab9e188..094074fd1 100644 --- a/src/parameters.F90 +++ b/src/parameters.F90 @@ -36,6 +36,7 @@ module w90_parameters !! Read the wvfn from fortran formatted file logical, public, save :: spn_formatted !! Read the spin from fortran formatted file + logical :: uHu_formatted logical, public, save :: berry_uHu_formatted !! Read the uHu from fortran formatted file integer, public, save :: spin @@ -545,8 +546,11 @@ subroutine param_read ( ) spn_formatted = .false. ! formatted or "binary" file call param_get_keyword('spn_formatted',found,l_value=spn_formatted) - berry_uHu_formatted = .false. ! formatted or "binary" file - call param_get_keyword('berry_uHu_formatted',found,l_value=berry_uHu_formatted) + uHu_formatted = .false. ! formatted or "binary" file + call param_get_keyword('uhu_formatted',found,l_value=uHu_formatted) + + berry_uHu_formatted = uHu_formatted ! formatted or "binary" file + call param_get_keyword('berry_uhu_formatted',found,l_value=berry_uHu_formatted) spin=1 call param_get_keyword('spin',found,c_value=spin_str) @@ -2613,6 +2617,11 @@ subroutine param_postw90_write else write(stdout,'(1x,a46,7x,a11,13x,a1)') '| Spn file-type :','unformatted','|' endif + if(berry_uHu_formatted) then + write(stdout,'(1x,a46,9x,a9,13x,a1)') '| uHu file-type :','formatted','|' + else + write(stdout,'(1x,a46,7x,a11,13x,a1)') '| uHu file-type :','unformatted','|' + endif end if if (size(fermi_energy_list) == 1) then From 1cccbef86ea4c4936cb4d7581751e33e37578c53 Mon Sep 17 00:00:00 2001 From: tsirkinss Date: Sat, 21 Oct 2017 01:16:40 +0200 Subject: [PATCH 2/3] fixed nother bug in reading formatted uHu --- src/postw90/get_oper.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/postw90/get_oper.F90 b/src/postw90/get_oper.F90 index 73dbd0c2f..1ccc1070e 100644 --- a/src/postw90/get_oper.F90 +++ b/src/postw90/get_oper.F90 @@ -755,7 +755,7 @@ subroutine get_CC_R if (berry_uHu_formatted) then do m=1,num_bands do n=1,num_bands - read(uHu_in,'(2ES20.10)',err=106,end=106) c_real,c_img + read(uHu_in,*,err=106,end=106) c_real,c_img Ho_qb1_q_qb2(n,m) = cmplx(c_real,c_img,dp) end do end do From 33d015f59e4621f2b35dc9a71d0142b16ed9b83b Mon Sep 17 00:00:00 2001 From: tsirkinss Date: Sat, 21 Oct 2017 01:30:05 +0200 Subject: [PATCH 3/3] changed berry_uHu_formatted to uHu_formatted --- src/parameters.F90 | 10 +++------- src/postw90/get_oper.F90 | 6 +++--- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/parameters.F90 b/src/parameters.F90 index 094074fd1..d1f187433 100644 --- a/src/parameters.F90 +++ b/src/parameters.F90 @@ -36,8 +36,7 @@ module w90_parameters !! Read the wvfn from fortran formatted file logical, public, save :: spn_formatted !! Read the spin from fortran formatted file - logical :: uHu_formatted - logical, public, save :: berry_uHu_formatted + logical, public, save :: uHu_formatted !! Read the uHu from fortran formatted file integer, public, save :: spin !! Spin up=1 down=2 @@ -549,9 +548,6 @@ subroutine param_read ( ) uHu_formatted = .false. ! formatted or "binary" file call param_get_keyword('uhu_formatted',found,l_value=uHu_formatted) - berry_uHu_formatted = uHu_formatted ! formatted or "binary" file - call param_get_keyword('berry_uhu_formatted',found,l_value=berry_uHu_formatted) - spin=1 call param_get_keyword('spin',found,c_value=spin_str) if(found) then @@ -2617,7 +2613,7 @@ subroutine param_postw90_write else write(stdout,'(1x,a46,7x,a11,13x,a1)') '| Spn file-type :','unformatted','|' endif - if(berry_uHu_formatted) then + if(uHu_formatted) then write(stdout,'(1x,a46,9x,a9,13x,a1)') '| uHu file-type :','formatted','|' else write(stdout,'(1x,a46,7x,a11,13x,a1)') '| uHu file-type :','unformatted','|' @@ -5437,7 +5433,7 @@ subroutine param_dist call comms_bcast(length_unit,1) call comms_bcast(wvfn_formatted,1) call comms_bcast(spn_formatted,1) - call comms_bcast(berry_uHu_formatted,1) + call comms_bcast(uHu_formatted,1) call comms_bcast(spin,1) call comms_bcast(num_dump_cycles,1) call comms_bcast(num_print_cycles,1) diff --git a/src/postw90/get_oper.F90 b/src/postw90/get_oper.F90 index 1ccc1070e..81ef73a22 100644 --- a/src/postw90/get_oper.F90 +++ b/src/postw90/get_oper.F90 @@ -669,7 +669,7 @@ subroutine get_CC_R use w90_parameters, only : num_kpts,nntot,nnlist,num_wann,& num_bands,ndimwin,wb,bk,& have_disentangled,timing_level,& - scissors_shift, berry_uHu_formatted + scissors_shift, uHu_formatted use w90_postw90_common, only : nrpts,v_matrix use w90_io, only : stdout,io_error,io_stopwatch,io_file_unit,& seedname @@ -713,7 +713,7 @@ subroutine get_CC_R enddo uHu_in=io_file_unit() - if (berry_uHu_formatted) then + if (uHu_formatted) then open(unit=uHu_in, file=trim(seedname)//".uHu",form='formatted',& status='old',action='read',err=105) write(stdout,'(/a)',advance='no')& @@ -752,7 +752,7 @@ subroutine get_CC_R ! Read from .uHu file the matrices ! between the original ab initio eigenstates ! - if (berry_uHu_formatted) then + if (uHu_formatted) then do m=1,num_bands do n=1,num_bands read(uHu_in,*,err=106,end=106) c_real,c_img