Some more xml cleanup: routines writing the xml file collected into the

same region of code; comments better explaining what is going on
This commit is contained in:
Paolo Giannozzi 2019-08-10 15:10:21 +02:00
parent ea0d58461b
commit 60ca6eff36
4 changed files with 35 additions and 31 deletions

View File

@ -269,22 +269,9 @@ MODULE cp_restart_new
! ... HEADER
!-------------------------------------------------------------------------------
!
CALL qexsd_openschema(TRIM( dirname ) // TRIM( xmlpun_schema ), &
iunpun, 'CPV', title)
output_obj%tagname="output"
output_obj%lwrite = .TRUE.
!-------------------------------------------------------------------------------
! ... CP-SPECIFIC CELL variables
!-------------------------------------------------------------------------------
!
CALL cp_writecp( qexsd_xf, nfi, simtime, ekin, eht, esr, eself, &
epseu, enl, exc, vave, enthal, acc, stau0, svel0, taui, cdmi,&
force, nhpcl, nhpdim, xnhp0, vnhp, ekincm, xnhe0, vnhe, ht,&
htvel, gvel, xnhh0, vnhh, staum, svelm, xnhpm, xnhem, htm, xnhhm)
! Wannier function centers
IF ( lwf ) CALL cp_writecenters ( qexsd_xf, h, wfc)
!
!-------------------------------------------------------------------------------
! ... CONVERGENCE_INFO - TO BE VERIFIED
!-------------------------------------------------------------------------------
!! @note set lwrite to false for this element P. Delugas
@ -451,15 +438,26 @@ MODULE cp_restart_new
! ... ACTUAL WRITING
!-------------------------------------------------------------------------------
!
CALL qexsd_openschema(TRIM( dirname ) // TRIM( xmlpun_schema ), &
iunpun, 'CPV', title)
CALL qes_write (qexsd_xf, output_obj)
CALL qes_reset (output_obj)
!
!-------------------------------------------------------------------------------
! ... CLOSING
!-------------------------------------------------------------------------------
! CP-SPECIFIC CELL variables
!
CALL cp_writecp( qexsd_xf, nfi, simtime, ekin, eht, esr, eself, &
epseu, enl, exc, vave, enthal, acc, stau0, svel0, taui, cdmi,&
force, nhpcl, nhpdim, xnhp0, vnhp, ekincm, xnhe0, vnhe, ht,&
htvel, gvel, xnhh0, vnhh, staum, svelm, xnhpm, xnhem, htm, xnhhm)
!
! Wannier function centers
!
IF ( lwf ) CALL cp_writecenters ( qexsd_xf, h, wfc)
!
CALL qexsd_closeschema()
!
!-------------------------------------------------------------------------------
!
END IF
!
!-------------------------------------------------------------------------------
@ -703,8 +701,12 @@ MODULE cp_restart_new
IF (.NOT. found ) &
CALL errore ('cp_readfile', 'xml data file not found', 1)
!
! read XML file into "root" object
!
root => parseFile (TRIM(filename))
!
! copy from "root" object into geninfo, parinfo, output objs
!
nodePointer => item (getElementsByTagname (root, "general_info"),0)
ierr = 0
IF (ASSOCIATED(nodePointer)) THEN
@ -728,6 +730,7 @@ MODULE cp_restart_new
END IF
IF ( ierr > 100) CALL errore ('cp_readfile', 'missing data in file', ierr)
!
! copy CP-specific MD information directly into variables
!
CALL cp_readcp ( root, nat, nfi, simtime, acc, stau0, svel0, taui, &
cdmi, force, nhpcl, nhpdim, xnhp0, vnhp, ekincm, xnhe0, vnhe, ht,&
@ -738,12 +741,16 @@ MODULE cp_restart_new
!
ierr = 0
!
! Wannier function centers
! copy Wannier function centers information directly into variables
!
IF ( lwf ) CALL cp_readcenters ( root, wfc)
!
ierr = 0
!
CALL destroy (root)
!
! objects filled, not get variables from objects
!
CALL qexsd_copy_geninfo (geninfo_obj, qexsd_fmt, qexsd_version)
!
CALL qexsd_copy_parallel_info (parinfo_obj, nproc_file, &

View File

@ -11,17 +11,17 @@ MODULE qexsd_module
! This module contains some common subroutines used to read and write
! in XML format the data produced by Quantum ESPRESSO package.
!
! Written by Giovanni Borghi, A. Ferretti, ... (2015).
!
! Based on the qexml.f90 routine:
! Written by Andrea Ferretti (2006).
! Initial work by Carlo Sbraccia (xml_io_base.f90)
! Based on the qexml.f90 routines written by Andrea Ferretti (2006).
! Modified by Simone Ziraldo (2013).
! Rewritten by Giovanni Borghi, A. Ferretti, et al. (2015).
! Heavily modified by Pietro Delugas and Paolo Giannozzi (2016 on)
!
!
USE kinds, ONLY : DP
USE input_parameters, ONLY : input_xml_schema_file
USE mp_world, ONLY : nproc
USE mp_images, ONLY : nimage,nproc_image
USE mp_images, ONLY : nimage,nproc_image
USE mp_pools, ONLY : npool
USE mp_bands, ONLY : ntask_groups, nproc_bgrp, nbgrp
USE global_version, ONLY: version_number, svn_revision

View File

@ -235,8 +235,6 @@ MODULE pw_restart_new
! ... HEADER
!-------------------------------------------------------------------------------
!
CALL qexsd_openschema(TRIM( dirname ) // TRIM( xmlpun_schema ), &
iunpun, 'PWSCF', title )
output%tagname="output"
output%lwrite = .TRUE.
output%lread = .TRUE.
@ -656,20 +654,19 @@ MODULE pw_restart_new
NULLIFY(dipol_ptr)
ENDIF
NULLIFY ( bp_obj_ptr)
!------------------------------------------------------------------------------------------------
!-------------------------------------------------------------------------------
! ... ACTUAL WRITING
!-------------------------------------------------------------------------------
10 CONTINUE
!
CALL qexsd_openschema(TRIM( dirname ) // TRIM( xmlpun_schema ), &
iunpun, 'PWSCF', title )
CALL qes_write (qexsd_xf,output)
CALL qes_reset (output)
!
!-------------------------------------------------------------------------------
! ... CLOSING
!-------------------------------------------------------------------------------
!
CALL qexsd_closeschema()
!
!-------------------------------------------------------------------------------
!
END IF
DEALLOCATE (ngk_g)
!

View File

@ -54,7 +54,7 @@ SUBROUTINE wfcinit()
CALL open_buffer( iunwfc, 'wfc', nwordwfc, io_level, exst_mem, exst_file )
!
IF ( TRIM(starting_wfc) == 'file') THEN
CALL pw_read_schema(IERR = ierr, RESTART_OUTPUT = output_obj )
CALL pw_read_schema( ierr, output_obj )
IF ( ierr == 0 ) THEN
twfcollect_file = output_obj%band_structure%wf_collected
dirname = TRIM( tmp_dir ) // TRIM( prefix ) // postfix