<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3AClimate</id>
	<title>Module:Climate - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3AClimate"/>
	<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Climate&amp;action=history"/>
	<updated>2026-05-27T03:38:36Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://stockhub.co/index.php?title=Module:Climate&amp;diff=135680&amp;oldid=prev</id>
		<title>imported&gt;Erutuon: Module:Table → Module:TableTools</title>
		<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Climate&amp;diff=135680&amp;oldid=prev"/>
		<updated>2019-02-28T01:08:17Z</updated>

		<summary type="html">&lt;p&gt;&lt;a href=&quot;/index.php?title=Module:Table&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Module:Table (page does not exist)&quot;&gt;Module:Table&lt;/a&gt; → &lt;a href=&quot;/research/Module:TableTools&quot; title=&quot;Module:TableTools&quot;&gt;Module:TableTools&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;require &amp;quot;Module:Log globals&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
local Stats = require &amp;quot;Module:Climate/stats&amp;quot;&lt;br /&gt;
local mean = Stats.ops.mean&lt;br /&gt;
&lt;br /&gt;
local map = require &amp;quot;Module:fun&amp;quot;.map&lt;br /&gt;
&lt;br /&gt;
local use_alt_CD_isotherm = false&lt;br /&gt;
local use_alt_hk_isotherm = false&lt;br /&gt;
local use_alt_w_isotherm = false&lt;br /&gt;
&lt;br /&gt;
local minus_sign = &amp;#039;−&amp;#039; -- U+2212 (MINUS SIGN)&lt;br /&gt;
&lt;br /&gt;
local function errorf(level, ...)&lt;br /&gt;
	if type(level) == &amp;quot;number&amp;quot; then&lt;br /&gt;
		return error(string.format(...), level + 1)&lt;br /&gt;
	else -- level is actually the format string.&lt;br /&gt;
		return error(string.format(level, ...), 2)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function logf(...)&lt;br /&gt;
	mw.log(string.format(...))&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
errorf = logf&lt;br /&gt;
&lt;br /&gt;
local function in_range(val, low, high)&lt;br /&gt;
	if low &amp;lt; high then -- |---i+++j---|&lt;br /&gt;
		return low &amp;lt;= val and val &amp;lt;= high&lt;br /&gt;
	else -- |+++j---i+++|&lt;br /&gt;
		return val &amp;lt; high or low &amp;lt; val&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function get_aridity_threshold(mean_temp, total_precip, total_summer_precip)&lt;br /&gt;
	local summer_precip_fraction = total_summer_precip / total_precip&lt;br /&gt;
	return mean_temp * 20&lt;br /&gt;
		+ (summer_precip_fraction &amp;gt;= 0.7 and 280&lt;br /&gt;
		or summer_precip_fraction &amp;gt;= 0.3 and 140&lt;br /&gt;
		or 0)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- in C:      cond ? a : b&lt;br /&gt;
-- in Python: a if cond else b&lt;br /&gt;
local function ternary(cond, a, b)&lt;br /&gt;
	if cond then&lt;br /&gt;
		return a&lt;br /&gt;
	else&lt;br /&gt;
		return b&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function mean_of_highs_and_lows(highs, lows)&lt;br /&gt;
	local high_count, low_count = #highs, #lows&lt;br /&gt;
	-- for now, no annual average accepted&lt;br /&gt;
	if not (high_count == 12 and low_count == 12) then&lt;br /&gt;
		errorf(&amp;quot;Wrong number of highs or lows (%d, %d): expected 12 each&amp;quot;,&lt;br /&gt;
			high_count, low_count)&lt;br /&gt;
	elseif high_count ~= low_count then&lt;br /&gt;
		errorf(&amp;quot;Number of highs (%d) is not equal to number of lows (%d)&amp;quot;,&lt;br /&gt;
			high_count, low_count)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local temperatures = {}&lt;br /&gt;
	&lt;br /&gt;
	for i = 1, high_count do&lt;br /&gt;
		if not highs[i] then&lt;br /&gt;
			errorf(&amp;quot;High #%d is missing&amp;quot;, i)&lt;br /&gt;
		elseif not lows[i] then&lt;br /&gt;
			errorf(&amp;quot;Low #%d is missing&amp;quot;, i)&lt;br /&gt;
		elseif highs[i] &amp;lt;= lows[i] then&lt;br /&gt;
			mw.logObject({ highs = highs, lows = lows })&lt;br /&gt;
			errorf(&amp;quot;High #%d (%d) is not greater than low #%d (%d)&amp;quot;,&lt;br /&gt;
				i, highs[i], i, lows[i])&lt;br /&gt;
		end&lt;br /&gt;
		temperatures[i] = mean(highs[i], lows[i])&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return temperatures&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function check_temperatures_and_precipitation(temperatures, precipitation, Southern_Hemisphere)&lt;br /&gt;
	local temperature_count = #temperatures&lt;br /&gt;
	if temperature_count == 2 then&lt;br /&gt;
		local highs_and_lows = temperatures&lt;br /&gt;
		temperatures = mean_of_highs_and_lows(unpack(temperatures))&lt;br /&gt;
	elseif temperature_count ~=  12 then&lt;br /&gt;
		errorf(&amp;quot;Wrong number of temperatures (expected 12, got %d)&amp;quot;,&lt;br /&gt;
			temperature_count)&lt;br /&gt;
	elseif #precipitation ~= 12 then&lt;br /&gt;
		errorf(&amp;quot;Wrong number of precipitation stats (expected 12, got %d)&amp;quot;,&lt;br /&gt;
			#precipitation)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	temperatures = Stats(temperatures, Southern_Hemisphere)&lt;br /&gt;
	precipitation = Stats(precipitation, Southern_Hemisphere)&lt;br /&gt;
	&lt;br /&gt;
	return temperatures, precipitation&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Temperatures and precipitation are tables of mean monthly temperature and&lt;br /&gt;
-- precipitation. Or temperatures can be a table containing a table of monthly&lt;br /&gt;
-- mean of daily highs and monthly mean of daily lows.&lt;br /&gt;
-- Units: °C, mm.&lt;br /&gt;
function p.Koeppen(temperatures, precipitation, Southern_Hemisphere, location)&lt;br /&gt;
	temperatures, precipitation =&lt;br /&gt;
		check_temperatures_and_precipitation(temperatures, precipitation, Southern_Hemisphere)&lt;br /&gt;
	&lt;br /&gt;
	-- E takes precedence over B, B over A, C, D:&lt;br /&gt;
	-- http://hanschen.org/koppen/&lt;br /&gt;
	if temperatures.max.value &amp;lt; 0 then&lt;br /&gt;
		return &amp;quot;EF&amp;quot;&lt;br /&gt;
	elseif temperatures.max.value &amp;lt; 10 then&lt;br /&gt;
		return &amp;quot;ET&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
		&lt;br /&gt;
	local aridity_threshold =&lt;br /&gt;
		get_aridity_threshold(temperatures.mean, precipitation.sum, precipitation.summer_sum)&lt;br /&gt;
	&lt;br /&gt;
	if precipitation.sum &amp;lt;= aridity_threshold then&lt;br /&gt;
		return &amp;quot;B&amp;quot;&lt;br /&gt;
			 .. (precipitation.sum &amp;gt; aridity_threshold / 2 and &amp;quot;S&amp;quot; or &amp;quot;W&amp;quot;) -- semi-arid, arid&lt;br /&gt;
			 .. (ternary(use_alt_hk_isotherm, temperatures.mean &amp;gt;= 18,&lt;br /&gt;
			 	temperatures.min.value &amp;gt; 0)&lt;br /&gt;
			 	and &amp;quot;h&amp;quot; or &amp;quot;k&amp;quot;)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local first_letter =&lt;br /&gt;
		temperatures.min.value &amp;gt;= 18 and &amp;quot;A&amp;quot;&lt;br /&gt;
		or temperatures.min.value &amp;gt;  (use_alt_CD_isotherm and -3 or 0) and &amp;quot;C&amp;quot;&lt;br /&gt;
		or &amp;quot;D&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	if first_letter == &amp;quot;A&amp;quot; then&lt;br /&gt;
		return first_letter&lt;br /&gt;
			.. (precipitation.min.value &amp;gt;= 60 and &amp;quot;f&amp;quot;&lt;br /&gt;
			or  precipitation.min.value / precipitation.sum &amp;gt; 0.04 and &amp;quot;m&amp;quot;&lt;br /&gt;
			or  in_range(precipitation.min.index, unpack(precipitation.summer_months))&lt;br /&gt;
				and &amp;quot;s&amp;quot;&lt;br /&gt;
			or  &amp;quot;w&amp;quot;)&lt;br /&gt;
	else&lt;br /&gt;
		local second_letter =&lt;br /&gt;
			ternary(use_alt_w_isotherm, precipitation.sum / precipitation.summer_sum &amp;gt;= 0.7,&lt;br /&gt;
				precipitation.summer_max.value &amp;gt; precipitation.winter_min.value * 10)&lt;br /&gt;
				and &amp;quot;w&amp;quot;&lt;br /&gt;
			or precipitation.summer_min.value &amp;lt; 30&lt;br /&gt;
				and precipitation.winter_max.value &amp;gt; precipitation.summer_min.value * 3&lt;br /&gt;
				and &amp;quot;s&amp;quot;&lt;br /&gt;
			or &amp;quot;f&amp;quot;&lt;br /&gt;
		&lt;br /&gt;
		local third_letter&lt;br /&gt;
		if temperatures.above_10 &amp;lt;= 3 then&lt;br /&gt;
			if temperatures.min.value &amp;lt; -38 then&lt;br /&gt;
				third_letter = &amp;quot;d&amp;quot;&lt;br /&gt;
			else&lt;br /&gt;
				third_letter = &amp;quot;c&amp;quot;&lt;br /&gt;
			end&lt;br /&gt;
		elseif temperatures.max.value &amp;lt; 22 then&lt;br /&gt;
			third_letter = &amp;quot;b&amp;quot;&lt;br /&gt;
		else&lt;br /&gt;
			third_letter = &amp;quot;a&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		return first_letter .. second_letter .. third_letter&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.Trewartha(temperatures, precipitation, Southern_Hemisphere)&lt;br /&gt;
	temperatures, precipitation =&lt;br /&gt;
		check_temperatures_and_precipitation(temperatures, precipitation, Southern_Hemisphere)&lt;br /&gt;
	&lt;br /&gt;
	if temperatures.max.value &amp;lt; 0 then&lt;br /&gt;
		return &amp;quot;Fi&amp;quot;&lt;br /&gt;
	elseif temperatures.max.value &amp;lt; 10 then&lt;br /&gt;
		return &amp;quot;Ft&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- according to Wikipedia article&lt;br /&gt;
	local aridity_threshold =&lt;br /&gt;
		10 * (temperature.mean - 10) + 3 * precipitation.summer_sum / precipitation.sum&lt;br /&gt;
	&lt;br /&gt;
	if precipitation.sum &amp;lt; aridity_threshold then&lt;br /&gt;
		return &amp;quot;BW&amp;quot;&lt;br /&gt;
	elseif precipitation.sum &amp;lt; aridity_threshold * 2 then&lt;br /&gt;
		return &amp;quot;BS&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if temperature.min &amp;gt;= 18 then&lt;br /&gt;
		if precipitation.below_60 &amp;lt;= 2 then&lt;br /&gt;
			return &amp;quot;Ar&amp;quot;&lt;br /&gt;
		elseif in_range(precipitation.min.index, unpack(precipitation.winter_months)) then&lt;br /&gt;
			return &amp;quot;Aw&amp;quot;&lt;br /&gt;
		else&lt;br /&gt;
			return &amp;quot;As&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
	elseif temperature.above_10 &amp;gt;= 8 then&lt;br /&gt;
		return &amp;quot;C&amp;quot; -- TODO: Cf, Cs, Cw; a, b, c&lt;br /&gt;
	elseif temperature.above_10 &amp;gt;= 4 then&lt;br /&gt;
		if temperature.max.value &amp;gt; 0 then -- TODO: a, b, c?&lt;br /&gt;
			return &amp;quot;Do&amp;quot;&lt;br /&gt;
		else&lt;br /&gt;
			return &amp;quot;Dc&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		if temperature.min.value &amp;gt; -10 then&lt;br /&gt;
			return &amp;quot;Eo&amp;quot;&lt;br /&gt;
		else&lt;br /&gt;
			return &amp;quot;Ec&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	-- H excluded&lt;br /&gt;
	-- Universal Thermal Scale?&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function gather_numbers(str)&lt;br /&gt;
	str = str:gsub(minus_sign, &amp;#039;-&amp;#039;) -- U+2212 (MINUS SIGN) -&amp;gt; U+002D (HYPHEN-MINUS)&lt;br /&gt;
	local arr = {}&lt;br /&gt;
	local i = 0&lt;br /&gt;
	for number in str:gmatch(&amp;#039;%-?%d+%.?%d*&amp;#039;) do&lt;br /&gt;
		i = i + 1&lt;br /&gt;
		arr[i] = tonumber(number)&lt;br /&gt;
	end&lt;br /&gt;
	return arr&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local convert_functions = {&lt;br /&gt;
	C = {&lt;br /&gt;
		F = function(value) return (value - 32) * 5/9 end, -- F to C&lt;br /&gt;
	},&lt;br /&gt;
	F = {&lt;br /&gt;
		C = function(value) return (value * 9/5) + 32 end, -- C to F&lt;br /&gt;
	},&lt;br /&gt;
	mm = {&lt;br /&gt;
		inch = function(value) return value * 25.4 end, -- inch to mm&lt;br /&gt;
		cm = function(value) return value * 10 end, -- cm to mm&lt;br /&gt;
	},&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
local function convert(values, to, from)&lt;br /&gt;
	if to == from then&lt;br /&gt;
		return values&lt;br /&gt;
	elseif convert_functions[to] and convert_functions[to][from] then&lt;br /&gt;
		return map(convert_functions[to][from], values)&lt;br /&gt;
	end&lt;br /&gt;
	return errorf(&amp;quot;Conversion from %s to %s not implemented&amp;quot;, from or &amp;quot;nil&amp;quot;, to or &amp;quot;nil&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.example(frame)&lt;br /&gt;
	local args = frame.args&lt;br /&gt;
	local temperatures, lows, highs, precipitation&lt;br /&gt;
	local yesno = require &amp;#039;Module:yesno&amp;#039;&lt;br /&gt;
	&lt;br /&gt;
	local Southern_Hemisphere = yesno(args[3]) or false&lt;br /&gt;
	&lt;br /&gt;
	if args[1] then&lt;br /&gt;
		-- If args[3] can be parsed into a boolean, it is specifying the hemisphere.&lt;br /&gt;
		-- Otherwise, it must be a list of monthly average precipitation values, and&lt;br /&gt;
		-- args[1] and args[2] are monthly mean lows and highs.&lt;br /&gt;
		if args[3] and yesno(args[3]) == nil then -- args[3] is not boolean&lt;br /&gt;
			highs, lows, precipitation = args[1], args[2], args[3]&lt;br /&gt;
		else&lt;br /&gt;
			temperatures, precipitation = args[1], args[2]&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		temperatures, lows, highs, precipitation = args.temp, args.lows, args.highs, args.precip&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if lows and highs then&lt;br /&gt;
		lows, highs = gather_numbers(lows), gather_numbers(highs)&lt;br /&gt;
		&lt;br /&gt;
		if args.temp_unit then&lt;br /&gt;
			lows, highs = convert(lows, &amp;quot;C&amp;quot;, args.temp_unit),&lt;br /&gt;
				convert(highs, &amp;quot;C&amp;quot;, args.temp_unit)&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		temperatures = { highs, lows }&lt;br /&gt;
	else&lt;br /&gt;
		temperatures = gather_numbers(temperatures)&lt;br /&gt;
		&lt;br /&gt;
		if args.temp_unit then&lt;br /&gt;
			temperatures = convert(temperatures, &amp;quot;C&amp;quot;, args.temp_unit)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	precipitation = gather_numbers(precipitation)&lt;br /&gt;
	&lt;br /&gt;
	if args.precip_unit then&lt;br /&gt;
		precipitation = convert(precipitation, &amp;quot;mm&amp;quot;, args.precip_unit)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if yesno(args.alt_CD) then&lt;br /&gt;
		use_alt_CD_isotherm = true&lt;br /&gt;
	end&lt;br /&gt;
	if yesno(args.alt_hk) then&lt;br /&gt;
		use_alt_hk_isotherm = true&lt;br /&gt;
	end&lt;br /&gt;
	if yesno(args.alt_w) then&lt;br /&gt;
		use_alt_w_isotherm = true&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local location = args.location&lt;br /&gt;
	local result = p.Koeppen(temperatures, precipitation, Southern_Hemisphere, location)&lt;br /&gt;
	-- mw.logObject{ temperatures = temperatures, precipitation = precipitation }&lt;br /&gt;
	&lt;br /&gt;
	if args.url and location then&lt;br /&gt;
		return (&amp;quot;[%s %s]: %s&amp;quot;):format(args.url, location, result)&lt;br /&gt;
	else&lt;br /&gt;
		return result&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local month_to_number = require &amp;quot;Module:TableTools&amp;quot;.invert {&lt;br /&gt;
	&amp;quot;Jan&amp;quot;, &amp;quot;Feb&amp;quot;, &amp;quot;Mar&amp;quot;, &amp;quot;Apr&amp;quot;, &amp;quot;May&amp;quot;, &amp;quot;Jun&amp;quot;, &amp;quot;Jul&amp;quot;, &amp;quot;Aug&amp;quot;, &amp;quot;Sep&amp;quot;, &amp;quot;Oct&amp;quot;, &amp;quot;Nov&amp;quot;, &amp;quot;Dec&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
setmetatable(month_to_number, {&lt;br /&gt;
	__index = function (self, key)&lt;br /&gt;
		errorf(&amp;quot;Month %s not recognized&amp;quot;, key)&lt;br /&gt;
	end&lt;br /&gt;
})&lt;br /&gt;
&lt;br /&gt;
local precipitation_units = require &amp;quot;Module:TableTools&amp;quot;.listToSet {&lt;br /&gt;
	&amp;quot;inch&amp;quot;, &amp;quot;cm&amp;quot;, &amp;quot;mm&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function p.weather_box_Koeppen(frame)&lt;br /&gt;
	local errorf = logf&lt;br /&gt;
	local results = setmetatable({}, {&lt;br /&gt;
		__index = function (self, key)&lt;br /&gt;
			if key == &amp;quot;temperatures&amp;quot; or key == &amp;quot;precipitation&amp;quot; or key == &amp;quot;highs&amp;quot; or key == &amp;quot;lows&amp;quot; then&lt;br /&gt;
				local val = {}&lt;br /&gt;
				self[key] = val&lt;br /&gt;
				return val&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	})&lt;br /&gt;
&lt;br /&gt;
	local args = frame:getParent().args&lt;br /&gt;
	for k, v in pairs(args) do&lt;br /&gt;
		local month, stat_type, unit&lt;br /&gt;
		if type(k) == &amp;quot;string&amp;quot; then&lt;br /&gt;
			month, stat_type, unit = k:match(&amp;quot;(%u%l%l) (%l+) (%a+)&amp;quot;)&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		if month and month_to_number[month] and v ~= &amp;quot;&amp;quot; then&lt;br /&gt;
			local result&lt;br /&gt;
			if (stat_type == &amp;quot;high&amp;quot; or stat_type == &amp;quot;low&amp;quot; or stat_type == &amp;quot;mean&amp;quot;)&lt;br /&gt;
					and (unit == &amp;quot;C&amp;quot; or unit == &amp;quot;F&amp;quot;) then&lt;br /&gt;
				result = results[stat_type == &amp;quot;high&amp;quot; and &amp;quot;highs&amp;quot; or stat_type == &amp;quot;low&amp;quot; and &amp;quot;lows&amp;quot;&lt;br /&gt;
					or stat_type == &amp;quot;mean&amp;quot; and &amp;quot;temperatures&amp;quot;]&lt;br /&gt;
			elseif stat_type == &amp;quot;precipitation&amp;quot; and (unit == &amp;quot;mm&amp;quot; or unit == &amp;quot;cm&amp;quot; or unit == &amp;quot;inch&amp;quot;) then&lt;br /&gt;
				result = results.precipitation&lt;br /&gt;
			end&lt;br /&gt;
			&lt;br /&gt;
			if result then&lt;br /&gt;
				if result.unit then&lt;br /&gt;
					if result.unit ~= unit then&lt;br /&gt;
						errorf(&amp;quot;Unit %s conflicts with earlier unit %s&amp;quot;, unit, result.unit)&lt;br /&gt;
					end&lt;br /&gt;
				else&lt;br /&gt;
					result.unit = unit&lt;br /&gt;
				end&lt;br /&gt;
				&lt;br /&gt;
				-- U+2212 (MINUS SIGN) -&amp;gt; U+002D (HYPHEN-MINUS)&lt;br /&gt;
				v = v:gsub(minus_sign, &amp;quot;-&amp;quot;)&lt;br /&gt;
				result[month_to_number[month]] = tonumber(v)&lt;br /&gt;
					or errorf(&amp;quot;Value of parameter &amp;#039;|%s=%s&amp;#039; cannot be parsed as a number&amp;quot;,&lt;br /&gt;
						k, v)&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	setmetatable(results, nil)&lt;br /&gt;
	&lt;br /&gt;
	if not ((results.temperature or results.highs and results.lows)&lt;br /&gt;
			and results.precipitation) then&lt;br /&gt;
		mw.logObject(results)&lt;br /&gt;
		errorf(&amp;quot;Something is missing; cannot determine climate classification.&amp;quot;)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	for name, result in pairs(results) do&lt;br /&gt;
		local length = require &amp;quot;Module:TableTools&amp;quot;.length(result)&lt;br /&gt;
		if length == 13 then&lt;br /&gt;
			result[13] = nil&lt;br /&gt;
		elseif length ~= 12 then&lt;br /&gt;
			mw.logObject(results)&lt;br /&gt;
			errorf(&amp;quot;Not the right number of %s stats (got %d, expected 12 or 13)&amp;quot;,&lt;br /&gt;
				name, length)&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		if result.unit and (result.unit == &amp;quot;inch&amp;quot; or result.unit == &amp;quot;cm&amp;quot; or result.unit == &amp;quot;F&amp;quot;) then&lt;br /&gt;
			results[name] = convert(result,&lt;br /&gt;
				(result.unit == &amp;quot;inch&amp;quot; or result.unit == &amp;quot;cm&amp;quot;) and &amp;quot;mm&amp;quot; or &amp;quot;C&amp;quot;,&lt;br /&gt;
				result.unit)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	mw.logObject(results)&lt;br /&gt;
	&lt;br /&gt;
	local Southern_Hemisphere = require &amp;quot;Module:Yesno&amp;quot; (args.south)&lt;br /&gt;
	&lt;br /&gt;
	if not results.temperature and results.lows and results.highs then&lt;br /&gt;
		results.temperature = { results.highs, results.lows }&lt;br /&gt;
		results.highs, results.lows = nil, nil -- not necessary&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return &amp;quot; &amp;amp;ndash; [[Köppen climate classification|Köppen]] &amp;#039;&amp;#039;&amp;quot;&lt;br /&gt;
		.. p.Koeppen(results.temperature, results.precipitation, Southern_Hemisphere)&lt;br /&gt;
		.. &amp;quot;&amp;#039;&amp;#039;&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.Weather_box_Koeppen = p.weather_box_Koeppen&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>imported&gt;Erutuon</name></author>
	</entry>
</feed>