Commit f8dbfd9c authored by Daniel Wortmann's avatar Daniel Wortmann

More additions to io

parent 734a94db
This diff is collapsed.
......@@ -19,15 +19,10 @@ MODULE m_types_xml
TYPE t_xml
INTEGER:: id
CONTAINS
PROCEDURE,NOPASS :: InitInterface
PROCEDURE,NOPASS :: ParseSchema
PROCEDURE,NOPASS :: ParseDoc
PROCEDURE,NOPASS :: ValidateDoc
PROCEDURE,NOPASS :: InitXPath
PROCEDURE :: init
PROCEDURE,NOPASS :: GetNumberOfNodes
PROCEDURE,NOPASS :: SetAttributeValue
PROCEDURE,NOPASS :: GetAttributeValue
PROCEDURE,NOPASS :: FreeResources
PROCEDURE :: read_q_list
PROCEDURE,NOPASS :: popFirstStringToken
PROCEDURE,NOPASS :: countStringTokens
......@@ -42,6 +37,54 @@ MODULE m_types_xml
PUBLIC t_xml,evaluateFirstOnly,EvaluateFirst,evaluateFirstBool,evaluateFirstBoolOnly,evaluateFirstInt,evaluateFirstIntOnly
CONTAINS
SUBROUTINE init(xml)
USE iso_c_binding
CLASS(t_xml),INTENT(IN)::xml
INTEGER :: errorStatus
CHARACTER(LEN=200,KIND=c_char) :: schemaFilename, docFilename
INTEGER :: i,numberNodes
CHARACTER(LEN=255) :: xPathA,xPathB,valueString,versionString
REAL :: tempReal
INTERFACE
FUNCTION dropInputSchema() BIND(C, name="dropInputSchema")
USE iso_c_binding
INTEGER(c_int) dropInputSchema
END FUNCTION dropInputSchema
END INTERFACE
errorStatus = 0
errorStatus = dropInputSchema()
IF(errorStatus.NE.0) THEN
CALL juDFT_error('Error: Cannot print out FleurInputSchema.xsd')
END IF
schemaFilename = "FleurInputSchema.xsd"//C_NULL_CHAR
docFilename = "inp.xml"//C_NULL_CHAR
CALL xmlInitInterface()
CALL xmlParseSchema(schemaFilename)
CALL xmlParseDoc(docFilename)
CALL xmlValidateDoc()
CALL xmlInitXPath()
! Check version of inp.xml
versionString = xml%GetAttributeValue('/fleurInput/@fleurInputVersion')
IF((TRIM(ADJUSTL(versionString)).NE.'0.30')) THEN
CALL juDFT_error('version number of inp.xml file is not compatible with this fleur version')
END IF
! Read in constants
xPathA = '/fleurInput/constants/constant'
numberNodes = xmlGetNumberOfNodes(xPathA)
DO i = 1, numberNodes
WRITE(xPathB,*) TRIM(ADJUSTL(xPathA)), '[',i,']'
tempReal = evaluateFirstOnly(xml%GetAttributeValue(TRIM(ADJUSTL(xPathB))//'/@value'))
valueString = xml%GetAttributeValue(TRIM(ADJUSTL(xPathB))//'/@name')
CALL ASSIGN_var(valueString,tempReal)
END DO
END SUBROUTINE init
INTEGER FUNCTION get_lmaxd(xml)
CLASS(t_xml),INTENT(IN)::xml
INTEGER :: n
......
......@@ -27,6 +27,7 @@ MODULE m_types_cell
REAL::volint
CONTAINS
PROCEDURE :: init
procedure :: read_xml=>read_xml_cell
END TYPE t_cell
PUBLIC t_cell
CONTAINS
......@@ -60,7 +61,7 @@ MODULE m_types_cell
cell%aamat=matmul(transpose(cell%amat),cell%amat)
END SUBROUTINE init
subroutine read_xml(cell,xml)
SUBROUTINE read_xml_cell(cell,xml)
use m_types_xml
class(t_cell),intent(out)::cell
type(t_xml),intent(in) ::xml
......@@ -93,11 +94,13 @@ MODULE m_types_cell
cell%amat(2,3) = evaluateFirst(valueString)
cell%amat(3,3) = evaluateFirst(valueString)
IF (dvac>0) cell%amat(3,3)=dtild
IF (dvac>0) THEN
cell%amat(3,3)=dtild
cell%z1=dvac
ENDIF
cell%amat=cell%amat*scale
call cell%init(dvac)
end subroutine read_xml
END SUBROUTINE read_xml_cell
END MODULE m_types_cell
......@@ -83,6 +83,9 @@ CONTAINS
enpara%qn_ello(lo,n,:)=-1*enpara%qn_ello(lo,n,:)
END DO
END DO
!Read vacuum
END SUBROUTINE read_xml_enpara
SUBROUTINE set_quantum_numbers(enpara,ntype,atoms,str,lo)
......
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