Commit bd82d386 authored by Daniel Wortmann's avatar Daniel Wortmann

More changes to get rid of dimension type

parent 3d3c2cb1
......@@ -360,7 +360,28 @@ CONTAINS
END IF
END SUBROUTINE read_xml_input
subroutine init(input)
class(t_input),intent(in)::input
subroutine init(input,noco,nbasfcn)
use m_types_noco
Class(t_input),intent(inout):: input
TYPE(t_noco),intent(in) :: noco
INTEGER,INTENT(IN) :: nbasfcn
! Generate missing general parameters
INTEGER :: minNeigd
minNeigd = MAX(5,NINT(0.75*input%zelec) + 1)
IF (noco%l_soc.and.(.not.noco%l_noco)) minNeigd = 2 * minNeigd
IF (noco%l_soc.and.noco%l_ss) minNeigd=(3*minNeigd)/2
IF ((input%neig.NE.-1).AND.(input%neig.LT.minNeigd)) THEN
IF (input%neig>0) THEN
WRITE(*,*) 'numbands is too small. Setting parameter to default value.'
WRITE(*,*) 'changed numbands (input%neig) to ',minNeigd
ENDIF
input%neig = minNeigd
END IF
IF(input%neig.EQ.-1) THEN
input%neig = nbasfcn
END IF
IF (noco%l_noco) input%neig = 2*input%neig
end subroutine init
END MODULE m_types_input
......@@ -146,6 +146,7 @@ CONTAINS
CALL make_stars(stars,sym,atoms,vacuum,sphhar,input,cell,xcpot,oneD,noco,mpi)
call make_forcetheo(forcetheo_data,cell,sym,atoms,forcetheo)
call lapw_dim(kpts,cell,input,noco,oneD,forcetheo,atoms)
call input%init(noco,lapw_dim_nbasfcn)
call oned%init(atoms) !call again, because make_stars modified it :-)
! Store structure data
CALL storeStructureIfNew(input,stars, atoms, cell, vacuum, oneD, sym, mpi,sphhar,noco)
......@@ -170,22 +171,6 @@ CONTAINS
!
!--> determine more dimensions
!
! Generate missing general parameters
minNeigd = MAX(5,NINT(0.75*input%zelec) + 1)
IF (noco%l_soc.and.(.not.noco%l_noco)) minNeigd = 2 * minNeigd
IF (noco%l_soc.and.noco%l_ss) minNeigd=(3*minNeigd)/2
IF ((input%neig.NE.-1).AND.(input%neig.LT.minNeigd)) THEN
IF (input%neig>0) THEN
WRITE(*,*) 'numbands is too small. Setting parameter to default value.'
WRITE(*,*) 'changed numbands (input%neig) to ',minNeigd
ENDIF
input%neig = minNeigd
END IF
IF(input%neig.EQ.-1) THEN
input%neig = lapw_dim_nvd + atoms%nlotot
END IF
IF (noco%l_noco) input%neig = 2*input%neig
......
......@@ -6,13 +6,14 @@
MODULE m_types_lapw
USE m_judft
IMPLICIT NONE
PRIVATE
!These dimensions should be set once per call of FLEUR
!They can be queried by the functions lapw%dim_nvd,...
!You probably should avoid using the variables directly
integer :: lapw_dim_nvd
integer :: lapw_dim_nv2d
integer :: lapw_dim_nbasfcn
integer,save :: lapw_dim_nvd
integer,save :: lapw_dim_nv2d
integer,save :: lapw_dim_nbasfcn
TYPE t_lapw
INTEGER :: nv(2)
......@@ -56,13 +57,13 @@ CONTAINS
end subroutine
INTEGER function dim_nvd()
dim_nvd=nvd
dim_nvd=lapw_dim_nvd
end function
INTEGER function dim_nv2d()
dim_nv2d=nv2d
dim_nv2d=lapw_dim_nv2d
end function
INTEGER function dim_nbasfcn()
dim_basfcn=nbasfcn
dim_nbasfcn=lapw_dim_nbasfcn
end function
SUBROUTINE lapw_alloc(lapw,cell,input,noco)
......
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