<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>One more thing -- since you be comparing to the old dusty, you
need to keep it around and also as a target in your makefile. I
recommend putting another target in your makefile for dusty.f95.</p>
<p>You could have your makefile actually have three sources</p>
<p>dusty.f</p>
<p>dusty.f90</p>
<p>dusty.cc</p>
<p>but the compilers would technically leave them with the same
dusty.o object file. So I recommend that you name the object
files in your makefile using the -o command.</p>
<p>gfortran dusty.f -c -o dusty77.o</p>
<p>gfortran dusty.f90 -c -o dusty95.o</p>
<p>g++ dusty.cc -c -o dusty.o</p>
<p>you will need to update your OBJS variable and the names of the
targets in your makefile accordingly.</p>
<p>The executables might be called dusty77, dusty95 and dusty.
Again, you will have to create these targets in your makefile.</p>
<p>Please don't think you have to stick with fortran 95 -- the Gnu
fortran compiler supports many of the new language features all
the way through the ISO Fortran 2018 standard -- there may be some
gems there to help you later!<br>
</p>
<div class="moz-cite-prefix">On 1/17/22 18:25, Andrew J. Pounds
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:1cc013aa-8b9b-d94a-fc2f-fa36fb6438f2@sandbox.mercer.edu">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<p>Now that some of you are finishing up the "initial profiling"
assignment (due Wednesday night) you can start working on the
re-write of dusty.</p>
<p>Remember -- you are rewriting in modern fortran (at least .f95
or newer with free-form formatted source lines) and C/C++. <br>
</p>
<p>One of the hard parts of this project is getting identical
results between the old code and your new code. If you look at
the old dusty code it is broken up into loop sections. I
recommend working through each one of these individually. In
other words complete the rewrite of loop 10 and then compare the
results of the dusty.f AV array with your array. Work through
each loop in this manner.</p>
<p>Once you hit loop 12 you will have to implement a new version
of idcheck. That is where things get particularly nasty and you
hit some OLD fortran constructs that are extremely frowned upon
these days. For example...</p>
<p> goto ( 200, 300, 400, 500 ) int(mod(i+j+k,4)+1) <br>
</p>
<p>is particularly troubling. You may have to look this one up!
It's called a computed goto statement. You will definitely have
to rewrite this in your new fortran.</p>
<p>Anyway, as you work through the code stop and verify results
after each "loop section". Using that strategy I was able to
get everything rewritten and give the same results. Once we
have the codes rewritten in modern forms and giving the same
results, we can start working on optimizing them.<br>
</p>
<p>Remember -- correct results first -- then optimization. If you
optimize first bad things will happen and you will most likely
have to start over (seen it at least a dozen times in this class
with this piece of code). At this point, just focus on the
re-write and getting correct results.<br>
</p>
<div class="moz-signature">-- <br>
<b><i>Andrew J. Pounds, Ph.D. </i></b> (<a
class="moz-txt-link-abbreviated moz-txt-link-freetext"
href="mailto:pounds_aj@mercer.edu" moz-do-not-send="true">pounds_aj@mercer.edu</a>)<br>
<i>Professor of Chemistry and Computer Science</i><br>
<i>Director of the Computational Science Program</i><br>
<i>Mercer University, Macon, GA 31207 (478) 301-5627</i></div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
csc435 mailing list
<a class="moz-txt-link-abbreviated" href="mailto:csc435@theochem.mercer.edu">csc435@theochem.mercer.edu</a>
<a class="moz-txt-link-freetext" href="http://theochem.mercer.edu/mailman/listinfo/csc435">http://theochem.mercer.edu/mailman/listinfo/csc435</a>
</pre>
</blockquote>
<div class="moz-signature">-- <br>
<b><i>Andrew J. Pounds, Ph.D. </i></b> (<a class="moz-txt-link-abbreviated" href="mailto:pounds_aj@mercer.edu">pounds_aj@mercer.edu</a>)<br>
<i>Professor of Chemistry and Computer Science</i><br>
<i>Director of the Computational Science Program</i><br>
<i>Mercer University, Macon, GA 31207 (478) 301-5627</i></div>
</body>
</html>