Commit cb77dcdf authored by Marco Govoni's avatar Marco Govoni
Browse files

Committing part of the stuff.

parent fe3cc00d
...@@ -5,6 +5,7 @@ include ../../make.inc ...@@ -5,6 +5,7 @@ include ../../make.inc
# location of needed modules # location of needed modules
MODFLAGS= $(MOD_FLAG)../../iotk/src $(MOD_FLAG)../../Modules $(MOD_FLAG)../../LAXlib \ MODFLAGS= $(MOD_FLAG)../../iotk/src $(MOD_FLAG)../../Modules $(MOD_FLAG)../../LAXlib \
$(MOD_FLAG)../../FFTXlib $(MOD_FLAG)../../PW/src \ $(MOD_FLAG)../../FFTXlib $(MOD_FLAG)../../PW/src \
$(MOD_FLAG)../Libraries/Json \
$(MOD_FLAG)../Modules \ $(MOD_FLAG)../Modules \
$(MOD_FLAG)../Tools \ $(MOD_FLAG)../Tools \
$(MOD_FLAG)../FFT_kernel \ $(MOD_FLAG)../FFT_kernel \
...@@ -26,7 +27,7 @@ wfreq_io.o \ ...@@ -26,7 +27,7 @@ wfreq_io.o \
wfreq_restart.o wfreq_restart.o
PWOBJS = ../../PW/src/libpw.a PWOBJS = ../../PW/src/libpw.a
QEMODS = ../../Modules/libqemod.a ../../FFTXlib/libqefft.a ../../LAXlib/libqela.a QEMODS = ../../Modules/libqemod.a ../../FFTXlib/libqefft.a ../../LAXlib/libqela.a ../Libraries/Json/libjson.a
TLDEPS= bindir mods libs pw TLDEPS= bindir mods libs pw
......
...@@ -14,9 +14,9 @@ ...@@ -14,9 +14,9 @@
MODULE pdep_db MODULE pdep_db
!---------------------------------------------------------------------------- !----------------------------------------------------------------------------
! !
USE iotk_module USE kinds, ONLY : DP
USE kinds, ONLY : DP USE westcom, ONLY : wstat_save_dir
USE io_files, ONLY : tmp_dir USE json_module, ONLY : json_file
! !
IMPLICIT NONE IMPLICIT NONE
! !
...@@ -32,14 +32,13 @@ MODULE pdep_db ...@@ -32,14 +32,13 @@ MODULE pdep_db
SUBROUTINE pdep_db_write( ) SUBROUTINE pdep_db_write( )
!------------------------------------------------------------------------ !------------------------------------------------------------------------
! !
USE xml_io_base, ONLY : create_directory
USE mp, ONLY : mp_bcast,mp_barrier USE mp, ONLY : mp_bcast,mp_barrier
USE mp_world, ONLY : mpime,root,world_comm USE mp_world, ONLY : mpime,root,world_comm
USE mp_global, ONLY : my_image_id USE mp_global, ONLY : my_image_id
USE io_global, ONLY : stdout USE io_global, ONLY : stdout
USE westcom, ONLY : wstat_calculation,n_pdep_times,n_pdep_eigen,n_pdep_maxiter,n_dfpt_maxiter, & USE westcom, ONLY : n_pdep_eigen,n_dfpt_maxiter, &
& n_steps_write_restart,n_pdep_restart_from_itr,n_pdep_read_from_file,trev_pdep, & & 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,wstat_dirname,trev_pdep_rel, & & tr2_dfpt,l_deflate,l_kinetic_only,ev,dvg,west_prefix,wstat_save_dir,trev_pdep_rel, &
& l_minimize_exx_if_active,l_use_ecutrho & l_minimize_exx_if_active,l_use_ecutrho
!USE eig_distribute, ONLY : local_npert,pdep_distr_l2g !USE eig_distribute, ONLY : local_npert,pdep_distr_l2g
USE pdep_io, ONLY : pdep_merge_and_write_G USE pdep_io, ONLY : pdep_merge_and_write_G
...@@ -55,6 +54,7 @@ MODULE pdep_db ...@@ -55,6 +54,7 @@ MODULE pdep_db
CHARACTER(20),EXTERNAL :: human_readable_time CHARACTER(20),EXTERNAL :: human_readable_time
INTEGER :: iunout,global_j,local_j INTEGER :: iunout,global_j,local_j
INTEGER :: ierr INTEGER :: ierr
TYPE(json_file) :: json
! !
! MPI BARRIER ! MPI BARRIER
! !
...@@ -64,72 +64,62 @@ MODULE pdep_db ...@@ -64,72 +64,62 @@ MODULE pdep_db
! !
CALL start_clock('pdep_db') CALL start_clock('pdep_db')
time_spent(1)=get_clock('pdep_db') time_spent(1)=get_clock('pdep_db')
! !!
! 1) CREATE THE INPUT FILE !! 1) CREATE THE INPUT FILE
! !!
IF ( mpime == root ) THEN !IF ( mpime == root ) THEN
! ! !
! ... open XML descriptor ! ! ... open XML descriptor
! ! !
CALL iotk_free_unit( iunout, ierr ) ! CALL iotk_free_unit( iunout, ierr )
CALL iotk_open_write( iunout, FILE = TRIM( wstat_dirname ) // '/' // TRIM("input-file.xml") , BINARY=.FALSE.,IERR=ierr ) ! CALL iotk_open_write( iunout, FILE = TRIM( wstat_save_dir ) // '/' // TRIM("input-file.xml") , BINARY=.FALSE.,IERR=ierr )
! ! !
END IF !END IF
! !!
CALL mp_bcast( ierr, root, world_comm ) !CALL mp_bcast( ierr, root, world_comm )
CALL errore( 'pdep_db', 'cannot open input-file.xml for writing', ierr ) !CALL errore( 'pdep_db', 'cannot open input-file.xml for writing', ierr )
! !!
IF ( mpime == root ) THEN !IF ( mpime == root ) THEN
! ! !
CALL iotk_write_begin( iunout, "WSTAT_CONTROL" ) ! CALL iotk_write_begin( iunout, "WSTAT_CONTROL" )
! ! !
CALL iotk_write_dat( iunout, "wstat_calculation" , wstat_calculation) ! CALL iotk_write_dat( iunout, "wstat_calculation" , wstat_calculation)
CALL iotk_write_dat( iunout, "n_pdep_eigen" , n_pdep_eigen) ! CALL iotk_write_dat( iunout, "n_pdep_eigen" , n_pdep_eigen)
CALL iotk_write_dat( iunout, "n_pdep_times" , n_pdep_times) ! CALL iotk_write_dat( iunout, "n_pdep_times" , n_pdep_times)
CALL iotk_write_dat( iunout, "n_pdep_maxiter" , n_pdep_maxiter) ! CALL iotk_write_dat( iunout, "n_pdep_maxiter" , n_pdep_maxiter)
CALL iotk_write_dat( iunout, "n_dfpt_maxiter" , n_dfpt_maxiter) ! CALL iotk_write_dat( iunout, "n_dfpt_maxiter" , n_dfpt_maxiter)
CALL iotk_write_dat( iunout, "n_pdep_read_from_file" , n_pdep_read_from_file) ! CALL iotk_write_dat( iunout, "n_pdep_read_from_file" , n_pdep_read_from_file)
CALL iotk_write_dat( iunout, "trev_pdep" , trev_pdep) ! CALL iotk_write_dat( iunout, "trev_pdep" , trev_pdep)
CALL iotk_write_dat( iunout, "trev_pdep_rel" , trev_pdep_rel) ! CALL iotk_write_dat( iunout, "trev_pdep_rel" , trev_pdep_rel)
CALL iotk_write_dat( iunout, "tr2_dfpt" , tr2_dfpt) ! CALL iotk_write_dat( iunout, "tr2_dfpt" , tr2_dfpt)
CALL iotk_write_dat( iunout, "l_kinetic_only" , l_kinetic_only) ! CALL iotk_write_dat( iunout, "l_kinetic_only" , l_kinetic_only)
CALL iotk_write_dat( iunout, "l_minimize_exx_if_active" , l_minimize_exx_if_active) ! CALL iotk_write_dat( iunout, "l_minimize_exx_if_active" , l_minimize_exx_if_active)
CALL iotk_write_dat( iunout, "l_use_ecutrho" , l_use_ecutrho) ! CALL iotk_write_dat( iunout, "l_use_ecutrho" , l_use_ecutrho)
! ! !
CALL iotk_write_end( iunout, "WSTAT_CONTROL" ) ! CALL iotk_write_end( iunout, "WSTAT_CONTROL" )
! ! !
! ... close XML descriptor ! ! ... close XML descriptor
! ! !
CALL iotk_close_write( iunout ) ! CALL iotk_close_write( iunout )
! ! !
END IF !END IF
! !
! 2) CREATE THE EIGENVALUE FILE ! 2) CREATE THE EIGENVALUE FILE
! !
IF ( mpime == root ) THEN IF( mpime == root ) THEN
!
! ... open XML descriptor
! !
CALL iotk_free_unit( iunout, ierr ) CALL json%initialize()
CALL iotk_open_write( iunout, FILE = TRIM( wstat_dirname ) // '/' // TRIM("dbs_eigenvalues.xml"),BINARY=.FALSE.,IERR=ierr)
!
END IF
!
CALL mp_bcast( ierr, root, world_comm )
CALL errore( 'pdep_db', 'cannot open dbs_eigenvalues.xml file for writing', ierr )
!
IF ( mpime == root ) THEN
! !
CALL iotk_write_begin( iunout, "EIGENVALUES" ) CALL json%add('pdep.ndim', n_pdep_eigen )
CALL iotk_write_dat( iunout, "ndim", n_pdep_eigen ) CALL json%add('pdep.ev' , ev( 1:n_pdep_eigen ) )
CALL iotk_write_dat( iunout, "ev", ev(1:n_pdep_eigen))
CALL iotk_write_end( iunout, "EIGENVALUES" )
! !
! ... close XML descriptor OPEN(UNIT=4000,FILE=TRIM(ADJUSTL(wstat_save_dir))//"/pdep_db.json",IOSTAT=ierr)
CALL json%print_file( 4000 )
CLOSE( 4000, IOSTAT=ierr )
! !
CALL iotk_close_write( iunout ) CALL json%destroy()
! !
END IF ENDIF
! !
! 3) CREATE THE EIGENVECTOR FILES ! 3) CREATE THE EIGENVECTOR FILES
! !
...@@ -141,7 +131,7 @@ MODULE pdep_db ...@@ -141,7 +131,7 @@ MODULE pdep_db
WRITE(my_label,'(i6.6)') global_j WRITE(my_label,'(i6.6)') global_j
IF(global_j>n_pdep_eigen) CYCLE IF(global_j>n_pdep_eigen) CYCLE
! !
fname = TRIM( wstat_dirname ) // "/E"//TRIM(ADJUSTL(my_label))//".dat" fname = TRIM( wstat_save_dir ) // "/E"//TRIM(ADJUSTL(my_label))//".dat"
CALL pdep_merge_and_write_G(fname,dvg(:,local_j)) CALL pdep_merge_and_write_G(fname,dvg(:,local_j))
! !
ENDDO ENDDO
...@@ -158,7 +148,7 @@ MODULE pdep_db ...@@ -158,7 +148,7 @@ MODULE pdep_db
WRITE(stdout,'( 5x," ")') WRITE(stdout,'( 5x," ")')
CALL io_push_bar() CALL io_push_bar()
WRITE(stdout, "(5x, 'Database written in ',a20)") human_readable_time(time_spent(2)-time_spent(1)) WRITE(stdout, "(5x, 'Database written in ',a20)") human_readable_time(time_spent(2)-time_spent(1))
WRITE(stdout, "(5x, 'In location : ',a)") TRIM( wstat_dirname ) WRITE(stdout, "(5x, 'In location : ',a)") TRIM( wstat_save_dir )
CALL io_push_bar() CALL io_push_bar()
! !
END SUBROUTINE END SUBROUTINE
...@@ -194,6 +184,7 @@ MODULE pdep_db ...@@ -194,6 +184,7 @@ MODULE pdep_db
INTEGER :: tmp_n_pdep_eigen INTEGER :: tmp_n_pdep_eigen
INTEGER :: dime, iun, global_j, local_j INTEGER :: dime, iun, global_j, local_j
REAL(DP),ALLOCATABLE :: tmp_ev(:) REAL(DP),ALLOCATABLE :: tmp_ev(:)
TYPE(json_file) :: json
! !
! MPI BARRIER ! MPI BARRIER
! !
...@@ -207,84 +198,122 @@ MODULE pdep_db ...@@ -207,84 +198,122 @@ MODULE pdep_db
! !
! ... the main db directory ! ... the main db directory
! !
dirname = TRIM( tmp_dir ) // TRIM( west_prefix ) // '.wstat.save' !dirname = TRIM( tmp_dir ) // TRIM( west_prefix ) // '.wstat.save'
! !
! 1) READ THE INPUT FILE ierr = 0
!
ierr = 0
! !
IF ( mpime==root ) THEN IF ( mpime==root ) THEN
! !
! ... open XML descriptor CALL json%initialize()
! !
CALL iotk_free_unit( iun, ierr ) CALL json%load_file(TRIM(ADJUSTL(wstat_save_dir))//"/pdep_db.json")
CALL iotk_open_read( iun, FILE = TRIM( dirname ) // '/' // TRIM( 'input-file.xml' ), IERR = ierr )
! !
ENDIF CALL json%get('pdep.ndim', dime )
!
CALL mp_bcast( ierr, root, world_comm )
IF ( ierr /=0 ) CALL errore( 'pdep_db', 'cannot open input-file.xml file for reading', ierr )
!
IF ( mpime==root ) THEN
! !
CALL iotk_scan_begin( iun, "WSTAT_CONTROL" ) ENDIF
CALL iotk_scan_dat( iun, "n_pdep_eigen" , tmp_n_pdep_eigen)
CALL iotk_scan_end( iun, "WSTAT_CONTROL" )
!
! ... close XML descriptor
!
CALL iotk_close_read( iun )
!
ENDIF
!
CALL mp_bcast( tmp_n_pdep_eigen, root, world_comm )
! !
! In case nglob_to_be_read is 0, overwrite it with the read value CALL mp_bcast( tmp_n_pdep_eigen, root, world_comm )
! !
IF (nglob_to_be_read==0) THEN IF (nglob_to_be_read==0) THEN
n_eigen_to_get = tmp_n_pdep_eigen n_eigen_to_get = dime
n_pdep_eigen=tmp_n_pdep_eigen n_pdep_eigen = dime
ELSE ELSE
n_eigen_to_get = MIN(tmp_n_pdep_eigen,nglob_to_be_read) n_eigen_to_get = MIN(dime,nglob_to_be_read)
ENDIF ENDIF
!
! 2) READ THE EIGENVALUES FILE
!
IF(.NOT.ALLOCATED(ev)) ALLOCATE(ev(n_eigen_to_get))
!
ierr = 0
!
IF ( mpime==root ) THEN
! !
! ... open XML descriptor IF(.NOT.ALLOCATED(ev)) ALLOCATE(ev(n_eigen_to_get))
!
CALL iotk_free_unit( iun, ierr )
CALL iotk_open_read( iun, FILE = TRIM( dirname ) // '/' // TRIM( 'dbs_eigenvalues.xml' ), IERR = ierr )
!
ENDIF
!
CALL mp_bcast( ierr, root, world_comm )
!
IF ( ierr /=0 ) CALL errore( 'pdep_db', 'cannot open dbs_eigenvalues.xml file for reading', ierr )
! !
IF ( mpime==root ) THEN IF ( mpime==root ) THEN
! !
CALL iotk_scan_begin( iun, "EIGENVALUES" )
CALL iotk_scan_dat( iun, "ndim" , dime)
ALLOCATE(tmp_ev(dime)) ALLOCATE(tmp_ev(dime))
CALL iotk_scan_dat( iun, "ev" , tmp_ev) CALL json%get('pdep.ev' , tmp_ev( 1:dime ) )
CALL iotk_scan_end( iun, "EIGENVALUES" )
!
! ... close XML descriptor
!
CALL iotk_close_read( iun )
ev(1:nglob_to_be_read) = tmp_ev(1:nglob_to_be_read) ev(1:nglob_to_be_read) = tmp_ev(1:nglob_to_be_read)
DEALLOCATE(tmp_ev) DEALLOCATE(tmp_ev)
! !
CALL json%destroy()
!
ENDIF ENDIF
! !
CALL mp_bcast( ev, root, world_comm ) CALL mp_bcast( ev, root, world_comm )
! !
! !
! ! 1) READ THE INPUT FILE
! !
! ierr = 0
! !
! IF ( mpime==root ) THEN
! !
! ! ... open XML descriptor
! !
! CALL iotk_free_unit( iun, ierr )
! CALL iotk_open_read( iun, FILE = TRIM( dirname ) // '/' // TRIM( 'input-file.xml' ), IERR = ierr )
! !
! ENDIF
! !
! CALL mp_bcast( ierr, root, world_comm )
! IF ( ierr /=0 ) CALL errore( 'pdep_db', 'cannot open input-file.xml file for reading', ierr )
! !
! IF ( mpime==root ) THEN
! !
! CALL iotk_scan_begin( iun, "WSTAT_CONTROL" )
! CALL iotk_scan_dat( iun, "n_pdep_eigen" , tmp_n_pdep_eigen)
! CALL iotk_scan_end( iun, "WSTAT_CONTROL" )
! !
! ! ... close XML descriptor
! !
! CALL iotk_close_read( iun )
! !
! ENDIF
! !
! CALL mp_bcast( tmp_n_pdep_eigen, root, world_comm )
! !
! ! In case nglob_to_be_read is 0, overwrite it with the read value
! !
! IF (nglob_to_be_read==0) THEN
! n_eigen_to_get = tmp_n_pdep_eigen
! n_pdep_eigen=tmp_n_pdep_eigen
! ELSE
! n_eigen_to_get = MIN(tmp_n_pdep_eigen,nglob_to_be_read)
! ENDIF
! !
! ! 2) READ THE EIGENVALUES FILE
! !
! IF(.NOT.ALLOCATED(ev)) ALLOCATE(ev(n_eigen_to_get))
! !
! ierr = 0
! !
! IF ( mpime==root ) THEN
! !
! ! ... open XML descriptor
! !
! CALL iotk_free_unit( iun, ierr )
! CALL iotk_open_read( iun, FILE = TRIM( dirname ) // '/' // TRIM( 'dbs_eigenvalues.xml' ), IERR = ierr )
! !
! ENDIF
! !
! CALL mp_bcast( ierr, root, world_comm )
! !
! IF ( ierr /=0 ) CALL errore( 'pdep_db', 'cannot open dbs_eigenvalues.xml file for reading', ierr )
! !
! IF ( mpime==root ) THEN
! !
! CALL iotk_scan_begin( iun, "EIGENVALUES" )
! CALL iotk_scan_dat( iun, "ndim" , dime)
! ALLOCATE(tmp_ev(dime))
! CALL iotk_scan_dat( iun, "ev" , tmp_ev)
! CALL iotk_scan_end( iun, "EIGENVALUES" )
! !
! ! ... close XML descriptor
! !
! CALL iotk_close_read( iun )
! ev(1:nglob_to_be_read) = tmp_ev(1:nglob_to_be_read)
! DEALLOCATE(tmp_ev)
! !
! ENDIF
! !
! CALL mp_bcast( ev, root, world_comm )
!
! 3) READ THE EIGENVECTOR FILES ! 3) READ THE EIGENVECTOR FILES
! !
IF(.NOT.ALLOCATED(dvg)) THEN IF(.NOT.ALLOCATED(dvg)) THEN
......
...@@ -30,7 +30,7 @@ MODULE write_xml ...@@ -30,7 +30,7 @@ MODULE write_xml
USE mp_world, ONLY : mpime,root,world_comm USE mp_world, ONLY : mpime,root,world_comm
USE io_global, ONLY : stdout USE io_global, ONLY : stdout
USE io_push, ONLY : io_push_bar USE io_push, ONLY : io_push_bar
USE westcom, ONLY : wstat_dirname, l_is_wstat_converged, ev USE westcom, ONLY : wstat_save_dir, l_is_wstat_converged, ev
USE westcom, ONLY : qe_prefix, west_prefix, outdir USE westcom, ONLY : qe_prefix, west_prefix, outdir
USE westcom, ONLY : wstat_calculation, n_pdep_eigen, n_pdep_times, n_pdep_maxiter, n_dfpt_maxiter, & USE westcom, ONLY : wstat_calculation, n_pdep_eigen, n_pdep_times, n_pdep_maxiter, n_dfpt_maxiter, &
& n_pdep_read_from_file, trev_pdep, trev_pdep_rel, tr2_dfpt, l_minimize_exx_if_active, & & n_pdep_read_from_file, trev_pdep, trev_pdep_rel, tr2_dfpt, l_minimize_exx_if_active, &
...@@ -85,7 +85,7 @@ MODULE write_xml ...@@ -85,7 +85,7 @@ MODULE write_xml
! !
CALL iotk_free_unit( iunout, ierr ) CALL iotk_free_unit( iunout, ierr )
! !
CALL iotk_open_write( iunout, FILE = TRIM( wstat_dirname ) // '/' // TRIM("wstat.xml") , & CALL iotk_open_write( iunout, FILE = TRIM( wstat_save_dir ) // '/' // TRIM("wstat.xml") , &
& ROOT="wstat",BINARY=.FALSE.,SKIP_HEAD=.TRUE.,IERR=ierr ) & ROOT="wstat",BINARY=.FALSE.,SKIP_HEAD=.TRUE.,IERR=ierr )
! !
END IF END IF
...@@ -206,7 +206,7 @@ MODULE write_xml ...@@ -206,7 +206,7 @@ MODULE write_xml
WRITE(stdout,'( 5x," ")') WRITE(stdout,'( 5x," ")')
CALL io_push_bar() CALL io_push_bar()
WRITE(stdout, "(5x, 'wstat.xml file written in ',a20)") human_readable_time(time_spent(2)-time_spent(1)) WRITE(stdout, "(5x, 'wstat.xml file written in ',a20)") human_readable_time(time_spent(2)-time_spent(1))
WRITE(stdout, "(5x, 'In location : ',a)") TRIM( wstat_dirname ) WRITE(stdout, "(5x, 'In location : ',a)") TRIM( wstat_save_dir )
CALL io_push_bar() CALL io_push_bar()
! !
END SUBROUTINE END SUBROUTINE
......
...@@ -100,7 +100,10 @@ MODULE wstat_center ...@@ -100,7 +100,10 @@ MODULE wstat_center
! Common workspace ! Common workspace
! !
COMPLEX(DP) :: alphapv_dfpt COMPLEX(DP) :: alphapv_dfpt
CHARACTER(LEN=256) :: wstat_dirname !CHARACTER(LEN=256) :: wstat_dirname
CHARACTER(LEN=256) :: wstat_save_dir
CHARACTER(LEN=256) :: wstat_output_dir
CHARACTER(LEN=256) :: wstat_restart_dir
LOGICAL :: l_is_wstat_converged LOGICAL :: l_is_wstat_converged
! !
END MODULE END MODULE
......
...@@ -15,6 +15,7 @@ exx_go.o \ ...@@ -15,6 +15,7 @@ exx_go.o \
exx_ungo.o \ exx_ungo.o \
report_dynamical_memory.o \ report_dynamical_memory.o \
io_push.o \ io_push.o \
set_dirs.o \
do_setup.o \ do_setup.o \
linear_algebra_kernel.o \ linear_algebra_kernel.o \
human_readable_time.o \ human_readable_time.o \
......
...@@ -49,6 +49,7 @@ SUBROUTINE do_setup ...@@ -49,6 +49,7 @@ SUBROUTINE do_setup
CALL init_pw_arrays(nbnd) CALL init_pw_arrays(nbnd)
CALL set_iks_l2g() CALL set_iks_l2g()
! !
CALL set_dirs()
! !
IF ( lsda ) THEN IF ( lsda ) THEN
IF ( INT( nelup ) == 0 .AND. INT( neldw ) == 0 ) THEN IF ( INT( nelup ) == 0 .AND. INT( neldw ) == 0 ) THEN
......
!
! Copyright (C) 2015-2016 M. Govoni
! This file is distributed under the terms of the
! GNU General Public License. See the file `License'
! in the root directory of the present distribution,
! or http://www.gnu.org/copyleft/gpl.txt .
!
! This file is part of WEST.
!
! Contributors to this file:
! Marco Govoni
!
!-----------------------------------------------------------------------
SUBROUTINE set_dirs( )
!-----------------------------------------------------------------------
!
USE io_files, ONLY : tmp_dir
USE westcom, ONLY : west_prefix, wstat_save_dir, wstat_output_dir, wstat_restart_dir
!
IMPLICIT NONE
!
wstat_save_dir = TRIM( tmp_dir ) // TRIM( west_prefix ) // '.wstat.save'
wstat_output_dir = TRIM( tmp_dir ) // TRIM( west_prefix ) // '.wstat.output'
wstat_restart_dir = TRIM( tmp_dir ) // TRIM( west_prefix ) // '.wstat.restart'
!
END SUBROUTINE
...@@ -1064,9 +1064,9 @@ END SUBROUTINE ...@@ -1064,9 +1064,9 @@ END SUBROUTINE
! !
SUBROUTINE output_a_report(iteration) SUBROUTINE output_a_report(iteration)
! !
USE json_module USE json_module, ONLY : json_file
USE kinds, ONLY : DP USE kinds, ONLY : DP
USE westcom, ONLY : n_pdep_eigen,ev,conv USE westcom, ONLY : n_pdep_eigen,ev,conv,wstat_output_dir
USE west_io , ONLY : serial_table_output USE west_io , ONLY : serial_table_output
USE mp_world, ONLY : mpime,root USE mp_world, ONLY : mpime,root
! !
...@@ -1076,13 +1076,20 @@ SUBROUTINE output_a_report(iteration) ...@@ -1076,13 +1076,20 @@ SUBROUTINE output_a_report(iteration)
INTEGER,INTENT(IN) :: iteration INTEGER,INTENT(IN) :: iteration
CHARACTER(LEN=9) :: pref CHARACTER(LEN=9) :: pref
INTEGER :: ip, ierr INTEGER :: ip, ierr
REAL(DP) :: out_tab(n_pdep_eigen,3) !REAL(DP) :: out_tab(n_pdep_eigen,3)
! !
INTEGER,ALLOCATABLE :: ipert(:), converged(:)
!
ALLOCATE( ipert(n_pdep_eigen), converged(n_pdep_eigen) )
!
converged = 0
DO ip=1,n_pdep_eigen DO ip=1,n_pdep_eigen
out_tab(ip,1) = REAL(ip,DP) !out_tab(ip,1) = REAL(ip,DP)
out_tab(ip,2) = ev(ip) ipert(ip) = ip
out_tab(ip,3) = 0._DP !out_tab(ip,2) = ev(ip)
IF(conv(ip)) out_tab(ip,3) = 1._DP !out_tab(ip,3) = 0._DP
!IF(conv(ip)) out_tab(ip,3) = 1._DP