<?xml version="1.0" encoding="UTF-8" standalone="yes"?><oembed><version><![CDATA[1.0]]></version><provider_name><![CDATA[Real Science]]></provider_name><provider_url><![CDATA[https://stevengoddard.wordpress.com]]></provider_url><author_name><![CDATA[stevengoddard]]></author_name><author_url><![CDATA[https://stevengoddard.wordpress.com/author/stevengoddard/]]></author_url><title><![CDATA[C++ For Climate&nbsp;Gurus]]></title><type><![CDATA[link]]></type><html><![CDATA[<p>Most climate science code is in Fortran. Here is a useful C++ code snippet in case they ever want to switch over.</p>
<pre>float record_temperature = yearly_temperatures[2005];
float 2010_temperature = yearly_temperatures[2010];

while (2010_temperature &lt; record_temperature)
{
    for (int month = 0; month &lt; 12; month++)
    {
        float monthly_temperature = monthly_temperatures[2010][month];
        float random_noise = ( float( (rand() % 5 ) / 10 ) - 0.15 );
        monthly_temperature += random_noise;
        monthly_temperatures[2010][month] = monthly_temperature;
        2010_temperature += (random_noise / 12);
    }
}

yearly_temperatures[2010] = 2010_temperature;
record_temperature = 2010_temperature;
</pre>
]]></html></oembed>