Commit a7f0e59d authored by Daniel Wortmann's avatar Daniel Wortmann
Browse files

Small bugfixes

parent c576a63f
......@@ -60,13 +60,14 @@
x = (0.0,0.0)
END IF
ELSE
ig2d = stars%ig2(ig3d)
IF (ig2d.EQ.1) THEN
g = stars%kv3(3,ng)*cell%bmat(3,3)*cell%z1
x = cmplx(cell%vol*sin(g)/g,0.0)
ELSE
x = (0.0,0.0)
END IF
x = (0.0,0.0)
if (allocated(stars%ig2)) THEN !film
ig2d = stars%ig2(ig3d)
IF (ig2d.EQ.1) THEN
g = stars%kv3(3,ng)*cell%bmat(3,3)*cell%z1
x = cmplx(cell%vol*sin(g)/g,0.0)
ENDIF
END IF
END IF
END IF
......
......@@ -138,12 +138,12 @@ CONTAINS
stars,oneD,hybinp,kpts,a1,a2,a3,namex,relcor,latnam,namgrp,grid)
!
IF (xcpot%needs_grad()) THEN
ALLOCATE (stars%ft2_gfx(0:kimax2),stars%ft2_gfy(0:kimax2))
!ALLOCATE (stars%ft2_gfx(0:kimax2),stars%ft2_gfy(0:kimax2))
ALLOCATE (oneD%pgft1x(0:oneD%odd%nn2d-1),oneD%pgft1xx(0:oneD%odd%nn2d-1),&
oneD%pgft1xy(0:oneD%odd%nn2d-1),&
oneD%pgft1y(0:oneD%odd%nn2d-1),oneD%pgft1yy(0:oneD%odd%nn2d-1))
ELSE
ALLOCATE (stars%ft2_gfx(0:1),stars%ft2_gfy(0:1))
!ALLOCATE (stars%ft2_gfx(0:1),stars%ft2_gfy(0:1))
ALLOCATE (oneD%pgft1x(0:1),oneD%pgft1xx(0:1),oneD%pgft1xy(0:1),&
oneD%pgft1y(0:1),oneD%pgft1yy(0:1))
ENDIF
......
......@@ -99,7 +99,10 @@ function map_g_to_fft_grid(grid, g_in) result(g_idx)
enddo
this%gridLength = product(this%dimensions)
IF (ALLOCATED(this%grid)) DEALLOCATE (this%grid)
IF (ALLOCATED(this%grid)) THEN
IF (size(this%grid)==this%gridlength) RETURN
DEALLOCATE (this%grid)
ENDIF
ALLOCATE (this%grid(0:this%gridLength - 1), source=CMPLX_NOT_INITALIZED)
END SUBROUTINE t_fftGrid_init
......
......@@ -311,14 +311,16 @@ CONTAINS
kv(1) = k1
y_dim: DO k2 = stars%mx2,-stars%mx2,-1
kv(2) = k2
kv(3) = 0
!Check 2d-star
IF (stars%i2g(k1,k2)==0) THEN
g(:2)=matmul(kv(:2),cell%bmat(:2,:2))
s=dot_product(g(:2),g(:2))
g=matmul(kv,cell%bmat)
s=dot_product(g,g)
IF (.not.s>gmax2) THEN !in sphere
stars%ng2=stars%ng2+1
CALL spgrot(sym%nop2,sym%symor,sym%mrot(:2,:2,:),sym%tau(:2,:),sym%invtab,kv(:2),kr(:2,:))
CALL spgrot(sym%nop2,sym%symor,sym%mrot,sym%tau,sym%invtab,kv,kr)
DO n = 1,sym%nop2
if (kr(3,n).ne.0) cycle
stars%i2g(kr(1,n),kr(2,n))=stars%ng2
ENDDO
ENDIF
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment