<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Approximatrix Forums — Modules in SF]]></title>
	<link rel="self" href="https://forums.approximatrix.com/extern.php?action=feed&amp;tid=163&amp;type=atom" />
	<updated>2013-03-11T11:11:39Z</updated>
	<generator>PunBB</generator>
	<id>https://forums.approximatrix.com/viewtopic.php?id=163</id>
		<entry>
			<title type="html"><![CDATA[Re: Modules in SF]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=612#p612" />
			<content type="html"><![CDATA[<p>Thank you very much!</p>]]></content>
			<author>
				<name><![CDATA[akemppin]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=3418</uri>
			</author>
			<updated>2013-03-11T11:11:39Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=612#p612</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Modules in SF]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=611#p611" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[jeff]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=2</uri>
			</author>
			<updated>2013-03-08T16:44:46Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=611#p611</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Modules in SF]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=610#p610" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[akemppin]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=3418</uri>
			</author>
			<updated>2013-03-08T15:00:33Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=610#p610</id>
		</entry>
</feed>
