<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Hansen Code</title>
	<atom:link href="http://climateaudit.org/2007/09/10/hansen-code/feed/" rel="self" type="application/rss+xml" />
	<link>http://climateaudit.org/2007/09/10/hansen-code/</link>
	<description>by Steve McIntyre</description>
	<lastBuildDate>Wed, 19 Jun 2013 17:55:02 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Crossword Puzzle #4: Re-Visiting Y2K &#171; Climate Audit</title>
		<link>http://climateaudit.org/2007/09/10/hansen-code/#comment-307717</link>
		<dc:creator><![CDATA[Crossword Puzzle #4: Re-Visiting Y2K &#171; Climate Audit]]></dc:creator>
		<pubDate>Sat, 29 Oct 2011 19:15:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.climateaudit.org/?p=2041#comment-307717</guid>
		<description><![CDATA[[...] the graphic below compares the Detroit Lakes version from Step 0 from Not Sure not here to the Dset=0 version currently online at NASA GISS. The results are obviously similar in recent [...]]]></description>
		<content:encoded><![CDATA[<p>[...] the graphic below compares the Detroit Lakes version from Step 0 from Not Sure not here to the Dset=0 version currently online at NASA GISS. The results are obviously similar in recent [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: E.M.Smith</title>
		<link>http://climateaudit.org/2007/09/10/hansen-code/#comment-104756</link>
		<dc:creator><![CDATA[E.M.Smith]]></dc:creator>
		<pubDate>Mon, 27 Jul 2009 07:31:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.climateaudit.org/?p=2041#comment-104756</guid>
		<description><![CDATA[Oh, BTW, anyone wanting to ask question of me can do so at:

http://chiefio.wordpress.com/gistemp/

where I&#039;m documenting my &quot;discoveries&quot;...]]></description>
		<content:encoded><![CDATA[<p>Oh, BTW, anyone wanting to ask question of me can do so at:</p>
<p><a href="http://chiefio.wordpress.com/gistemp/" rel="nofollow">http://chiefio.wordpress.com/gistemp/</a></p>
<p>where I&#8217;m documenting my &#8220;discoveries&#8221;&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: E.M.Smith</title>
		<link>http://climateaudit.org/2007/09/10/hansen-code/#comment-104755</link>
		<dc:creator><![CDATA[E.M.Smith]]></dc:creator>
		<pubDate>Mon, 27 Jul 2009 07:26:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.climateaudit.org/?p=2041#comment-104755</guid>
		<description><![CDATA[I have GIStemp running on a x86 Linux (RedHat 7.2) box using the G95 compiler.

I&#039;ve run it up through step3.  At step4_5 I hit the &#039;endian&#039; problem with the read of the SBBX.HadR2 dataset in Step5 SBBXotoBX.f file (read(11) at line 112 or so) and convert.HadR2_mod4.upto15full_yrs.f with the same file.  I&#039;ve not yet reached the point of finding out if the oisstv2_mod4... et al files have similar problems.

So I&#039;m now looking at making an &quot;endian conversion tool&quot;.  We&#039;ll see.  It might be easier just to get an old Macintosh PowerPC box (also big endian) and put linux on it with the G95 compiler...

The major issue I found with the G95 compiler was the use, by GIStemp, of a non-standard extension to the language for doing data declarations in a variable declaration.  Where they have:

INT foo(3)/1,2,3/

You need instead:

INT foo(3)
DATA foo /1,2,3/

FWIW, I&#039;ve moved the source files into a &#039;src&#039; directory, the executables into a &#039;bin&#039; directory and added a Makefile to do all the compiles (pulling that out of the other scripts).  At this point I have a version that works pretty well (up to the bigendian point...) compiles well, and generally seems usable for testing.]]></description>
		<content:encoded><![CDATA[<p>I have GIStemp running on a x86 Linux (RedHat 7.2) box using the G95 compiler.</p>
<p>I&#8217;ve run it up through step3.  At step4_5 I hit the &#8216;endian&#8217; problem with the read of the SBBX.HadR2 dataset in Step5 SBBXotoBX.f file (read(11) at line 112 or so) and convert.HadR2_mod4.upto15full_yrs.f with the same file.  I&#8217;ve not yet reached the point of finding out if the oisstv2_mod4&#8230; et al files have similar problems.</p>
<p>So I&#8217;m now looking at making an &#8220;endian conversion tool&#8221;.  We&#8217;ll see.  It might be easier just to get an old Macintosh PowerPC box (also big endian) and put linux on it with the G95 compiler&#8230;</p>
<p>The major issue I found with the G95 compiler was the use, by GIStemp, of a non-standard extension to the language for doing data declarations in a variable declaration.  Where they have:</p>
<p>INT foo(3)/1,2,3/</p>
<p>You need instead:</p>
<p>INT foo(3)<br />
DATA foo /1,2,3/</p>
<p>FWIW, I&#8217;ve moved the source files into a &#8216;src&#8217; directory, the executables into a &#8216;bin&#8217; directory and added a Makefile to do all the compiles (pulling that out of the other scripts).  At this point I have a version that works pretty well (up to the bigendian point&#8230;) compiles well, and generally seems usable for testing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan Hughes</title>
		<link>http://climateaudit.org/2007/09/10/hansen-code/#comment-104754</link>
		<dc:creator><![CDATA[Dan Hughes]]></dc:creator>
		<pubDate>Mon, 30 Mar 2009 00:29:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.climateaudit.org/?p=2041#comment-104754</guid>
		<description><![CDATA[Thanks for the info Peter.

I would like to help get the code up and running.  I have all the FORTRAN code compiled, but I did not yet look into the details of that coding.  I&#039;ve noticed that all the independent efforts started back in 2007/2008 seem to have come to a dead stop.  I remain amazed that whatever it is that prevents independent porting of the code so problematic.  Can code actually be so tightly tied specific machines and OS configurations?

Drop me an e-mail dhughes4 at mac dot com.]]></description>
		<content:encoded><![CDATA[<p>Thanks for the info Peter.</p>
<p>I would like to help get the code up and running.  I have all the FORTRAN code compiled, but I did not yet look into the details of that coding.  I&#8217;ve noticed that all the independent efforts started back in 2007/2008 seem to have come to a dead stop.  I remain amazed that whatever it is that prevents independent porting of the code so problematic.  Can code actually be so tightly tied specific machines and OS configurations?</p>
<p>Drop me an e-mail dhughes4 at mac dot com.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter O'Neill</title>
		<link>http://climateaudit.org/2007/09/10/hansen-code/#comment-104753</link>
		<dc:creator><![CDATA[Peter O'Neill]]></dc:creator>
		<pubDate>Sun, 29 Mar 2009 23:52:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.climateaudit.org/?p=2041#comment-104753</guid>
		<description><![CDATA[Re: &lt;a href=&quot;#comment-334984&quot; rel=&quot;nofollow&quot;&gt;Dan Hughes (#159)&lt;/a&gt;,

&lt;blockquote&gt;I just ran across this comment on the GISTemp Updates page:

    &lt;em&gt;&lt;strong&gt;Feb. 11,2009:&lt;/strong&gt; Two bugs in STEP0 programs were corrected before they had a chance to affect any results. Thanks to Dr. Peter O&#039;Neill for discovering and reporting them to us.&lt;/em&gt;

I don&#039;t understand how bugs discovered in 2009 cannot have affected results of calculations made in, say, the 1990s.
&lt;/blockquote&gt;
Surprising as that may seem, that is the case here.

The first bug I reported was located in unreachable code in antarc_comb.f, and would have had serious consequences but for the fact that it could never be executed. The danger of course would be that at some future date the code might be taken over by someone with experience only of structured programming, who might make the mistake of believing that FORTRAN code of a certain era was always first designed and then coded - and who might then &quot;fix&quot; the unreachable code.

The second bug was in USHCN2v2.f, where the format statement used to read ushcn.tbl selected the wrong (and blank) column for a single digit numeric value, but as the FORTRAN code reads a blank as zero, and as all the values in the correct column are in fact zero for ushcn.tbl, again the current calculations were not affected. The other .tbl files, where the corresponding values would &lt;strong&gt;not&lt;/strong&gt; have been zero, are read instead (correctly) in Python.

The coders of GISTemp seemed to have liked to live dangerously. I&#039;m curious whether this lucky streak will still hold should I find any further bugs as I work my way through the later steps.

On reflection I&#039;m beginning to think releasing the code could have been a clever strategy to get it debugged at no cost before old-timers like myself, who started out with FORTRAN II and may still be able to put ourselves in the mindset needed to follow some of the more esoteric code, die off.

Perhaps this could be our final business opportunity - &quot;we can review your &#039;legacy&#039; FORTRAN II/IV, ALGOL, PL/1, 360 ASSEMBLY, COBOL, APL, RPG II ... code; GOTOs welcome; all common, even if now deprecated, stupid programming tricks accepted&quot;?]]></description>
		<content:encoded><![CDATA[<p>Re: <a href="#comment-334984" rel="nofollow">Dan Hughes (#159)</a>,</p>
<blockquote><p>I just ran across this comment on the GISTemp Updates page:</p>
<p>    <em><strong>Feb. 11,2009:</strong> Two bugs in STEP0 programs were corrected before they had a chance to affect any results. Thanks to Dr. Peter O&#8217;Neill for discovering and reporting them to us.</em></p>
<p>I don&#8217;t understand how bugs discovered in 2009 cannot have affected results of calculations made in, say, the 1990s.
</p></blockquote>
<p>Surprising as that may seem, that is the case here.</p>
<p>The first bug I reported was located in unreachable code in antarc_comb.f, and would have had serious consequences but for the fact that it could never be executed. The danger of course would be that at some future date the code might be taken over by someone with experience only of structured programming, who might make the mistake of believing that FORTRAN code of a certain era was always first designed and then coded &#8211; and who might then &#8220;fix&#8221; the unreachable code.</p>
<p>The second bug was in USHCN2v2.f, where the format statement used to read ushcn.tbl selected the wrong (and blank) column for a single digit numeric value, but as the FORTRAN code reads a blank as zero, and as all the values in the correct column are in fact zero for ushcn.tbl, again the current calculations were not affected. The other .tbl files, where the corresponding values would <strong>not</strong> have been zero, are read instead (correctly) in Python.</p>
<p>The coders of GISTemp seemed to have liked to live dangerously. I&#8217;m curious whether this lucky streak will still hold should I find any further bugs as I work my way through the later steps.</p>
<p>On reflection I&#8217;m beginning to think releasing the code could have been a clever strategy to get it debugged at no cost before old-timers like myself, who started out with FORTRAN II and may still be able to put ourselves in the mindset needed to follow some of the more esoteric code, die off.</p>
<p>Perhaps this could be our final business opportunity &#8211; &#8220;we can review your &#8216;legacy&#8217; FORTRAN II/IV, ALGOL, PL/1, 360 ASSEMBLY, COBOL, APL, RPG II &#8230; code; GOTOs welcome; all common, even if now deprecated, stupid programming tricks accepted&#8221;?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan Hughes</title>
		<link>http://climateaudit.org/2007/09/10/hansen-code/#comment-104752</link>
		<dc:creator><![CDATA[Dan Hughes]]></dc:creator>
		<pubDate>Sat, 28 Mar 2009 11:28:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.climateaudit.org/?p=2041#comment-104752</guid>
		<description><![CDATA[I just ran across this comment on the &lt;a href=&quot;http://data.giss.nasa.gov/gistemp/updates/&quot; rel=&quot;nofollow&quot;&gt;GISTemp Updates&lt;/a&gt; page:


&lt;blockquote&gt;&lt;strong&gt;Feb. 11,2009:&lt;/strong&gt; Two bugs in STEP0 programs were corrected before they had a chance to affect any results. Thanks to Dr. Peter O&#039;Neill for discovering and reporting them to us.&lt;/blockquote&gt;

I don&#039;t understand how bugs discovered in 2009 cannot have affected results of calculations made in, say, the 1990s.]]></description>
		<content:encoded><![CDATA[<p>I just ran across this comment on the <a href="http://data.giss.nasa.gov/gistemp/updates/" rel="nofollow">GISTemp Updates</a> page:</p>
<blockquote><p><strong>Feb. 11,2009:</strong> Two bugs in STEP0 programs were corrected before they had a chance to affect any results. Thanks to Dr. Peter O&#8217;Neill for discovering and reporting them to us.</p></blockquote>
<p>I don&#8217;t understand how bugs discovered in 2009 cannot have affected results of calculations made in, say, the 1990s.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rui Sousa</title>
		<link>http://climateaudit.org/2007/09/10/hansen-code/#comment-104751</link>
		<dc:creator><![CDATA[Rui Sousa]]></dc:creator>
		<pubDate>Thu, 22 Jan 2009 13:09:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.climateaudit.org/?p=2041#comment-104751</guid>
		<description><![CDATA[Sorry, it means the average temperature of this period is 12 ºC]]></description>
		<content:encoded><![CDATA[<p>Sorry, it means the average temperature of this period is 12 ºC</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rui Sousa</title>
		<link>http://climateaudit.org/2007/09/10/hansen-code/#comment-104750</link>
		<dc:creator><![CDATA[Rui Sousa]]></dc:creator>
		<pubDate>Thu, 18 Dec 2008 14:58:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.climateaudit.org/?p=2041#comment-104750</guid>
		<description><![CDATA[To copy data from the original format to the new table I used the following code:


&lt;blockquote&gt;&lt;em&gt;
declare @Month as int
Set @Month = 1
Declare @SQLString as varchar(500)


while (@Month &lt;= 12)
BEGIN

	SET @SQLString = &#039;insert into dbo.StationMonthValue
	SELECT  CAST( v2mean.stationID as bigint), Tie, cast(v2mean.Ano as int) as [year],
	cast(? as varchar) as [Month], cast( v2mean.[?] as int) as value
	FROM         GHCNStationIventory INNER JOIN
      v2mean ON GHCNStationIventory.StationID = v2mean.stationID&#039;

    SET @SQLString = REPLACE(@SQLString,&#039;?&#039;,cast(@Month as varchar))

	EXECUTE (@SQLString)

    SET @Month = @Month + 1
END&lt;/em&gt;&lt;/blockquote&gt;

Then I queried this table to obtain the global average of the values, with this querie:


&lt;blockquote&gt;&lt;em&gt;SELECT  AVG(Value)
FROM   dbo.StationMonthValue&lt;/em&gt;&lt;/blockquote&gt;

The result was: 120

Does this mean that the whole dataset presents a raw average deviation from the reference period of 1.2 ºC ?]]></description>
		<content:encoded><![CDATA[<p>To copy data from the original format to the new table I used the following code:</p>
<blockquote><p><em><br />
declare @Month as int<br />
Set @Month = 1<br />
Declare @SQLString as varchar(500)</p>
<p>while (@Month &lt;= 12)<br />
BEGIN</p>
<p>	SET @SQLString = &#8216;insert into dbo.StationMonthValue<br />
	SELECT  CAST( v2mean.stationID as bigint), Tie, cast(v2mean.Ano as int) as [year],<br />
	cast(? as varchar) as [Month], cast( v2mean.[?] as int) as value<br />
	FROM         GHCNStationIventory INNER JOIN<br />
      v2mean ON GHCNStationIventory.StationID = v2mean.stationID&#8217;</p>
<p>    SET @SQLString = REPLACE(@SQLString,&#8217;?',cast(@Month as varchar))</p>
<p>	EXECUTE (@SQLString)</p>
<p>    SET @Month = @Month + 1<br />
END</em></p></blockquote>
<p>Then I queried this table to obtain the global average of the values, with this querie:</p>
<blockquote><p><em>SELECT  AVG(Value)<br />
FROM   dbo.StationMonthValue</em></p></blockquote>
<p>The result was: 120</p>
<p>Does this mean that the whole dataset presents a raw average deviation from the reference period of 1.2 ºC ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rui Sousa</title>
		<link>http://climateaudit.org/2007/09/10/hansen-code/#comment-104749</link>
		<dc:creator><![CDATA[Rui Sousa]]></dc:creator>
		<pubDate>Thu, 18 Dec 2008 14:51:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.climateaudit.org/?p=2041#comment-104749</guid>
		<description><![CDATA[Then I imported the station data into another table, even if I wasn&#039;t able to identify all columns, the porpuse was to be able to establish a relation with the mean data. This table has the following script:

&lt;blockquote&gt;&lt;em&gt;
CREATE TABLE [dbo].[GHCNStationIventory](
	[StationID] [varchar](11) NULL,
	[Column 1] [varchar](1) NULL,
	[Station Name] [varchar](31) NULL,
	[Latitude] [varchar](6) NULL,
	[Longitude] [varchar](8) NULL,
	[Elevation] [varchar](5) NULL,
	[col 6] [varchar](5) NULL,
	[Urbanization] [varchar](1) NULL,
	[Column 8] [varchar](5) NULL,
	[Column 9] [varchar](2) NULL,
	[Column 10] [varchar](2) NULL,
	[Column 11] [varchar](7) NULL,
	[LandType] [varchar](16) NULL,
	[C13] [varchar](1) NULL,
	[Filler] [varchar](1) NULL
) ON [PRIMARY]
&lt;/em&gt;&lt;/blockquote&gt;

My next step was to create a new table that in my opinion addresses better the Normals Forms of relational database (http://en.wikipedia.org/wiki/Database_normalization), here is the script to create this new table:

&lt;em&gt;
&lt;blockquote&gt;CREATE TABLE [dbo].[StationMonthValue](
	[StationID] [bigint] NOT NULL,
	[Tie] [int] NOT NULL,
	[Year] [int] NOT NULL,
	[Month] [int] NOT NULL,
	[Value] [int] NULL,
 CONSTRAINT [PK_StationMonthValue_1] PRIMARY KEY CLUSTERED
(
	[StationID] ASC,
	[Tie] ASC,
	[Year] ASC,
	[Month] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF,
IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
&lt;/blockquote&gt;
&lt;/em&gt;

On this new table I will have one record per value, which makes future queries much easier.]]></description>
		<content:encoded><![CDATA[<p>Then I imported the station data into another table, even if I wasn&#8217;t able to identify all columns, the porpuse was to be able to establish a relation with the mean data. This table has the following script:</p>
<blockquote><p><em><br />
CREATE TABLE [dbo].[GHCNStationIventory](<br />
	[StationID] [varchar](11) NULL,<br />
	[Column 1] [varchar](1) NULL,<br />
	[Station Name] [varchar](31) NULL,<br />
	[Latitude] [varchar](6) NULL,<br />
	[Longitude] [varchar](8) NULL,<br />
	[Elevation] [varchar](5) NULL,<br />
	[col 6] [varchar](5) NULL,<br />
	[Urbanization] [varchar](1) NULL,<br />
	[Column 8] [varchar](5) NULL,<br />
	[Column 9] [varchar](2) NULL,<br />
	[Column 10] [varchar](2) NULL,<br />
	[Column 11] [varchar](7) NULL,<br />
	[LandType] [varchar](16) NULL,<br />
	[C13] [varchar](1) NULL,<br />
	[Filler] [varchar](1) NULL<br />
) ON [PRIMARY]<br />
</em></p></blockquote>
<p>My next step was to create a new table that in my opinion addresses better the Normals Forms of relational database (<a href="http://en.wikipedia.org/wiki/Database_normalization" rel="nofollow">http://en.wikipedia.org/wiki/Database_normalization</a>), here is the script to create this new table:</p>
<p><em></p>
<blockquote><p>CREATE TABLE [dbo].[StationMonthValue](<br />
	[StationID] [bigint] NOT NULL,<br />
	[Tie] [int] NOT NULL,<br />
	[Year] [int] NOT NULL,<br />
	[Month] [int] NOT NULL,<br />
	[Value] [int] NULL,<br />
 CONSTRAINT [PK_StationMonthValue_1] PRIMARY KEY CLUSTERED<br />
(<br />
	[StationID] ASC,<br />
	[Tie] ASC,<br />
	[Year] ASC,<br />
	[Month] ASC<br />
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF,<br />
IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]<br />
) ON [PRIMARY]
</p></blockquote>
<p></em></p>
<p>On this new table I will have one record per value, which makes future queries much easier.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rui Sousa</title>
		<link>http://climateaudit.org/2007/09/10/hansen-code/#comment-104748</link>
		<dc:creator><![CDATA[Rui Sousa]]></dc:creator>
		<pubDate>Thu, 18 Dec 2008 14:40:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.climateaudit.org/?p=2041#comment-104748</guid>
		<description><![CDATA[Hello friends,

I have taken the v2.mean file from GHCN and I have imported it to an SQL Server 2008 database, to explore the data with the tools I am used to.

I imported the raw data to a new table and then runned a SQL script to transform -9999 into Null values.

The create table script is:


&lt;blockquote&gt;&lt;em&gt;
CREATE TABLE [dbo].[v2mean](
	[stationID] [varchar](11) NULL,
	[Tie] [varchar](1) NULL,
	[Ano] [varchar](4) NULL,
	[1] [varchar](5) NULL,
	[2] [varchar](5) NULL,
	[3] [varchar](5) NULL,
	[4] [varchar](5) NULL,
	[5] [varchar](5) NULL,
	[6] [varchar](5) NULL,
	[7] [varchar](5) NULL,
	[8] [varchar](5) NULL,
	[9] [varchar](5) NULL,
	[10] [varchar](5) NULL,
	[11] [varchar](5) NULL,
	[12] [varchar](5) NULL,
	[filler] [varchar](1) NULL
) ON [PRIMARY]
&lt;/em&gt;
&lt;/blockquote&gt;



The script to handle the null values is here:


&lt;blockquote&gt;&lt;em&gt;
declare @Month as int
Set @Month = 1
Declare @SQLString as varchar(500)

while (@Month &lt;= 12)
BEGIN

	SET @SQLString = &#039;update dbo.[v2mean]
					set [{0}] = null
					where [{0}] = {1}&#039;

	set @SQLString = REPLACE(@SQLString,&#039;{0}&#039;,cast(@Month as varchar))
	set @SQLString = REPLACE(@SQLString,&#039;{1}&#039;,&#039;-9999&#039;)

	execute (@sqlstring)

	set @Month = @Month + 1
END
&lt;/em&gt;&lt;/blockquote&gt;]]></description>
		<content:encoded><![CDATA[<p>Hello friends,</p>
<p>I have taken the v2.mean file from GHCN and I have imported it to an SQL Server 2008 database, to explore the data with the tools I am used to.</p>
<p>I imported the raw data to a new table and then runned a SQL script to transform -9999 into Null values.</p>
<p>The create table script is:</p>
<blockquote><p><em><br />
CREATE TABLE [dbo].[v2mean](<br />
	[stationID] [varchar](11) NULL,<br />
	[Tie] [varchar](1) NULL,<br />
	[Ano] [varchar](4) NULL,<br />
	[1] [varchar](5) NULL,<br />
	[2] [varchar](5) NULL,<br />
	[3] [varchar](5) NULL,<br />
	[4] [varchar](5) NULL,<br />
	[5] [varchar](5) NULL,<br />
	[6] [varchar](5) NULL,<br />
	[7] [varchar](5) NULL,<br />
	[8] [varchar](5) NULL,<br />
	[9] [varchar](5) NULL,<br />
	[10] [varchar](5) NULL,<br />
	[11] [varchar](5) NULL,<br />
	[12] [varchar](5) NULL,<br />
	[filler] [varchar](1) NULL<br />
) ON [PRIMARY]<br />
</em>
</p></blockquote>
<p>The script to handle the null values is here:</p>
<blockquote><p><em><br />
declare @Month as int<br />
Set @Month = 1<br />
Declare @SQLString as varchar(500)</p>
<p>while (@Month &lt;= 12)<br />
BEGIN</p>
<p>	SET @SQLString = &#8216;update dbo.[v2mean]<br />
					set [{0}] = null<br />
					where [{0}] = {1}&#8217;</p>
<p>	set @SQLString = REPLACE(@SQLString,&#8217;{0}&#8217;,cast(@Month as varchar))<br />
	set @SQLString = REPLACE(@SQLString,&#8217;{1}&#8217;,'-9999&#8242;)</p>
<p>	execute (@sqlstring)</p>
<p>	set @Month = @Month + 1<br />
END<br />
</em></p></blockquote>
]]></content:encoded>
	</item>
</channel>
</rss>
