Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

FoX fortran library in parallel studio 2017 update 4

Sah_A_
Beginner
346 Views

Hi all
I compiled Fox library in Parallel Studio 2017 composer edition update 4 (Successfully). 
In new project I tried to read data from xml (dom_example_2) and there are two errors:

error #6284: There is no matching specific function for this generic function reference.   [ITEM]
error #6678: When the target is an expression it must deliver a pointer result.   [ITEM]

Fox library: https://github.com/andreww/fox
Compiling with Intel(R) Visual Fortran Compiler 17.0.4.210 [IA-32]
OS: Windows 10

****************************************************************************
program dom_example

  use FoX_dom
  implicit none

  type(Node), pointer :: myDoc, p
  type(NodeList), pointer :: parameterList, children
  integer :: i, j

  real :: energy

  ! Load in the document
  myDoc => parseFile("h2o.xml")

  ! Find all the parameters:
  parameterList => getElementsByTagNameNS(myDoc, &
    "http://www.xml-cml.org/schema", "parameter")

  print*, "Found ", getLength(parameterList), " parameters."

  ! Loop over the parameter list. Note that the DOM
  ! counts from zero, not from one.
  do i = 0, getLength(parameterList)-1
    p => item(parameterList, i)
    ! Check for the existence of the attribute we're looking for
    if (hasAttribute(p, "name")) then
      if (getAttribute(p, "name")=="DM.EnergyTolerance") then
        ! The energy is in the text node which is the child of the <scalar> element under this node ...
        ! Check all the children of the node for the <scalar> element.
        children => getChildNodes(p)
        do j = 0, getLength(children)-1
          p => item(children, j)
          if (getLocalName(p) =="scalar") then
            ! This is the scalar node whose child we want:
            call extractDataContent(p, energy)
            print*, "Energy Tolerance is ", energy
          endif
        enddo
      endif
    endif
  enddo

  ! Clear up all allocated memory
  call destroy(myDoc)
end program dom_example

*******************************************************************
Greetings
Sah

0 Kudos
2 Replies
Johannes_Rieke
New Contributor III
346 Views

Dear Sah A., welcome here in this Forum. The example you posted above works OK for me with PSXE 17 Up4. If you like to get help, you need to supply your program 'dom_example_2' and a valid XML for testing. Without this its hard to say what causes the errors above...

0 Kudos
Sah_A_
Beginner
346 Views

Thank you Johannes. I found what was the problem.
In Fox xml library project I had settings in Fortran->Data-> Default integer KIND =8, but in my test project it was Default Integer KIND=4.
When I changed settings in test project to Default Integer KIND=8 everything is fine.

0 Kudos
Reply