Commit f038d40a authored by giannozz's avatar giannozz

Merge branch 'adding_lumo_to_xml' into 'develop'

adding LUMO value to band structure when available

See merge request QEF/q-e!320
parents ffc001fa 1f88e906
......@@ -2080,6 +2080,9 @@ MODULE qes_bcast_module
CALL mp_bcast(obj%highestOccupiedLevel_ispresent, ionode_id, comm)
IF (obj%highestOccupiedLevel_ispresent) &
CALL mp_bcast(obj%highestOccupiedLevel, ionode_id, comm)
CALL mp_bcast(obj%lowestUnoccupiedLevel_ispresent, ionode_id, comm)
IF (obj%lowestUnoccupiedLevel_ispresent) &
CALL mp_bcast(obj%lowestUnoccupiedLevel, ionode_id, comm)
CALL mp_bcast(obj%two_fermi_energies_ispresent, ionode_id, comm)
IF (obj%two_fermi_energies_ispresent) &
CALL mp_bcast(obj%two_fermi_energies, ionode_id, comm)
......
......@@ -2898,7 +2898,7 @@ MODULE qes_init_module
SUBROUTINE qes_init_band_structure(obj, tagname, lsda, noncolin, spinorbit, nelec, wf_collected,&
starting_k_points, nks, occupations_kind, ks_energies, nbnd,&
nbnd_up, nbnd_dw, num_of_atomic_wfc, fermi_energy, highestOccupiedLevel,&
two_fermi_energies, smearing)
lowestUnoccupiedLevel, two_fermi_energies, smearing)
!
IMPLICIT NONE
!
......@@ -2915,6 +2915,7 @@ MODULE qes_init_module
LOGICAL,INTENT(IN) :: wf_collected
REAL(DP),OPTIONAL,INTENT(IN) :: fermi_energy
REAL(DP),OPTIONAL,INTENT(IN) :: highestOccupiedLevel
REAL(DP),OPTIONAL,INTENT(IN) :: lowestUnoccupiedLevel
REAL(DP), DIMENSION(2),OPTIONAL,INTENT(IN) :: two_fermi_energies
TYPE(k_points_IBZ_type),INTENT(IN) :: starting_k_points
INTEGER,INTENT(IN) :: nks
......@@ -2967,6 +2968,12 @@ MODULE qes_init_module
ELSE
obj%highestOccupiedLevel_ispresent = .FALSE.
END IF
IF ( PRESENT(lowestUnoccupiedLevel)) THEN
obj%lowestUnoccupiedLevel_ispresent = .TRUE.
obj%lowestUnoccupiedLevel = lowestUnoccupiedLevel
ELSE
obj%lowestUnoccupiedLevel_ispresent = .FALSE.
END IF
IF ( PRESENT(two_fermi_energies)) THEN
obj%two_fermi_energies_ispresent = .TRUE.
obj%two_fermi_energies = two_fermi_energies
......
......@@ -10211,6 +10211,34 @@ MODULE qes_read_module
obj%highestOccupiedLevel_ispresent = .FALSE.
END IF
!
tmp_node_list => getElementsByTagname(xml_node, "lowestUnoccupiedLevel")
tmp_node_list_size = getLength(tmp_node_list)
!
IF (tmp_node_list_size > 1) THEN
IF (PRESENT(ierr) ) THEN
CALL infomsg("qes_read:band_structureType","lowestUnoccupiedLevel: too many occurrences")
ierr = ierr + 1
ELSE
CALL errore("qes_read:band_structureType","lowestUnoccupiedLevel: too many occurrences",10)
END IF
END IF
!
IF (tmp_node_list_size>0) THEN
obj%lowestUnoccupiedLevel_ispresent = .TRUE.
tmp_node => item(tmp_node_list, 0)
CALL extractDataContent(tmp_node, obj%lowestUnoccupiedLevel , IOSTAT = iostat_)
IF ( iostat_ /= 0 ) THEN
IF ( PRESENT (ierr ) ) THEN
CALL infomsg("qes_read:band_structureType","error reading lowestUnoccupiedLevel")
ierr = ierr + 1
ELSE
CALL errore ("qes_read:band_structureType","error reading lowestUnoccupiedLevel",10)
END IF
END IF
ELSE
obj%lowestUnoccupiedLevel_ispresent = .FALSE.
END IF
!
tmp_node_list => getElementsByTagname(xml_node, "two_fermi_energies")
tmp_node_list_size = getLength(tmp_node_list)
!
......
......@@ -1574,6 +1574,7 @@ MODULE qes_reset_module
obj%num_of_atomic_wfc_ispresent = .FALSE.
obj%fermi_energy_ispresent = .FALSE.
obj%highestOccupiedLevel_ispresent = .FALSE.
obj%lowestUnoccupiedLevel_ispresent = .FALSE.
obj%two_fermi_energies_ispresent = .FALSE.
CALL qes_reset_k_points_IBZ(obj%starting_k_points)
CALL qes_reset_occupations(obj%occupations_kind)
......
......@@ -1251,6 +1251,8 @@ MODULE qes_types_module
REAL(DP) :: fermi_energy
LOGICAL :: highestOccupiedLevel_ispresent = .FALSE.
REAL(DP) :: highestOccupiedLevel
LOGICAL :: lowestUnoccupiedLevel_ispresent = .FALSE.
REAL(DP) :: lowestUnoccupiedLevel
LOGICAL :: two_fermi_energies_ispresent = .FALSE.
REAL(DP), DIMENSION(2) :: two_fermi_energies
TYPE(k_points_IBZ_type) :: starting_k_points
......
......@@ -2337,6 +2337,11 @@ MODULE qes_write_module
CALL xml_addCharacters(xp, obj%highestOccupiedLevel, fmt='s16')
CALL xml_EndElement(xp, "highestOccupiedLevel")
END IF
IF (obj%lowestUnoccupiedLevel_ispresent) THEN
CALL xml_NewElement(xp, "lowestUnoccupiedLevel")
CALL xml_addCharacters(xp, obj%lowestUnoccupiedLevel, fmt='s16')
CALL xml_EndElement(xp, "lowestUnoccupiedLevel")
END IF
IF (obj%two_fermi_energies_ispresent) THEN
CALL xml_NewElement(xp, "two_fermi_energies")
CALL xml_addCharacters(xp, obj%two_fermi_energies, fmt='s16')
......
......@@ -1107,7 +1107,7 @@ CONTAINS
NKS = ndim_ks_energies, OCCUPATIONS_KIND = occupations_kind, KS_ENERGIES = ks_objs, &
NBND_UP = nbnd_up_opt, NBND_DW = nbnd_dw_opt, NUM_OF_ATOMIC_WFC = n_wfc_at, &
FERMI_ENERGY = fermi_energy, HIGHESTOCCUPIEDLEVEL = homo, TWO_FERMI_ENERGIES = ef_updw, &
SMEARING = smearing)
SMEARING = smearing, LOWESTUNOCCUPIEDLEVEL = lumo)
DO ik=1,ndim_ks_energies
CALL qes_reset(ks_objs(ik))
END DO
......
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