<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Approximatrix Forums — Progress Bar]]></title>
		<link>https://forums.approximatrix.com/viewtopic.php?id=846</link>
		<atom:link href="https://forums.approximatrix.com/extern.php?action=feed&amp;tid=846&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Progress Bar.]]></description>
		<lastBuildDate>Tue, 01 Mar 2022 19:05:24 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Progress Bar]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=3894#p3894</link>
			<description><![CDATA[<p>Hello,</p><p>Thank you for your reply.</p><p>Yes, the initial changes I made were in progress.f90 by merely substituting 1000 for 100.</p><p>The most recent changes I made are listed in the following code, and now the program runs the way I would like it.</p><p>program main<br />use progress<br />implicit none</p><p>&nbsp; &nbsp; type(progresswindow), volatile::prog_bar<br />&nbsp; &nbsp; integer::counter, i, kount, nsims, n_times<br />&nbsp; &nbsp; real::last_time, now_time<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; write(*,&quot;(1x,&#039;Enter number of simulations:&nbsp; &#039;$)&quot;)<br />&nbsp; &nbsp; read(*,*) nsims<br />&nbsp; &nbsp; n_times = nsims/100<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; prog_bar = initprogress(&quot;Timed Progress&quot;, canceltest)<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; call cpu_time(last_time)<br />&nbsp; &nbsp; now_time = last_time<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; counter=0<br />&nbsp; &nbsp; kount = 0<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; do i = 1, nsims<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; kount = kount + 1<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; if (kount.ge.n_times) then<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; do while(counter &lt; 100) <br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; do while(now_time - last_time &lt; 0.2)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; call cpu_time(now_time)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end do<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; last_time = now_time<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; counter = counter + 1<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; call prog_bar%draw(counter)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; kount = 0<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; end do</p><p>&nbsp; &nbsp; &nbsp; end if</p><p>&nbsp; &nbsp; end do</p><p>&nbsp; &nbsp; call prog_bar%close()<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; contains<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; subroutine canceltest<br />&nbsp; &nbsp; implicit none<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; counter = 101<br />&nbsp; &nbsp; &nbsp; &nbsp; now_time = now_time + 1.0<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; end subroutine canceltest</p><p>end program main</p>]]></description>
			<author><![CDATA[null@example.com (david.jeong)]]></author>
			<pubDate>Tue, 01 Mar 2022 19:05:24 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=3894#p3894</guid>
		</item>
		<item>
			<title><![CDATA[Re: Progress Bar]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=3890#p3890</link>
			<description><![CDATA[<p>The code in <em>progress.f90</em> was meant to display a percentage, so the number <strong>100</strong> appears in two places.&nbsp; You hadn&#039;t pointed out where exactly you changed &quot;iterations to 1000,&quot; but I&#039;m assuming you meant that you changed something in <em>progress.f90</em> itself?&nbsp; </p><p>The progress bar shouldn&#039;t close by itself.&nbsp; Are you getting to a line like:</p><div class="codebox"><pre><code>call p%close()</code></pre></div><p>Do you open any other windows along the way?</p>]]></description>
			<author><![CDATA[null@example.com (jeff)]]></author>
			<pubDate>Tue, 22 Feb 2022 11:40:56 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=3890#p3890</guid>
		</item>
		<item>
			<title><![CDATA[Progress Bar]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=3889#p3889</link>
			<description><![CDATA[<p>Hello,<br />I am trying to display a progress bar for a Monte Carlo simulation program written in Fortran.&nbsp; I used the example program progress.f90 as a starting point.&nbsp; When I changed 100 iterations to 1000, the progress bar does not close.&nbsp; Are there other changes that need to be made in the module if the number of iterations is different than 100?&nbsp; Thank you.</p>]]></description>
			<author><![CDATA[null@example.com (david.jeong)]]></author>
			<pubDate>Mon, 21 Feb 2022 01:05:40 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=3889#p3889</guid>
		</item>
	</channel>
</rss>
