Commit b0526f71 authored by Gregor Michalicek's avatar Gregor Michalicek

Replaced STOPs in io/xmlIntWrapFort.f90 by juDFT_error calls

parent dd608d2d
...@@ -13,6 +13,8 @@ ...@@ -13,6 +13,8 @@
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
MODULE m_xmlIntWrapFort MODULE m_xmlIntWrapFort
USE m_juDFT
CONTAINS CONTAINS
SUBROUTINE xmlInitInterface() SUBROUTINE xmlInitInterface()
...@@ -32,7 +34,9 @@ SUBROUTINE xmlInitInterface() ...@@ -32,7 +34,9 @@ SUBROUTINE xmlInitInterface()
errorStatus = 0 errorStatus = 0
errorStatus = initializeXMLInterface() errorStatus = initializeXMLInterface()
IF(errorStatus.NE.0) STOP 'Error!' IF(errorStatus.NE.0) THEN
CALL juDFT_error("Could not initialize XML interface.",calledby="xmlInitInterface")
END IF
END SUBROUTINE xmlInitInterface END SUBROUTINE xmlInitInterface
...@@ -58,8 +62,7 @@ SUBROUTINE xmlParseSchema(schemaFilename) ...@@ -58,8 +62,7 @@ SUBROUTINE xmlParseSchema(schemaFilename)
errorStatus = 0 errorStatus = 0
errorStatus = parseXMLSchema(schemaFilename) errorStatus = parseXMLSchema(schemaFilename)
IF(errorStatus.NE.0) THEN IF(errorStatus.NE.0) THEN
WRITE(*,*) 'Parsing xml schema file ', TRIM(ADJUSTL(schemaFilename)) CALL juDFT_error("XML Schema file not parsable: "//TRIM(ADJUSTL(schemaFilename)),calledby="xmlParseSchema")
STOP 'Error: xml Schema file not parsable!'
END IF END IF
END SUBROUTINE xmlParseSchema END SUBROUTINE xmlParseSchema
...@@ -86,8 +89,7 @@ SUBROUTINE xmlParseDoc(docFilename) ...@@ -86,8 +89,7 @@ SUBROUTINE xmlParseDoc(docFilename)
errorStatus = 0 errorStatus = 0
errorStatus = parseXMLDocument(docFilename) errorStatus = parseXMLDocument(docFilename)
IF(errorStatus.NE.0) THEN IF(errorStatus.NE.0) THEN
WRITE(*,*) 'Parsing xml document file ', TRIM(ADJUSTL(docFilename)) CALL juDFT_error("XML document file not parsable: "//TRIM(ADJUSTL(docFilename)),calledby="xmlParseDoc")
STOP 'Error: xml document file not parsable!'
END IF END IF
END SUBROUTINE xmlParseDoc END SUBROUTINE xmlParseDoc
...@@ -111,7 +113,7 @@ SUBROUTINE xmlValidateDoc() ...@@ -111,7 +113,7 @@ SUBROUTINE xmlValidateDoc()
errorStatus = 0 errorStatus = 0
errorStatus = validateXMLDocument() errorStatus = validateXMLDocument()
IF(errorStatus.NE.0) THEN IF(errorStatus.NE.0) THEN
STOP 'Error: xml document does not validate!' CALL juDFT_error("XML document cannot be validated against Schema.",calledby="xmlValidateDoc")
END IF END IF
END SUBROUTINE xmlValidateDoc END SUBROUTINE xmlValidateDoc
...@@ -134,7 +136,9 @@ SUBROUTINE xmlInitXPath() ...@@ -134,7 +136,9 @@ SUBROUTINE xmlInitXPath()
errorStatus = 0 errorStatus = 0
errorStatus = initializeXPath() errorStatus = initializeXPath()
IF(errorStatus.NE.0) STOP 'Error!' IF(errorStatus.NE.0) THEN
CALL juDFT_error("Could not initialize XPath.",calledby="xmlInitXPath")
END IF
END SUBROUTINE xmlInitXPath END SUBROUTINE xmlInitXPath
...@@ -188,7 +192,9 @@ FUNCTION xmlGetAttributeValue(xPath) ...@@ -188,7 +192,9 @@ FUNCTION xmlGetAttributeValue(xPath)
CALL C_F_POINTER(c_string, valueFromC, [ 255 ]) CALL C_F_POINTER(c_string, valueFromC, [ 255 ])
IF (.NOT.c_associated(c_string)) THEN IF (.NOT.c_associated(c_string)) THEN
STOP 'null returned!' WRITE(*,*) 'Error in trying to obtain attribute value from XPath:'
WRITE(*,*) TRIM(ADJUSTL(xPath))
CALL juDFT_error("Attribute value could not be obtained.",calledby="xmlGetAttributeValue")
END IF END IF
DO i=1, 255 DO i=1, 255
value(i:i) = valueFromC(i) value(i:i) = valueFromC(i)
...@@ -217,7 +223,10 @@ SUBROUTINE xmlFreeResources() ...@@ -217,7 +223,10 @@ SUBROUTINE xmlFreeResources()
errorStatus = 0 errorStatus = 0
errorStatus = freeXMLResources() errorStatus = freeXMLResources()
IF(errorStatus.NE.0) STOP 'Error!' IF(errorStatus.NE.0) THEN
CALL juDFT_error("Could not free XML resources.",calledby="xmlFreeResources")
STOP 'Error!'
END IF
END SUBROUTINE xmlFreeResources END SUBROUTINE xmlFreeResources
......
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