Quantcast
Channel: Intel® Software - Intel® Visual Fortran Compiler for Windows*
Viewing all articles
Browse latest Browse all 5691

Problems with replacing statement functions

$
0
0

Hi,

I am modernizing legacy code, replacing statement functions through internal functions. While compiling the files individually no error occurs. If I am trying to rebuild the project or compile them all together I am getting link error lnk2019 and lnk1120, telling me the subroutine above calling the subroutine test1 containing the internal function can not link.

If I am using the statement function everything works fine...

Here are the code snippets:

subroutine test1 (..., xk, ... )

use Flowfield_size_control_mod, only : KX, LX, IORD, KXMAX, KXIMAX,  LXMAX, LXIMAX
use Precision_mod,              only : DP

implicit none

![ code ]

dimension ::  xk ( -IORD: KXIMAX,  -IORD : LXIMAX )
dimension :: xkth ( 0 : KXMAX, 0 : LXMAX )

real ( kind = DP ) :: xk, xkth

! old statement function
! ABL(XM2,XM1,X,XP1,XP2)=(XM2-8.D0*XM1+8.D0*XP1-XP2)/12.D0

![ code ]

DO 52 L=0,LX
DO 53 K=0,KX
         XKTH(K,L)=ABL(XK(K,L-2),XK(K,L-1),XK(K,L),XK(K,L+1),XK(K,L+2))
53 END DO
52 END DO

![ code ]

contains
! new internal function
   real ( kind = DP ) function abl ( xm2, xm1, x, xp1, xp2 ) result ( ret_val )
        implicit none
        real ( kind = DP ), intent ( in ) :: xm2, xm1, x, xp1, xp2
        real ( kind = DP ) :: ret_val

        ret_val = ( xm2 - 8.0_DP * xm1 + 8.0_DP * xp1 - xp2 ) / 12.0_DP

    end real function abl

end subroutine test1

 

 Any ideas?

 

Kind regards,

Martin


Viewing all articles
Browse latest Browse all 5691

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>