<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Approximatrix Forums — Help with Fortran MODULES]]></title>
	<link rel="self" href="https://forums.approximatrix.com/extern.php?action=feed&amp;tid=68&amp;type=atom" />
	<updated>2012-02-17T23:11:11Z</updated>
	<generator>PunBB</generator>
	<id>https://forums.approximatrix.com/viewtopic.php?id=68</id>
		<entry>
			<title type="html"><![CDATA[Re: Help with Fortran MODULES]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=209#p209" />
			<content type="html"><![CDATA[<p>John,</p><p>Modules in Fortran 90 (and higher) are simply organizational units within your source code.&nbsp; The files should remain named with proper Fortran extensions (.f, .f90, etc.).&nbsp; Files ending in .mod are generated by the compiler, and they are not human-readable.&nbsp; Furthermore, you can place multiple modules in the same Fortran file, although ordering of modules becomes important if they &quot;use&quot; each other.&nbsp; </p><p>There is a great tutorial for Fortran 90 written by a Dr. Shene from Michigan Technological University that delves into modules.&nbsp; Have a look at <a href="http://www.cs.mtu.edu/~shene/COURSES/cs201/NOTES/funct-module.html">http://www.cs.mtu.edu/~shene/COURSES/cs … odule.html</a>, specifically the section introducing modules as to the advantages of using them.&nbsp; I&#039;ve always used them as organizational units, grouping related data, functions, and subroutines together.&nbsp; You can also begin thinking about data and subprogram hiding (using PRIVATE and PUBLIC keywords), overloading functions based on argument types, and working with type-bound procedures when using modules.</p>]]></content>
			<author>
				<name><![CDATA[jeff]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=2</uri>
			</author>
			<updated>2012-02-17T23:11:11Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=209#p209</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Help with Fortran MODULES]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=207#p207" />
			<content type="html"><![CDATA[<p>I&#039;m a Fortran-IV and F77 veteran but new to F90 et seq.<br />I&#039;m starting to make use of, but not yet fully familiar with, <br /> - structured typing, <br /> - allocatable arrays and <br /> - modules.</p><p>Is there anuything I need to know about adding a module to a SF project?<br />Should the source filename be &#039;filename.mod&#039; or can be anything I like, as long as I add it to the project?</p><p>Do I add it just like anuy otehr source file?</p><p>And lastly, can anyone tell me what&#039;s wrong with this code (see below)?&nbsp; I am getting an error message pegged to the USE statement that the file &#039;materials.mod&#039; opened is not a GFORTRAN module file.</p><p>&nbsp; &nbsp; &nbsp; MODULE MATERIALS<br />C&nbsp; &nbsp; &nbsp;----------------<br />C&nbsp; &nbsp; &nbsp;Materials<br />C<br />C&nbsp; &nbsp; &nbsp;jw 17-02-12 draft<br />C&nbsp; &nbsp; &nbsp;jw 17-02-12 last amended</p><p>&nbsp; &nbsp; &nbsp; Type :: MATERIAL<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;REAL&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::&nbsp; &nbsp;Gamma,Emod,Gmod<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CHARACTER(24)&nbsp; ::&nbsp; &nbsp;Desc<br />&nbsp; &nbsp; &nbsp; END TYPE</p><p>&nbsp; &nbsp; &nbsp; TYPE(MATERIAL), ALLOCATABLE :: MATLS(:)</p><p>&nbsp; &nbsp; &nbsp; LOGICAL&nbsp; MadeMAT, ShowsMAT, GoodMAT</p><p>&nbsp; &nbsp; &nbsp; INTEGER&nbsp; idMatPAN,<br />&nbsp; &nbsp; &nbsp;+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; idMatPAN1,<br />&nbsp; &nbsp; &nbsp;+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; idMatPAN2,<br />&nbsp; &nbsp; &nbsp;+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; idMatTbl</p><br /><p>&nbsp; &nbsp; &nbsp; END MODULE MATERIALS</p><p>Any help will be greatly appreciated.<br />--- <br />John</p>]]></content>
			<author>
				<name><![CDATA[JohnWasilewski]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=102</uri>
			</author>
			<updated>2012-02-17T22:42:37Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=207#p207</id>
		</entry>
</feed>
