Commit a7f27c4a authored by Gregor Michalicek's avatar Gregor Michalicek

Write out inp_new.xml iff forces are calculated

parent df09adc2
......@@ -39,6 +39,8 @@ CONTAINS
USE m_bfgs
USE m_bfgs0
USE m_types
USE m_rinpXML
USE m_winpXML
IMPLICIT NONE
TYPE(t_oneD),INTENT(IN) :: oneD
TYPE(t_cell),INTENT(IN) :: cell
......@@ -63,7 +65,54 @@ CONTAINS
TYPE(t_input):: input
! temporary variables for XML IO
TYPE(t_input) :: input_temp
TYPE(t_dimension) :: dimension_temp
TYPE(t_atoms) :: atoms_temp
TYPE(t_sphhar) :: sphhar_temp
TYPE(t_cell) :: cell_temp
TYPE(t_stars) :: stars_temp
TYPE(t_sym) :: sym_temp
TYPE(t_noco) :: noco_temp
TYPE(t_vacuum) :: vacuum_temp
TYPE(t_sliceplot) :: sliceplot_temp
TYPE(t_banddos) :: banddos_temp
TYPE(t_obsolete) :: obsolete_temp
TYPE(t_enpara) :: enpara_temp
TYPE(t_xcpot) :: xcpot_temp
TYPE(t_results) :: results_temp
TYPE(t_jij) :: jij_temp
TYPE(t_kpts) :: kpts_temp
TYPE(t_hybrid) :: hybrid_temp
TYPE(t_oneD) :: oneD_temp
LOGICAL :: l_opti_temp
INTEGER :: numSpecies
INTEGER :: div(3)
INTEGER, ALLOCATABLE :: xmlElectronStates(:,:)
INTEGER, ALLOCATABLE :: atomTypeSpecies(:)
INTEGER, ALLOCATABLE :: speciesRepAtomType(:)
REAL, ALLOCATABLE :: xmlCoreOccs(:,:,:)
LOGICAL, ALLOCATABLE :: xmlPrintCoreStates(:,:)
CHARACTER(len=3), ALLOCATABLE :: noel_temp(:)
CHARACTER(len=4) :: namex_temp
CHARACTER(len=12) :: relcor_temp
CHARACTER(LEN=20) :: filename
REAL :: a1_temp(3),a2_temp(3),a3_temp(3)
REAL :: scale_temp, dtild_temp
input=input_in
atoms_new=atoms
! na = 1
! DO i = 1,atoms_new%ntype
! IF (input%film) atoms_new%taual(3,na) = atoms_new%taual(3,na)/cell%amat(3,3)
! DO j = 1,3
! tau0_i(j,i) = atoms_new%taual(j,na)
! END DO
! tau0(:,i)=MATMUL(cell%amat,tau0_i(:,i))
!! CALL cotra0(tau0_i(1,i),tau0(1,i),cell%amat)
! na = na + atoms_new%neq(i)
! END DO
CALL bfgs0(&
& atoms%ntype,&
......@@ -96,8 +145,6 @@ CONTAINS
WRITE (6,'(a)') "Des woars!"
CALL juDFT_end(" GEO Des woars ", 1) ! The 1 is temporarily. Should be mpi%irank.
ELSE
atoms_new=atoms
na = 0
DO itype=1,atoms%ntype
tau0_i(:,itype)=MATMUL(cell%bmat,tau0(:,itype))
......@@ -126,13 +173,34 @@ CONTAINS
ENDDO
ENDDO
CALL judft_error("Writing on new input file not implemented in geo")
! input%l_f = .false.
! CALL rw_inp(&
! & 'W',atoms_new,obsolete,vacuum,input,stars,sliceplot,banddos,&
! & cell,sym,xcpot,noco,jij,oneD,hybrid,kpts,&
! & noel,namex,relcor,a1,a2,a3,scale,dtild,name)
! CALL judft_error("Writing on new input file not implemented in geo")
input%l_f = .false.
! CALL rw_inp('W',atoms_new,obsolete,vacuum,input,stars,sliceplot,banddos,&
! cell,sym,xcpot,noco,jij,oneD,hybrid,kpts,&
! noel,namex,relcor,a1,a2,a3,scale,dtild,name)
IF(input%l_inpXML) THEN
ALLOCATE(noel_temp(1),atomTypeSpecies(1),speciesRepAtomType(1))
ALLOCATE(xmlElectronStates(1,1),xmlPrintCoreStates(1,1))
ALLOCATE(xmlCoreOccs(1,1,1))
CALL r_inpXML(&
atoms_temp,obsolete_temp,vacuum_temp,input_temp,stars_temp,sliceplot_temp,&
banddos_temp,dimension_temp,cell_temp,sym_temp,xcpot_temp,noco_temp,Jij_temp,&
oneD_temp,hybrid_temp,kpts_temp,enpara_temp,sphhar_temp,l_opti_temp,noel_temp,&
namex_temp,relcor_temp,a1_temp,a2_temp,a3_temp,scale_temp,dtild_temp,xmlElectronStates,&
xmlPrintCoreStates,xmlCoreOccs,atomTypeSpecies,speciesRepAtomType)
numSpecies = SIZE(speciesRepAtomType)
filename = 'inp_new.xml'
input_temp%l_f = input%l_f
div(:) = MIN(kpts_temp%nmop(:),1)
CALL w_inpXML(&
& atoms_new,obsolete_temp,vacuum_temp,input_temp,stars_temp,sliceplot_temp,&
banddos_temp,cell_temp,sym_temp,xcpot_temp,noco_temp,jij_temp,oneD_temp,hybrid_temp,&
kpts_temp,kpts_temp%nmop,kpts_temp%l_gamma,noel_temp,namex_temp,relcor_temp,a1_temp,a2_temp,a3_temp,&
scale_temp,dtild_temp,input_temp%comment,xmlElectronStates,xmlPrintCoreStates,xmlCoreOccs,&
& atomTypeSpecies,speciesRepAtomType,.FALSE.,filename,numSpecies,enpara_temp)
DEALLOCATE(noel_temp,atomTypeSpecies,speciesRepAtomType)
DEALLOCATE(xmlElectronStates,xmlPrintCoreStates,xmlCoreOccs)
END IF
ENDIF
RETURN
......
......@@ -57,12 +57,13 @@
REAL dx0(atoms%ntype), rmtTemp(atoms%ntype)
INTEGER div(3)
INTEGER jri0(atoms%ntype),lmax0(atoms%ntype),nlo0(atoms%ntype),llo0(atoms%nlod,atoms%ntype)
CHARACTER(len=1) :: ch_rw
CHARACTER(len=4) :: namex
CHARACTER(len=3) :: noel(atoms%ntype)
CHARACTER(len=1) :: ch_rw
CHARACTER(len=4) :: namex
CHARACTER(len=3) :: noel(atoms%ntype)
CHARACTER(len=12) :: relcor
CHARACTER(len=3) :: latnamTemp
INTEGER nu,iofile
CHARACTER(len=3) :: latnamTemp
CHARACTER(LEN=20) :: filename
INTEGER nu,iofile
INTEGER iggachk
INTEGER n ,iostat, errorStatus, numSpecies
REAL scale,scpos ,zc
......@@ -428,14 +429,15 @@
IF(errorStatus.NE.0) THEN
STOP 'Error: Cannot print out FleurInputSchema.xsd'
END IF
filename = 'inp.xml'
numSpecies = atoms%nat
CALL w_inpXML(&
& atoms,obsolete,vacuum,input,stars,sliceplot,banddos,&
& cell,sym,xcpot,noco,jij,oneD,hybrid,kpts,div,l_gamma,&
& noel,namex,relcor,a1,a2,a3,scale,dtild,input%comment,&
& xmlElectronStates,xmlPrintCoreStates,xmlCoreOccs,&
& atomTypeSpecies,speciesRepAtomType,.FALSE.,numSpecies,&
& enpara)
& atomTypeSpecies,speciesRepAtomType,.FALSE.,filename,&
& numSpecies,enpara)
IF(juDFT_was_argument("-explicit")) THEN
sumWeight = 0.0
......
......@@ -21,8 +21,8 @@ SUBROUTINE w_inpXML(&
& cell,sym,xcpot,noco,jij,oneD,hybrid,kpts,div,l_gamma,&
& noel,namex,relcor,a1,a2,a3,scale,dtild_opt,name_opt,&
& xmlElectronStates,xmlPrintCoreStates,xmlCoreOccs,&
& atomTypeSpecies,speciesRepAtomType,l_outFile,numSpecies,&
& enpara)
& atomTypeSpecies,speciesRepAtomType,l_outFile,filename,&
& numSpecies,enpara)
USE m_types
USE m_juDFT_init
......@@ -61,6 +61,7 @@ SUBROUTINE w_inpXML(&
CHARACTER(len=3),INTENT(IN) :: noel(atoms%ntypd)
CHARACTER(len=4),INTENT(IN) :: namex
CHARACTER(len=12),INTENT(IN):: relcor
CHARACTER(LEN=*),INTENT(IN) :: filename
REAL,INTENT(IN),OPTIONAL :: dtild_opt
CHARACTER(len=8),INTENT(IN),OPTIONAL:: name_opt(10)
......@@ -155,7 +156,7 @@ SUBROUTINE w_inpXML(&
CALL openXMLElementNoAttributes('inputData')
ELSE
fileNum = 5
OPEN (fileNum,file='inp.xml',form='formatted',status='unknown')
OPEN (fileNum,file=TRIM(ADJUSTL(filename)),form='formatted',status='unknown')
REWIND (fileNum)
WRITE (fileNum,'(a)') '<?xml version="1.0" encoding="UTF-8" standalone="no"?>'
......
......@@ -64,6 +64,7 @@
COMPLEX :: cdum
CHARACTER(len=4) :: namex
CHARACTER(len=12) :: relcor
CHARACTER(LEN=20) :: filename
REAL :: a1(3),a2(3),a3(3)
REAL :: scale, dtild
#ifdef CPP_MPI
......@@ -124,14 +125,15 @@
ALLOCATE (results%force_old(3,atoms%ntype))
results%force(:,:,:) = 0.0
filename = ''
numSpecies = SIZE(speciesRepAtomType)
CALL w_inpXML(&
& atoms,obsolete,vacuum,input,stars,sliceplot,banddos,&
& cell,sym,xcpot,noco,jij,oneD,hybrid,kpts,(/1,1,1/),kpts%l_gamma,&
& noel,namex,relcor,a1,a2,a3,scale,dtild,input%comment,&
& xmlElectronStates,xmlPrintCoreStates,xmlCoreOccs,&
& atomTypeSpecies,speciesRepAtomType,.TRUE.,numSpecies,&
& enpara)
& atomTypeSpecies,speciesRepAtomType,.TRUE.,filename,&
& numSpecies,enpara)
DEALLOCATE(noel,atomTypeSpecies,speciesRepAtomType)
DEALLOCATE(xmlElectronStates,xmlPrintCoreStates,xmlCoreOccs)
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