Commit e6940309 authored by Matthias Redies's avatar Matthias Redies

remove numpy outputs

parent 51d239f8
......@@ -41,8 +41,6 @@ sysinfo.F90
check_arguments.F90
check_para.F90
xmlOutput.F90
npy.F90
endian_swap.f90
)
if (JUDFT_USE_MPI)
target_compile_definitions(juDFT PUBLIC CPP_MPI)
......
module endian_swap
implicit none
PRIVATE
PUBLIC :: Big_Endian
PUBLIC :: Swap_Endian
INTERFACE Swap_Endian
module procedure SWAP_I1
module procedure SWAP_I2
module procedure SWAP_I4
module procedure SWAP_I8
module procedure SWAP_F4
module procedure SWAP_F8
module procedure SWAP_F16
module procedure SWAP_C4
module procedure SWAP_C8
END INTERFACE Swap_Endian
CONTAINS
FUNCTION Big_Endian()
LOGICAL :: Big_Endian
Big_Endian = ichar(transfer(1,'a')) == 0
END FUNCTION Big_Endian
function SWAP_I4(input) result(output)
implicit none
integer(4), parameter :: b_sz = 4
integer(b_sz), intent(in) :: input
integer(b_sz) :: output
integer(1) :: byte_arr(b_sz), byte_arr_tmp(b_sz)
integer(1) :: i
byte_arr_tmp = transfer(input, byte_arr_tmp)
do i = 1,b_sz
byte_arr(i) = byte_arr_tmp(1 + b_sz - i)
enddo
output = transfer(byte_arr, output)
end function SWAP_I4
function SWAP_I2(input) result(output)
implicit none
integer(4), parameter :: b_sz = 2
integer(b_sz), intent(in) :: input
integer(b_sz) :: output
integer(1) :: byte_arr(b_sz), byte_arr_tmp(b_sz)
integer(1) :: i
byte_arr_tmp = transfer(input, byte_arr_tmp)
do i = 1,b_sz
byte_arr(i) = byte_arr_tmp(1 + b_sz - i)
enddo
output = transfer(byte_arr, output)
end function SWAP_I2
function SWAP_I1(input) result(output)
implicit none
integer(4), parameter :: b_sz = 1
integer(b_sz), intent(in) :: input
integer(b_sz) :: output
integer(1) :: byte_arr(b_sz), byte_arr_tmp(b_sz)
integer(1) :: i
byte_arr_tmp = transfer(input, byte_arr_tmp)
do i = 1,b_sz
byte_arr(i) = byte_arr_tmp(1 + b_sz - i)
enddo
output = transfer(byte_arr, output)
end function SWAP_I1
function SWAP_I8(input) result(output)
implicit none
integer(4), parameter :: b_sz = 8
integer(b_sz), intent(in) :: input
integer(b_sz) :: output
integer(1) :: byte_arr(b_sz), byte_arr_tmp(b_sz)
integer(1) :: i
byte_arr_tmp = transfer(input, byte_arr_tmp)
do i = 1,b_sz
byte_arr(i) = byte_arr_tmp(1 + b_sz - i)
enddo
output = transfer(byte_arr, output)
end function SWAP_I8
function SWAP_F4(input) result(output)
implicit none
integer(4), parameter :: b_sz = 4
real(b_sz), intent(in) :: input
real(b_sz) :: output
integer(1) :: byte_arr(b_sz), byte_arr_tmp(b_sz)
integer(1) :: i
byte_arr_tmp = transfer(input, byte_arr_tmp)
do i = 1,b_sz
byte_arr(i) = byte_arr_tmp(1 + b_sz - i)
enddo
output = transfer(byte_arr, output)
end function SWAP_F4
function SWAP_F8(input) result(output)
implicit none
integer(4), parameter :: b_sz = 8
real(b_sz), intent(in) :: input
real(b_sz) :: output
integer(1) :: byte_arr(b_sz), byte_arr_tmp(b_sz)
integer(1) :: i
byte_arr_tmp = transfer(input, byte_arr_tmp)
do i = 1,b_sz
byte_arr(i) = byte_arr_tmp(1 + b_sz - i)
enddo
output = transfer(byte_arr, output)
end function SWAP_F8
function SWAP_F16(input) result(output)
implicit none
integer(4), parameter :: b_sz = 16
real(b_sz), intent(in) :: input
real(b_sz) :: output
integer(1) :: byte_arr(b_sz), byte_arr_tmp(b_sz)
integer(1) :: i
byte_arr_tmp = transfer(input, byte_arr_tmp)
do i = 1,b_sz
byte_arr(i) = byte_arr_tmp(1 + b_sz - i)
enddo
output = transfer(byte_arr, output)
end function SWAP_F16
function SWAP_C8(input) result(output)
implicit none
integer(4), parameter :: b_sz = 8
complex(b_sz), intent(in) :: input
complex(b_sz) :: output
real(b_sz) :: re, im
re = Swap_Endian(real(input))
im = Swap_Endian(aimag(input))
output = cmplx(re, im)
end function swap_c8
function SWAP_C4(input) result(output)
implicit none
integer(4), parameter :: b_sz = 4
complex(b_sz), intent(in) :: input
complex(b_sz) :: output
real(b_sz) :: re, im
re = Swap_Endian(real(input))
im = Swap_Endian(aimag(input))
output = cmplx(re, im)
end function swap_c4
END module endian_swap
This diff is collapsed.
......@@ -36,7 +36,6 @@ SUBROUTINE cdngen(eig_id,mpi,input,banddos,sliceplot,vacuum,&
USE m_banddos_io
USE m_metagga
USE m_unfold_band_kpts
use m_npy
#ifdef CPP_MPI
USE m_mpi_bc_potden
#endif
......@@ -119,7 +118,6 @@ SUBROUTINE cdngen(eig_id,mpi,input,banddos,sliceplot,vacuum,&
IF (noco%l_mperp) jspmax = 1
DO jspin = 1,jspmax
CALL cdnvalJob%init(mpi,input,kpts,noco,results,jspin,sliceplot,banddos)
call save_npy("cdngen_weights.npy", cdnvalJob%weights)
CALL cdnval(eig_id,mpi,kpts,jspin,noco,input,banddos,cell,atoms,enpara,stars,vacuum,dimension,&
sphhar,sym,vTot,oneD,cdnvalJob,outDen,regCharges,dos,results,moments,coreSpecInput,mcd,slab,orbcomp)
do dim_idx =1,3
......@@ -238,7 +236,6 @@ subroutine save_kinED(xcpot, input, noco, stars, cell, sym)
use m_types
use m_pw_tofrom_grid
use m_judft_stop
use m_npy
implicit none
CLASS(t_xcpot),INTENT(IN) :: xcpot
......@@ -255,11 +252,6 @@ subroutine save_kinED(xcpot, input, noco, stars, cell, sym)
call init_pw_grid(xcpot, stars, sym, cell)
call save_npy("kED_pw_rezi_sum.npy", &
xcpot%comparison_kinED_pw(1)%pw &
+ xcpot%comparison_kinED_pw(2)%pw &
+ xcpot%comparison_kinED_pw(3)%pw )
do dim_idx = 1,3
call pw_to_grid(xcpot, input%jspins, noco%l_noco, stars, cell, &
xcpot%comparison_kinED_pw(dim_idx)%pw, grad, tmp)
......@@ -268,22 +260,11 @@ subroutine save_kinED(xcpot, input, noco, stars, cell, sym)
kinED = 0.0
endif
kinEd = kinED + tmp
write (filename, '( "kED_pw_comp_", I1, ".npy" )') dim_idx
call save_npy(filename, xcpot%comparison_kinED_pw(dim_idx)%pw)
write (filename, '( "kED_realspace_comp_", I1, ".npy" )') dim_idx
call save_npy(filename, tmp)
enddo
kinED = 0.5 * kinED
call finish_pw_grid()
call save_npy("kin_ED_pwway.npy", kinED)
open(unit=69, file="kin_ED_pwway.dat")
write (69,'(ES17.10)') kinED
close(69)
end subroutine save_kinED
END MODULE m_cdngen
......@@ -262,7 +262,6 @@ CONTAINS
SUBROUTINE xcpot_get_exc(xcpot,jspins,rh,exc,grad, kinEnergyDen_KS)
use m_npy
use m_constants
IMPLICIT NONE
CLASS(t_xcpot_libxc),INTENT(IN) :: xcpot
......@@ -308,12 +307,6 @@ CONTAINS
cut_idx = NINT(size(rh,1) * cut_ratio)
! apply correction in eq (4) in https://doi.org/10.1063/1.1565316
kinEnergyDen_libXC = transpose(kinEnergyDen_KS + 0.25 * grad%laplace)
write (filename, '("kED_libxc_", I0.6, ".npy")') size(kinEnergyDen_libxc, dim=2)
call save_npy(filename, transpose(kinEnergyDen_libxc))
write (filename, '("sigma_", I0.6, ".npy")') size(grad%sigma, dim=2)
call save_npy(filename, grad%sigma)
exc = 0.0
excc = 0.0
......
......@@ -35,7 +35,6 @@ CONTAINS
USE m_types_xcpot_libxc
USE m_libxc_postprocess_gga
USE m_metagga
USE m_npy
IMPLICIT NONE
CLASS(t_xcpot),INTENT(INOUT) :: xcpot
......@@ -84,8 +83,6 @@ CONTAINS
CALL pw_to_grid(xcpot, input%jspins, noco%l_noco, stars, &
cell, EnergyDen%pw, tmp_grad, ED_rs)
call save_npy("EnergyDen_rezi.npy", EnergyDen%pw)
CALL pw_to_grid(xcpot, input%jspins, noco%l_noco, stars, &
cell, vTot%pw, tmp_grad, vTot_rs)
CALL calc_kinEnergyDen_pw(ED_rs, vTot_rs, rho, kinED_rs)
......@@ -98,7 +95,6 @@ CONTAINS
IF(ALLOCATED(EnergyDen%pw) .AND. xcpot%exc_is_MetaGGA()) THEN
CALL xcpot%get_exc(input%jspins,rho,e_xc(:,1),grad, kinED_rs)
xcpot%is_kED_schr%grid = kinED_rs
call save_npy("exc_pw.npy", e_xc(:,1))
ELSE
CALL xcpot%get_exc(input%jspins,rho,e_xc(:,1),grad)
ENDIF
......
......@@ -25,8 +25,6 @@
CONTAINS
SUBROUTINE vmt_xc(DIMENSION,mpi,sphhar,atoms,&
den,xcpot,input,sym, obsolete,EnergyDen,vTot,vx,exc)
use m_npy
#include"cpp_double.h"
use m_libxc_postprocess_gga
USE m_mt_tofrom_grid
......@@ -118,8 +116,6 @@
n_start=1
n_stride=1
#endif
call save_npy("rmsh.npy", atoms%rmsh)
if(.not. allocated(xcpot%mt_lapl)) allocate(xcpot%mt_lapl(atoms%ntype))
DO n = n_start,atoms%ntype,n_stride
CALL mt_to_grid(xcpot, input%jspins, atoms,sphhar,den%mt(:,0:,n,:),n,grad,ch)
......@@ -212,8 +208,6 @@
nt=nt+nsp
END DO
ENDIF
call save_npy("mt=" // int2str(n) // "_exc.npy", &
get_radial_line(e_xc,1,nsp) )
CALL mt_from_grid(atoms,sphhar,n,1,e_xc,exc%mt(:,0:,n,:))
ENDIF
ENDDO
......
......@@ -9,7 +9,6 @@ CONTAINS
SUBROUTINE libxc_postprocess_gga_mt(xcpot,atoms,sphhar,n,v_xc,grad, atom_num)
USE m_mt_tofrom_grid
USE m_types
USE m_npy
use m_judft_string
IMPLICIT NONE
......@@ -38,26 +37,12 @@ CONTAINS
ALLOCATE(grad_vsigma%gr(3,nsp,n_sigma))
CALL mt_to_grid(xcpot,n_sigma,atoms,sphhar,vsigma_mt,n,grad=grad_vsigma)
if(present(atom_num)) then
fname = "mt=" //int2str(atom_num) // "_lapl.npy"
else
fname = "mt_lapl.npy"
endif
call save_npy(fname, grad%laplace)
if(present(atom_num)) then
fname = "mt="// int2str(atom_num) // "_grad.npy"
else
fname = "mt_grad.npy"
endif
call save_npy(fname, grad%gr)
CALL libxc_postprocess_gga(transpose(grad%vsigma),grad,grad_vsigma,v_xc)
END SUBROUTINE libxc_postprocess_gga_mt
SUBROUTINE libxc_postprocess_gga_pw(xcpot,stars,cell,v_xc,grad)
USE m_pw_tofrom_grid
USE m_types
USE m_npy
IMPLICIT NONE
CLASS(t_xcpot),INTENT(IN) :: xcpot
......@@ -80,10 +65,7 @@ CONTAINS
ALLOCATE(grad_vsigma%gr(3,nsp,n_sigma))
CALL pw_to_grid(xcpot,n_sigma,.false.,stars,cell,vsigma_g,grad_vsigma)
call save_npy("pw_lapl.npy", grad%laplace)
call save_npy("pw_grad.npy", grad%gr)
CALL libxc_postprocess_gga(transpose(grad%vsigma),grad,grad_vsigma,v_xc)
END SUBROUTINE libxc_postprocess_gga_pw
SUBROUTINE libxc_postprocess_gga(vsigma,grad,grad_vsigma,v_xc)
......
......@@ -14,7 +14,6 @@ MODULE m_metagga
CONTAINS
SUBROUTINE calc_kinEnergyDen_pw(EnergyDen_rs, vTot_rs, den_rs, kinEnergyDen_RS)
USE m_juDFT_stop
use m_npy
!use m_cdngen
IMPLICIT NONE
REAL, INTENT(in) :: den_RS(:,:), EnergyDen_RS(:,:), vTot_RS(:,:)
......@@ -23,12 +22,6 @@ CONTAINS
REAL, PARAMETER :: eps = 1e-15
kinEnergyDen_RS = EnergyDen_RS - vTot_RS * den_RS
call save_npy("pw_EnergyDen_RS.npy", EnergyDen_RS)
call save_npy("pw_vTot_RS.npy", vTot_RS)
call save_npy("pw_den_RS.npy", den_RS)
call save_npy("pw_vTot_RSxdenRS.npy", vtot_RS*den_RS)
call save_npy("pw_kinED_pw_schroeway.npy",kinEnergyDen_RS)
#else
CALL juDFT_error("MetaGGA require LibXC",hint="compile Fleur with LibXC (e.g. by giving '-external libxc' to ./configure")
#endif
......@@ -38,7 +31,6 @@ CONTAINS
atm_idx, nsp, kinEnergyDen_RS)
USE m_juDFT_stop
USE m_juDFT_string
use m_npy
implicit none
REAL, INTENT(in) :: EnergyDen_RS(:,:), vTot_rs(:,:), vTot0_rs(:,:), core_den_rs(:,:), val_den_rs(:,:)
INTEGER, intent(in) :: atm_idx, nsp
......@@ -46,28 +38,6 @@ CONTAINS
#ifdef CPP_LIBXC
kinEnergyDen_RS = EnergyDen_RS - (vTot0_rs * core_den_rs + vTot_rs * val_den_rs)
call save_npy("mt=" // int2str(atm_idx) // "_EnergyDen_RS.npy", &
get_radial_line(EnergyDen_RS,1,nsp))
call save_npy("mt=" // int2str(atm_idx) // "_vTot_RS.npy", &
get_radial_line(vTot_RS,1,nsp))
call save_npy("mt=" // int2str(atm_idx) // "_vTot0_RS.npy", &
get_radial_line(vTot0_RS,1,nsp))
call save_npy("mt=" // int2str(atm_idx) // "_core_den_RS.npy", &
get_radial_line(core_den_RS,1,nsp))
call save_npy("mt=" // int2str(atm_idx) // "_val_den_RS.npy", &
get_radial_line(val_den_RS,1,nsp))
call save_npy("mt=" // int2str(atm_idx) // "_vTot0_RSxcore_denRS.npy", &
get_radial_line(vtot0_RS*core_den_RS,1,nsp))
call save_npy("mt=" // int2str(atm_idx) // "_vTot_RSxval_denRS.npy", &
get_radial_line(vtot_RS*val_den_RS,1,nsp))
call save_npy("mt=" // int2str(atm_idx) // "_kinED_schroeway.npy", &
get_radial_line(kinEnergyDen_RS,1,nsp))
call save_npy("mt=" // int2str(atm_idx) // "_val_den_RS.npy", &
get_radial_line(val_den_RS,1,nsp))
call save_npy("mt=" // int2str(atm_idx) // "_core_den_RS.npy", &
get_radial_line(core_den_RS,1,nsp))
#else
CALL juDFT_error("MetaGGA require LibXC",hint="compile Fleur with LibXC (e.g. by giving '-external libxc' to ./configure")
#endif
......@@ -407,7 +377,6 @@ CONTAINS
end function internal_to_rez
function get_radial_line(den, line_idx, nsp) result(line)
use m_npy
implicit none
real, intent(in) :: den(:, :)
integer, intent(in) :: line_idx, nsp
......@@ -419,7 +388,6 @@ CONTAINS
allocate(mask(size(den, dim=1)))
mask = 0
mask(line_idx:size(mask):nsp) = 1
call save_npy("line_mask.npy", mask)
num_elem = size(den(:, 1))/nsp
line = den(line_idx:size(den(:,1)):nsp,:)
......
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