<?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 Jumping from a CASE statement cascade to a program block down b in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Jumping-from-a-CASE-statement-cascade-to-a-program-block-down/m-p/801121#M37726</link>
    <description>I went back and re-created that which I had discarded in the evolution of my program. I totally duplicated the problem I originally reported on this thread. I stand corrected and what I will say now validates what Steve &amp;amp; others have said: the Intel compiler will always diagnose (and flag as an error) a missing EndIf.&lt;BR /&gt;&lt;BR /&gt;When my condition initially happened, the compiler (in the Build View area at the bottom of the IDE) listed a series of &lt;I&gt;&lt;B&gt;warnings&lt;/B&gt;&lt;/I&gt; pointing to the statement labels associated with the GoTo's in the CASE cascade. This was as I posted initially. What I failed to notice, listed way below, was the ever-familiar:&lt;BR /&gt;&lt;BR /&gt;&lt;B&gt;Error: An unterminated block exists.&lt;/B&gt;&lt;BR /&gt;&lt;BR /&gt;I didn't see it! One question I do have (of the compiler) is:&lt;BR /&gt;Why not list the show-stopping errors &lt;SPAN style="text-decoration: underline;"&gt;FIRST&lt;/SPAN&gt;?&lt;BR /&gt;&lt;BR /&gt;It turns out that the warnings were just vague "contingencies" that, once the If/Then was properly terminated, went away.&lt;BR /&gt;&lt;BR /&gt;Thanks for the attention to this and sorry for any confusion this post caused, but it was instructive (for me anyhow).&lt;BR /&gt;&lt;BR /&gt;TC</description>
    <pubDate>Sat, 23 Oct 2010 18:00:35 GMT</pubDate>
    <dc:creator>TommyCee</dc:creator>
    <dc:date>2010-10-23T18:00:35Z</dc:date>
    <item>
      <title>Jumping from a CASE statement cascade to a program block down below (F90)</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Jumping-from-a-CASE-statement-cascade-to-a-program-block-down/m-p/801113#M37718</link>
      <description>Consider this CASE statement cascade:&lt;BR /&gt;&lt;BR /&gt;If (Title .eq. 'Some Character String ')THEN&lt;BR /&gt; Select Case(L)&lt;BR /&gt; CASE(1)&lt;BR /&gt; OPEN (11, FILE = 'File1.txt', STATUS = 'unknown')&lt;BR /&gt; GoTo 100&lt;BR /&gt; CASE(2)&lt;BR /&gt; OPEN (12, FILE = 'File2.txt', STATUS = 'unknown')&lt;BR /&gt; GoTo 100&lt;BR /&gt; CASE(3)&lt;BR /&gt; OPEN (13, FILE = 'File3.txt', STATUS = 'unknown')&lt;BR /&gt; GoTo 100&lt;BR /&gt; CASE(4)&lt;BR /&gt; OPEN (14, FILE = 'File4.txt', STATUS = 'unknown')&lt;BR /&gt; GoTo 100&lt;BR /&gt; CASE(5)&lt;BR /&gt;  OPEN (15, FILE = 'File5.txt', STATUS = 'unknown')&lt;BR /&gt; GoTo 100&lt;BR /&gt; End Select&lt;BR /&gt;&lt;BR /&gt;When the appropriate CASE is found, I want to jump below to a DO loop that startrs at line 100, e.g., &lt;BR /&gt;&lt;BR /&gt;100 DO 200, i = 1,n&lt;BR /&gt; {statements}&lt;BR /&gt;&lt;BR /&gt;200 EndDo&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;On compile, I get this error message (it says "Warning" but believe me - it's a show-stopping ERROR):&lt;BR /&gt;&lt;BR /&gt;&lt;B&gt;Warning: A jump into a block from outside the block may have occurred. [100]&lt;/B&gt;&lt;BR /&gt;&lt;BR /&gt;Is there no way to do this? Is this kind of "jumping" strictly verboten in F90?&lt;BR /&gt;Is there a slick work-around?&lt;BR /&gt;&lt;BR /&gt;I earlier configured this as an if/then cascade and the "jumps" worked fine. Is there something unique about the CASE cascade?&lt;BR /&gt;&lt;BR /&gt;Any help is appreciated.&lt;BR /&gt;&lt;BR /&gt;TC&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 22 Oct 2010 19:38:03 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Jumping-from-a-CASE-statement-cascade-to-a-program-block-down/m-p/801113#M37718</guid>
      <dc:creator>TommyCee</dc:creator>
      <dc:date>2010-10-22T19:38:03Z</dc:date>
    </item>
    <item>
      <title>Jumping from a CASE statement cascade to a program block down b</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Jumping-from-a-CASE-statement-cascade-to-a-program-block-down/m-p/801114#M37719</link>
      <description>Oops! I'll answer my own question:&lt;BR /&gt;&lt;BR /&gt;Yes, you &lt;B&gt;CAN&lt;/B&gt; jump off from a CASE cascade. I presented an IF branch of the code that nests the CASE cascade (excerpt pasted above). At the bottom of a few more If/Then blocks, I accidentaly commented out my EndIf statement, so the IF/THEN block wasn't properly terminated. {Frankly, I'm surprised why the compiler didn't complain about that and directly point it out but it didn't.}&lt;BR /&gt;&lt;BR /&gt;Anyway, I got my answer (the hard way, as usual).&lt;BR /&gt;I hack on ...&lt;BR /&gt;smile</description>
      <pubDate>Fri, 22 Oct 2010 20:21:20 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Jumping-from-a-CASE-statement-cascade-to-a-program-block-down/m-p/801114#M37719</guid>
      <dc:creator>TommyCee</dc:creator>
      <dc:date>2010-10-22T20:21:20Z</dc:date>
    </item>
    <item>
      <title>Jumping from a CASE statement cascade to a program block down b</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Jumping-from-a-CASE-statement-cascade-to-a-program-block-down/m-p/801115#M37720</link>
      <description>Can you show a complete program with the missing endif that doesn't get an error?</description>
      <pubDate>Fri, 22 Oct 2010 21:31:39 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Jumping-from-a-CASE-statement-cascade-to-a-program-block-down/m-p/801115#M37720</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2010-10-22T21:31:39Z</dc:date>
    </item>
    <item>
      <title>Jumping from a CASE statement cascade to a program block down b</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Jumping-from-a-CASE-statement-cascade-to-a-program-block-down/m-p/801116#M37721</link>
      <description>I reconstructed this example based on what I read in this thread. The Intel compiler seems willing to allow a jump into an IF construct with only a warning.&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;[fortran]subroutine tsub()
   character(len=50) :: Title
   Integer :: I,j

   j = 100
   If (Title .eq. 'Some Character String ')THEN
      Select Case(L)
         CASE(1)
            OPEN (11, FILE = 'File1.txt', STATUS = 'unknown')
            GoTo 100
         CASE(2)
            OPEN (12, FILE = 'File2.txt', STATUS = 'unknown')
            GoTo 100
      End Select
      j = 0
   End If

   if(j.eq.100)Then
      j=j+50
!   EndIf      ! This is the missing EndIf
100   DO i = 1,n
          j=i*i+j
       EndDo
    return
    EndIf      ! misplaced EndIf, incorrect fix for syntax error reported earlier
    Return
end subroutine tsub
[/fortran]&lt;/PRE&gt; &lt;BR /&gt;</description>
      <pubDate>Fri, 22 Oct 2010 22:11:40 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Jumping-from-a-CASE-statement-cascade-to-a-program-block-down/m-p/801116#M37721</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2010-10-22T22:11:40Z</dc:date>
    </item>
    <item>
      <title>Jumping from a CASE statement cascade to a program block down b</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Jumping-from-a-CASE-statement-cascade-to-a-program-block-down/m-p/801117#M37722</link>
      <description>In reply to Steve's request, I'm sorry to say that I vastly re-coded that program and so the original structure is lost. Sorry. But trust me, the error messaging was as I described. Sounds like &lt;SPAN style="text-decoration: underline;"&gt;you&lt;/SPAN&gt; were more surpised than I was.</description>
      <pubDate>Fri, 22 Oct 2010 22:24:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Jumping-from-a-CASE-statement-cascade-to-a-program-block-down/m-p/801117#M37722</guid>
      <dc:creator>TommyCee</dc:creator>
      <dc:date>2010-10-22T22:24:49Z</dc:date>
    </item>
    <item>
      <title>Jumping from a CASE statement cascade to a program block down b</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Jumping-from-a-CASE-statement-cascade-to-a-program-block-down/m-p/801118#M37723</link>
      <description>Actually, now that I pay better attention, MECEJ4 did a pretty good job in reconstructing what I presented. Except that when my program bailed out of one of the CASEs (GoTo100), 100 was &lt;SPAN style="text-decoration: underline;"&gt;not&lt;/SPAN&gt; in an If/Then construct; it was just part of a series of program code. Not sure if that changes his interpretation but I just wanted to set it straight.&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="text-decoration: underline;"&gt;I revise MECEJ4's code as follows (this is a little more like what I had)&lt;/SPAN&gt;:&lt;BR /&gt;&lt;BR /&gt;&lt;OL start="1"&gt;&lt;LI class="alt"&gt;program OffMyCase&lt;/LI&gt;&lt;LI&gt;character(len=50)::Title&lt;/LI&gt;&lt;LI class="alt"&gt;Integer::I, j , L&lt;/LI&gt;&lt;LI&gt;&lt;/LI&gt;&lt;LI&gt;If(Title.eq.'SomeCharacterString')THEN&lt;/LI&gt;&lt;LI class="alt"&gt;SelectCase(L)&lt;/LI&gt;&lt;LI&gt;CASE(1)&lt;/LI&gt;&lt;LI class="alt"&gt;OPEN(11,FILE='File1.txt',STATUS='unknown')&lt;/LI&gt;&lt;LI&gt;GoTo100&lt;/LI&gt;&lt;LI class="alt"&gt;CASE(2)&lt;/LI&gt;&lt;LI&gt;OPEN(12,FILE='File2.txt',STATUS='unknown')&lt;/LI&gt;&lt;LI class="alt"&gt;GoTo100&lt;/LI&gt;&lt;LI&gt;EndSelect&lt;/LI&gt;&lt;LI&gt;EndIf &lt;B&gt;&amp;lt;== &lt;SPAN style="text-decoration: underline;"&gt;THIS&lt;/SPAN&gt; was the missing EndIf&lt;/B&gt;&lt;/LI&gt;&lt;LI class="alt"&gt;&lt;/LI&gt;&lt;LI class="alt"&gt;100DOi=1,n&lt;/LI&gt;&lt;LI&gt;j=i*i+j&lt;/LI&gt;&lt;LI class="alt"&gt; EndDo &lt;/LI&gt;&lt;LI class="alt"&gt;&lt;/LI&gt;&lt;LI class="alt"&gt;end program OffMyCase&lt;/LI&gt;&lt;/OL&gt;</description>
      <pubDate>Sat, 23 Oct 2010 00:51:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Jumping-from-a-CASE-statement-cascade-to-a-program-block-down/m-p/801118#M37723</guid>
      <dc:creator>TommyCee</dc:creator>
      <dc:date>2010-10-23T00:51:52Z</dc:date>
    </item>
    <item>
      <title>Jumping from a CASE statement cascade to a program block down b</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Jumping-from-a-CASE-statement-cascade-to-a-program-block-down/m-p/801119#M37724</link>
      <description>No, this version of the source, with the EndIf commented out, results in an error:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;[bash]jmp.f90(5): error #6321: An unterminated block exists.
   If (Title .eq. 'Some Character String ')THEN
^
compilation aborted for jmp.f90 (code 1)
[/bash]&lt;/PRE&gt; In this code, there is no reason for the compiler to issue the warning "&lt;B&gt;A jump into a block from outside the block may have occurred&lt;/B&gt;".&lt;BR /&gt;&lt;BR /&gt;I think that the compiler will not let code with an IF block without an EndIF go with just a warning.</description>
      <pubDate>Sat, 23 Oct 2010 12:01:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Jumping-from-a-CASE-statement-cascade-to-a-program-block-down/m-p/801119#M37724</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2010-10-23T12:01:36Z</dc:date>
    </item>
    <item>
      <title>Jumping from a CASE statement cascade to a program block down b</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Jumping-from-a-CASE-statement-cascade-to-a-program-block-down/m-p/801120#M37725</link>
      <description>I have never seen a case where the compiler failed to diagnose a missing END IF.&lt;BR /&gt;&lt;BR /&gt;In the tests I have constructed, a jump into a block gets a warning, not an error. Such jumps have always been illegal in Fortran (*), and even though the compiler does not give an error, the results of such a jump can be unpredictable. I remember coding the logic in the VAX Fortran compiler to detect such jumps.&lt;BR /&gt;&lt;BR /&gt;(*) An exception is the Fortran 66 "Extended range of a DO loop" feature, where you could jump out of a DO loop and back into the samel level. This was removed in Fortran 77. Intel Fortran still allows this, again with a warning.</description>
      <pubDate>Sat, 23 Oct 2010 13:11:57 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Jumping-from-a-CASE-statement-cascade-to-a-program-block-down/m-p/801120#M37725</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2010-10-23T13:11:57Z</dc:date>
    </item>
    <item>
      <title>Jumping from a CASE statement cascade to a program block down b</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Jumping-from-a-CASE-statement-cascade-to-a-program-block-down/m-p/801121#M37726</link>
      <description>I went back and re-created that which I had discarded in the evolution of my program. I totally duplicated the problem I originally reported on this thread. I stand corrected and what I will say now validates what Steve &amp;amp; others have said: the Intel compiler will always diagnose (and flag as an error) a missing EndIf.&lt;BR /&gt;&lt;BR /&gt;When my condition initially happened, the compiler (in the Build View area at the bottom of the IDE) listed a series of &lt;I&gt;&lt;B&gt;warnings&lt;/B&gt;&lt;/I&gt; pointing to the statement labels associated with the GoTo's in the CASE cascade. This was as I posted initially. What I failed to notice, listed way below, was the ever-familiar:&lt;BR /&gt;&lt;BR /&gt;&lt;B&gt;Error: An unterminated block exists.&lt;/B&gt;&lt;BR /&gt;&lt;BR /&gt;I didn't see it! One question I do have (of the compiler) is:&lt;BR /&gt;Why not list the show-stopping errors &lt;SPAN style="text-decoration: underline;"&gt;FIRST&lt;/SPAN&gt;?&lt;BR /&gt;&lt;BR /&gt;It turns out that the warnings were just vague "contingencies" that, once the If/Then was properly terminated, went away.&lt;BR /&gt;&lt;BR /&gt;Thanks for the attention to this and sorry for any confusion this post caused, but it was instructive (for me anyhow).&lt;BR /&gt;&lt;BR /&gt;TC</description>
      <pubDate>Sat, 23 Oct 2010 18:00:35 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Jumping-from-a-CASE-statement-cascade-to-a-program-block-down/m-p/801121#M37726</guid>
      <dc:creator>TommyCee</dc:creator>
      <dc:date>2010-10-23T18:00:35Z</dc:date>
    </item>
    <item>
      <title>Jumping from a CASE statement cascade to a program block down b</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Jumping-from-a-CASE-statement-cascade-to-a-program-block-down/m-p/801122#M37727</link>
      <description>I'm not a good example about habit-forming, but one of my habits for failed computation is to run "grep Error" on the build log. I wouldn't be capable of running even under Windows without installing grep. If you have a bias against that, there's always the ctrl-F search method for Windows text viewers.</description>
      <pubDate>Sat, 23 Oct 2010 19:01:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Jumping-from-a-CASE-statement-cascade-to-a-program-block-down/m-p/801122#M37727</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2010-10-23T19:01:27Z</dc:date>
    </item>
    <item>
      <title>Jumping from a CASE statement cascade to a program block down b</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Jumping-from-a-CASE-statement-cascade-to-a-program-block-down/m-p/801123#M37728</link>
      <description>The missing ENDIF wasn't detected until the end of the program unit - errors come out in the order they are detected.</description>
      <pubDate>Sun, 24 Oct 2010 01:18:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Jumping-from-a-CASE-statement-cascade-to-a-program-block-down/m-p/801123#M37728</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2010-10-24T01:18:06Z</dc:date>
    </item>
    <item>
      <title>Jumping from a CASE statement cascade to a program block down b</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Jumping-from-a-CASE-statement-cascade-to-a-program-block-down/m-p/801124#M37729</link>
      <description>10-4, Steve. I guess you make a good point that validates the behavior seen (re: warning/error flagging sequence). Good call.</description>
      <pubDate>Mon, 25 Oct 2010 17:01:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Jumping-from-a-CASE-statement-cascade-to-a-program-block-down/m-p/801124#M37729</guid>
      <dc:creator>TommyCee</dc:creator>
      <dc:date>2010-10-25T17:01:06Z</dc:date>
    </item>
  </channel>
</rss>

