set fft_fact in open_grid; catch invalid np in fft_support/good_fft_order; fix...

set fft_fact in open_grid; catch invalid np in fft_support/good_fft_order; fix bug negative translation in fft_fact
parent c72bb59b
......@@ -143,6 +143,11 @@ end function allowed
INTEGER, OPTIONAL, INTENT(IN) :: np
INTEGER :: new
IF (PRESENT(np)) THEN
IF (np <= 0) &
CALL fftx_error__( ' good_fft_order ', ' invalid np ', new )
ENDIF
new = nr
IF( PRESENT( np ) ) THEN
DO WHILE( ( ( .NOT. allowed( new ) ) .OR. ( MOD( new, np ) /= 0 ) ) .AND. ( new <= nfftx ) )
......
......@@ -14,7 +14,7 @@ PROGRAM open_grid
USE noncollin_module, ONLY : noncolin
USE control_flags, ONLY : gamma_only, twfcollect
USE environment, ONLY : environment_start, environment_end
USE symm_base, ONLY : nrot, nsym, s, t_rev
USE symm_base, ONLY : nrot, nsym, s, t_rev, fft_fact
USE parameters, ONLY : npk
USE exx_base, ONLY : nq1,nq2,nq3, xkq_collect, &
nkqs, exx_mp_init, index_xk, exx_grid_init
......@@ -130,6 +130,7 @@ PROGRAM open_grid
exx_status_back = .true.
CALL dft_force_hybrid(exx_status_back)
!
fft_fact = 1
nq1 = -1
nq2 = -1
nq3 = -1
......
......@@ -533,7 +533,7 @@ SUBROUTINE sgam_at ( nat, tau, ityp, sym, no_z_inv)
! commensurate with FFT grids
DO i = 1, 3
IF ( ABS (ft_(i)) > eps2 ) THEN
nfrac = NINT(1.0_dp/ft_(i))
nfrac = NINT(1.0_dp/ABS(ft_(i)))
ELSE
nfrac = 0
END IF
......
Markdown is supported
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