<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic no detection of undefined variable when passed through a module ? in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/no-detection-of-undefined-variable-when-passed-through-a-module/m-p/818849#M4551</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;My present version of Intel compiler is 11.1.069&lt;BR /&gt;&lt;BR /&gt;I join two examples where the undefined variable is detected on execution in one case but not in the other when this variable is passed via a fortan module.&lt;BR /&gt;&lt;BR /&gt;The programs are below:&lt;BR /&gt;module mod_trigo&lt;BR /&gt; save&lt;BR /&gt; real*8 :: cx,c2x&lt;BR /&gt; real*8 :: sx,s2x,s3x&lt;BR /&gt; end module mod_trigo&lt;BR /&gt;!&lt;BR /&gt; program essai_c2x_undef1&lt;BR /&gt; use mod_trigo&lt;BR /&gt; implicit none&lt;BR /&gt;!&lt;BR /&gt; open(7,file='essai_c2x_undef_result',form='formatted',status='unknown')&lt;BR /&gt; sx=0.3d0 ; cx=dsqrt(1.d0-sx*sx)&lt;BR /&gt; call fonction&lt;BR /&gt; write(7,'(a,2(1pd16.6))') ' sx cx =',sx,cx&lt;BR /&gt; write(7,'(a,2(1pd16.6))') ' s2x c2x =',s2x,c2x&lt;BR /&gt; write(7,'(a,1pd16.6)') ' s3x = sx*c2x + s2x*cx = ',s3x&lt;BR /&gt;!&lt;BR /&gt; close(7)&lt;BR /&gt; end program essai_c2x_undef1&lt;BR /&gt;!&lt;BR /&gt; subroutine fonction&lt;BR /&gt; use mod_trigo&lt;BR /&gt; implicit none&lt;BR /&gt; s2x=2*sx*cx&lt;BR /&gt;! c2x=cx*cx - sx*sx ! &amp;lt;== definition of c2x&lt;BR /&gt; s3x=sx*c2x + s2x*cx&lt;BR /&gt; end subroutine fonction&lt;BR /&gt;!&lt;BR /&gt;!--------------------------------------------------------------&lt;BR /&gt;!compiled with Intel 11.1.069 :&lt;BR /&gt;! ifort -check all -watch all -O2 -o $1_go $1.f90&lt;BR /&gt;!result:&lt;BR /&gt;!sx cx = 3.000000D-01 9.539392D-01&lt;BR /&gt;!s2x c2x = 5.723635D-01 0.000000D+00&lt;BR /&gt;!s3x = sx*c2x + s2x*cx = 5.460000D-01&lt;BR /&gt;!--------------------------------------------------------------&lt;BR /&gt;!compiled with Intel-11.1.069 &lt;BR /&gt;! ifort -check all -watch all -o $1_go $1.f90&lt;BR /&gt;!Result:&lt;BR /&gt;!sx cx = 3.000000D-01 9.539392D-01&lt;BR /&gt;!s2x c2x = 5.723635D-01 0.000000D+00&lt;BR /&gt;!s3x = sx*c2x + s2x*cx = 5.460000D-01&lt;BR /&gt;!--------------------------------------------------------------&lt;BR /&gt;&lt;BR /&gt;program essai_c2x_undef2&lt;BR /&gt; implicit none&lt;BR /&gt;!&lt;BR /&gt; real*8 :: cx,c2x,sx,s2x,s3x&lt;BR /&gt;!&lt;BR /&gt; open(7,file='essai_c2x_undef_result',form='formatted',status='unknown')&lt;BR /&gt; sx=0.3d0 ; cx=dsqrt(1.d0-sx*sx)&lt;BR /&gt; s2x=2*sx*cx&lt;BR /&gt;! c2x=cx*cx - sx*sx ! &amp;lt;== definition of c2x&lt;BR /&gt; s3x=sx*c2x + s2x*cx&lt;BR /&gt;!&lt;BR /&gt; write(7,'(a,2(1pd16.6))') ' sx cx =',sx,cx&lt;BR /&gt; write(7,'(a,2(1pd16.6))') ' s2x c2x =',s2x,c2x&lt;BR /&gt; write(7,'(a,1pd16.6)') ' s3x = sx*c2x + s2x*cx = ',s3x&lt;BR /&gt;!&lt;BR /&gt; close(7)&lt;BR /&gt; end program essai_c2x_undef2&lt;BR /&gt;!---------------------------------------------------------&lt;BR /&gt;! after compilation with Intel-11.1.069 (with or without O2) :&lt;BR /&gt;!&lt;BR /&gt;!==&amp;gt; a warning diagnosis is issued on execution unlike le case where c2x was passed to the subroutine through a module&lt;BR /&gt;!&lt;BR /&gt;! result :&lt;BR /&gt;!&lt;BR /&gt;!forrtl: severe (193): Run-Time Check Failure. The variable 'essai_c2x_undef_$C2X' is being used without being defined&lt;BR /&gt;!Image PC Routine Line Source &lt;BR /&gt;!essai_c2x_undef2_ 0808E42D Unknown Unknown Unknown&lt;BR /&gt;!essai_c2x_undef2_ 0808D225 Unknown Unknown Unknown&lt;BR /&gt;!essai_c2x_undef2_ 0806154F Unknown Unknown Unknown&lt;BR /&gt;!essai_c2x_undef2_ 0804BE47 Unknown Unknown Unknown&lt;BR /&gt;!essai_c2x_undef2_ 0804C582 Unknown Unknown Unknown&lt;BR /&gt;!essai_c2x_undef2_ 08049D54 Unknown Unknown Unknown&lt;BR /&gt;!essai_c2x_undef2_ 08049C81 Unknown Unknown Unknown&lt;BR /&gt;!libc.so.6 4005B450 Unknown Unknown Unknown&lt;BR /&gt;!essai_c2x_undef2_ 08049BC1 Unknown Unknown Unknown&lt;BR /&gt;!-----------------------------------------------------------------&lt;BR /&gt;&lt;BR /&gt;Is there a flaw anywhere ?&lt;BR /&gt;&lt;BR /&gt;Sincerely Yours&lt;BR /&gt;&lt;BR /&gt;JL Bocquet&lt;BR /&gt;</description>
    <pubDate>Mon, 21 May 2012 13:57:18 GMT</pubDate>
    <dc:creator>jlbocquet</dc:creator>
    <dc:date>2012-05-21T13:57:18Z</dc:date>
    <item>
      <title>no detection of undefined variable when passed through a module ?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/no-detection-of-undefined-variable-when-passed-through-a-module/m-p/818849#M4551</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;My present version of Intel compiler is 11.1.069&lt;BR /&gt;&lt;BR /&gt;I join two examples where the undefined variable is detected on execution in one case but not in the other when this variable is passed via a fortan module.&lt;BR /&gt;&lt;BR /&gt;The programs are below:&lt;BR /&gt;module mod_trigo&lt;BR /&gt; save&lt;BR /&gt; real*8 :: cx,c2x&lt;BR /&gt; real*8 :: sx,s2x,s3x&lt;BR /&gt; end module mod_trigo&lt;BR /&gt;!&lt;BR /&gt; program essai_c2x_undef1&lt;BR /&gt; use mod_trigo&lt;BR /&gt; implicit none&lt;BR /&gt;!&lt;BR /&gt; open(7,file='essai_c2x_undef_result',form='formatted',status='unknown')&lt;BR /&gt; sx=0.3d0 ; cx=dsqrt(1.d0-sx*sx)&lt;BR /&gt; call fonction&lt;BR /&gt; write(7,'(a,2(1pd16.6))') ' sx cx =',sx,cx&lt;BR /&gt; write(7,'(a,2(1pd16.6))') ' s2x c2x =',s2x,c2x&lt;BR /&gt; write(7,'(a,1pd16.6)') ' s3x = sx*c2x + s2x*cx = ',s3x&lt;BR /&gt;!&lt;BR /&gt; close(7)&lt;BR /&gt; end program essai_c2x_undef1&lt;BR /&gt;!&lt;BR /&gt; subroutine fonction&lt;BR /&gt; use mod_trigo&lt;BR /&gt; implicit none&lt;BR /&gt; s2x=2*sx*cx&lt;BR /&gt;! c2x=cx*cx - sx*sx ! &amp;lt;== definition of c2x&lt;BR /&gt; s3x=sx*c2x + s2x*cx&lt;BR /&gt; end subroutine fonction&lt;BR /&gt;!&lt;BR /&gt;!--------------------------------------------------------------&lt;BR /&gt;!compiled with Intel 11.1.069 :&lt;BR /&gt;! ifort -check all -watch all -O2 -o $1_go $1.f90&lt;BR /&gt;!result:&lt;BR /&gt;!sx cx = 3.000000D-01 9.539392D-01&lt;BR /&gt;!s2x c2x = 5.723635D-01 0.000000D+00&lt;BR /&gt;!s3x = sx*c2x + s2x*cx = 5.460000D-01&lt;BR /&gt;!--------------------------------------------------------------&lt;BR /&gt;!compiled with Intel-11.1.069 &lt;BR /&gt;! ifort -check all -watch all -o $1_go $1.f90&lt;BR /&gt;!Result:&lt;BR /&gt;!sx cx = 3.000000D-01 9.539392D-01&lt;BR /&gt;!s2x c2x = 5.723635D-01 0.000000D+00&lt;BR /&gt;!s3x = sx*c2x + s2x*cx = 5.460000D-01&lt;BR /&gt;!--------------------------------------------------------------&lt;BR /&gt;&lt;BR /&gt;program essai_c2x_undef2&lt;BR /&gt; implicit none&lt;BR /&gt;!&lt;BR /&gt; real*8 :: cx,c2x,sx,s2x,s3x&lt;BR /&gt;!&lt;BR /&gt; open(7,file='essai_c2x_undef_result',form='formatted',status='unknown')&lt;BR /&gt; sx=0.3d0 ; cx=dsqrt(1.d0-sx*sx)&lt;BR /&gt; s2x=2*sx*cx&lt;BR /&gt;! c2x=cx*cx - sx*sx ! &amp;lt;== definition of c2x&lt;BR /&gt; s3x=sx*c2x + s2x*cx&lt;BR /&gt;!&lt;BR /&gt; write(7,'(a,2(1pd16.6))') ' sx cx =',sx,cx&lt;BR /&gt; write(7,'(a,2(1pd16.6))') ' s2x c2x =',s2x,c2x&lt;BR /&gt; write(7,'(a,1pd16.6)') ' s3x = sx*c2x + s2x*cx = ',s3x&lt;BR /&gt;!&lt;BR /&gt; close(7)&lt;BR /&gt; end program essai_c2x_undef2&lt;BR /&gt;!---------------------------------------------------------&lt;BR /&gt;! after compilation with Intel-11.1.069 (with or without O2) :&lt;BR /&gt;!&lt;BR /&gt;!==&amp;gt; a warning diagnosis is issued on execution unlike le case where c2x was passed to the subroutine through a module&lt;BR /&gt;!&lt;BR /&gt;! result :&lt;BR /&gt;!&lt;BR /&gt;!forrtl: severe (193): Run-Time Check Failure. The variable 'essai_c2x_undef_$C2X' is being used without being defined&lt;BR /&gt;!Image PC Routine Line Source &lt;BR /&gt;!essai_c2x_undef2_ 0808E42D Unknown Unknown Unknown&lt;BR /&gt;!essai_c2x_undef2_ 0808D225 Unknown Unknown Unknown&lt;BR /&gt;!essai_c2x_undef2_ 0806154F Unknown Unknown Unknown&lt;BR /&gt;!essai_c2x_undef2_ 0804BE47 Unknown Unknown Unknown&lt;BR /&gt;!essai_c2x_undef2_ 0804C582 Unknown Unknown Unknown&lt;BR /&gt;!essai_c2x_undef2_ 08049D54 Unknown Unknown Unknown&lt;BR /&gt;!essai_c2x_undef2_ 08049C81 Unknown Unknown Unknown&lt;BR /&gt;!libc.so.6 4005B450 Unknown Unknown Unknown&lt;BR /&gt;!essai_c2x_undef2_ 08049BC1 Unknown Unknown Unknown&lt;BR /&gt;!-----------------------------------------------------------------&lt;BR /&gt;&lt;BR /&gt;Is there a flaw anywhere ?&lt;BR /&gt;&lt;BR /&gt;Sincerely Yours&lt;BR /&gt;&lt;BR /&gt;JL Bocquet&lt;BR /&gt;</description>
      <pubDate>Mon, 21 May 2012 13:57:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/no-detection-of-undefined-variable-when-passed-through-a-module/m-p/818849#M4551</guid>
      <dc:creator>jlbocquet</dc:creator>
      <dc:date>2012-05-21T13:57:18Z</dc:date>
    </item>
    <item>
      <title>no detection of undefined variable when passed through a module</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/no-detection-of-undefined-variable-when-passed-through-a-module/m-p/818850#M4552</link>
      <description>I believe you're correct in pointing out that ifort has difficulty diagnosing undefined module variables (undefined in the Fortran terminology, referred to elsewhere as uninitialized). The save which you set explicitly in the module is probably the default; this may contribute to the difficulty of diagnosing defined status. If this problem is in fact typical of module variables, it's a problem which the proponents of modules like to ignore.&lt;BR /&gt;I get similar results to yours with the current Windows X64 version of ifort.&lt;BR /&gt;</description>
      <pubDate>Mon, 21 May 2012 15:40:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/no-detection-of-undefined-variable-when-passed-through-a-module/m-p/818850#M4552</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2012-05-21T15:40:28Z</dc:date>
    </item>
    <item>
      <title>no detection of undefined variable when passed through a module</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/no-detection-of-undefined-variable-when-passed-through-a-module/m-p/818851#M4553</link>
      <description>This thread would be more appropriate on one of the Fortran forum sections.&lt;BR /&gt;The following would be more appropriate on Inspector forum:&lt;BR /&gt;I got a fresh copy of Windows Inspector (which ought to support Fortran now). I was unable to persuade it to import the inspector file created by ifort /Qdiag-enable:sc.&lt;BR /&gt;Running inspector on your example compiled without debug information showed uninitialized data at the assembler view level. When compiled with debug information, it reported no problems.</description>
      <pubDate>Mon, 21 May 2012 16:41:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/no-detection-of-undefined-variable-when-passed-through-a-module/m-p/818851#M4553</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2012-05-21T16:41:13Z</dc:date>
    </item>
  </channel>
</rss>

