Skip to content

Commit

Permalink
Indent
Browse files Browse the repository at this point in the history
  • Loading branch information
mewall committed Jul 20, 2023
1 parent c928f95 commit 6872a27
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 43 deletions.
30 changes: 15 additions & 15 deletions src/latte_mods/ham_latte_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,12 @@ subroutine get_hsmat(ham_bml,over_bml,coordinate,lattice_vector,spindex,&
maxnorbi = maxval(norbi)

if(.not.allocated(ham)) then
allocate(ham(norb,norb))
allocate(ham(norb,norb))
endif
if(.not.allocated(over)) then
allocate(over(norb,norb))
allocate(over(norb,norb))
endif

if (.not.allocated(block)) then
allocate(block(maxnorbi,maxnorbi,nats))
endif
Expand All @@ -209,10 +209,10 @@ subroutine get_hsmat(ham_bml,over_bml,coordinate,lattice_vector,spindex,&

do jj=1,dimj
do ii=1,dimi
ham(hindex(1,i)-1+ii,hindex(1,j)-1+jj) = block(ii,jj,i)
! if(abs(block(ii,jj,i)).gt.threshold)then
! call bml_set_element_new(ham_bml,hindex(1,i)-1+ii,&
! hindex(1,j)-1+jj,block(ii,jj,i))
ham(hindex(1,i)-1+ii,hindex(1,j)-1+jj) = block(ii,jj,i)
! if(abs(block(ii,jj,i)).gt.threshold)then
! call bml_set_element_new(ham_bml,hindex(1,i)-1+ii,&
! hindex(1,j)-1+jj,block(ii,jj,i))
!endif
enddo
enddo
Expand All @@ -223,7 +223,7 @@ subroutine get_hsmat(ham_bml,over_bml,coordinate,lattice_vector,spindex,&

do jj=1,dimj
do ii=1,dimi
over(hindex(1,i)-1+ii,hindex(1,j)-1+jj) = block(ii,jj,i)
over(hindex(1,i)-1+ii,hindex(1,j)-1+jj) = block(ii,jj,i)
!if(abs(block(ii,jj,i)).gt.threshold)then
! call bml_set_element_new(over_bml,hindex(1,i)-1+ii,&
! hindex(1,j)-1+jj,block(ii,jj,i))
Expand All @@ -236,19 +236,19 @@ subroutine get_hsmat(ham_bml,over_bml,coordinate,lattice_vector,spindex,&
! call prg_print_matrix("block",block(:,:,i),1,4,1,4)

enddo
enddo
enddo

!$omp end parallel do

bml_type=bml_get_type(ham_bml) !Get the bml type
call bml_import_from_dense(bml_type,over,over_bml,threshold,norb) !Dense to dense_bml
call bml_import_from_dense(bml_type,ham,ham_bml,threshold,norb) !Dense to dense_bml
bml_type=bml_get_type(ham_bml) !Get the bml type
call bml_import_from_dense(bml_type,over,over_bml,threshold,norb) !Dense to dense_bml
call bml_import_from_dense(bml_type,ham,ham_bml,threshold,norb) !Dense to dense_bml

if(allocated(ham)) then
deallocate(ham)
deallocate(ham)
endif
if(allocated(over)) then
deallocate(over)
deallocate(over)
endif

! call bml_print_matrix("ham_bml",ham_bml,0,6,0,6)
Expand Down
56 changes: 28 additions & 28 deletions src/latte_mods/hsderivative_latte_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -85,19 +85,19 @@ subroutine get_dH(dx,coords,hindex,spindex,intPairsH,onsitesH,symbol,lattice_vec
! dH0x = zeros(HDIM,HDIM); dH0y = zeros(HDIM,HDIM); dH0z = zeros(HDIM,HDIM);

if (.not.allocated(dH0x)) then
allocate(dH0x(norb,norb))
allocate(dH0x(norb,norb))
endif
if (.not.allocated(dH0y)) then
allocate(dH0y(norb,norb))
allocate(dH0y(norb,norb))
endif
if (.not.allocated(dH0z)) then
allocate(dH0z(norb,norb))
allocate(dH0z(norb,norb))
endif

dH0x = 0.0_dp
dH0y = 0.0_dp
dH0z = 0.0_dp

allocate(Rx(nats))
allocate(Ry(nats))
allocate(Rz(nats))
Expand Down Expand Up @@ -169,7 +169,7 @@ subroutine get_dH(dx,coords,hindex,spindex,intPairsH,onsitesH,symbol,lattice_vec

do jj=1,dimj
do ii=1,dimi
dH0x(hindex(1,i)-1+ii,hindex(1,j)-1+jj) = blockp(ii,jj,i)
dH0x(hindex(1,i)-1+ii,hindex(1,j)-1+jj) = blockp(ii,jj,i)
!if(abs(blockp(ii,jj,i)).gt.threshold)then
! call bml_set_element_new(dH0x_bml,hindex(1,i)-1+ii,&
! hindex(1,j)-1+jj,blockp(ii,jj,i))
Expand All @@ -195,7 +195,7 @@ subroutine get_dH(dx,coords,hindex,spindex,intPairsH,onsitesH,symbol,lattice_vec

do jj=1,dimj
do ii=1,dimi
dH0y(hindex(1,i)-1+ii,hindex(1,j)-1+jj) = blockp(ii,jj,i)
dH0y(hindex(1,i)-1+ii,hindex(1,j)-1+jj) = blockp(ii,jj,i)
!if(abs(blockp(ii,jj,i)).gt.threshold)then
! call bml_set_element_new(dH0y_bml,hindex(1,i)-1+ii,&
! hindex(1,j)-1+jj,blockp(ii,jj,i))
Expand All @@ -221,7 +221,7 @@ subroutine get_dH(dx,coords,hindex,spindex,intPairsH,onsitesH,symbol,lattice_vec

do jj=1,dimj
do ii=1,dimi
dH0z(hindex(1,i)-1+ii,hindex(1,j)-1+jj) = blockp(ii,jj,i)
dH0z(hindex(1,i)-1+ii,hindex(1,j)-1+jj) = blockp(ii,jj,i)
!if(abs(blockp(ii,jj,i)).gt.threshold)then
! call bml_set_element_new(dH0z_bml,hindex(1,i)-1+ii,&
! hindex(1,j)-1+jj,blockp(ii,jj,i))
Expand All @@ -234,19 +234,19 @@ subroutine get_dH(dx,coords,hindex,spindex,intPairsH,onsitesH,symbol,lattice_vec
enddo
enddo
!$omp end parallel do
!bml_type=bml_get_type(dH0x_bml) !Get the bml type
call bml_import_from_dense(bml_type,dH0x,dH0x_bml,threshold,norb) !Dense to dense_bml
call bml_import_from_dense(bml_type,dH0y,dH0y_bml,threshold,norb) !Dense to dense_bml
call bml_import_from_dense(bml_type,dH0z,dH0z_bml,threshold,norb) !Dense to dense_bml
!bml_type=bml_get_type(dH0x_bml) !Get the bml type
call bml_import_from_dense(bml_type,dH0x,dH0x_bml,threshold,norb) !Dense to dense_bml
call bml_import_from_dense(bml_type,dH0y,dH0y_bml,threshold,norb) !Dense to dense_bml
call bml_import_from_dense(bml_type,dH0z,dH0z_bml,threshold,norb) !Dense to dense_bml

if (allocated(dH0x)) then
deallocate(dH0x)
deallocate(dH0x)
endif
if (allocated(dH0y)) then
deallocate(dH0y)
deallocate(dH0y)
endif
if (allocated(dH0z)) then
deallocate(dH0z)
deallocate(dH0z)
endif

! stop
Expand Down Expand Up @@ -312,13 +312,13 @@ subroutine get_dS(dx,coords,hindex,spindex,intPairsS,onsitesS,symbol,lattice_vec
endif

if (.not.allocated(dSx)) then
allocate(dSx(norb,norb))
allocate(dSx(norb,norb))
endif
if (.not.allocated(dSy)) then
allocate(dSy(norb,norb))
allocate(dSy(norb,norb))
endif
if (.not.allocated(dSz)) then
allocate(dSz(norb,norb))
allocate(dSz(norb,norb))
endif

allocate(Rx(nats))
Expand All @@ -328,7 +328,7 @@ subroutine get_dS(dx,coords,hindex,spindex,intPairsS,onsitesS,symbol,lattice_vec
dSx = 0.0_dp
dSy = 0.0_dp
dSz = 0.0_dp

Rx = coords(1,:)
Ry = coords(2,:)
Rz = coords(3,:)
Expand Down Expand Up @@ -386,7 +386,7 @@ subroutine get_dS(dx,coords,hindex,spindex,intPairsS,onsitesS,symbol,lattice_vec

do jj=1,dimj
do ii=1,dimi
dSx(hindex(1,i)-1+ii,hindex(1,j)-1+jj) = blockp(ii,jj,i)
dSx(hindex(1,i)-1+ii,hindex(1,j)-1+jj) = blockp(ii,jj,i)
!if(abs(blockp(ii,jj,i)).gt.threshold)then
! call bml_set_element_new(dSx_bml,hindex(1,i)-1+ii,&
! hindex(1,j)-1+jj,blockp(ii,jj,i))
Expand All @@ -406,7 +406,7 @@ subroutine get_dS(dx,coords,hindex,spindex,intPairsS,onsitesS,symbol,lattice_vec

do jj=1,dimj
do ii=1,dimi
dSy(hindex(1,i)-1+ii,hindex(1,j)-1+jj) = blockp(ii,jj,i)
dSy(hindex(1,i)-1+ii,hindex(1,j)-1+jj) = blockp(ii,jj,i)
!if(abs(blockp(ii,jj,i)).gt.threshold)then
! call bml_set_element_new(dSy_bml,hindex(1,i)-1+ii,&
! hindex(1,j)-1+jj,blockp(ii,jj,i))
Expand All @@ -426,7 +426,7 @@ subroutine get_dS(dx,coords,hindex,spindex,intPairsS,onsitesS,symbol,lattice_vec

do jj=1,dimj
do ii=1,dimi
dSz(hindex(1,i)-1+ii,hindex(1,j)-1+jj) = blockp(ii,jj,i)
dSz(hindex(1,i)-1+ii,hindex(1,j)-1+jj) = blockp(ii,jj,i)
!if(abs(blockp(ii,jj,i)).gt.threshold)then
! call bml_set_element_new(dSz_bml,hindex(1,i)-1+ii,&
! hindex(1,j)-1+jj,blockp(ii,jj,i))
Expand All @@ -439,19 +439,19 @@ subroutine get_dS(dx,coords,hindex,spindex,intPairsS,onsitesS,symbol,lattice_vec
enddo
enddo
!$omp end parallel do
!bml_type=bml_get_type(dSx_bml) !Get the bml type
call bml_import_from_dense(bml_type,dSx,dSx_bml,threshold,norb) !Dense to dense_bml
call bml_import_from_dense(bml_type,dSy,dSy_bml,threshold,norb) !Dense to dense_bml
call bml_import_from_dense(bml_type,dSz,dSz_bml,threshold,norb) !Dense to dense_bml
!bml_type=bml_get_type(dSx_bml) !Get the bml type
call bml_import_from_dense(bml_type,dSx,dSx_bml,threshold,norb) !Dense to dense_bml
call bml_import_from_dense(bml_type,dSy,dSy_bml,threshold,norb) !Dense to dense_bml
call bml_import_from_dense(bml_type,dSz,dSz_bml,threshold,norb) !Dense to dense_bml

if (allocated(dSx)) then
deallocate(dSx)
deallocate(dSx)
endif
if (allocated(dSy)) then
deallocate(dSy)
deallocate(dSy)
endif
if (allocated(dSz)) then
deallocate(dSz)
deallocate(dSz)
endif

end subroutine get_dS
Expand Down

0 comments on commit 6872a27

Please sign in to comment.