Commit e2f32cea authored by Gregor Michalicek's avatar Gregor Michalicek

Introduce oUnit to files in main directory

parent 71949dfc
......@@ -15,6 +15,7 @@ MODULE m_constants
END TYPE t_constants
REAL :: warp_factor=1.0 !should be set from input later
INTEGER, PARAMETER :: oUnit = 6 !This is the unit number for the out file
INTEGER, PARAMETER :: noState_const = 0
INTEGER, PARAMETER :: coreState_const = 1
INTEGER, PARAMETER :: valenceState_const = 2
......
......@@ -223,7 +223,7 @@ CONTAINS
!CALL resetIterationDependentTimers()
CALL timestart("Iteration")
IF (mpi%irank.EQ.0) THEN
WRITE (6,FMT=8100) iter
WRITE (oUnit,FMT=8100) iter
8100 FORMAT (/,10x,' iter= ',i5)
ENDIF !mpi%irank.eq.0
......@@ -522,13 +522,13 @@ END IF
WRITE(*,*) "Occupation Distance: " , results%last_occdistance
WRITE(*,*) "Element Distance: " , results%last_mmpMatdistance
WRITE(*,*) "-----------------------------------------------------"
WRITE(6,*) "nmmp occupation distance: ", results%last_occdistance
WRITE(6,*) "nmmp element distance: ", results%last_mmpMatdistance
WRITE(6,FMT=8140) hub1data%iter
WRITE(oUnit,*) "nmmp occupation distance: ", results%last_occdistance
WRITE(oUnit,*) "nmmp element distance: ", results%last_mmpMatdistance
WRITE(oUnit,FMT=8140) hub1data%iter
8140 FORMAT (/,5x,'******* Hubbard 1 it=',i3,' is completed********',/,/)
ENDIF
WRITE (6,FMT=8130) iter
WRITE (oUnit,FMT=8130) iter
8130 FORMAT (/,5x,'******* it=',i3,' is completed********',/,/)
WRITE(*,*) "Iteration:",iter," Distance:",results%last_distance
END IF ! mpi%irank.EQ.0
......
......@@ -114,11 +114,11 @@ CONTAINS
IF (mpi%irank.EQ.0) THEN
CALL startFleur_XMLOutput()
IF (judft_was_argument("-info")) THEN
CLOSE(6)
OPEN (6,status='SCRATCH')
CLOSE(oUnit)
OPEN (oUnit,status='SCRATCH')
ELSE
IF (.NOT.judft_was_argument("-no_out")) &
OPEN (6,file='out',form='formatted',status='unknown')
OPEN (oUnit,file='out',form='formatted',status='unknown')
ENDIF
CALL writeOutHeader()
!this should be removed, it deletes output of old inf file
......@@ -261,17 +261,17 @@ CONTAINS
IF(wann%l_gwf) THEN
OPEN(113,file=wann%param_file,status='old')
READ(113,*)!header
WRITE(6,*) 'parameter points for HDWFs generation:'
WRITE(oUnit,*) 'parameter points for HDWFs generation:'
IF(wann%l_sgwf.OR.wann%l_ms) THEN
WRITE(6,*)' q1 ',' q2 ',' q3'
WRITE(oUnit,*)' q1 ',' q2 ',' q3'
ELSE IF(wann%l_socgwf) THEN
WRITE(6,*)' -- ',' phi ',' theta'
WRITE(oUnit,*)' -- ',' phi ',' theta'
END IF
DO pc = 1, wann%nparampts
READ(113,'(3(f14.10,1x))') wann%param_vec(1,pc), wann%param_vec(2,pc), wann%param_vec(3,pc)
wann%param_vec(:,pc) = wann%param_vec(:,pc) / wann%scale_param
WRITE(6,'(3(f14.10,1x))') wann%param_vec(1,pc), wann%param_vec(2,pc), wann%param_vec(3,pc)
WRITE(oUnit,'(3(f14.10,1x))') wann%param_vec(1,pc), wann%param_vec(2,pc), wann%param_vec(3,pc)
IF(wann%l_sgwf.OR.wann%l_ms) THEN
iAtom = 1
DO iType = 1, atoms%ntype
......
......@@ -110,30 +110,30 @@ contains
CALL timestart("Mixing")
SELECT CASE(input%imix)
CASE(0)
IF (mpi%irank==0) WRITE( 6, fmt='(a,f10.5,a,f10.5)' ) &
IF (mpi%irank==0) WRITE(oUnit, fmt='(a,f10.5,a,f10.5)' ) &
'STRAIGHT MIXING: alpha=',input%alpha," spin-mixing=",MERGE(input%alpha*input%spinf,0.,input%jspins>1)
CALL stmix(atoms,input,noco,fsm(it),fsm_mag,sm(it))
CASE(3,5)
CALL judft_error("Broyden 1/2 method not implemented")
CASE(7)
IF (mpi%irank==0) WRITE( 6, fmt='(a,f10.5,a,i0)' ) &
IF (mpi%irank==0) WRITE(oUnit, fmt='(a,f10.5,a,i0)' ) &
'GENERALIZED ANDERSON MIXING: alpha=',input%alpha," History-length=",it-1
Call broyden(input%alpha,fsm,sm)
CASE(9)
IF (mpi%irank==0) WRITE( 6, fmt='(a,f10.5,a,i0,a,i0)' ) &
IF (mpi%irank==0) WRITE(oUnit, fmt='(a,f10.5,a,i0,a,i0)' ) &
'PULAY MIXING: alpha=',input%alpha," History-length=",it-1,"/",input%maxiter
CALL pulay(input%alpha,fsm,sm,0)
CASE(11)
IF (mpi%irank==0) WRITE( 6, fmt='(a,f10.5,a,i0,a,i0)' ) &
IF (mpi%irank==0) WRITE(oUnit, fmt='(a,f10.5,a,i0,a,i0)' ) &
'PERIODIC PULAY MIXING: alpha=',input%alpha," History-length=",it-1,"/",input%maxiter
CALL pulay(input%alpha,fsm,sm,input%maxiter)
CASE(13)
IF (mpi%irank==0) WRITE( 6, fmt='(a,f10.5,a,i0,a,i0)' ) &
IF (mpi%irank==0) WRITE(oUnit, fmt='(a,f10.5,a,i0,a,i0)' ) &
'RESTARTED PULAY MIXING: alpha=',input%alpha," History-length=",it-1,"/",input%maxiter
CALL pulay(input%alpha,fsm,sm,0)
IF (it==input%maxiter) CALL mixing_history_limit(0) !Restarting Pulay
CASE(15)
IF (mpi%irank==0) WRITE( 6, fmt='(a,f10.5,a,i0,a,i0)' ) &
IF (mpi%irank==0) WRITE(oUnit, fmt='(a,f10.5,a,i0,a,i0)' ) &
'ADAPTED PULAY MIXING: alpha=',input%alpha," History-length=",it-1,"/",input%maxiter
CALL a_pulay(input%alpha,fsm,sm)
CASE DEFAULT
......
......@@ -83,32 +83,32 @@ CONTAINS
!CALL den%init(stars,atoms,sphhar,vacuum,noco,oneD,input%jspins,.FALSE.,POTDEN_TYPE_DEN)
IF (mpi%irank==0) THEN
WRITE (6,FMT=8000)
WRITE (oUnit,FMT=8000)
8000 FORMAT (/,/,/,5x,'t o t a l e n e r g y')
!
! ---> sum of eigenvalues (core, semicore and valence states)
!
eigSum = results%seigscv + results%seigc
results%tote = eigSum
WRITE (6,FMT=8010) results%tote
WRITE (oUnit,FMT=8010) results%tote
8010 FORMAT (/,10x,'sum of eigenvalues =',t40,f20.10)
!
! ---> add contribution of coulomb potential
!
results%tote = results%tote + 0.5e0*results%te_vcoul
WRITE (6,FMT=8020) results%te_vcoul
WRITE (oUnit,FMT=8020) results%te_vcoul
8020 FORMAT (/,10x,'density-coulomb potential integral =',t40,f20.10)
!
! ---> add contribution of effective potential
!
results%tote = results%tote - results%te_veff
WRITE (6,FMT=8030) results%te_veff
WRITE (oUnit,FMT=8030) results%te_veff
8030 FORMAT (/,10x,'density-effective potential integral =',t40,f20.10)
!
! ---> add contribution of exchange-correlation energy
!
results%tote = results%tote + results%te_exc
WRITE (6,FMT=8040) results%te_exc
WRITE (oUnit,FMT=8040) results%te_exc
8040 FORMAT (/,10x,'charge density-ex.-corr.energy density integral=', t40,f20.10)
!
! ---> Fock exchange contribution
......@@ -119,8 +119,8 @@ CONTAINS
!ELSE
results%tote = results%tote - 0.5e0*results%te_hfex%valence + 0.5e0*results%te_hfex%core
!END IF
WRITE (6,FMT=8100) 0.5e0*results%te_hfex%valence
WRITE (6,FMT=8101) 0.5e0*results%te_hfex%core
WRITE (oUnit,FMT=8100) 0.5e0*results%te_hfex%valence
WRITE (oUnit,FMT=8101) 0.5e0*results%te_hfex%core
8100 FORMAT (/,10x,'Fock-exchange energy (valence)=',t40,f20.10)
8101 FORMAT (10x,'Fock-exchange energy (core)=',t40,f20.10)
ENDIF
......@@ -168,22 +168,22 @@ CONTAINS
zintn_r(n) = atoms%neq(n)*atoms%zatom(n)*sfp_const*rhs/2.
results%tote = results%tote - zintn_r(n)
!
WRITE (6,FMT=8045) zintn_r(n)
WRITE (oUnit,FMT=8045) zintn_r(n)
CALL intgr3(mt(1,n),atoms%rmsh(1,n),atoms%dx(n),atoms%jri(n),totz)
vmd(n) = atoms%rmt(n)*vCoul%mt(atoms%jri(n),0,n,1)/sfp_const + atoms%zatom(n) - totz*sfp_const
vmd(n) = -atoms%neq(n)*atoms%zatom(n)*vmd(n)/ (2.*atoms%rmt(n))
WRITE (6,FMT=8050) n,vmd(n)
WRITE (oUnit,FMT=8050) n,vmd(n)
results%tote = results%tote + vmd(n)
ENDDO
IF (atoms%n_u+atoms%n_hia.GT.0) THEN
WRITE ( 6,FMT=8090) results%e_ldau
WRITE (oUnit,FMT=8090) results%e_ldau
results%tote = results%tote - results%e_ldau ! gu test
ENDIF
! print 'HF' before total energy to make it grepable
IF ( .NOT. hybdat%l_calhf ) THEN
WRITE ( 6,FMT=8060) results%tote
WRITE (oUnit,FMT=8060) results%tote
ELSE
WRITE ( 6,FMT=8061) results%tote
WRITE (oUnit,FMT=8061) results%tote
END IF
!
! ---> calculate the free energy and the ground state energy,
......@@ -191,13 +191,13 @@ CONTAINS
!
! print 'HF' before all energies to make them grepable
IF ( .NOT. hybdat%l_calhf ) THEN
WRITE ( 6,FMT=8065) results%ts
WRITE ( 6,FMT=8070) results%tote-results%ts
WRITE ( 6,FMT=8080) results%tote-0.5e0*results%ts
WRITE (oUnit,FMT=8065) results%ts
WRITE (oUnit,FMT=8070) results%tote-results%ts
WRITE (oUnit,FMT=8080) results%tote-0.5e0*results%ts
ELSE
WRITE ( 6,FMT=8066) results%ts
WRITE ( 6,FMT=8071) results%tote-results%ts
WRITE ( 6,FMT=8081) results%tote-0.5e0*results%ts
WRITE (oUnit,FMT=8066) results%ts
WRITE (oUnit,FMT=8071) results%tote-results%ts
WRITE (oUnit,FMT=8081) results%tote-0.5e0*results%ts
END IF
WRITE(attributes(1),'(f20.10)') results%tote
......
......@@ -25,6 +25,7 @@ CONTAINS
! TE_EXC : charge density-xc-energy density integral
!--------------------------------------------------------------------------
USE m_types
USE m_constants
USE m_rotate_int_den_tofrom_local
USE m_bfield
USE m_vgen_coulomb
......@@ -69,13 +70,13 @@ CONTAINS
IF (noco%l_sourceFree) THEN
CALL magnMomFromDen(input,atoms,noco,den,b,dummy1,dummy2)
DO i=1,atoms%ntype
WRITE (6,8025) i,b(1,i),b(2,i),b(3,i),SQRT(b(1,i)**2+b(2,i)**2+b(3,i)**2)
WRITE (oUnit,8025) i,b(1,i),b(2,i),b(3,i),SQRT(b(1,i)**2+b(2,i)**2+b(3,i)**2)
8025 FORMAT(2x,'Magmom before SF [local frame, atom ',i2,']: ','mx=',f9.5,' my=',f9.5,' mz=',f9.5,' |m|=',f9.5)
END DO
END IF
END IF
IF (mpi%irank==0) WRITE (6,FMT=8000)
IF (mpi%irank==0) WRITE (oUnit,FMT=8000)
8000 FORMAT (/,/,t10,' p o t e n t i a l g e n e r a t o r',/)
IF(atoms%n_u+atoms%n_hia>0.AND.input%ldaUAdjEnpara) THEN
......
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