Commit e05ef0d0 authored by Govoni's avatar Govoni
Browse files

Changed output of SX.

parent 2e08e0fe
......@@ -37,7 +37,7 @@ MODULE pdep_db
USE westcom, ONLY : wstat_calculation,n_pdep_times,n_pdep_eigen,n_pdep_maxiter,n_dfpt_maxiter, &
& n_steps_write_restart,n_pdep_restart_from_itr,n_pdep_read_from_file,trev_pdep, &
& tr2_dfpt,l_deflate,l_kinetic_only,ev,dvg,west_prefix,trev_pdep_rel, &
& l_minimize_exx_if_active,l_use_ecutrho,wstat_save_dir
& l_minimize_exx_if_active,l_use_ecutrho,wstat_save_dir,logfile
USE pdep_io, ONLY : pdep_merge_and_write_G
USE io_push, ONLY : io_push_bar
USE distribution_center, ONLY : pert
......@@ -77,12 +77,12 @@ MODULE pdep_db
!
CALL json%initialize()
!
CALL add_intput_parameters_to_json_file( 2,(/1,2/) , json )
CALL json%load_file(filename=TRIM(logfile))
!
CALL json%add('output.eigenval',ev(1:n_pdep_eigen))
CALL json%add('output.eigenpot',eigenpot_filename(1:n_pdep_eigen))
!
OPEN( NEWUNIT=iunit, FILE=TRIM( wstat_save_dir ) // '/' // TRIM('wstat-save.json') )
OPEN( NEWUNIT=iunit, FILE=TRIM( logfile ) )
CALL json%print_file( iunit )
CLOSE( iunit )
CALL json%destroy()
......@@ -114,7 +114,7 @@ MODULE pdep_db
!
WRITE(stdout,'( 5x," ")')
CALL io_push_bar()
WRITE(stdout, "(5x, 'Database written in ',a20)") human_readable_time(time_spent(2)-time_spent(1))
WRITE(stdout, "(5x, 'SAVE written in ',a20)") human_readable_time(time_spent(2)-time_spent(1))
WRITE(stdout, "(5x, 'In location : ',a)") TRIM( wstat_save_dir )
CALL io_push_bar()
!
......@@ -143,7 +143,7 @@ MODULE pdep_db
!
INTEGER, INTENT(IN) :: nglob_to_be_read
!
CHARACTER(LEN=512) :: dirname,fname
CHARACTER(LEN=512) :: fname
CHARACTER(LEN=6) :: my_label
REAL(DP), EXTERNAL :: GET_CLOCK
REAL(DP) :: time_spent(2)
......@@ -172,7 +172,7 @@ MODULE pdep_db
IF ( mpime == root ) THEN
!
CALL json%initialize()
CALL json%load_file( filename = TRIM( wstat_save_dir ) // '/' // TRIM('wstat-save.json') )
CALL json%load_file( filename = TRIM( wstat_save_dir ) // '/' // TRIM('wstat.json') )
!
CALL json%get('input.wstat_control.n_pdep_eigen', tmp_n_pdep_eigen, found)
CALL json%get('output.eigenval', tmp_ev, found)
......@@ -216,7 +216,7 @@ MODULE pdep_db
global_j = pert%l2g(local_j)
IF(global_j>n_eigen_to_get) CYCLE
!
fname = TRIM( dirname ) // "/"//TRIM(eigenpot_filename(global_j))
fname = TRIM( wstat_save_dir ) // "/"//TRIM(eigenpot_filename(global_j))
CALL pdep_read_G_and_distribute(fname,dvg(:,local_j))
!
ENDDO
......@@ -233,8 +233,8 @@ MODULE pdep_db
!
WRITE(stdout,'( 5x," ")')
CALL io_push_bar()
WRITE(stdout, "(5x, 'Database read in ',a20)") human_readable_time(time_spent(2)-time_spent(1))
WRITE(stdout, "(5x, 'In location : ',a)") TRIM( dirname )
WRITE(stdout, "(5x, 'SAVE read in ',a20)") human_readable_time(time_spent(2)-time_spent(1))
WRITE(stdout, "(5x, 'In location : ',a)") TRIM( wstat_save_dir )
WRITE(stdout, "(5x, 'Eigen. found : ',i12)") n_eigen_to_get
CALL io_push_bar()
!
......
......@@ -34,7 +34,7 @@ MODULE wfreq_db
USE mp_world, ONLY : mpime,root,world_comm
USE mp_global, ONLY : my_image_id
USE io_global, ONLY : stdout
USE westcom, ONLY : wfreq_save_dir,iks_l2g,qp_bandrange,wfreq_calculation,n_spectralf, &
USE westcom, ONLY : wfreq_save_dir,iks_l2g,qp_bandrange,wfreq_calculation,n_spectralf,logfile, &
& sigma_exx,sigma_vxcl,sigma_vxcnl,sigma_hf,sigma_z,sigma_eqplin,sigma_eqpsec,sigma_sc_eks,&
& sigma_sc_eqplin,sigma_sc_eqpsec,sigma_diff,sigma_freq,sigma_spectralf
USE pwcom, ONLY : npw,nbnd,nkstot,nspin,nelec,nelup,neldw,lspinorb,domag,lsda,nks,et
......@@ -70,7 +70,7 @@ MODULE wfreq_db
!
CALL json%initialize()
!
CALL add_intput_parameters_to_json_file( 3,(/1,2,3/) , json )
CALL json%load_file(filename=TRIM(logfile))
!
l_generate_plot = .FALSE.
l_optics = .FALSE.
......@@ -129,7 +129,7 @@ MODULE wfreq_db
!
ENDDO
!
OPEN( NEWUNIT=iunit, FILE=TRIM( wfreq_save_dir ) // '/' // TRIM('wfreq-save.json') )
OPEN( NEWUNIT=iunit, FILE=TRIM( logfile ) )
CALL json%print_file( iunit )
CLOSE( iunit )
CALL json%destroy()
......@@ -147,7 +147,7 @@ MODULE wfreq_db
!
WRITE(stdout,'( 5x," ")')
CALL io_push_bar()
WRITE(stdout, "(5x, 'Database written in ',a20)") human_readable_time(time_spent(2)-time_spent(1))
WRITE(stdout, "(5x, 'SAVE written in ',a20)") human_readable_time(time_spent(2)-time_spent(1))
WRITE(stdout, "(5x, 'In location : ',a)") TRIM( wfreq_save_dir )
CALL io_push_bar()
!
......
......@@ -60,7 +60,7 @@ CONTAINS
!
savedir = TRIM(outdir) // trim(west_prefix) // "." // TRIM(to_lower_case(code)) // ".save/"
CALL my_mkdir( savedir )
logfile = TRIM(savedir) // TRIM(to_lower_case(code))//"-logfile.json"
logfile = TRIM(savedir) // TRIM(to_lower_case(code))//".json"
!
! ... use ".FALSE." to disable all clocks except the total cpu time clock
! ... use ".TRUE." to enable clocks
......@@ -169,9 +169,9 @@ CONTAINS
CALL json%initialize()
CALL json%load_file(filename=TRIM(logfile))
!
CALL json%update('run.job.completed', .TRUE., found)
CALL json%add('run.job.endtime', TRIM(ctime) )
CALL json%add('run.job.enddate', TRIM(cdate) )
CALL json%update('runjob.completed', .TRUE., found)
CALL json%add('runjob.endtime', TRIM(ctime) )
CALL json%add('runjob.enddate', TRIM(cdate) )
!
OPEN( NEWUNIT=iunit,FILE=TRIM(logfile) )
CALL json%print_file( iunit )
......@@ -239,17 +239,18 @@ CONTAINS
!
CALL json%initialize()
!
CALL json%add('run.job.startdate', TRIM(cdate) )
CALL json%add('run.job.starttime', TRIM(ctime) )
CALL json%add('run.job.completed', .FALSE. )
CALL json%add('run.software.program', TRIM(code) )
CALL json%add('run.software.version', TRIM(west_version_number) )
IF( TRIM (west_svn_revision) /= "unknown" ) CALL json%add('init.svn', TRIM(west_svn_revision) )
CALL json%add('run.software.website',"http://www.west-code.org")
CALL json%add('run.software.citation',"M. Govoni et al., J. Chem. Theory Comput. 11, 2680 (2015).")
CALL json%add('run.software.qeversion', TRIM(version_number) )
IF( TRIM (svn_revision) /= "unknown" ) CALL json%add('run.software.qesvn', TRIM(svn_revision) )
CALL json%add('run.io.islittleendian', islittleendian() )
CALL json%add('runjob.startdate', TRIM(cdate) )
CALL json%add('runjob.starttime', TRIM(ctime) )
CALL json%add('runjob.completed', .FALSE. )
CALL json%add('software.package', "WEST" )
CALL json%add('software.program', TRIM(code) )
CALL json%add('software.version', TRIM(west_version_number) )
IF( TRIM (west_svn_revision) /= "unknown" ) CALL json%add('software.westsvn', TRIM(west_svn_revision) )
CALL json%add('software.website',"http://www.west-code.org")
CALL json%add('software.citation',"M. Govoni et al., J. Chem. Theory Comput. 11, 2680 (2015).")
CALL json%add('software.qeversion', TRIM(version_number) )
IF( TRIM (svn_revision) /= "unknown" ) CALL json%add('software.qesvn', TRIM(svn_revision) )
CALL json%add('config.io.islittleendian', islittleendian() )
!
OPEN( NEWUNIT=iunit, FILE=TRIM(logfile) )
CALL json%print_file( iunit )
......
......@@ -20,7 +20,7 @@ SUBROUTINE do_sxx ( )
USE pwcom, ONLY : current_spin,wk,nks,nelup,neldw,isk,igk_k,xk,npw,npwx,lsda,nkstot,current_k,ngk,et
USE io_push, ONLY : io_push_title,io_push_bar
USE westcom, ONLY : iuwfc,lrwfc,westpp_range,westpp_save_dir,nbnd_occ,iks_l2g,westpp_epsinfty,dvg,ev,&
& npwq0,npwq0x,fftdriver
& npwq0,npwq0x,fftdriver,logfile
USE mp_global, ONLY : inter_image_comm,my_image_id,intra_bgrp_comm
USE mp, ONLY : mp_bcast,mp_sum
USE fft_base, ONLY : dfftp,dffts
......@@ -36,7 +36,6 @@ SUBROUTINE do_sxx ( )
USE gvect, ONLY : g,nl,gstart,ngm_g,ig_l2g,ngm
USE cell_base, ONLY : omega,at,alat
USE noncollin_module, ONLY : noncolin,npol
!USE west_io, ONLY : serial_table_output
USE mp_world, ONLY : mpime,root
USE constants, ONLY : rytoev
USE json_module, ONLY : json_file
......@@ -211,9 +210,20 @@ SUBROUTINE do_sxx ( )
!
! Output it per k-point
!
IF(mpime==root) CALL json%initialize()
IF(mpime==root) THEN
CALL json%initialize()
CALL json%load_file(filename=TRIM(logfile))
ENDIF
!
! STDOUT
!
WRITE(stdout,"(5X)")
CALL io_push_bar()
WRITE(stdout,"(5X,a,1X,a,1X,a,1X,a,1X,a,1X,a)") &
& 'K ', 'B ', ' Eks [eV]', ' Sx [eV]', ' Sxx [eV]', ' Sxx/Sx'
CALL io_push_bar()
!
ALLOCATE(out_tab(westpp_range(2)-westpp_range(1)+1,4))
ALLOCATE(out_tab(westpp_range(2)-westpp_range(1)+1,5))
!
DO iks=1,nks
DO ib = westpp_range(1), westpp_range(2)
......@@ -221,7 +231,9 @@ SUBROUTINE do_sxx ( )
out_tab( ib - westpp_range(1) + 1, 2) = et(ib,iks) * rytoev
out_tab( ib - westpp_range(1) + 1, 3) = sigma_exx(ib,iks) * rytoev
out_tab( ib - westpp_range(1) + 1, 4) = sigma_sxx(ib,iks) * rytoev
!out_tab( ib - westpp_range(1) + 1, 5) = sigma_sxx(ib,iks) / sigma_exx(ib,iks)
out_tab( ib - westpp_range(1) + 1, 5) = sigma_sxx(ib,iks) / sigma_exx(ib,iks)
WRITE(stdout,"(5X,i6.6,1X,i6.6,1X,1f14.6,1X,1f14.6,1X,1f14.6,1X,1f14.6)") &
& iks, ib, et(ib,iks)*rytoev, sigma_exx(ib,iks)*rytoev, sigma_sxx(ib,iks)*rytoev, sigma_sxx(ib,iks)/sigma_exx(ib,iks)
ENDDO
WRITE(myglobk,'(i6.6)') iks_l2g(iks)
!
......@@ -231,18 +243,20 @@ SUBROUTINE do_sxx ( )
!
IF(mpime==root) THEN
!
CALL json%add('K'//TRIM(myglobk)//'.bandmap',out_tab(:,1))
CALL json%add('K'//TRIM(myglobk)//'.eks',out_tab(:,2))
CALL json%add('K'//TRIM(myglobk)//'.sx',out_tab(:,3))
CALL json%add('K'//TRIM(myglobk)//'.sxx',out_tab(:,4))
CALL json%add('output.S.K'//TRIM(myglobk)//'.bandmap',out_tab(:,1))
CALL json%add('output.S.K'//TRIM(myglobk)//'.eks',out_tab(:,2))
CALL json%add('output.S.K'//TRIM(myglobk)//'.sx',out_tab(:,3))
CALL json%add('output.S.K'//TRIM(myglobk)//'.sxx',out_tab(:,4))
CALL json%add('output.S.K'//TRIM(myglobk)//'.fraction',out_tab(:,5))
!
ENDIF
ENDDO
DEALLOCATE(out_tab)
CALL io_push_bar()
!
IF( mpime == root ) THEN
!
OPEN( NEWUNIT=iunit, FILE=TRIM(westpp_save_dir)//"/sxx.json" )
OPEN( NEWUNIT=iunit, FILE=TRIM(logfile) )
CALL json%print_file( iunit )
CLOSE( iunit )
!
......
......@@ -1180,7 +1180,7 @@ SUBROUTINE output_eqp_report(iteration,en1,en2,sc1)
!
CALL json%load_file(filename=TRIM(logfile))
!
CALL json%get('eqp.secitr',secitr, found )
CALL json%get('exec.Q.secitr',secitr, found )
!
IF( found ) THEN
secitr = secitr+1
......@@ -1190,17 +1190,17 @@ SUBROUTINE output_eqp_report(iteration,en1,en2,sc1)
!
WRITE(citr,'(i6)') secitr
!
CALL json%update('eqp.secitr', secitr, found )
CALL json%update('exec.Q.secitr', secitr, found )
!
DO iks = 1, nks
WRITE( my_label_k, '(i6.6)') iks_l2g(iks)
DO ib = qp_bandrange(1), qp_bandrange(2)
WRITE( my_label_b, '(i6.6)') ib
CALL json%add('eqp.K'//TRIM(my_label_k)//'.B'//TRIM(my_label_b)//'.ein('//TRIM(ADJUSTL(citr))//')',&
CALL json%add('exec.Q.K'//TRIM(my_label_k)//'.B'//TRIM(my_label_b)//'.ein('//TRIM(ADJUSTL(citr))//')',&
& en1(ib,iks)*rytoev)
CALL json%add('eqp.K'//TRIM(my_label_k)//'.B'//TRIM(my_label_b)//'.eout('//TRIM(ADJUSTL(citr))//')',&
CALL json%add('exec.Q.K'//TRIM(my_label_k)//'.B'//TRIM(my_label_b)//'.eout('//TRIM(ADJUSTL(citr))//')',&
& en2(ib,iks)*rytoev)
CALL json%add('eqp.K'//TRIM(my_label_k)//'.B'//TRIM(my_label_b)//'.sc_ein('//TRIM(ADJUSTL(citr))//')',&
CALL json%add('exec.Q.K'//TRIM(my_label_k)//'.B'//TRIM(my_label_b)//'.sc_ein('//TRIM(ADJUSTL(citr))//')',&
& REAL(sc1(ib,iks))*rytoev)
ENDDO
ENDDO
......
......@@ -1199,7 +1199,7 @@ SUBROUTINE output_ev_and_time(nvec,ev_,conv_,time,sternop,tr2,dfpt_dim,diago_dim
!
CALL json%load_file(filename=TRIM(logfile))
!
CALL json%get('davidson.ndav', ndav, found )
CALL json%get('exec.ndav', ndav, found )
!
IF( found ) THEN
ndav = ndav+1
......@@ -1209,19 +1209,19 @@ SUBROUTINE output_ev_and_time(nvec,ev_,conv_,time,sternop,tr2,dfpt_dim,diago_dim
!
WRITE(cdav,'(i6)') ndav
!
CALL json%update('davidson.ndav', ndav, found )
CALL json%add('davidson.davitr('//TRIM(ADJUSTL(cdav))//').dav_iter', dav_iter )
CALL json%add('davidson.davitr('//TRIM(ADJUSTL(cdav))//').ev', ev_ ( 1:nvec ) )
CALL json%add('davidson.davitr('//TRIM(ADJUSTL(cdav))//').conv', conv_ ( 1:nvec ) )
CALL json%add('davidson.davitr('//TRIM(ADJUSTL(cdav))//').notcnv', notcnv )
CALL json%add('davidson.davitr('//TRIM(ADJUSTL(cdav))//').time_elap:sec', time(2) )
CALL json%add('davidson.davitr('//TRIM(ADJUSTL(cdav))//').time_elap:hum', TRIM(human_readable_time(time(2))) )
CALL json%add('davidson.davitr('//TRIM(ADJUSTL(cdav))//').time_iter:sec', (time(2)-time(1)))
CALL json%add('davidson.davitr('//TRIM(ADJUSTL(cdav))//').time_iter:hum', TRIM(human_readable_time(time(2)-time(1))) )
CALL json%add('davidson.davitr('//TRIM(ADJUSTL(cdav))//').sternop_ncalls', sternop(2)-sternop(1) )
CALL json%add('davidson.davitr('//TRIM(ADJUSTL(cdav))//').dfpt_tr2', tr2 )
CALL json%add('davidson.davitr('//TRIM(ADJUSTL(cdav))//').dfpt_dim', dfpt_dim )
CALL json%add('davidson.davitr('//TRIM(ADJUSTL(cdav))//').diago_dim', diago_dim )
CALL json%update('exec.ndav', ndav, found )
CALL json%add('exec.davitr('//TRIM(ADJUSTL(cdav))//').dav_iter', dav_iter )
CALL json%add('exec.davitr('//TRIM(ADJUSTL(cdav))//').ev', ev_ ( 1:nvec ) )
CALL json%add('exec.davitr('//TRIM(ADJUSTL(cdav))//').conv', conv_ ( 1:nvec ) )
CALL json%add('exec.davitr('//TRIM(ADJUSTL(cdav))//').notcnv', notcnv )
CALL json%add('exec.davitr('//TRIM(ADJUSTL(cdav))//').time_elap:sec', time(2) )
CALL json%add('exec.davitr('//TRIM(ADJUSTL(cdav))//').time_elap:hum', TRIM(human_readable_time(time(2))) )
CALL json%add('exec.davitr('//TRIM(ADJUSTL(cdav))//').time_iter:sec', (time(2)-time(1)))
CALL json%add('exec.davitr('//TRIM(ADJUSTL(cdav))//').time_iter:hum', TRIM(human_readable_time(time(2)-time(1))) )
CALL json%add('exec.davitr('//TRIM(ADJUSTL(cdav))//').sternop_ncalls', sternop(2)-sternop(1) )
CALL json%add('exec.davitr('//TRIM(ADJUSTL(cdav))//').dfpt_tr2', tr2 )
CALL json%add('exec.davitr('//TRIM(ADJUSTL(cdav))//').dfpt_dim', dfpt_dim )
CALL json%add('exec.davitr('//TRIM(ADJUSTL(cdav))//').diago_dim', diago_dim )
!
OPEN( NEWUNIT=iunit,FILE=TRIM(logfile) )
CALL json%print_file( iunit )
......
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