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

Call Error

JohnNichols
Valued Contributor III
642 Views
Steve:
I fixed the WULF program for the stack error. Thanks for the help.  
​I tried to put a note of thanks and a picture on this forum but it got lost again.
​First call to PXFCDDIR fails. IFPOSIX - as use statement does not work either.
John
!      ****************************************************************
!     
      subroutine chdirA(i)
!
!      ****************************************************************
      
      
      use IFPORT
      implicit none


      CHARACTER(len=255) :: path
      integer i,ilen, ierror
    
    
      CALL PXFGETCWD (path,ilen,ierror)
      WRITE(*,*) TRIM(path)
      call PXFCHDIR("C:\",3,i)
      call PXFCHDIR("users\macne\documents\Visual Studio 2013\Projects\Program070 - Beams\Lothurr",76,i)
       write(*,*)i
       CALL PXFGETCWD (path,ilen,ierror)
       WRITE(*,*) TRIM(path)
       return 
       end subroutine

 

0 Kudos
7 Replies
JohnNichols
Valued Contributor III
642 Views

 

Picture of error

Steve: The other picture is the result from the FFT analysis. This is based on Kappler's 1931 research in Germany on vibration due a differential number of atoms hitting the surface causing vibration.  The movement is 10 billionth of a meter.  Picture is acceleration

Thanks for the help

John

0 Kudos
JohnNichols
Valued Contributor III
642 Views

I also worked out the incorrect posts occur when I upload a picture in a post that creates a new topic.

Ying from the MKL pointed out the error - this code came in part from the MKL examples, perhaps these could be adjusted.

John

0 Kudos
JohnNichols
Valued Contributor III
642 Views

This is where I got the code from

0 Kudos
mecej4
Honored Contributor III
642 Views

The second argument to PFXCHDIR is the length of the input string, which is the first argument, as you can see from the documentation at https://software.intel.com/en-us/node/580986.

In your code of #1, before line-21 insert "      ilen=255".

0 Kudos
jimdempseyatthecove
Honored Contributor III
642 Views

Although the documentation does not state this, try concatenating a null character to your directory string (do not count it).

call PXFCHDIR("users\macne\documents\Visual Studio 2013\Projects\Program070 - Beams\Lothurr"//char(0),76,i)

(and elsewhere on calls)

Jim Dempsey

0 Kudos
JohnNichols
Valued Contributor III
642 Views

Thanks you for the comments - the interesting issue is the code works perfectly in a program by itself, it just stops working when I turn the program into a subroutine and call it.

 

0 Kudos
JohnNichols
Valued Contributor III
642 Views

Guys:

The following code works perfectly - just not as subroutine - WULF was not fixed with the suggested changes

 !  ChDir - Entry point of console application.
    !

    !****************************************************************************
    !
    !  PROGRAM: ChDir
    !
    !  PURPOSE:  Entry point for the console application.
    !
    !****************************************************************************

    program ChDir

    use IFPORT
    implicit none


    CHARACTER(len=255) :: path
    integer i,ilen, ierror
    ilen = 255
    
    CALL PXFGETCWD (path,ilen,ierror)
    WRITE(*,*) TRIM(path)
    call PXFCHDIR("C:\",3,i)
    call PXFCHDIR("users\macne\documents\Visual Studio 2013\Projects\Program070 - Beams\Lothurr",76,i)
    write(*,*)i
    CALL PXFGETCWD (path,ilen,ierror)
    WRITE(*,*) TRIM(path)




    end program ChDir

 

0 Kudos
Reply