<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Approximatrix Forums — Modules in SF]]></title>
		<link>https://forums.approximatrix.com/viewtopic.php?id=163</link>
		<atom:link href="https://forums.approximatrix.com/extern.php?action=feed&amp;tid=163&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Modules in SF.]]></description>
		<lastBuildDate>Mon, 11 Mar 2013 11:11:39 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Modules in SF]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=612#p612</link>
			<description><![CDATA[<p>Thank you very much!</p>]]></description>
			<author><![CDATA[null@example.com (akemppin)]]></author>
			<pubDate>Mon, 11 Mar 2013 11:11:39 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=612#p612</guid>
		</item>
		<item>
			<title><![CDATA[Re: Modules in SF]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=611#p611</link>
			<description><![CDATA[<p>You&#039;re actually very close to getting everything working.&nbsp; You shouldn&#039;t use the extension &quot;.mod&quot; for any source code.&nbsp; Your file <em>testmodule.mod</em> should actually be named <em>testmodule.<strong>f90</strong></em>.&nbsp; The compiler will generate a file <em>testmodule.mod</em> itself based on your source code in the <em>modules</em> subdirectory in your project&#039;s directory.</p><p>Module files are created by the compiler, and, generally speaking, they aren&#039;t human-readable.&nbsp; The source code for the modules, however, just needs to be stored in Fortran source files ending in <em>.f90</em> or something else appropriate (<em>.f95 .f03 .f08</em> for example).</p>]]></description>
			<author><![CDATA[null@example.com (jeff)]]></author>
			<pubDate>Fri, 08 Mar 2013 16:44:46 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=611#p611</guid>
		</item>
		<item>
			<title><![CDATA[Modules in SF]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=610#p610</link>
			<description><![CDATA[<p>I am a beginner in Fortran, and maybe I am just stupid, but I have spent a huge amount of time trying to write programs that use modules that I have done myself. I need to make several numerical calculation programs, and some tasks are similar in all these programs. Therefore it would be nice to make a module that contains many functions that I need often. Can anyone tell me what goes wrong in the very simple test program below:</p><p>I have made a simple&nbsp; project with the name moduletest. It contains two files:</p><p>moduletest_main.f90:</p><p>program moduletest<br />use testmodule<br />implicit none<br />real :: x, y<br />x=2.0<br />y=testmodulefunction(x)<br />write(*,*) x, y<br />end program moduletest</p><p>testmodule.mod:</p><p>module testmodule<br />implicit none<br />real :: x, y<br />contains<br />function testmodulefunction(x) result(y)<br />y=x**2<br />end function testmodulefunction<br />end module testmodule</p><br /><p>Build =&gt; Build Now! (F6) produces the following log:</p><p>==============================================================================<br />Open Watcom Make Version 1.9 (Built on May 17 2012)<br />Portions Copyright (c) 1988-2002 Sybase, Inc. All Rights Reserved.<br />Source code is available under the Sybase Open Watcom Public License.<br />See <a href="http://www.openwatcom.org/">http://www.openwatcom.org/</a> for details.<br />&nbsp; &nbsp; &quot;C:\Program Files (x86)\Simply Fortran\mingw-w64\bin\gfortran.exe&quot; -c -o build\moduletest_main.o -g -m32&nbsp; &nbsp;-Jmodules .\moduletest_main.f90<br />.\moduletest_main.f90:2.4:</p><p>use testmodule<br />&nbsp; &nbsp; 1<br />Fatal Error: File &#039;testmodule.mod&#039; opened at (1) is not a GFORTRAN module file<br />Error(E42): Last command making (build\moduletest_main.o) returned a bad status<br />Error(E02): Make execution terminated</p><p>* Complete *</p>]]></description>
			<author><![CDATA[null@example.com (akemppin)]]></author>
			<pubDate>Fri, 08 Mar 2013 15:00:33 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=610#p610</guid>
		</item>
	</channel>
</rss>
