<?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 Re: Bsearch in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Bsearch/m-p/1456566#M165099</link>
    <description>&lt;P&gt;I am happy to place in your suggestion, of course you are free to help, I was just filling in 5 minutes of spare time and looking at the manual is better than reading Facebook.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 16 Feb 2023 14:44:44 GMT</pubDate>
    <dc:creator>JohnNichols</dc:creator>
    <dc:date>2023-02-16T14:44:44Z</dc:date>
    <item>
      <title>Bsearch</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Bsearch/m-p/1455757#M165028</link>
      <description>&lt;P&gt;Dear Intel Guru:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="fortran"&gt;USE IFPORT
INTEGER(4) array(10), length
INTEGER(4) result, target
length = SIZE(array)
do i = 1,length
array(i) = i
end do
target = 8
write(*,100)length,array,target
100 Format("Array length :: ",i4,/,"Array Elements :: ",10i5,/,"Target number :: ",i5)
result = BSEARCHQQ(LOC(target),LOC(array),length,SRT$INTEGER4)
write(*,*)"Location :: ", result
End &lt;/LI-CODE&gt;
&lt;P&gt;The bsearch sample actually does not run in your manual, here is a simple sample that runs and tell you what all the numbers mean.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bsearch should also tell you if you got the sort wrong in the original data, that is a trivial step.&amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Feb 2023 16:58:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Bsearch/m-p/1455757#M165028</guid>
      <dc:creator>JohnNichols</dc:creator>
      <dc:date>2023-02-14T16:58:31Z</dc:date>
    </item>
    <item>
      <title>Re: Bsearch</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Bsearch/m-p/1456313#M165074</link>
      <description>&lt;P&gt;Thank you! Can you take a few minutes and update the sample to remove the warning message?&lt;/P&gt;
&lt;P&gt;I got:&lt;/P&gt;
&lt;LI-CODE lang="fortran"&gt;$ ifort b.f90
b.f90(11): warning #6075: The data type of the actual argument does not match the definition.  [LENGTH]
result = BSEARCHQQ(LOC(target),LOC(array),length,SRT$INTEGER4)
------------------------------------------^&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2023 22:40:46 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Bsearch/m-p/1456313#M165074</guid>
      <dc:creator>Barbara_P_Intel</dc:creator>
      <dc:date>2023-02-15T22:40:46Z</dc:date>
    </item>
    <item>
      <title>Re: Bsearch</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Bsearch/m-p/1456319#M165076</link>
      <description>&lt;P&gt;Integer 4 works on 32 bit and integer 8 works on 64 bit, how do I check the version before I compile the program?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2023 22:59:47 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Bsearch/m-p/1456319#M165076</guid>
      <dc:creator>JohnNichols</dc:creator>
      <dc:date>2023-02-15T22:59:47Z</dc:date>
    </item>
    <item>
      <title>Re: Bsearch</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Bsearch/m-p/1456323#M165078</link>
      <description>&lt;P&gt;Your sample used Int4.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2023 23:02:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Bsearch/m-p/1456323#M165078</guid>
      <dc:creator>JohnNichols</dc:creator>
      <dc:date>2023-02-15T23:02:16Z</dc:date>
    </item>
    <item>
      <title>Re: Bsearch</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Bsearch/m-p/1456325#M165079</link>
      <description>&lt;P&gt;well&amp;nbsp;INTEGER (INT_PTR_KIND()) :: length&amp;nbsp; would&amp;nbsp; be in keeping seeing has we already have a whole host of non-standard stuff in the example...&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2023 23:11:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Bsearch/m-p/1456325#M165079</guid>
      <dc:creator>andrew_4619</dc:creator>
      <dc:date>2023-02-15T23:11:25Z</dc:date>
    </item>
    <item>
      <title>Re: Bsearch</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Bsearch/m-p/1456566#M165099</link>
      <description>&lt;P&gt;I am happy to place in your suggestion, of course you are free to help, I was just filling in 5 minutes of spare time and looking at the manual is better than reading Facebook.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2023 14:44:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Bsearch/m-p/1456566#M165099</guid>
      <dc:creator>JohnNichols</dc:creator>
      <dc:date>2023-02-16T14:44:44Z</dc:date>
    </item>
    <item>
      <title>Re: Bsearch</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Bsearch/m-p/1456569#M165101</link>
      <description>&lt;P&gt;&lt;a href="https://community.intel.com/t5/user/viewprofilepage/user-id/44501"&gt;@Barbara_P_Intel&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;here are three versions,&amp;nbsp; version one uses kind, version 2 complies on 64 bit and version 3 works on X32 bit.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I usually run x32, it is the default created by Intel and I have never changed it.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;take your pick.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="fortran"&gt;USE IFPORT
INTEGER, PARAMETER :: dp = selected_real_kind(15, 307)
integer,parameter :: k15 = selected_int_kind(15)
INTEGER(kind=k15) array(10), length
INTEGER(kind=k15) result, target
length = SIZE(array)
do i = 1,length
array(i) = i
end do
target = 8
write(*,100)length,array,target
100 Format("Array length :: ",i4,/,"Array Elements :: ",10i5,/,"Target number :: ",i5)
result = BSEARCHQQ(LOC(target),LOC(array),length,SRT$INTEGER8)
write(*,*)"Location :: ", result

End 


 USE IFPORT
INTEGER(8) array(10), length
INTEGER(8) result, target
length = SIZE(array)
do i = 1,length
array(i) = i
end do
target = 8
write(*,100)length,array,target
100 Format("Array length :: ",i4,/,"Array Elements :: ",10i5,/,"Target number :: ",i5)
result = BSEARCHQQ(LOC(target),LOC(array),length,SRT$INTEGER8)
write(*,*)"Location :: ", result
End 

USE IFPORT
INTEGER(4) array(10), length
INTEGER(4) result, target
length = SIZE(array)
do i = 1,length
array(i) = i
end do
target = 8
write(*,100)length,array,target
100 Format("Array length :: ",i4,/,"Array Elements :: ",10i5,/,"Target number :: ",i5)
result = BSEARCHQQ(LOC(target),LOC(array),length,SRT$INTEGER4)
write(*,*)"Location :: ", result
End &lt;/LI-CODE&gt;
&lt;P&gt;I threw in the real kind as a bonus.&amp;nbsp; &amp;nbsp;I dislike the print statements that are common in the Intel Manual, I always use format.&amp;nbsp; &amp;nbsp;Real code should check the array is positive increasing in value as a reverse sort will just output zero.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I stole the kind from&amp;nbsp;&lt;A href="https://gcc.gnu.org/onlinedocs/gfortran/SELECTED_005fINT_005fKIND.html#SELECTED_005fINT_005fKIND" target="_self"&gt;https://gcc.gnu.org/onlinedocs/gfortran/SELECTED_005fINT_005fKIND.html#SELECTED_005fINT_005fKIND&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2023 15:02:42 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Bsearch/m-p/1456569#M165101</guid>
      <dc:creator>JohnNichols</dc:creator>
      <dc:date>2023-02-16T15:02:42Z</dc:date>
    </item>
    <item>
      <title>Re:Bsearch</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Bsearch/m-p/1456623#M165111</link>
      <description>&lt;P&gt;Thank you for these! We'll turn you into a QA engineer yet! &lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 16 Feb 2023 17:13:03 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Bsearch/m-p/1456623#M165111</guid>
      <dc:creator>Barbara_P_Intel</dc:creator>
      <dc:date>2023-02-16T17:13:03Z</dc:date>
    </item>
    <item>
      <title>Re:Bsearch</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Bsearch/m-p/1456635#M165112</link>
      <description>&lt;P&gt;Bug DOC-10914 filed to update the example code snippet to a complete program.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 16 Feb 2023 17:44:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Bsearch/m-p/1456635#M165112</guid>
      <dc:creator>Barbara_P_Intel</dc:creator>
      <dc:date>2023-02-16T17:44:30Z</dc:date>
    </item>
    <item>
      <title>Re: Re:Bsearch</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Bsearch/m-p/1456648#M165113</link>
      <description>&lt;P&gt;I once told an ISO 9001 QA Inspector it was all mindless garbage.&amp;nbsp; He randomly reviewed every one of my files over the next 12 months and then at the next annual meeting, said, do you want to repeat that opinion.&amp;nbsp; I said no.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2023 18:05:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Bsearch/m-p/1456648#M165113</guid>
      <dc:creator>JohnNichols</dc:creator>
      <dc:date>2023-02-16T18:05:19Z</dc:date>
    </item>
    <item>
      <title>Re:Bsearch</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Bsearch/m-p/1457022#M165141</link>
      <description>&lt;P&gt;&lt;a href="https://community.intel.com/t5/user/viewprofilepage/user-id/89041"&gt;@JohnNichols&lt;/a&gt;, Karen, the tech writer for the Fortran DGR wrote, "&lt;SPAN style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Roboto, Oxygen, Ubuntu, &amp;quot;Fira Sans&amp;quot;, &amp;quot;Droid Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, sans-serif;"&gt;I really do appreciate it when our customers report issues, especially when they provide solutions."&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 17 Feb 2023 19:46:10 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Bsearch/m-p/1457022#M165141</guid>
      <dc:creator>Barbara_P_Intel</dc:creator>
      <dc:date>2023-02-17T19:46:10Z</dc:date>
    </item>
    <item>
      <title>Re:Bsearch</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Bsearch/m-p/1461190#M165362</link>
      <description>&lt;P&gt;Karen fixed this problem, too. It'll be in the next version of the DGR (Developer Guide and Reference) available later this spring.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 02 Mar 2023 20:54:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Bsearch/m-p/1461190#M165362</guid>
      <dc:creator>Barbara_P_Intel</dc:creator>
      <dc:date>2023-03-02T20:54:36Z</dc:date>
    </item>
  </channel>
</rss>

