Commit f12b1f6b authored by Gregor Michalicek's avatar Gregor Michalicek

Fix segfault if juDFT_stop is called from inpgen

parent 2b91d79b
...@@ -22,6 +22,7 @@ MODULE m_xmlOutput ...@@ -22,6 +22,7 @@ MODULE m_xmlOutput
INTEGER, SAVE :: currentElementIndex INTEGER, SAVE :: currentElementIndex
INTEGER, SAVE :: maxNumElements INTEGER, SAVE :: maxNumElements
INTEGER, SAVE :: xmlOutputUnit INTEGER, SAVE :: xmlOutputUnit
LOGICAL, SAVE :: xmlOpened = .FALSE.
CHARACTER(LEN= 40), ALLOCATABLE :: elementList(:) CHARACTER(LEN= 40), ALLOCATABLE :: elementList(:)
PUBLIC startXMLOutput, endXMLOutput PUBLIC startXMLOutput, endXMLOutput
...@@ -86,6 +87,7 @@ MODULE m_xmlOutput ...@@ -86,6 +87,7 @@ MODULE m_xmlOutput
ELSE ELSE
OPEN (xmlOutputUnit,file='out.xml',form='formatted',status='unknown') OPEN (xmlOutputUnit,file='out.xml',form='formatted',status='unknown')
ENDIF ENDIF
xmlOpened = .TRUE.
WRITE (xmlOutputUnit,'(a)') '<?xml version="1.0" encoding="UTF-8" standalone="no"?>' WRITE (xmlOutputUnit,'(a)') '<?xml version="1.0" encoding="UTF-8" standalone="no"?>'
WRITE (xmlOutputUnit,'(a)') '<fleurOutput fleurOutputVersion="0.27">' WRITE (xmlOutputUnit,'(a)') '<fleurOutput fleurOutputVersion="0.27">'
CALL openXMLElement('programVersion',(/'version'/),(/version_const/)) CALL openXMLElement('programVersion',(/'version'/),(/version_const/))
...@@ -150,6 +152,7 @@ MODULE m_xmlOutput ...@@ -150,6 +152,7 @@ MODULE m_xmlOutput
CHARACTER(LEN=10) :: dateString CHARACTER(LEN=10) :: dateString
CHARACTER(LEN=10) :: timeString CHARACTER(LEN=10) :: timeString
IF (.NOT.xmlOpened) RETURN
DO WHILE (currentElementIndex.NE.0) DO WHILE (currentElementIndex.NE.0)
CALL closeXMLElement(elementList(currentElementIndex)) CALL closeXMLElement(elementList(currentElementIndex))
END DO 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