<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Approximatrix Forums — Fortran Version error]]></title>
	<link rel="self" href="http://forums.approximatrix.com/extern.php?action=feed&amp;tid=356&amp;type=atom" />
	<updated>2014-07-03T17:39:40Z</updated>
	<generator>PunBB</generator>
	<id>http://forums.approximatrix.com/viewtopic.php?id=356</id>
		<entry>
			<title type="html"><![CDATA[Re: Fortran Version error]]></title>
			<link rel="alternate" href="http://forums.approximatrix.com/viewtopic.php?pid=1452#p1452" />
			<content type="html"><![CDATA[<p>To enable OpenMP, you only need to either add the <em>-fopenmp</em> flag or, alternatively, check &quot;Enable OpenMP&quot; under the Fortran tab in Project Options (accessible from the Options menu).&nbsp; </p><p>Using OpenMP in your code is rather easy.&nbsp; Basically, you just specify OpenMP directives in specially formatted comments&nbsp; that instruct the compiler and runtime how to handle certain portions of your code.&nbsp; Simply Fortran does provide an example project&nbsp; by default that shows a simple example of executing multiple threads.&nbsp; If you&#039;re looking for some examples, <a href="https://computing.llnl.gov/tutorials/openMP/exercise.html">this site</a> has a nice set of examples in fixed-format Fortran.</p><p>OpenMP is not a drop-in replacement for MPI.&nbsp; If your code was designed to implement MPI, you&#039;ll have some work to do to port it to OpenMP.&nbsp; The <em>-dparallel</em> flag would be specific to your code only; it doesn&#039;t have any special meaning outside that context.&nbsp; &nbsp;</p><p>I&#039;m glad Simply Fortran is meeting your needs, though.&nbsp; &nbsp;If you have any questions, feel free to post them here!</p>]]></content>
			<author>
				<name><![CDATA[jeff]]></name>
				<uri>http://forums.approximatrix.com/profile.php?id=2</uri>
			</author>
			<updated>2014-07-03T17:39:40Z</updated>
			<id>http://forums.approximatrix.com/viewtopic.php?pid=1452#p1452</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Fortran Version error]]></title>
			<link rel="alternate" href="http://forums.approximatrix.com/viewtopic.php?pid=1449#p1449" />
			<content type="html"><![CDATA[<p>Thanks for your patient replys Jeff.<br />What&#039;s involved in employing openmp?&nbsp; I assume that if I simply set the -fopenmp flag will it won&#039;t make any difference.&nbsp; There are sections of code that are dependant on the -dparallel flag, and apart from &quot; use mpi&quot; it has compiled. Is it likely that these sections of code will apply to openmp too, or do they need to be recoded for open mp?&nbsp; I tried &quot;use openmp&quot; and it compiled, but I don&#039;t know how it will affect the program.<br />Really enjoying the SF by the way.&nbsp; I&#039;ve struggled with compiling this on Linux for some time and SF has made it seem a breeze by comparison.</p>]]></content>
			<author>
				<name><![CDATA[bmod]]></name>
				<uri>http://forums.approximatrix.com/profile.php?id=3554</uri>
			</author>
			<updated>2014-07-02T23:13:35Z</updated>
			<id>http://forums.approximatrix.com/viewtopic.php?pid=1449#p1449</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Fortran Version error]]></title>
			<link rel="alternate" href="http://forums.approximatrix.com/viewtopic.php?pid=1445#p1445" />
			<content type="html"><![CDATA[<p>Simply Fortran cannot use an existing makefile. When you build using Simply Fortran, it creates its own makefile, but it wouldn&#039;t be able to use a different one (generally speaking, at least).&nbsp; In your case, the makefile really isn&#039;t doing anything complicated.&nbsp; I would suggest adding the flags that aren&#039;t commented to the Fortran compiler flags for your project in Simply Fortran:</p><div class="codebox"><pre><code>-DPARALLEL -DSAMPLES -DCARTESIAN -DMIXING</code></pre></div><p>Simply Fortran doesn&#039;t support the MPI form of parallel coding that the compiler command <em>mpif90</em> implies.&nbsp; Instead, it does support <a href="http://en.wikipedia.org/wiki/OpenMP">OpenMP</a>, which is generally finer-grained, single-system parallel processing.</p>]]></content>
			<author>
				<name><![CDATA[jeff]]></name>
				<uri>http://forums.approximatrix.com/profile.php?id=2</uri>
			</author>
			<updated>2014-07-02T11:31:33Z</updated>
			<id>http://forums.approximatrix.com/viewtopic.php?pid=1445#p1445</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Fortran Version error]]></title>
			<link rel="alternate" href="http://forums.approximatrix.com/viewtopic.php?pid=1444#p1444" />
			<content type="html"><![CDATA[<p>Cancel that last one, there is this before the routines that are missing:<br /># if defined (SAMPLES)<br />And so added the flag -DSAMPLES and it has worked.</p><p>As a more general question, there is a make file included with the source files:&nbsp; What is the best way to handle the details in this file?&nbsp; Can that make file be run from SF?&nbsp; Or should I copy the flags into the project options?</p><p>Also, it would be nice to be able to run this in parallel - the original makefile is looking for mpif90.&nbsp; What do I need to do to be able to enable this?</p><br /><p>Here is the supplied make file if that helps at all:</p><p>#-----------BEGIN MAKEFILE-------------------------------------------------<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SHELL&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= /bin/sh<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DEF_FLAGS&nbsp; &nbsp; &nbsp;= -P -C -traditional<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; EXEC&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = mytvd<br />#==========================================================================<br />#--------------------------------------------------------------------------<br />#&nbsp; &nbsp; &nbsp; &nbsp; PRECISION&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DEFAULT PRECISION: SINGLE<br />#&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;UNCOMMENT TO SELECT DOUBLE PRECISION<br />#--------------------------------------------------------------------------</p><p>#&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FLAG_1 = -DDOUBLE_PRECISION<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FLAG_2 = -DPARALLEL<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FLAG_3 = -DSAMPLES<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FLAG_4 = -DCARTESIAN<br />#&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FLAG_6 = -DINTEL<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FLAG_7 = -DMIXING<br />#&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FLAG_8 = -DCOUPLING<br />#&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FLAG_9 = -DZALPHA<br />#&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FLAG_10 = -DMANNING</p><p>#--------------------------------------------------------------------------<br />#&nbsp; mpi defs<br />#--------------------------------------------------------------------------<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CPP&nbsp; &nbsp; &nbsp; = /usr/bin/cpp<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CPPFLAGS = $(DEF_FLAGS)<br />#&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FC&nbsp; &nbsp; &nbsp; &nbsp;= gfortran<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FC&nbsp; &nbsp; &nbsp; &nbsp; = mpif90<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DEBFLGS&nbsp; =<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;OPT&nbsp; &nbsp; &nbsp; =<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CLIB&nbsp; &nbsp; &nbsp;=<br />#==========================================================================</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FFLAGS = $(DEBFLGS) $(OPT)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;MDEPFLAGS = --cpp --fext=f90 --file=-<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;RANLIB = ranlib<br />#--------------------------------------------------------------------------<br />#&nbsp; CAT Preprocessing Flags<br />#--------------------------------------------------------------------------<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CPPARGS = $(CPPFLAGS) $(DEF_FLAGS) $(FLAG_1) $(FLAG_2) \<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $(FLAG_3) $(FLAG_4) $(FLAG_5) $(FLAG_6) \<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $(FLAG_7) $(FLAG_8) $(FLAG_9) $(FLAG_10)&nbsp; \<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $(FLAG_11) $(FLAG_12) $(FLAG_13) $(FLAG_14) \<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $(FLAG_15) $(FLAG_16) $(FLAG_17) $(FLAG_18) \<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $(FLAG_19) $(FLAG_20) $(FLAG_21) $(FLAG_22) \<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $(FLAG_23) $(FLAG_24)<br />#--------------------------------------------------------------------------<br />#&nbsp; Libraries<br />#--------------------------------------------------------------------------</p><p>#&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LIBS&nbsp; = $(PV3LIB) $(CLIB)&nbsp; $(PARLIB) $(IOLIBS) $(MPILIB) $(GOTMLIB)<br />#&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; INCS&nbsp; = $(IOINCS) $(GOTMINCS)</p><br /><p>#--------------------------------------------------------------------------<br />#&nbsp; Preprocessing and Compilation Directives<br />#--------------------------------------------------------------------------<br />.SUFFIXES: .o .f90 .F .F90</p><p>.F.o:<br />&nbsp; &nbsp; $(CPP) $(CPPARGS) $*.F &gt; $*.f90<br />&nbsp; &nbsp; $(FC)&nbsp; -c $(FFLAGS) $(INCS) $*.f90<br />#&nbsp; &nbsp; \rm $*.f90<br />#--------------------------------------------------------------------------<br />#&nbsp; FUNWAVE-TVD Source Code.<br />#--------------------------------------------------------------------------</p><p>MODS&nbsp; = mod_param.F&nbsp; &nbsp; mod_global.F&nbsp; &nbsp; mod_util.F \</p><p>MAIN&nbsp; = main.F bc.F fluxes.F init.F io.F trid.F&nbsp; &nbsp; &nbsp; &nbsp;\</p><p>SRCS = $(MODS)&nbsp; $(MAIN)</p><p>OBJS = $(SRCS:.F=.o)</p><p>#--------------------------------------------------------------------------<br />#&nbsp; Linking Directives<br />#--------------------------------------------------------------------------</p><p>$(EXEC):&nbsp; &nbsp; $(OBJS)<br />&nbsp; &nbsp; &nbsp; &nbsp; $(FC) $(FFLAGS) $(LDFLAGS) -o $(EXEC) $(OBJS) $(LIBS)<br />&nbsp; &nbsp; mv $(EXEC) ../work/.<br />#--------------------------------------------------------------------------</p><p>#--------------------------------------------------------------------------<br />#&nbsp; Tar Up Code<br />#--------------------------------------------------------------------------</p><p>tarfile:<br />&nbsp; &nbsp; tar cvf funwave_tvd.tar *.F&nbsp; Makefile</p><p>#--------------------------------------------------------------------------<br />#&nbsp; Cleaning targets.<br />#--------------------------------------------------------------------------</p><p>clean:<br />&nbsp; &nbsp; &nbsp; &nbsp; /bin/rm -f *.o *.mod</p><p>clobber:&nbsp; &nbsp; clean<br />&nbsp; &nbsp; &nbsp; &nbsp; /bin/rm -f *.f90 *.o mytvd</p>]]></content>
			<author>
				<name><![CDATA[bmod]]></name>
				<uri>http://forums.approximatrix.com/profile.php?id=3554</uri>
			</author>
			<updated>2014-07-02T02:32:10Z</updated>
			<id>http://forums.approximatrix.com/viewtopic.php?pid=1444#p1444</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Fortran Version error]]></title>
			<link rel="alternate" href="http://forums.approximatrix.com/viewtopic.php?pid=1443#p1443" />
			<content type="html"><![CDATA[<p>That fixed it, thanks!</p><p>I worked through a few other problems but am stuck on this one:<br />D:\Projects\Funwave\Code\funwave-version2.1\src/init.F:874: undefined reference to `wk_wavemaker_time_series_&#039;</p><p>But it is in the same file:<br />SUBROUTINE WK_WAVEMAKER_TIME_SERIES &amp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(NumWaveComp,WAVE_COMP,PeakPeriod,H_gen,delta,D_gen,beta_gen,width)</p><p>Do you have any suggestions for this one?&nbsp; Is there a reason why it cant see something lower in the file?</p>]]></content>
			<author>
				<name><![CDATA[bmod]]></name>
				<uri>http://forums.approximatrix.com/profile.php?id=3554</uri>
			</author>
			<updated>2014-07-02T01:59:15Z</updated>
			<id>http://forums.approximatrix.com/viewtopic.php?pid=1443#p1443</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Fortran Version error]]></title>
			<link rel="alternate" href="http://forums.approximatrix.com/viewtopic.php?pid=1440#p1440" />
			<content type="html"><![CDATA[<p>This error means that the Fortran compiler did find a &quot;param.mod&quot; that it hadn&#039;t compiled itself.&nbsp; There is most likely a file in the base directory of your project named &quot;param.mod.&quot;&nbsp; Simply Fortran, by default, writes all modules into a <em>modules</em> subdirectory, and, when you select &quot;Clean&quot; from the Build menu, it will delete modules only in that directory that it had created.</p><p>When you were given the code to compile, was there a &quot;param.mod&quot; (or any other &quot;.mod&quot; file) included with it?&nbsp; &nbsp;You&#039;ll want to delete all &quot;.mod&quot; files provided with the code base before attempting to compile it.</p>]]></content>
			<author>
				<name><![CDATA[jeff]]></name>
				<uri>http://forums.approximatrix.com/profile.php?id=2</uri>
			</author>
			<updated>2014-06-30T11:26:04Z</updated>
			<id>http://forums.approximatrix.com/viewtopic.php?pid=1440#p1440</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Fortran Version error]]></title>
			<link rel="alternate" href="http://forums.approximatrix.com/viewtopic.php?pid=1439#p1439" />
			<content type="html"><![CDATA[<p>Hi,<br />I&#039;m new to simply fortran (and fortran in general) so this could be a newbie mistake.&nbsp; I&#039;m trying to compile someone else&#039;s code, which I assume is in F77 (.f extension)<br />The first problem was module &amp; end statements occuring at the start or the line instead of at the 6th character causing an error.&nbsp; I added some spaces and the error went away.&nbsp; But I&#039;m getting this error now:</p><p>Compiling mod_param.F<br />Compiling mod_global.F<br />mod_global.F:2.10:</p><p>&nbsp; &nbsp; &nbsp; &nbsp;USE PARAM&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1<br />Fatal Error: Cannot read module file &#039;param.mod&#039; opened at (1), because it was created by a different version of GNU Fortran<br />Error(E42): Last command making (build\mod_global.o) returned a bad status<br />Error(E02): Make execution terminated</p><p>Yes I cleaned before building, so I don&#039;t know where the error is comming from as SF is trying to read a file it created.</p>]]></content>
			<author>
				<name><![CDATA[bmod]]></name>
				<uri>http://forums.approximatrix.com/profile.php?id=3554</uri>
			</author>
			<updated>2014-06-30T02:21:29Z</updated>
			<id>http://forums.approximatrix.com/viewtopic.php?pid=1439#p1439</id>
		</entry>
</feed>
