Commit 3631692a authored by Daniel Wortmann's avatar Daniel Wortmann

Started removing old input from FLEUR and added to inpgen2. inpgen->inpgen2

parent 18c63441
......@@ -6,21 +6,18 @@
MODULE m_dimens
USE m_juDFT
USE m_utility
private
public :: dimens
CONTAINS
SUBROUTINE dimens(&
& mpi,input,sym,stars,&
& input,sym,stars,&
& atoms,sphhar,dimension,vacuum,&
& obsolete,kpts,oneD,hybrid)
USE m_types
USE m_dimen7
USE m_firstglance
USE m_writeOutHeader
IMPLICIT NONE
TYPE(t_mpi),INTENT(INOUT) :: mpi
TYPE(t_input),INTENT(INOUT) :: input
TYPE(t_sym),INTENT(INOUT) :: sym
TYPE(t_stars),INTENT(INOUT) :: stars
......@@ -40,20 +37,9 @@ CONTAINS
INTEGER i_vec(33)
#ifdef CPP_MPI
INCLUDE 'mpif.h'
INTEGER ierr(3)
#endif
oneD%odd%d1=.TRUE.
l_kpts=.TRUE.
IF (mpi%irank.EQ.0) WRITE (6,*) 'Your parameters: '
#ifdef CPP_MPI
CALL MPI_BARRIER(mpi%Mpi_comm,ierr)
#endif
201 IF (mpi%irank == 0) THEN
IF (l_kpts) WRITE (6,*) ' No fl7para-file found, '
WRITE (6,*) ' invoking dimen7... '
!call first_glance to generate k-points
......@@ -61,34 +47,7 @@ CONTAINS
CALL dimen7(input,sym,stars,atoms,sphhar,dimension,vacuum,obsolete,kpts,&
oneD,hybrid,cell)
ENDIF
! in case of a parallel calculation we have to broadcast
#ifdef CPP_MPI
i_vec = (/sym%nop,stars%mx1,stars%mx2,stars%mx3,stars%ng3,stars%ng2,stars%kq1_fft,stars%kq2_fft,stars%kq3_fft,stars%kxc1_fft,stars%kxc2_fft,stars%kxc3_fft&
& ,atoms%ntype,atoms%nat,atoms%jmtd,sphhar%ntypsd,sphhar%nlhd,sphhar%memd,atoms%lmaxd,input%jspins,vacuum%nvacd,dimension%nvd,dimension%nv2d&
& ,1,kpts%nkpt,dimension%nstd,dimension%neigd,dimension%msh,dimension%ncvd,vacuum%layerd,atoms%nlod,atoms%llod,input%itmax/)
CALL MPI_BCAST(i_vec,33,MPI_INTEGER,0,mpi%Mpi_comm,ierr)
sym%nop=i_vec(1);stars%mx1=i_vec(2);stars%mx2=i_vec(3);stars%mx3=i_vec(4);stars%ng3=i_vec(5)
stars%ng2 = i_vec(6);stars%kq1_fft=i_vec(7);stars%kq2_fft=i_vec(8);stars%kq3_fft=i_vec(9)
stars%kxc1_fft = i_vec(10);stars%kxc2_fft = i_vec(11);stars%kxc3_fft = i_vec(12)
atoms%ntype = i_vec(13);atoms%nat =i_vec(14);atoms%jmtd=i_vec(15);sphhar%ntypsd=i_vec(16)
sphhar%nlhd = i_vec(17);sphhar%memd=i_vec(18);atoms%lmaxd=i_vec(19);input%jspins=i_vec(20)
vacuum%nvacd=i_vec(21);dimension%nvd=i_vec(22);dimension%nv2d=i_vec(23)
kpts%nkpt = i_vec(25); dimension%nstd=i_vec(26);dimension%neigd=i_vec(27);dimension%msh=i_vec(28)
dimension%ncvd=i_vec(29);vacuum%layerd=i_vec(30);atoms%nlod=i_vec(31);atoms%llod=i_vec(32)
input%itmax=i_vec(33)
CALL MPI_BCAST(oneD%odd%d1,1,MPI_LOGICAL,0,mpi%Mpi_comm,ierr)
! IF (odd%d1) THEN
i_vec(:7) = (/oneD%odd%mb,oneD%odd%M,oneD%odd%m_cyl,oneD%odd%chi,oneD%odd%rot,oneD%odd%nop&
& ,oneD%odd%n2d/)
CALL MPI_BCAST(i_vec,7,MPI_INTEGER,0,mpi%Mpi_comm,ierr)
oneD%odd%mb = i_vec(1);oneD%odd%M = i_vec(2);oneD%odd%m_cyl=i_vec(3)
oneD%odd%chi = i_vec(4);oneD%odd%rot = i_vec(5);oneD%odd%nop=i_vec(6)
oneD%odd%n2d= i_vec(7)
! ELSE
! odd%nop = nop
! ENDIF
#endif
dimension%nspd=(atoms%lmaxd+1+mod(atoms%lmaxd+1,2))*(2*atoms%lmaxd+1)
vacuum%nmzd = 250
vacuum%nmzxyd = 100
......
......@@ -7,26 +7,19 @@ MODULE m_fleur_init_old
IMPLICIT NONE
CONTAINS
!> Collection of code for old-style inp-file treatment
SUBROUTINE fleur_init_old(mpi,&
SUBROUTINE fleur_init_old(&
input,DIMENSION,atoms,sphhar,cell,stars,sym,noco,vacuum,forcetheo,&
sliceplot,banddos,obsolete,enpara,xcpot,kpts,hybrid,&
oneD,coreSpecInput,l_opti)
sliceplot,banddos,enpara,xcpot,kpts,hybrid,&
oneD,coreSpecInput)
USE m_types
USE m_judft
USE m_dimens
USE m_inped
USE m_setup
USE m_constants
USE m_winpXML
#ifdef CPP_MPI
#ifndef CPP_OLDINTEL
USE m_mpi_dist_forcetheorem
#endif
#endif
IMPLICIT NONE
! Types, these variables contain a lot of data!
TYPE(t_mpi) ,INTENT(INOUT) :: mpi
TYPE(t_input) ,INTENT(INOUT):: input
TYPE(t_dimension),INTENT(OUT) :: DIMENSION
TYPE(t_atoms) ,INTENT(OUT) :: atoms
......@@ -38,7 +31,6 @@ CONTAINS
TYPE(t_vacuum) ,INTENT(OUT) :: vacuum
TYPE(t_sliceplot),INTENT(INOUT):: sliceplot
TYPE(t_banddos) ,INTENT(OUT) :: banddos
TYPE(t_obsolete) ,INTENT(OUT) :: obsolete
TYPE(t_enpara) ,INTENT(OUT) :: enpara
CLASS(t_xcpot),INTENT(OUT),ALLOCATABLE :: xcpot
TYPE(t_kpts) ,INTENT(INOUT):: kpts
......@@ -46,8 +38,7 @@ CONTAINS
TYPE(t_oneD) ,INTENT(OUT) :: oneD
TYPE(t_coreSpecInput),INTENT(OUT) :: coreSpecInput
CLASS(t_forcetheo),ALLOCATABLE,INTENT(OUT)::forcetheo
LOGICAL, INTENT(OUT):: l_opti
! .. Local Scalars ..
INTEGER :: i,n,l,m1,m2,isym,iisym,pc,iAtom,iType
......@@ -58,21 +49,15 @@ CONTAINS
REAL :: a1(3),a2(3),a3(3)
REAL :: dtild, phi_add
LOGICAL :: l_found, l_kpts, l_exist, l_krla
#ifdef CPP_MPI
INTEGER:: ierr
INCLUDE 'mpif.h'
#endif
ALLOCATE(t_forcetheo::forcetheo) !default no forcetheorem type
ALLOCATE(t_xcpot_inbuild::xcpot)
SELECT TYPE(xcpot)
TYPE IS (t_xcpot_inbuild)
namex = ' '
relcor = ' '
CALL dimens(mpi,input,sym,stars,atoms,sphhar,DIMENSION,vacuum,&
obsolete,kpts,oneD,hybrid)
kpts,oneD,hybrid)
stars%kimax2= (2*stars%mx1+1)* (2*stars%mx2+1)-1
stars%kimax = (2*stars%mx1+1)* (2*stars%mx2+1)* (2*stars%mx3+1)-1
!-odim
......@@ -135,120 +120,42 @@ CONTAINS
IF(.NOT.juDFT_was_argument("-toXML")) THEN
PRINT *,"--------------WARNING----------------------"
PRINT *,"You are using the old-style FLEUR inp file."
PRINT *,"Please be warned that not all features are"
PRINT *,"implemented/tested in this mode. Please "
PRINT *,"consider switching to xml input. You might"
PRINT *,"find the -toXML command line option useful."
PRINT *,"--------------WARNING----------------------"
CALL inped(atoms,vacuum,input,banddos,xcpot,sym,&
cell,sliceplot,noco,&
stars,oneD,hybrid,kpts,a1,a2,a3,namex,relcor)
!
IF (xcpot%needs_grad()) THEN
ALLOCATE (stars%ft2_gfx(0:stars%kimax2),stars%ft2_gfy(0:stars%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
IF (mpi%isize>1) CALL judft_error("Do not call -toXML with more than a single PE")
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
CALL timestart("preparation:stars,lattice harmonics,+etc")
!+t3e
IF (mpi%irank.EQ.0) THEN
!-t3e
CALL inped(atoms,obsolete,vacuum,input,banddos,xcpot,sym,&
cell,sliceplot,noco,&
stars,oneD,hybrid,kpts,a1,a2,a3,namex,relcor)
!
IF (xcpot%needs_grad()) THEN
ALLOCATE (stars%ft2_gfx(0:stars%kimax2),stars%ft2_gfy(0:stars%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 (oneD%pgft1x(0:1),oneD%pgft1xx(0:1),oneD%pgft1xy(0:1),&
oneD%pgft1y(0:1),oneD%pgft1yy(0:1))
ENDIF
oneD%odd%nq2 = stars%ng2!oneD%odd%n2d
oneD%odi%nq2 = oneD%odd%nq2
!-odim
!+t3e
INQUIRE(file="cdn1",exist=l_opti)
IF (noco%l_noco) INQUIRE(file="rhomat_inp",exist=l_opti)
l_opti=.NOT.l_opti
IF ((sliceplot%iplot).OR.(input%strho).OR.(input%swsp).OR.&
& (input%lflip).OR.(input%l_bmt)) l_opti = .TRUE.
!
namex=xcpot%get_name()
l_krla = xcpot%data%krla.EQ.1
END IF ! mpi%irank.eq.0
oneD%odd%nq2 = stars%ng2!oneD%odd%n2d
oneD%odi%nq2 = oneD%odd%nq2
!-odim
namex=xcpot%get_name()
l_krla = xcpot%data%krla.EQ.1
#ifdef CPP_MPI
CALL MPI_BCAST(namex,4,MPI_CHARACTER,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(l_krla,1,MPI_LOGICAL,0,mpi%mpi_comm,ierr)
CALL MPI_BCAST(atoms%ntype,1,MPI_INTEGER,0,mpi%mpi_comm,ierr)
#ifndef CPP_OLDINTEL
CALL mpi_dist_forcetheorem(mpi,forcetheo)
#endif
#endif
IF (mpi%irank.NE.0) THEN
CALL xcpot%init(namex,l_krla,atoms%ntype)
END IF
CALL setup(mpi,atoms,kpts,DIMENSION,sphhar,&
obsolete,sym,stars,oneD,input,noco,&
sym,stars,oneD,input,noco,&
vacuum,cell,xcpot,&
sliceplot,enpara,l_opti)
IF (mpi%irank.EQ.0) THEN
banddos%l_orb = .FALSE.
banddos%orbCompAtom = 0
ALLOCATE(noco%socscale(atoms%ntype))
xcpot%lda_atom(:) = .FALSE.
noco%socscale(:) = 1.0
IF(juDFT_was_argument("-toXML")) THEN
WRITE(*,*) ''
WRITE(*,*) 'Please note:'
WRITE(*,*) 'The inp to xml input conversion is experimental and'
WRITE(*,*) 'only made for basic inp files without sophisticated'
WRITE(*,*) 'parametrizations. You might have to adjust the generated'
WRITE(*,*) 'file by hand to really obtain an adequate input file.'
WRITE(*,*) 'Also the generated XML input file is not meant to be'
WRITE(*,*) 'beautiful.'
WRITE(*,*) ''
ALLOCATE(hybrid%lcutm1(atoms%ntype),hybrid%lcutwf(atoms%ntype),hybrid%select1(4,atoms%ntype))
filename = 'inpConverted.xml'
DO i = 1, atoms%nat
WRITE(atoms%label(i),'(i0)') i
END DO
ALLOCATE(atoms%speciesName(atoms%ntype))
DO iType = 1, atoms%ntype
WRITE(tempNumberString,'(i0)') iType
atoms%speciesName(itype) = TRIM(ADJUSTL(namat_const(atoms%nz(iType)))) // '-' // TRIM(ADJUSTL(tempNumberString))
hybrid%lcutm1(iType) = 4
hybrid%lcutwf(iType) = atoms%lmax(iType) - atoms%lmax(iType) / 10
hybrid%select1(:,iType) = (/4, 0, 4, 2 /)
END DO
hybrid%gcutm1 = input%rkmax - 0.5
hybrid%tolerance1 = 1.0e-4
hybrid%ewaldlambda = 3
hybrid%lexp = 16
hybrid%bands1 = max( nint(input%zelec)*10, 60 )
a1(:) = a1(:) / input%scaleCell
a2(:) = a2(:) / input%scaleCell
a3(:) = a3(:) / input%scaleCell
kpts%specificationType = 3
sym%symSpecType = 3
CALL w_inpXML(&
atoms,vacuum,input,stars,sliceplot,forcetheo,banddos,&
cell,sym,xcpot,noco,oneD,hybrid,kpts,kpts%nkpt3,kpts%l_gamma,&
namex,relcor,a1,a2,a3,cell%amat(3,3),input%comment,&
.FALSE.,filename,&
.TRUE.,enpara)
CALL juDFT_end("Fleur inp to XML input conversion completed.")
END IF
END IF ! mpi%irank.eq.0
CALL timestop("preparation:stars,lattice harmonics,+etc")
END SELECT
sliceplot,enpara)
banddos%l_orb = .FALSE.
banddos%orbCompAtom = 0
ALLOCATE(noco%socscale(atoms%ntype))
xcpot%lda_atom(:) = .FALSE.
noco%socscale(:) = 1.0
END SUBROUTINE fleur_init_old
END MODULE m_fleur_init_old
......@@ -9,7 +9,7 @@
use m_juDFT
CONTAINS
SUBROUTINE rw_inp(&
& ch_rw,atoms,obsolete,vacuum,input,stars,sliceplot,banddos,&
& ch_rw,atoms,vacuum,input,stars,sliceplot,banddos,&
& cell,sym,xcpot,noco,oneD,hybrid,kpts,&
& noel,namex,relcor,a1,a2,a3,dtild_opt)!,name_opt)
......
......@@ -2,7 +2,10 @@
USE m_juDFT
CONTAINS
SUBROUTINE setup(mpi,atoms,kpts,DIMENSION,sphhar,&
obsolete,sym,stars,oneD, input,noco,vacuum,cell,xcpot, sliceplot,enpara,l_opti)
obsolete,sym,stars,oneD, input,noco,vacuum,cell,xcpot, sliceplot,enpara)
!stripped down version
!
!----------------------------------------
! this routine is called by: fleur.F
......@@ -71,7 +74,6 @@
CLASS(t_xcpot),INTENT(INOUT) :: xcpot
TYPE(t_sliceplot),INTENT(INOUT):: sliceplot
TYPE(t_enpara),INTENT(INOUT) :: enpara
LOGICAL, INTENT (IN) :: l_opti
! ..
! .. Local Scalars ..
REAL :: rkmaxx
......@@ -86,101 +88,13 @@
ENDIF
IF (input%film.AND..NOT.sym%symor) CALL juDFT_warn("Films&Symor",hint&
& ="Films should be symmorphic",calledby ='setup')
CALL ylmnorm_init(atoms%lmaxd)
IF (.NOT.oneD%odd%d1) THEN
CALL local_sym(&
atoms%lmaxd,atoms%lmax,sym%nop,sym%mrot,sym%tau,&
atoms%nat,atoms%ntype,atoms%neq,cell%amat,cell%bmat,atoms%taual,&
sphhar%nlhd,sphhar%memd,sphhar%ntypsd,.FALSE.,&
atoms%nlhtyp,atoms%ntypsy,sphhar%nlh,sphhar%llh,sphhar%nmem,sphhar%mlh,sphhar%clnu)
sym%nsymt = sphhar%ntypsd
oneD%mrot1(:,:,:) = sym%mrot(:,:,:)
oneD%tau1(:,:) = sym%tau(:,:)
ELSEIF (oneD%odd%d1) THEN
CALL od_chisym(oneD%odd,oneD%mrot1,oneD%tau1,sym%zrfs,sym%invs,sym%invs2,cell%amat)
ntp1 = atoms%nat
ALLOCATE (nq1(ntp1),lmx1(ntp1),nlhtp1(ntp1))
ii = 1
DO i = 1,atoms%ntype
DO j = 1,atoms%neq(i)
nq1(ii) = 1
lmx1(ii) = atoms%lmax(i)
ii = ii + 1
END DO
END DO
CALL local_sym(&
atoms%lmaxd,lmx1,sym%nop,sym%mrot,sym%tau,&
atoms%nat,ntp1,nq1,cell%amat,cell%bmat,atoms%taual,&
sphhar%nlhd,sphhar%memd,sphhar%ntypsd,.FALSE.,&
nlhtp1,atoms%ntypsy,sphhar%nlh,sphhar%llh,sphhar%nmem,sphhar%mlh,sphhar%clnu)
sym%nsymt = sphhar%ntypsd
ii = 1
DO i = 1,atoms%ntype
atoms%nlhtyp(i) = nlhtp1(ii)
ii = ii + atoms%neq(i)
END DO
DEALLOCATE (lmx1,nlhtp1)
END IF
!+odim
IF (atoms%n_u.GT.0) THEN
CALL d_wigner(sym%nop,sym%mrot,cell%bmat,3, sym%d_wgn)
ENDIF
!
!+odim
IF (.NOT.oneD%odd%d1) THEN
CALL mapatom(sym,atoms, cell,input, noco)
oneD%ngopr1(1:atoms%nat) = atoms%ngopr(1:atoms%nat)
! DEALLOCATE ( nq1 )
ELSE
!-odim
CALL juDFT_error("The oneD version is broken here. Compare call to mapatom with old version")
CALL mapatom(sym,atoms, cell,input, noco)
CALL od_mapatom(oneD,atoms,sym,cell)
END IF
! Store structure data
CALL storeStructureIfNew(input,stars, atoms, cell, vacuum, oneD, sym,mpi,sphhar,noco)
!+odim
IF (input%film.OR.(sym%namgrp.NE.'any ')) THEN
CALL strgn1(stars,sym,atoms, vacuum,sphhar, input,cell,xcpot)
!-odim
IF (oneD%odd%d1) THEN
CALL od_strgn1(xcpot,cell,sym,oneD)
END IF
!+odim
ELSE
CALL strgn2(stars,sym,atoms, vacuum,sphhar, input,cell,xcpot)
ENDIF
!
!IF (.NOT.l_opti) THEN
CALL inpeig(atoms,cell,input,oneD%odd%d1,kpts,enpara)
!ENDIF
!
!-----> prepare dimensions for charge density fft-box in pwden.f
!
CALL prp_qfft(stars, cell,noco, input)
!
!-----> prepare dimensions for xc fft-box in visxc(g).f
CALL inpeig(atoms,cell,input,oneD%odd%d1,kpts,enpara)
!
CALL prp_xcfft(stars,input, cell, xcpot)
!
ENDIF ! (mpi%irank == 0)
CALL stepf(sym,stars,atoms,oneD, input,cell, vacuum,mpi)
IF (.NOT.sliceplot%iplot) THEN
IF ( mpi%irank == 0 ) THEN
CALL convn(DIMENSION,atoms,stars)
!---> set up electric field parameters (if needed)
! CALL e_field(atoms, DIMENSION, stars, sym, vacuum, cell, input,field)
ENDIF
ENDIF
END SUBROUTINE setup
END MODULE m_setup
TYPE(t_input) :: input
TYPE(t_atoms) :: atoms
TYPE(t_cell) :: cell
TYPE(t_sym) :: sym
TYPE(t_noco) :: noco
TYPE(t_vacuum) :: vacuum
TYPE(t_banddos) :: banddos
TYPE(t_hybrid) :: hybrid
TYPE(t_xcpot_inbuild_nf)::xcpot
TYPE(t_oned) :: oned
TYPE(t_sliceplot):: sliceplot
TYPE(t_stars) :: stars
TYPE(t_enpara) :: enpara
TYPE(t_forcetheo):: forcetheo
TYPE(t_kpts) :: kpts
call fleur_init_old(&
input,DIMENSION,atoms,sphhar,cell,stars,sym,noco,vacuum,forcetheo,&
sliceplot,banddos,enpara,xcpot,kpts,hybrid,&
oneD,coreSpecInput)
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