<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Approximatrix Forums — SF Do Concurrent Statement?]]></title>
	<link rel="self" href="https://forums.approximatrix.com/extern.php?action=feed&amp;tid=996&amp;type=atom" />
	<updated>2025-10-26T18:11:13Z</updated>
	<generator>PunBB</generator>
	<id>https://forums.approximatrix.com/viewtopic.php?id=996</id>
		<entry>
			<title type="html"><![CDATA[Re: SF Do Concurrent Statement?]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=4498#p4498" />
			<content type="html"><![CDATA[<p>The locality specifiers from Fortran 2018 (I believe?) aren&#039;t supported at all in GNU Fortran 14, which is what we&#039;re currently shipping.&nbsp; GNU Fortran 15 <a href="https://gcc.gnu.org/gcc-15/changes.html#fortran">does support locality specifiers</a>, and I&#039;m working on updating to that compiler.</p><p>Unfortunately, GNU Fortran 15 also changed the coarray API, so the update is taking a long while.</p>]]></content>
			<author>
				<name><![CDATA[jeff]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=2</uri>
			</author>
			<updated>2025-10-26T18:11:13Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=4498#p4498</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[SF Do Concurrent Statement?]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=4497#p4497" />
			<content type="html"><![CDATA[<p>Hi Jeff,</p><p>It appears from my simple program (below) that SF Do Concurrent statement does not accept LOCAL(variables).<br />It would be better if the variable &quot;R&quot; was locally specified (Local(R)) within the Do Concurrent loop.<br />It&#039;s possible that the code is in error, but if I&#039;m correct it would be a nice to add Local()&nbsp; to the SF compiler.<br />Btw, the variable &quot;I&quot; stays local by default even though it&#039;s not defined as local.</p><p>Frank</p><p>Routine and Results:<br />!--- Example DO_CONCURRENT<br />!--- The following shows a DO CONCURRENT construct with a mask-expr<br />!--- and no locality specified for variables:<br />PROGRAM DO_CONCURRENT<br />&nbsp; &nbsp; IMPLICIT NONE<br />&nbsp; &nbsp; INTEGER, PARAMETER :: N = 3<br />&nbsp; &nbsp; REAL,DIMENSION(N) :: A, B<br />&nbsp; &nbsp; REAL&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; :: C, R<br />&nbsp; &nbsp; INTEGER :: I</p><p>&nbsp; &nbsp; A = [4.0,5.0,6.0]<br />&nbsp; &nbsp; B = [1.0,2.0,3.0]<br />&nbsp; &nbsp; C = 15.0<br />&nbsp; &nbsp; R = -1.0<br />&nbsp; &nbsp; I = -1</p><p>&nbsp; &nbsp; PRINT *, &#039;ORIGINAL VALUES:&#039;<br />&nbsp; &nbsp; PRINT *, &#039;A=&#039;, A<br />&nbsp; &nbsp; PRINT *, &#039;B=&#039;, B<br />&nbsp; &nbsp; PRINT *, &#039;C=&#039;, C<br />&nbsp; &nbsp; PRINT *, &#039;R=&#039;, R<br />&nbsp; &nbsp; PRINT *, &#039;I=&#039;, I<br />&nbsp; &nbsp; PRINT *</p><p>&nbsp; &nbsp; WRITE(*,&#039;(1X,A)&#039;) &#039;RUN DO CONCURRENT LOOP:&#039;<br />&nbsp; &nbsp; WRITE(*,&#039;(1X,5(A,5X))&#039;) &#039;I&#039;, &#039;A&#039;, &#039;B&#039;, &#039;MOD(A,B)&#039;, &#039;R&#039;</p><p>&nbsp; &nbsp; DO CONCURRENT (I = 1:N, A(I) &gt; 0.0) ! LOCAL(R)<br />&nbsp; &nbsp; &nbsp; &nbsp; R =&nbsp; MODULO (A(I), B(I))</p><p>&nbsp; &nbsp; &nbsp; &nbsp; A(I) = A(I) - R</p><p>&nbsp; &nbsp; &nbsp; &nbsp; C = -15.0</p><p>&nbsp; &nbsp; &nbsp; &nbsp; WRITE(*,&#039;(1X,I1,1X,4(F6.2,2X))&#039;)&nbsp; I, A(I), B(I), A(I)-FLOOR(A(I)/B(I))*B(I), R<br />&nbsp; &nbsp; END DO</p><p>&nbsp; &nbsp; PRINT *<br />&nbsp; &nbsp; PRINT *, &#039;DO CONCURRENT FINAL VALUES:&#039;<br />&nbsp; &nbsp; PRINT *, &#039;I=&#039;, I, &#039; (DOES NOT GET REDEFINED!)&#039;<br />&nbsp; &nbsp; PRINT *, &#039; R=&#039;,&nbsp; R, &#039; (GETS REDEFINED!)&#039;<br />&nbsp; &nbsp; PRINT *, &#039;A=&#039;, A<br />&nbsp; &nbsp; PRINT *, &#039;B=&#039;, B<br />&nbsp; &nbsp; PRINT *, &#039;C=&#039;, C, &#039; (GETS REDEFINED!)&#039;<br />END PROGRAM DO_CONCURRENT</p><p>ORIGINAL VALUES:<br /> A=&nbsp; &nbsp;4.00000000&nbsp; &nbsp; &nbsp; &nbsp;5.00000000&nbsp; &nbsp; &nbsp; &nbsp;6.00000000<br /> B=&nbsp; &nbsp;1.00000000&nbsp; &nbsp; &nbsp; &nbsp;2.00000000&nbsp; &nbsp; &nbsp; &nbsp;3.00000000<br /> C=&nbsp; &nbsp;15.0000000<br /> R=&nbsp; -1.00000000<br /> I=&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -1</p><p> RUN DO CONCURRENT LOOP:<br /> I&nbsp; &nbsp; &nbsp;A&nbsp; &nbsp; &nbsp;B&nbsp; &nbsp; &nbsp;MOD(A,B)&nbsp; &nbsp; &nbsp;R<br /> 1&nbsp; &nbsp;4.00&nbsp; &nbsp; 1.00&nbsp; &nbsp; 0.00&nbsp; &nbsp; 0.00<br /> 2&nbsp; &nbsp;4.00&nbsp; &nbsp; 2.00&nbsp; &nbsp; 0.00&nbsp; &nbsp; 1.00<br /> 3&nbsp; &nbsp;6.00&nbsp; &nbsp; 3.00&nbsp; &nbsp; 0.00&nbsp; &nbsp; 0.00</p><p> DO CONCURRENT FINAL VALUES:<br /> I=&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -1&nbsp; (DOES NOT GET REDEFINED!)<br />&nbsp; R=&nbsp; &nbsp;0.00000000&nbsp; &nbsp; &nbsp; (GETS REDEFINED!)<br /> A=&nbsp; &nbsp;4.00000000&nbsp; &nbsp; &nbsp; &nbsp;4.00000000&nbsp; &nbsp; &nbsp; &nbsp;6.00000000<br /> B=&nbsp; &nbsp;1.00000000&nbsp; &nbsp; &nbsp; &nbsp;2.00000000&nbsp; &nbsp; &nbsp; &nbsp;3.00000000<br /> C=&nbsp; -15.0000000&nbsp; &nbsp; &nbsp; (GETS REDEFINED!)</p>]]></content>
			<author>
				<name><![CDATA[drfrank]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=223</uri>
			</author>
			<updated>2025-10-26T15:09:47Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=4497#p4497</id>
		</entry>
</feed>
