<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Approximatrix Forums — Small problem debugging character variables]]></title>
		<link>https://forums.approximatrix.com/viewtopic.php?id=431</link>
		<atom:link href="https://forums.approximatrix.com/extern.php?action=feed&amp;tid=431&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Small problem debugging character variables.]]></description>
		<lastBuildDate>Sat, 31 Jan 2015 21:04:53 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Small problem debugging character variables]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=1866#p1866</link>
			<description><![CDATA[<p>Thanks Jeff.</p><p>In order to pass character variables, a hidden argument containing the length is also passed. This has the same name as the variable prefixed with _. </p><p>However, users are not allowed to declare variables prefixed with _ so one option open to you would be to suppress such variables from the list.</p><p>So this is just a suggestion and not a bug at all. <img src="https://forums.approximatrix.com/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></description>
			<author><![CDATA[null@example.com (davidb)]]></author>
			<pubDate>Sat, 31 Jan 2015 21:04:53 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=1866#p1866</guid>
		</item>
		<item>
			<title><![CDATA[Re: Small problem debugging character variables]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=1862#p1862</link>
			<description><![CDATA[<p>David,</p><p>The presence of <em>_name</em> is somewhat of a legacy of Fortran compilers.&nbsp; Unlike your local character variable, the <em>name</em> variable was an argument.&nbsp; Historically, and GNU Fortran might do this for compatibility reasons, the length of a character of assumed length always followed the character itself.&nbsp; I don&#039;t believe GNU&#039;s old g77 compiler would do this same procedure with arrays, though, which is why you wouldn&#039;t see something similar.</p><p>Clearly your <em>nice</em> local variable also has a length stored somehow and somewhere, but if you were to pass it to another subroutine as an argument, there would be a corresponding <em>_nice</em> since it would be necessary for compatibility.</p>]]></description>
			<author><![CDATA[null@example.com (jeff)]]></author>
			<pubDate>Thu, 29 Jan 2015 23:33:33 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=1862#p1862</guid>
		</item>
		<item>
			<title><![CDATA[Re: Small problem debugging character variables]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=1861#p1861</link>
			<description><![CDATA[<p>This is not a big problem. I can see that <em>_name</em> is the length of the variable. However, this is not consistent with the way other variables are listed. It seems to happen only with character dummy arguments. If I add a new local character(len=10) variable to the example it is listed without an additional &quot;length&quot; variable:</p><div class="codebox"><pre><code>subroutine greet(name)
   character(len=*) :: name
   character(len=10) :: nice
   nice = &#039;, good day&#039;
   print *,&#039;Hello &#039;,trim(name), nice
end subroutine greet

program main
   character(len=10) :: name
   name = &#039;Michael&#039;
   call greet(name)
end program main</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (davidb)]]></author>
			<pubDate>Thu, 29 Jan 2015 21:56:27 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=1861#p1861</guid>
		</item>
		<item>
			<title><![CDATA[Re: Small problem debugging character variables]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=1857#p1857</link>
			<description><![CDATA[<div class="quotebox"><cite>davidb wrote:</cite><blockquote><p>The debugger doesn&#039;t properly list the local variables in subroutine greet in the following example.</p></blockquote></div><p>David,</p><p>I&#039;m not sure what you&#039;re seeing that you&#039;d classify as incorrect.&nbsp; When I debug, I enter the <em>greet</em>&nbsp; subroutine, and I see two local variables, <em>_name</em> and <em>name</em>.&nbsp; The former is an artifact of using assumed-length character strings, and it shows a correct value of 10.&nbsp; The latter is the character string&nbsp; itself, and it appears to be correct as well.&nbsp; What seemed to be the issue in your case?</p>]]></description>
			<author><![CDATA[null@example.com (jeff)]]></author>
			<pubDate>Thu, 29 Jan 2015 12:38:38 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=1857#p1857</guid>
		</item>
		<item>
			<title><![CDATA[Small problem debugging character variables]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=1854#p1854</link>
			<description><![CDATA[<p>The debugger doesn&#039;t properly list the local variables in subroutine greet in the following example.</p><div class="codebox"><pre><code>subroutine greet(name)
   character(len=*) :: name
   print *,&#039;Hello &#039;,trim(name)
end subroutine greet

program main
   character(len=10) :: name
   name = &#039;Michael&#039;
   call greet(name)
end program main</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (davidb)]]></author>
			<pubDate>Wed, 28 Jan 2015 18:50:02 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=1854#p1854</guid>
		</item>
	</channel>
</rss>
