XML: improved the write out of starting_k and other fields which currently must be read on restart. This improvement seems to solve some issues related reading info from non self consistent computations started by phonon and other linear response codes

git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13697 c92efa57-630b-4861-b058-cf58834340f0
This commit is contained in:
pietrodelugas 2017-08-07 10:53:12 +00:00
parent c99f3bde29
commit 4f47d85348
4 changed files with 80 additions and 15 deletions

View File

@ -1805,6 +1805,13 @@ MODULE qes_read_module
END IF
END IF
!
IF (hasAttribute(xml_node, "pseudo_dir")) THEN
CALL extractDataAttribute(xml_node, "pseudo_dir", obj%pseudo_dir)
obj%pseudo_dir_ispresent = .TRUE.
ELSE
obj%pseudo_dir_ispresent = .FALSE.
END IF
!
!
!
!
@ -3161,15 +3168,15 @@ MODULE qes_read_module
IF (hasAttribute(xml_node, "rank")) THEN
CALL extractDataAttribute(xml_node, "rank", obj%rank)
ELSE
CALL errore ("qes_read: Hubbard_nsType", &
"mandatory rank attribute not found in "//TRIM(obj%tagname), 12)
CALL errore ("qes_read: Hubbard_nsType",&
"required attribute rank not found, can't read further, stopping", 10 )
END IF
ALLOCATE (obj%dims(obj%rank))
IF (hasAttribute(xml_node, "dims")) THEN
CALL extractDataAttribute(xml_node, "dims", obj%dims)
ELSE
CALL errore ("qes_read: Hubbard_nsType", &
"mandatory dims attribute not found in "//TRIM(obj%tagname), 13)
CALL errore ("qes_read: Hubbard_nsType",&
"required attribute dims not found, can't read further, stopping", 10 )
END IF
IF (hasAttribute(xml_node,"order")) THEN
CALL extractDataAttribute(xml_node, "order", obj%order)
@ -9105,6 +9112,7 @@ MODULE qes_read_module
!
!
!
!
ALLOCATE (obj%vector(obj%size))
CALL extractDataContent(xml_node, obj%vector )
!
@ -9138,6 +9146,7 @@ MODULE qes_read_module
!
!
!
!
ALLOCATE (obj%integerVector(obj%size))
CALL extractDataContent(xml_node, obj%integerVector)
!
@ -9166,15 +9175,15 @@ MODULE qes_read_module
IF (hasAttribute(xml_node, "rank")) THEN
CALL extractDataAttribute(xml_node, "rank", obj%rank)
ELSE
CALL errore ("qes_read: matrixType", &
"mandatory rank attribute not found in "//TRIM(obj%tagname), 12)
CALL errore ("qes_read: matrixType",&
"required attribute rank not found, can't read further, stopping", 10 )
END IF
ALLOCATE (obj%dims(obj%rank))
IF (hasAttribute(xml_node, "dims")) THEN
CALL extractDataAttribute(xml_node, "dims", obj%dims)
ELSE
CALL errore ("qes_read: matrixType", &
"mandatory dims attribute not found in "//TRIM(obj%tagname), 13)
CALL errore ("qes_read: matrixType",&
"required attribute dims not found, can't read further, stopping", 10 )
END IF
IF (hasAttribute(xml_node,"order")) THEN
CALL extractDataAttribute(xml_node, "order", obj%order)
@ -9216,15 +9225,15 @@ MODULE qes_read_module
IF (hasAttribute(xml_node, "rank")) THEN
CALL extractDataAttribute(xml_node, "rank", obj%rank)
ELSE
CALL errore ("qes_read: integerMatrixType", &
"mandatory rank attribute not found in "//TRIM(obj%tagname), 12)
CALL errore ("qes_read: integerMatrixType",&
"required attribute rank not found, can't read further, stopping", 10 )
END IF
ALLOCATE (obj%dims(obj%rank))
IF (hasAttribute(xml_node, "dims")) THEN
CALL extractDataAttribute(xml_node, "dims", obj%dims)
ELSE
CALL errore ("qes_read: integerMatrixType", &
"mandatory dims attribute not found in "//TRIM(obj%tagname), 13)
CALL errore ("qes_read: integerMatrixType",&
"required attribute dims not found, can't read further, stopping", 10 )
END IF
IF (hasAttribute(xml_node,"order")) THEN
CALL extractDataAttribute(xml_node, "order", obj%order)

View File

@ -66,7 +66,9 @@ MODULE qexsd_module
TYPE (parallel_info_type) :: parallel_info
TYPE (berryPhaseOutput_type) :: qexsd_bp_obj
TYPE (dipoleOutput_type ) :: qexsd_dipol_obj
TYPE (k_points_IBZ_type) :: qexsd_startk_store_obj
TYPE (k_points_IBZ_type) :: qexsd_start_k_obj
TYPE (occupations_type) :: qexsd_occ_obj
TYPE (smearing_type) :: qexsd_smear_obj
TYPE ( step_type),ALLOCATABLE :: steps(:)
INTEGER :: exit_status
TYPE ( closed_type ) :: qexsd_closed_element
@ -78,7 +80,7 @@ MODULE qexsd_module
PUBLIC :: qexsd_current_version_init
PUBLIC :: qexsd_xf
!
PUBLIC :: qexsd_input_obj
PUBLIC :: qexsd_input_obj, qexsd_start_k_obj, qexsd_occ_obj, qexsd_smear_obj
!
PUBLIC :: qexsd_init_schema, qexsd_openschema, qexsd_closeschema
!

View File

@ -713,6 +713,53 @@ MODULE qexsd_input
END SUBROUTINE qexsd_init_atomic_constraints
!
!------------------------------------------------------------------------------------------------------------
SUBROUTINE qexsd_init_occupations(obj, occupations, nspin)
!------------------------------------------------------------------------------------------------------------
!
IMPLICIT NONE
TYPE(occupations_type),INTENT(OUT) :: obj
CHARACTER(LEN=*),INTENT(IN) :: occupations
INTEGER,INTENT(IN) :: nspin
!
INTEGER :: spin_degeneracy
!
IF (nspin .GT. 1) THEN
spin_degeneracy = 1
ELSE
spin_degeneracy = 2
END IF
CALL qes_init_occupations(obj, "occupations", spin= spin_degeneracy, &
spin_ispresent =.FALSE., occupations = TRIM(occupations))
END SUBROUTINE qexsd_init_occupations
!
!---------------------------------------------------------
SUBROUTINE qexsd_init_smearing(obj, smearing, degauss)
!---------------------------------------------------------
!
IMPLICIT NONE
TYPE(smearing_type),INTENT(OUT) :: obj
CHARACTER(LEN = * ), INTENT(IN) :: smearing
REAL(DP),INTENT(IN) :: degauss
!
CHARACTER(LEN=256) :: smearing_local
SELECT CASE (TRIM (smearing))
CASE ("gaussian", "gauss")
smearing_local="gaussian"
CASE ('methfessel-paxton', 'm-p', 'mp')
smearing_local="mp"
CASE ( 'marzari-vanderbilt', 'cold', 'm-v', 'mv')
smearing_local="mv"
CASE ('fermi-dirac', 'f-d', 'fd')
smearing_local="fd"
CASE default
smearing_local='not set'
END SELECT
CALL qes_init_smearing(obj,"smearing",degauss=degauss,smearing=smearing_local)
!
END SUBROUTINE qexsd_init_smearing
!--------------------------------------------------------------------------------------------
!
END MODULE qexsd_input
!
#endif

View File

@ -1152,7 +1152,14 @@ MODULE pw_restart_new
IF ( atomic_structure%alat_ispresent ) alat = atomic_structure%alat
tau(:,1:nat) = tau(:,1:nat)/alat
!
pseudo_dir_cur = TRIM (dirname)
IF ( atomic_species%pseudo_dir_ispresent) THEN
pseudo_dir = TRIM(atomic_species%pseudo_dir)
print *, "I have found pseudo dir:"// TRIM(pseudo_dir)
ELSE
pseudo_dir = TRIM (dirname)
print *, " I havent found pseudo dir:" // trim(pseudo_dir)
END IF
pseudo_dir_cur = pseudo_dir
!
END SUBROUTINE readschema_ions
!