From 7a1506c73456d2dcdd1d8d7128d52214c208aaf8 Mon Sep 17 00:00:00 2001 From: Rudolf Zeller <ru.zeller@fz-juelich.de> Date: Sat, 30 May 2020 13:07:36 +0200 Subject: [PATCH] introduced automatic determination of the factor between chebyshev interval lengths --- source/KKRnano/source/CalculationData_mod.F90 | 2 +- .../KKRnano/source/datastructures/ChebMeshData_mod.F90 | 6 +++--- .../KKRnano/source/datastructures/InputParamsNew.txt | 2 -- .../KKRnano/source/datastructures/InputParams_mod.F90 | 10 ---------- .../common/radial_solver_Chebychev/create_newmesh.f90 | 7 ++++++- 5 files changed, 10 insertions(+), 17 deletions(-) diff --git a/source/KKRnano/source/CalculationData_mod.F90 b/source/KKRnano/source/CalculationData_mod.F90 index 4d7b883de..8d5cd9ad0 100644 --- a/source/KKRnano/source/CalculationData_mod.F90 +++ b/source/KKRnano/source/CalculationData_mod.F90 @@ -521,7 +521,7 @@ module CalculationData_mod call create(self%cheb_mesh_a(ila), irmd_cheb, npan_tot_cheb, self%cell_a(ila)%nfu, params) ! create data for new radial mesh for atom iatom endif if (dims%korbit == 1) then ! NOCO - call construct(params%r_fac,params%r_log,params%npan_log,params%npan_eq,params%ncheb, & + call construct(params%r_log,params%npan_log,params%npan_eq,params%ncheb, & self%cheb_mesh_a(ila)%npan_lognew,self%cheb_mesh_a(ila)%npan_eqnew, & self%cheb_mesh_a(ila)%npan_tot,self%cheb_mesh_a(ila)%rnew, & self%cheb_mesh_a(ila)%rpan_intervall,self%cheb_mesh_a(ila)%ipan_intervall, & diff --git a/source/KKRnano/source/datastructures/ChebMeshData_mod.F90 b/source/KKRnano/source/datastructures/ChebMeshData_mod.F90 index c2b4e662b..e16f623bb 100644 --- a/source/KKRnano/source/datastructures/ChebMeshData_mod.F90 +++ b/source/KKRnano/source/datastructures/ChebMeshData_mod.F90 @@ -327,7 +327,7 @@ endsubroutine ! read !---------------------------------------------------------------------------- !> Construct Chebyshev mesh -subroutine ConstructChebMesh(r_fac,r_log,npan_log,npan_eq,ncheb, & +subroutine ConstructChebMesh(r_log,npan_log,npan_eq,ncheb, & npan_lognew,npan_eqnew, & npan_tot,rnew,rpan_intervall,ipan_intervall, & thetasnew,thetas,nfu,radial_mesh) ! new parameters @@ -335,7 +335,7 @@ subroutine ConstructChebMesh(r_fac,r_log,npan_log,npan_eq,ncheb, & !use read_formatted_shapefun_mod, only: shapefunfile use RadialMeshData_mod, only: RadialMeshData -double precision, intent(in) :: r_fac +double precision :: r_fac double precision, intent(in) :: r_log integer, intent(in) :: npan_log integer, intent(in) :: npan_eq @@ -378,7 +378,7 @@ ipotm=0 if (ilinpanshift == 1) then stop 'non-spherical part of the potential needs to be inside the log panel' end if - + r_fac = (rmax/rmin)**(1.d0/npan_log) do ip=0,npan_log-ilogpanshift rval=(r_fac**ip-1d0)/(r_fac**(npan_log-ilogpanshift)-1d0) rpan_intervall(ip+ishift)= rmin+rval*(rmax-rmin) diff --git a/source/KKRnano/source/datastructures/InputParamsNew.txt b/source/KKRnano/source/datastructures/InputParamsNew.txt index 89e35d518..a958fde0d 100644 --- a/source/KKRnano/source/datastructures/InputParamsNew.txt +++ b/source/KKRnano/source/datastructures/InputParamsNew.txt @@ -118,7 +118,5 @@ i npan_log 30 i npan_eq 30 ### [NOCO] number of Chebychev points in panel i ncheb 10 -### [NOCO] factor between interval lengths in logarithmic panel -d r_fac 2.0D0 ### [NOCO] size of logarithmic panel d r_log 0.1D0 diff --git a/source/KKRnano/source/datastructures/InputParams_mod.F90 b/source/KKRnano/source/datastructures/InputParams_mod.F90 index 8508fa33f..55314ef0b 100644 --- a/source/KKRnano/source/datastructures/InputParams_mod.F90 +++ b/source/KKRnano/source/datastructures/InputParams_mod.F90 @@ -75,7 +75,6 @@ module InputParams_mod integer :: npan_log integer :: npan_eq integer :: ncheb - double precision :: r_fac double precision :: r_log logical :: enable_quad_prec endtype ! InputParams @@ -611,15 +610,6 @@ integer function getValues(filename, self) result(ierror) destroy_and_return endif - ierror = getValue(cr, "r_fac", self%r_fac , def=2.0D0) - if (ierror == use_default) then - write(*,*) "WARNING: Bad/no value given for r_fac. Set r_fac to 2.0D0" - ierror = 0 ! ok, no error - elseif (ierror /= 0) then - write(*,*) "Bad/no value given for r_fac." - destroy_and_return - endif - ierror = getValue(cr, "r_log", self%r_log , def=0.1D0) if (ierror == use_default) then write(*,*) "WARNING: Bad/no value given for r_log. Set r_log to 0.1D0" diff --git a/source/common/radial_solver_Chebychev/create_newmesh.f90 b/source/common/radial_solver_Chebychev/create_newmesh.f90 index 8ce134ce8..ee3487922 100644 --- a/source/common/radial_solver_Chebychev/create_newmesh.f90 +++ b/source/common/radial_solver_Chebychev/create_newmesh.f90 @@ -72,7 +72,7 @@ contains ! .. Local variables ! real (kind=dp), parameter :: fac=2e0_dp - real (kind=dp), parameter :: fac=1.2e0_dp + real (kind=dp) :: fac integer :: npan_inst, i_stat, i_all integer :: i1, ir2, ip, icell integer :: imin, imax, iminnew, imaxnew, lm1 @@ -105,6 +105,7 @@ contains ! log panel rmin = rmesh(2, i1) rmax = r_log + fac = (rmax/rmin)**(1.d0/npan_log) rval = 0e0_dp ishift = 0 if (r_log>rmesh(irmin(i1),i1)) then @@ -162,6 +163,10 @@ contains call chebmesh(npan_tot(i1), ncheb, rpan_intervall(0:,i1), rnew(1,i1)) +! do ir2 = 1,50 +! write(6,*) ir2, rnew(ir2,i1) +! end do + ! do interpolation only when optional arguments are given if (present(ntcell)) then ! interpolate shape function THETAS to new shape function THETASNEW -- GitLab