<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>peawee dot net &#187; fortran</title>
	<atom:link href="http://peawee.net/tag/fortran/feed/" rel="self" type="application/rss+xml" />
	<link>http://peawee.net</link>
	<description>peawee's funky little corner of the internet</description>
	<lastBuildDate>Fri, 08 Jan 2010 00:13:53 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Damn Dirty Data</title>
		<link>http://peawee.net/2010/01/07/damn-dirty-data/</link>
		<comments>http://peawee.net/2010/01/07/damn-dirty-data/#comments</comments>
		<pubDate>Fri, 08 Jan 2010 00:13:53 +0000</pubDate>
		<dc:creator>Peawee</dc:creator>
				<category><![CDATA[Geeky Peawee]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[fortran]]></category>
		<category><![CDATA[frustrations]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://peawee.net/?p=134</guid>
		<description><![CDATA[No, this post isn&#8217;t Star Trek related.  It&#8217;s about SCIENCE!
I realize that the real world makes a lot of things difficult for those who collect data.  Consider this, then, a gripe list of things I may or may not expect to get fixed.
Moving on, I work on computer models to better understand physical [...]]]></description>
			<content:encoded><![CDATA[<p>No, this post isn&#8217;t Star Trek related.  It&#8217;s about SCIENCE!</p>
<p>I realize that the real world makes a lot of things difficult for those who collect data.  Consider this, then, a gripe list of things I may or may not expect to get fixed.</p>
<p>Moving on, I work on computer models to better understand physical processes.  These models are built and parameterized off of real world data of some way or another.  This means I consume a lot of data in my job.  However, how I as a modeler would like data is not often how I get the data.  Here&#8217;s some of the bigger issues:</p>
<ul>
<li><strong>Oddball formats</strong>.  On a given day, I have to deal with files in <a href="http://en.wikipedia.org/wiki/Microsoft_excel">Excel</a> format, varieties of plain text, oddball Fortran binary files (undocumented, of course), <a href="http://en.wikipedia.org/wiki/NetCDF">NetCDF</a>, <a href="http://en.wikipedia.org/wiki/HDF5">HDF</a>, ESRI <a href="http://en.wikipedia.org/wiki/Shapefile">Shapefiles</a>, <a href="http://en.wikipedia.org/wiki/GeoTIFF">GeoTIFF</a>, and a whole bunch of other raster formats.  And this doesn&#8217;t particularly phase me, either.  What phases me?  <em>Incomplete</em> oddball formats.  Whenever a new and interesting bit of geodata ends up on my desk in an oddball format, I can wind up spending over a day poking at it.  When I get gridded data, I need to know a few details about each datapoint in the grid:
<ol>
<li>The lat/lon coordinates</li>
<li>Units being used</li>
<li>The digital representation of the data</li>
</ol>
<p>Most data I get tends to follow this: well-put-together NetCDF &amp; HDF files, as well as anything produced by or with a GIS (such as GeoTIFF, Shapefiles, etc.), tend to be alright.  I can work with this.  However, if I have to figure things out, it slows me down.  Sometimes a lot if I misinterpret it- if it looks reasonable to my eye but actually is not, this Can Cause Baddness.  This is largely the case with Fortran binary files, but I get a lot of plain text that also shares these problems- I have an unclear idea of <em>where</em> or <em>what</em> is being represented.  Examples:</p>
<ol>
<li>Points are addressed from 0 to 360 degrees east instead of -180 to 180 (or vice versa)</li>
<li>There may be a README file with the line &#8220;value is thousands / 20&#8243; or something similarly vague.</li>
</ol>
<li><strong>Oddball Measurements</strong>.  Let&#8217;s start with something basic.  If a value is between zero and one, then why do your measurements include numbers both less than zero and greater than one?  Saying &#8220;sometimes in real life, things work out like that&#8221; doesn&#8217;t satisfy me in building a numerical model where the textbook definition of a function expects a value to be between zero and one.  Tell me <em>why</em> this is, with perhaps a textbook reference going more in depth.  I don&#8217;t mind that your measurements falls outside the traditionally accepted bounds of reality .  I mind that there&#8217;s no systematic explanation why this is.</li>
<li><strong>Oddball time-series</strong>.  In modeling, we want to see a lot of things over time.  The more fine-grained our models become, the more fine-grained we want our measurement data.  If I&#8217;m simulating the growth of a crop, I would like to see the growth of the crop as well as after it&#8217;s done growing.  It&#8217;s hard to determine a trend if one only has one to two datapoints to work from.</li>
</ul>
<p>I suppose the grand summary of this griping is that as a modeler, I have my hands full with a lot of things.  Spending weeks trying to work with bad data is frustrating; human hands entered the data into a computer, so why can&#8217;t those same hands <em>explain</em> the data?</p>
]]></content:encoded>
			<wfw:commentRss>http://peawee.net/2010/01/07/damn-dirty-data/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Just when you think it&#8217;s safe to venture into the office&#8230;</title>
		<link>http://peawee.net/2009/02/07/just-when-you-think-its-safe-to-venture-into-the-office/</link>
		<comments>http://peawee.net/2009/02/07/just-when-you-think-its-safe-to-venture-into-the-office/#comments</comments>
		<pubDate>Sat, 07 Feb 2009 21:06:58 +0000</pubDate>
		<dc:creator>Peawee</dc:creator>
				<category><![CDATA[Life of Peawee]]></category>
		<category><![CDATA[bitching]]></category>
		<category><![CDATA[fortran]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://peawee.net/?p=92</guid>
		<description><![CDATA[&#8230;everything breaks down.
Last week involved a lot of things that involved a lot of brainpower on my part.  I had to do a tricky interpolation of a dataset, get a multi-directory, F77/F90 source dependency generator working, re-factor a bunch of F77 I/O into some F90 that I can then wrench around to do as [...]]]></description>
			<content:encoded><![CDATA[<p>&#8230;everything breaks down.</p>
<p>Last week involved a lot of things that involved a lot of brainpower on my part.  I had to do a tricky interpolation of a dataset, get a multi-directory, F77/F90 source dependency generator working, re-factor a bunch of F77 I/O into some F90 that I can then wrench around to do as I require, and some analysis on some data to send to a model comparison.</p>
<p>It was all going swimmingly until things started breaking late Thursday.  Then come Friday, everything that could have gone wrong over the whole week did.  And that&#8217;s why I&#8217;m sitting here in the office on Saturday, plodding in a new sentence or whatnot with each short re-analysis until I get things done.  There are things I missed in my work on Monday that led me here- silly errors that still resulted in things coming out to the right pattern and the right order of magnitude, but threw model results for a tizzy.  I suppose that&#8217;s why I&#8217;m not <em>too</em> grumbly about things, but damnit, I was supposed to take down my Christmas tree this weekend!  It&#8217;s been up so long the cat&#8217;s lost interest in it!</p>
]]></content:encoded>
			<wfw:commentRss>http://peawee.net/2009/02/07/just-when-you-think-its-safe-to-venture-into-the-office/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Academented Programming</title>
		<link>http://peawee.net/2008/10/21/academented-programming/</link>
		<comments>http://peawee.net/2008/10/21/academented-programming/#comments</comments>
		<pubDate>Wed, 22 Oct 2008 03:11:33 +0000</pubDate>
		<dc:creator>Peawee</dc:creator>
				<category><![CDATA[Geeky Peawee]]></category>
		<category><![CDATA[Life of Peawee]]></category>
		<category><![CDATA[fortran]]></category>
		<category><![CDATA[improvement]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[proverb]]></category>
		<category><![CDATA[science]]></category>
		<category><![CDATA[superfuntime]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://peawee.net/?p=82</guid>
		<description><![CDATA[I work professionally as a programmer at an atmospheric science department at a major university.  One of the biggest things about atmospheric research is our reliance on computers for everything.  While we&#8217;re nowhere near the limit of what we can do with observational data (and indeed in many areas, observational data is woefully [...]]]></description>
			<content:encoded><![CDATA[<p>I work professionally as a programmer at an atmospheric science department at a major university.  One of <em>the</em> biggest things about atmospheric research is our reliance on computers for everything.  While we&#8217;re nowhere near the limit of what we can do with observational data (and indeed in many areas, observational data is woefully short), there are so many things we simply cannot do in laboratory experiments.  Because we can&#8217;t reproduce most things in a laboratory setting, we&#8217;re stuck creating computer models.  That&#8217;s fine.  However, the result of this is that we are almost an applied computer science field with how much we have to wrangle computers day in and day out.</p>
<p>What troubles me is that, at least in my place of employment, <em>practically no-one really understands computers</em>.  </p>
<p>I work in a primarily Fortran shop, which many of you would think &#8220;well, there&#8217;s your problem right there.&#8221;  Not so much, as there&#8217;s a huge literature of already perfected Fortran code to solve nearly every tricky numerical gymnastics problem you can think of (and twice that number of ones you can&#8217;t think of).  Fortran90/95&#8217;s greatest win, and flaw, is that it has <em>incredible</em> backwards compatibility with old FORTRAN77 code (and even some FORTRAN66!).  Re-writing the millions of lines of FORTRAN77 that passes through the department on a semi-regular basis would be costly in sanity, time, and money.</p>
<p>But what about how you work with that code?  Some of us know a certain friend of mine who sat up for hours manually inserting rows into a dataset to account for missing time in hourly reports.  It&#8217;d have taken half an hour to whip up a MATLAB script and have it loop through the dataset.  Almost nobody uses any form of version control (those that do have a sea of directories resembling <code>projectname_vers-num</code>, with <em>num</em> being their revision number), and most of the Unix programming is done through running VIM in vi compatibility mode.  Changing an identifier within the code from one to another is typically a day-long affair for most (hint: it should take perhaps 5 minutes, 10 if the SAN is feeling sluggish), and inter-routine data dependencies are best described as a maze of twisty passages, all alike.  Makefiles are written in a manner where it&#8217;s a requirement to run &#8220;make clean&#8221; before any recompile, and some folks swear by Intel Fortran&#8217;s <code>-save</code> flag, which makes all local variables static.  That flag is used entirely for its side effect of initializing all local variables to zero, however, and not a thought is given for the actual effects.</p>
<p>This is actually a rather sad, sad state we&#8217;re in right now.  It isn&#8217;t anyone&#8217;s fault, either.  There&#8217;s no overarching culture of programming and software engineering at my place of employment, so there&#8217;s not many examples of folks &#8220;doing it better&#8221;, with those of us who <em>are</em> being categorized as &#8220;Oh, but you&#8217;re one of those crazy geeks who just know how to do it.&#8221;</p>
<p>I&#8217;m one of those crazy geeks because I sat down and forced myself to learn how to do it, because I saw that it would pay off, in dividends.  It has, too.</p>
<p>I&#8217;m not trying to claim I&#8217;m some wunderkind, either.  There&#8217;s gaping holes in my expertise and practice that hinder me daily (which I&#8217;m trying to correct).  What does it come down to for me?  Right now, I&#8217;m sitting down and reading the GNU Emacs manual.  I can&#8217;t be arsed to dig up my copy of <em><a href="http://www.amazon.com/Pragmatic-Programmer-Journeyman-Master/dp/020161622X">The Pragmatic Programmer</a></em>, but there is a section in there that says one should really master a text editor.  I&#8217;ve taken it to heart, and with my limited time, that&#8217;s my &#8220;journey of a thousand miles starting with a single step.&#8221;</p>
<p>What have <em>you</em> done to be a better programmer today?</p>
]]></content:encoded>
			<wfw:commentRss>http://peawee.net/2008/10/21/academented-programming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Beautiful Fortran</title>
		<link>http://peawee.net/2008/02/06/beautiful-fortran/</link>
		<comments>http://peawee.net/2008/02/06/beautiful-fortran/#comments</comments>
		<pubDate>Thu, 07 Feb 2008 03:33:31 +0000</pubDate>
		<dc:creator>Peawee</dc:creator>
				<category><![CDATA[Geeky Peawee]]></category>
		<category><![CDATA[dos]]></category>
		<category><![CDATA[fortran]]></category>
		<category><![CDATA[goto]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://peawee.net/2008/02/06/beautiful-fortran/</guid>
		<description><![CDATA[One of my more favored software development blogs is Beautiful Code.  The concept is that code that is properly elegant is going to be readable, functional, and most of all, working correctly.  There&#8217;s a lot of focusing on unit testing, proper OO design techniques, and how to squeeze an elegant solution out of [...]]]></description>
			<content:encoded><![CDATA[<p>One of my more favored software development blogs is <a href="http://beautifulcode.oreillynet.com/">Beautiful Code</a>.  The concept is that code that is properly elegant is going to be readable, functional, and most of all, working correctly.  There&#8217;s a lot of focusing on unit testing, proper OO design techniques, and how to squeeze an elegant solution out of the nastiest conditions.</p>
<p>Well, I believe I have a Nasty Condition.</p>
<p>I hack on FORTRAN and Fortran at work, after getting out of the IT support gig.  What&#8217;s the difference between the capitalizations?  Easy.  FORTRAN references the language pre-1990 (1950&#8217;s through to 1990), and Fortran is the more modern Fortran 90/95/2003 standards.</p>
<p>Fortran 90/95/2003 isn&#8217;t that bad to work on, actually.  For its primary purpose (running numerical computations on hideously expensive computers), it works really well, and makes me a happy hacker.</p>
<p>FORTRAN helps to create ugly code.  Complex looping and branching statements are much more difficult than in other languages, and many FORTRAN coders cut their teeth on it when the language was still implemented via punchcards, and &#8220;eloquent&#8221; coding meant as few cards (aka lines of code) as possible.  Goto statements scare me.  Gotos with literally 5-6 arguments terrify me.  Did I mention that there&#8217;s limitations on line length imposed upon the language from punchcards?</p>
<p>The code in specific I&#8217;m working on is worse.  Those working on it use no version control, so it&#8217;s full of commented-out things every which way, and it definitely dates from the punchcard era, as it lacks things like blank lines in between logical blocks of code statements.  It has terrible, nonsensical indenting, and it relies heavily on subroutines acting in highly non-documented ways on literally hundreds of different, poorly named and undocumented, global variables.</p>
<p>Oh, and there&#8217;s a function that simply wraps ACOS(), the cosine function in FORTRAN.  This is what it does:<br />
<code><br />
FUNCTION ARCOS(X)<br />
ARCOS = ACOS(X)<br />
RETURN<br />
END<br />
</code></p>
<p>Lovely, yes?  Waste of a function to have to keep track of, yes?  I&#8217;ve seen it in three different versions of the model, and it troubles me the same.</p>
<p>I also saw references to MS-FORTRAN 4.0 for MS-DOS in the comments.  Joy of Joys.  In addition, it will only compile with Intel Fortran.  Portland Group&#8217;s compilers break a little bit on it, but gfortran, g95, g77, f2c, and sunf77 compilers all fail with pretty pyrotechnic displays with it.</p>
<p>Hopefully this stuff won&#8217;t drive me completely batty before I can understand what it does &#8220;under the hood&#8221; enough to re-write what I need out of it in something better.</p>
]]></content:encoded>
			<wfw:commentRss>http://peawee.net/2008/02/06/beautiful-fortran/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
