Modul:Weather box

Fra Wikipedia, den frie encyklopædi
Documentation icon Moduldokumentation[vis] [redigér] [historik] [opfrisk]

Brug[rediger kildetekst]

Dette modul bruges af {{Infoboks vejr}}.

{{#invoke:Weather box|function_name}}


Vejr for Edmonton City Centre (Blatchford Field) Airport (1981−2010)
Jan Feb Mar Apr Maj Jun Jul Aug Sep Okt Nov Dec År
Højest målte °C 11,7 14 23,9 31,1 32,3 34,9 34,6 34,5 33,9 28,6 21,7 16,7 34,9
Gennemsnitlig maks °C −6 −2,7 2,2 11,2 17,5 21 23,1 22,6 17,1 10,4 0 −4,5 9,3
Gennemsnitlig °C −10,4 −7,6 −2,5 5,4 11,5 15,5 17,7 16,9 11,4 5,1 −4,1 −8,8 4,2
Gennemsnitlig min °C −14,8 −12,5 −7,2 −0,5 5,4 9,9 12,3 11,3 5,8 −0,2 −8,2 −13,1 −1
Lavest målte °C −44,4 −46,1 −36,1 −25,6 −12,2 −1,1 0,6 −1,2 −11,7 −25 −34,1 −48,3 −48,3
Laveste wind chill −52,8 −50,7 −44,6 −37,5 −14,5 0 0 −3,7 −13,3 −34,3 −50,2 −55,5 −55,5
Gennemsnitlig nedbør mm 21,7 12 15,8 28,8 46,1 77,5 93,8 61,9 43,5 21,7 18 15 455,7
Gennemsnitlig regn mm 1,3 0,76 1,7 14,5 40,7 77,5 93,8 61,8 42,4 10,9 1,6 0,73 347,8
Gennemsnitlig sne cm 24,5 13,4 17,4 15,3 4,9 0 0 0 1 11,6 19,1 16,4 123,5
Gns. dage med nedbør (≥ 0.2 mm) 11 7,9 8,3 8,8 11 14,2 14,6 11,1 9,8 8 8,8 9,4 122,9
Gns. dage med regn (≥ 0.2 mm) 1,1 0,83 1,4 5,9 10,5 14,2 14,6 11,1 9,6 5,6 1,5 0,75 77,3
Gns. dage med sne (≥ 0.2 cm) 10,7 7,7 7,7 4,2 1,2 0 0 0 0,5 3,2 7,9 9,3 52,4
Gns. luftfugtighed (%) 65,2 61,2 56,5 42,9 40,4 48,2 52,6 51,4 50,1 50,5 64,7 65,4 54,1
Gns. månedlige solskinstimer 100,8 121,7 176,3 244,2 279,9 285,9 307,5 282,3 192,7 170,8 98,4 84,5 2.344,8
Pct. af muligt solskin 40,2 44,1 48,1 58,2 56,8 56,2 60,2 61,5 50,4 52 37,8 36 50,1
Gennemsnitlig UV-index 0 1 3 5 7 9 11 9 7 5 3 1 5
Kilde: Environment Canada,[1] Weather Atlas[2]


Vejr for Edmonton City Centre (Blatchford Field) Airport (1981−2010)
Jan Feb Mar Apr Maj Jun Jul Aug Sep Okt Nov Dec År
Højest målte °C 11,7 14 23,9 31,1 32,3 34,9 34,6 34,5 33,9 28,6 21,7 16,7 34,9
Gennemsnitlig maks °C −6 −2,7 2,2 11,2 17,5 21 23,1 22,6 17,1 10,4 0 −4,5 9,3
Gennemsnitlig °C −10,4 −7,6 −2,5 5,4 11,5 15,5 17,7 16,9 11,4 5,1 −4,1 −8,8 4,2
Gennemsnitlig min °C −14,8 −12,5 −7,2 −0,5 5,4 9,9 12,3 11,3 5,8 −0,2 −8,2 −13,1 −1
Lavest målte °C −44,4 −46,1 −36,1 −25,6 −12,2 −1,1 0,6 −1,2 −11,7 −25 −34,1 −48,3 −48,3
Laveste wind chill −52,8 −50,7 −44,6 −37,5 −14,5 0 0 −3,7 −13,3 −34,3 −50,2 −55,5 −55,5
Gennemsnitlig nedbør mm 21,7 12 15,8 28,8 46,1 77,5 93,8 61,9 43,5 21,7 18 15 455,7
Gennemsnitlig regn mm 1,3 0,76 1,7 14,5 40,7 77,5 93,8 61,8 42,4 10,9 1,6 0,73 347,8
Gennemsnitlig sne cm 24,5 13,4 17,4 15,3 4,9 0 0 0 1 11,6 19,1 16,4 123,5
Gns. dage med nedbør (≥ 0.2 mm) 11 7,9 8,3 8,8 11 14,2 14,6 11,1 9,8 8 8,8 9,4 122,9
Gns. dage med regn (≥ 0.2 mm) 1,1 0,83 1,4 5,9 10,5 14,2 14,6 11,1 9,6 5,6 1,5 0,75 77,3
Gns. dage med sne (≥ 0.2 cm) 10,7 7,7 7,7 4,2 1,2 0 0 0 0,5 3,2 7,9 9,3 52,4
Gns. luftfugtighed (%) 65,2 61,2 56,5 42,9 40,4 48,2 52,6 51,4 50,1 50,5 64,7 65,4 54,1
Gns. månedlige solskinstimer 100,8 121,7 176,3 244,2 279,9 285,9 307,5 282,3 192,7 170,8 98,4 84,5 2.344,8
Pct. af muligt solskin 40,2 44,1 48,1 58,2 56,8 56,2 60,2 61,5 50,4 52 37,8 36 50,1
Gennemsnitlig UV-index 0 1 3 5 7 9 11 9 7 5 3 1 5
Kilde: Environment Canada,[1] Weather Atlas[3]

Kildehenvisninger

  1. ^ a b "Edmonton City Centre Airport". Canadian Climate Normals 1981−2010. Environment Canada. 19. august 2013. Hentet 10. september 2013.
  2. ^ "Monthly weather forecast and Climate: Edmonton, Canada". Weather Atlas. Hentet 12. marts 2019.
  3. ^ "Monthly weather forecast and Climate: Edmonton, Canada". Weather Atlas. Hentet 12. marts 2019.

Dansk eksempel[rediger kildetekst]

Vejr for Aalborg
Jan Feb Mar Apr Maj Jun Jul Aug Sep Okt Nov Dec År
Gennemsnitlig maks °C 2 2 5 10 15 19 20 20 16 12 7 3 10,9
Gennemsnitlig °C 0 0 2 6 11 14 16 16 12 9 4 1 7,5
Gennemsnitlig min °C −3 −3 −1 2 6 10 12 11 9 6 2 −1 4
Gennemsnitlig nedbør mm 54 35 44 38 49 54 64 67 72 76 75 62 689
Kilde (12. maj 2009): Danmarks Meteorologiske Institut [1]

Kildehenvisninger

  1. ^ "(dansk) Klimanormaler for Danmark". Danmarks Meteorologiske Institut. Hentet 12. maj 2009.

-- Implement [[Template:Weather box]].

local precision = require('Module:Math')._precision
local checkFlag = require('Module:Weather box/row').checkFlag

local function stripToNil(text)
	-- If text is a non-empty string, return its trimmed content.
	-- Otherwise, return nothing (text is an empty string or is not a string).
	if type(text) == 'string' then
		return text:match('(%S.-)%s*$')
	end
end

local function isAny(args, suffix)
	local months = { 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Maj', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Oct', 'Nov', 'Dec' }
	for _, month in ipairs(months) do
		if stripToNil(args[month .. suffix]) then
			return true
		end
	end
end

local function makeLabel(args, is_first, base, what)
	local first
	if isAny(args, ' ' .. what .. ' cm') then
		first = 'cm'
	else
		if isAny(args, ' ' .. what .. ' mm') then
			first = 'mm'
		else
			first = (what == 'snow' or
				precision(args['Jan ' .. what .. ' inch'] or '0') < 1)
					and 'cm'
					or 'mm'
		end
	end
	local second = 'inches'

                if not is_first then first, second = second, first end
                local metric_first = checkFlag( args['metric first'], true )
                local text2
                if stripToNil(args['begge_enheder']) then
                   if metric_first then 
                         text2 = first
                         if stripToNil(args['single line']) then text2 = text2 .. ' ('..second..')' end 
                   else 
                         text2 = second 
                         if stripToNil(args['single line']) then text2 = text2 .. ' ('..first..')' end 
                   end
                else
                   if metric_first then 
                         text2 = first 
                   else 
                         text2 = second
                   end
                end

	return base .. ' ' .. text2
end

local function makeSources(frame, args)
	local source1 = stripToNil(args.source) or stripToNil(args['source 1']) or stripToNil(args['kilde']) or stripToNil(args['kilder']) 

	local source2 = stripToNil(args['source 2']) or stripToNil(args['source2'])
        local hentet = stripToNil(args['tilgået'])
	local result = '|-\n|colspan="14" style="text-align:center;font-size:88%;"|'
	local text, dato
        if hentet then dato = ' ('.. hentet .. ')' else dato = '' end
	if source1 or source2 then
		if source1 and source2 then
			text = 'Kilde 1: ' .. source1 .. '\n' .. result .. 'Kilde 2: ' .. source2
		else
			text = 'Kilde'..dato..': ' .. (source1 and source1 or source2)
		end
	else
		text = frame:expandTemplate({ title = 'citation needed', args = {date = stripToNil(args.date)} }) 
	end
        if (not (source1 or source2)) and stripToNil(args['sted']) ~=  nil then return '\n|}' else
	return result .. text .. '\n|}' end
end

local function getDefinitions(frame, args)
	-- Return a list of tables or strings that define each row.
	local navbar = require('Module:Navbar')._navbar
	local function _if(parm, a, b)
		return stripToNil(args[parm]) and a or b or ''
	end
	local function _if2(parm, a, b) -- udeladt parameter sættes til 'ja'
		return stripToNil(args[parm] or 'ja') and a or b or '' 
	end
	local function _ifset(parm, a)
		return stripToNil(args[parm]) and args[parm] or a
	end
	local function _ifany(suffix)
		return isAny(args, suffix)
	end

        local function makeLabelTemp(text, linje)
                local a, b = 'C', 'F'
                if linje == 'anden linje' then a, b = 'F', 'C' end
                local metric_first = checkFlag( args['metric first'], true )
                local text2
                if stripToNil(args['begge_enheder']) then
                   if metric_first then 
                         text2 = a .. _if('single line', ' (°F)', '') 
                   else 
                         text2 = b .. _if('single line', ' (°C)', '') 
                   end
                else
                   if metric_first then 
                         text2 = a 
                   else 
                         text2 = b 
                   end
                end
                return text .. text2
        end

        local sted = stripToNil(args.location) or stripToNil(args['sted']) or '{{{sted}}}'
	return {

----------- HEADER ----------
'{| class="wikitable ' .. _if('open', '', 'collapsible' .. _if('collapsed', ' collapsed')) ..
'" style="width:' .. _ifset('width', '100%') ..
'; text-align:center; line-height: 1.2em; margin:' ..
_ifset('margin', 'auto') .. ';"' ..
_if('open',
	-- Following intentionally shows "{{{sted}}}" if parameter is blank to alert editor.
	'\n|+Vejr for ' .. sted,
	'\n|-' .. 
	'\n!colspan="14" | ' ..
	_if('name', 
		navbar({'Vejr for ' .. sted, args.name, collapsible=1}),   
		'Vejr for ' .. sted
	)
) ..
[=[

|-
!scope="row" |
!scope="col" |Jan
!scope="col" |Feb
!scope="col" |Mar
!scope="col" |Apr
!scope="col" |Maj
!scope="col" |Jun
!scope="col" |Jul
!scope="col" |Aug
!scope="col" |Sep
!scope="col" |Okt
!scope="col" |Nov
!scope="col" |Dec
!scope="col" style="border-left-width:medium" |År
]=],

{---------- FIRST LINE MAXIMUM HUMIDEX ----------
	WANTROW = _ifany(' maximum humidex') and (_ifset('metric first') or _ifset('single line')),
	mode = 'basic',
	group_name = 'maximum humidex',
	color_scheme = _ifset('temperature colour', 't'),
	scale_factor = '1',
	label = 'Højeste [[humidex]]',
	annual_mode = 'max',
},
{---------- FIRST LINE RECORD HIGH TEMPERATURES ----------
	WANTROW = _ifany(' record high C') or _ifany(' record high F'),
	mode = 'temperature',
	group_name = 'record high',
	color_scheme = _ifset('temperature colour', 't'),
	scale_factor = '1',
	label = makeLabelTemp('Højest målte °'),
	annual_mode = 'max',
},
{---------- FIRST-SECOND LINE AVG MONTHLY MAXIMUM TEMPERATURES ----------
	WANTROW = _ifany(' avg record high C') or _ifany(' avg record high F'),
	mode = 'temperature',
	group_name = 'avg record high',
	color_scheme = _ifset('temperature colour', 't'),
	scale_factor = '1',
	label = makeLabelTemp('Gns. højeste maks °'),
	annual_mode = 'max',
},
{---------- FIRST LINE AVERAGE HIGH TEMPERATURES ----------
	WANTROW = _ifany(' high C') or _ifany(' high F'),
	mode = 'temperature',
	group_name = 'high',
	color_scheme = _ifset('temperature colour', 't'),
	scale_factor = '1',
	label = makeLabelTemp('Gennemsnitlig maks °'),
	annual_mode = 'avg',
},
{---------- FIRST LINE DAILY MEAN TEMPERATURES ----------
	WANTROW = _ifany(' mean C') or _ifany(' mean F'),
	mode = 'temperature',
	group_name = 'mean',
	color_scheme = _ifset('temperature colour', 't'),
	scale_factor = '1',
	label = makeLabelTemp('Gennemsnitlig °'),
	annual_mode = 'avg',
},
{---------- FIRST LINE AVERAGE LOW TEMPERATURES ----------
	WANTROW = _ifany(' low C') or _ifany(' low F'),
	mode = 'temperature',
	group_name = 'low',
	color_scheme = _ifset('temperature colour', 't'),
	scale_factor = '1',
	label = makeLabelTemp('Gennemsnitlig min °'),
	annual_mode = 'avg',
},
{---------- Gennemsnitlig maks TEMPERATURER ----------
	WANTROW = _ifany('_målt_maks'),
	mode = 'temperature',
        include_space = false,
	group_name = '_målt_maks',
	color_scheme = _ifset('temperature colour', 't'),
	scale_factor = '1',
	label = 'Gennemsnitlig maks °C',
	annual_mode = 'avg',
},
{---------- Gennemsnitstemperatur ----------
	WANTROW = _ifany('_målt'),
	mode = 'temperature',
        include_space = false,
	group_name = '_målt',
	color_scheme = _ifset('temperature colour', 't'),
	scale_factor = '1',
	label = 'Gennemsnitlig °C',
	annual_mode = 'avg',
},
{---------- Gennemsnitlig min TEMPERATURER ----------
	WANTROW = _ifany('_målt_min'),
	mode = 'temperature',
        include_space = false,
	group_name = '_målt_min',
	color_scheme = _ifset('temperature colour', 't'),
	scale_factor = '1',
	label = 'Gennemsnitlig min °C',
	annual_mode = 'avg',
},
{---------- FIRST-SECOND LINE AVG MONTHLY MINIMUM TEMPERATURES ----------
	WANTROW = _ifany(' avg record low C') or _ifany(' avg record low F'),
	mode = 'temperature',
	group_name = 'avg record low',
	color_scheme = _ifset('temperature colour', 't'),
	scale_factor = '1',
	label = makeLabelTemp('Gns. laveste min °'),
	annual_mode = 'min',
},
{---------- FIRST LINE RECORD LOW TEMPERATURES ----------
	WANTROW = _ifany(' record low C') or _ifany(' record low F'),
	mode = 'temperature',
	group_name = 'record low',
	color_scheme = _ifset('temperature colour', 't'),
	scale_factor = '1',
	label = makeLabelTemp('Lavest målte °'),
	annual_mode = 'min',
},
{---------- FIRST LINE MINIMUM WIND CHILL ----------
	WANTROW = _ifany(' chill') and (_ifset('metric first') or _ifset('single line')),
	mode = 'basic',
	group_name = 'chill',
	color_scheme = _ifset('temperature colour', 't'),
	scale_factor = '1',
	label = 'Laveste [[wind chill]]',
	annual_mode = 'min',
},
{---------- FIRST LINE TOTAL PRECIPITATION ----------
	WANTROW = _ifany(' precipitation cm') or _ifany(' precipitation mm') or _ifany(' precipitation inch'),
	mode = 'precipitation',
	group_name = 'precipitation',
	color_scheme = _ifset('precipitation colour', 'p'),
	date_mode = true,
	scale_factor = '1',
	prefer_cm = precision(_ifset('Jan precipitation inch', '0')) < 1,
	label = makeLabel(args, true, 'Gennemsnitlig [[nedbør]]', 'precipitation'),
	annual_mode = 'sum',
},
{---------- FØRSTE LINJE TOTAL NEDBØR ----------
	WANTROW = _ifany('_målt_nedbør'),
	mode = 'precipitation',
	group_name = '_målt',
        include_space = false,
	color_scheme = _ifset('precipitation colour', 'p'),
	date_mode = true,
	scale_factor = '1',
	prefer_cm = false,
	label = 'Gennemsnitlig [[nedbør]] mm',
	annual_mode = 'sum',
},
{---------- FIRST LINE RAINFALL ----------
	WANTROW = _ifany(' rain cm') or _ifany(' rain mm') or _ifany(' rain inch'),
	mode = 'precipitation',
	group_name = 'rain',
	color_scheme = _ifset('rain colour', 'p'),
	date_mode = true,
	scale_factor = '1',
	prefer_cm = precision(_ifset('Jan rain inch', '0')) < 1,
	label = makeLabel(args, true, 'Gennemsnitlig regn', 'rain'),
	annual_mode = 'sum',
},
{---------- FIRST LINE SNOWFALL ----------
	WANTROW = _ifany(' snow cm') or _ifany(' snow mm') or _ifany(' snow inch'),
	mode = 'precipitation',
	group_name = 'snow',
	prefer_cm = true,
	color_scheme = _ifset('snow colour', 'p'),
	date_mode = true,
	scale_factor = '1',
	label = makeLabel(args, true, 'Gennemsnitlig sne', 'snow'),
	annual_mode = 'sum',
},
{---------- SECOND LINE MAXIMUM HUMIDEX ----------
	WANTROW = not _ifset('single line') and _ifany(' maximum humidex'),
	mode = 'basic',
	group_name = 'maximum humidex',
	color_scheme = _ifset('temperature colour', 't'),
	scale_factor = '1',
	label = '[[Humidex]]',
	annual_mode = 'max',
	second_line = true,
},
{---------- SECOND LINE RECORD HIGH TEMPERATURES ----------
	WANTROW = not _ifset('single line') and (_ifany(' record high C') or _ifany(' record high F')),
	mode = 'temperature',
	group_name = 'record high',
	second_line = true,
	color_scheme = _ifset('temperature colour', 't'),
	scale_factor = '1',
	label = makeLabelTemp('Højest målte °', 'anden linje'),
	annual_mode = 'max',
},
{---------- SECOND LINE AVERAGE HIGH TEMPERATURES ----------
	WANTROW = not _ifset('single line') and (_ifany(' high C') or _ifany(' high F')),
	mode = 'temperature',
	group_name = 'high',
	second_line = true,
	color_scheme = _ifset('temperature colour', 't'),
	scale_factor = '1',
	label = makeLabelTemp('Gns. maks °', 'anden linje'),
	annual_mode = 'avg',
},
{---------- SECOND LINE DAILY MEAN TEMPERATURES ----------
	WANTROW = not _ifset('single line') and (_ifany(' mean C') or _ifany(' mean F')),
	mode = 'temperature',
	group_name = 'mean',
	second_line = true,
	color_scheme = _ifset('temperature colour', 't'),
	scale_factor = '1',
	label = makeLabelTemp('Gennemsnitlig °', 'anden linje'),
	show = _if2('metric first', '2', '1'),
	annual_mode = 'avg',
},
{---------- SECOND LINE AVERAGE LOW TEMPERATURES ----------
	WANTROW = not _ifset('single line') and (_ifany(' low C') or _ifany(' low F')),
	mode = 'temperature',
	group_name = 'low',
	second_line = true,
	color_scheme = _ifset('temperature colour', 't'),
	scale_factor = '1',
	label = makeLabelTemp('Gennemsnitlig min °', 'anden linje'),
	show = _if2('metric first', '2', '1'),
	annual_mode = 'avg',
},
{---------- SECOND LINE RECORD LOW TEMPERATURES ----------
	WANTROW = not _ifset('single line') and (_ifany(' record low C') or _ifany(' record low F')),
	mode = 'temperature',
	group_name = 'record low',
	second_line = true,
	color_scheme = _ifset('temperature colour', 't'),
	scale_factor = '1',
	label = makeLabelTemp('Laveste °', 'anden linje'),
	show = _if2('metric first', '2', '1'),
	annual_mode = 'min',
},
{---------- SECOND LINE MINIMUM WIND CHILL ----------
	WANTROW = not _ifset('single line') and (_ifany(' chill') and _if2('metric first')),
	mode = 'basic',
	group_name = 'chill',
	color_scheme = _ifset('temperature colour', 't'),
	scale_factor = '1',
	label = '[[Wind chill]]',
	annual_mode = 'min',
},
{---------- SECOND LINE TOTAL PRECIPITATION ----------
	WANTROW = not _ifset('single line') and (_ifany(' precipitation cm') or _ifany(' precipitation mm') or _ifany(' precipitation inch')),
	mode = 'precipitation',
	group_name = 'precipitation',
	second_line = true,
	color_scheme = _ifset('precipitation colour', 'p'),
	date_mode = true,
	scale_factor = '1',
	prefer_cm = precision(_ifset('Jan precipitation inch', '0')) < 1,
	label = makeLabel(args, false, 'Gennemsnitlig [[nedbør]]', 'precipitation'),
	annual_mode = 'sum',
},
{---------- SECOND LINE RAINFALL ----------
	WANTROW = not _ifset('single line') and (_ifany(' rain cm') or _ifany(' rain mm') or _ifany(' rain inch')),
	mode = 'precipitation',
	group_name = 'rain',
	second_line = true,
	color_scheme = _ifset('rain colour', 'p'),
	date_mode = true,
	scale_factor = '1',
	prefer_cm = precision(_ifset('Jan rain inch', '0')) < 1,
	label = makeLabel(args, false, 'Gennemsnitlig regn', 'rain'),
	annual_mode = 'sum',
},
{---------- SECOND LINE SNOWFALL ----------
	WANTROW = not _ifset('single line') and (_ifany(' snow cm') or _ifany(' snow mm') or _ifany(' snow inch')),
	mode = 'precipitation',
	group_name = 'snow',
	second_line = true,
	prefer_cm = true,
	color_scheme = _ifset('snow colour', 'p'),
	date_mode = true,
	scale_factor = '1',
	label = makeLabel(args, false, 'Gennemsnitlig sne', 'snow'),
	annual_mode = 'sum',
},
{---------- PRECIPITATION DAYS ----------
	WANTROW = _ifany(' precipitation days'),
	mode = 'basic',
	group_name = 'precipitation days',
	color_scheme = _ifset('precip days colour', 'd'),
	date_mode = true,
	scale_factor = '1',
	label = 'Gns. dage med nedbør' .. _if('unit precipitation days', ' <span style="font-size:90%;" class="nowrap">(≥ ' .. _ifset('unit precipitation days', '') .. ')</span>'),
	annual_mode = 'sum',
},
{---------- RAINY DAYS ----------
	WANTROW = _ifany(' rain days'),
	mode = 'basic',
	group_name = 'rain days',
	color_scheme = _ifset('precip days colour', 'd'),
	date_mode = true,
	scale_factor = '1',
	label = 'Gns. dage med regn' .. _if('unit rain days', ' <span style="font-size:90%;" class="nowrap">(≥ ' .. _ifset('unit rain days', '') .. ')</span>'),
	annual_mode = 'sum',
},
{---------- SNOWY DAYS ----------
	WANTROW = _ifany(' snow days'),
	mode = 'basic',
	group_name = 'snow days',
	color_scheme = _ifset('precip days colour', 'd'),
	date_mode = true,
	scale_factor = '1',
	label = 'Gns. dage med sne' .. _if('unit snow days', ' <span style="font-size:90%;" class="nowrap">(≥ ' .. _ifset('unit snow days', '') .. ')</span>'),
	annual_mode = 'sum',
},
{---------- PERCENT RELATIVE HUMIDITY ----------
	WANTROW = _ifany(' humidity'),
	mode = 'basic',
	group_name = 'humidity',
	color_scheme = _ifset('humidity colour', 'h'),
	scale_factor = '1',
	label = 'Gns. [[luftfugtighed]] (%)' ..
		_if('time day', ' <span style="font-size:90%;" class="nowrap">' .. _ifset('time day', '') .. '</span>') ..
		_if('daily', ' <span style="font-size:90%;" class="nowrap">(dgl. gns.)</span>'),
	annual_mode = 'avg',
},
{---------- AFTERNOON PERCENT RELATIVE HUMIDITY ----------
	WANTROW = _ifany(' afthumidity'),
	mode = 'basic',
	group_name = 'afthumidity',
	color_scheme = _ifset('humidity colour', 'h'),
	scale_factor = '1',
	label = 'Gns. [[luftfugtighed|luftf.]] eftermiddag (%)' ..
		_if('time day', ' <span style="font-size:90%;" class="nowrap">' .. _ifset('time day', '') .. '</span>') ..
		_if('daily', ' <span style="font-size:90%;" class="nowrap">(dagl. gns.)</span>'),
	annual_mode = 'avg',
},
{---------- FIRST LINE AVERAGE DEW POINT ----------
	WANTROW = _ifany(' dew point C') or _ifany(' dew point F'),
	mode = 'temperature',
	group_name = 'dew point',
	color_scheme = _ifset('temperature colour', 't'),
	scale_factor = '1',
	label = makeLabelTemp('Gns. [[dugpunkt]] °'),
	annual_mode = 'avg',
},
{---------- SECOND LINE AVERAGE DEW POINT----------
	WANTROW = not _ifset('single line') and (_ifany(' dew point C') or _ifany(' dew point F')),
	mode = 'temperature',
	group_name = 'dew point',
	second_line = true,
	color_scheme = _ifset('temperature colour', 't'),
	scale_factor = '1',
	label = makeLabelTemp('Gns. [[dugpunkt]] °', 'anden linje'),
	show = _if2('metric first', '2', '1'),
	annual_mode = 'avg',
},
{---------- MONTHLY SUNSHINE HOURS ----------
	WANTROW = _ifany(' sun'),
	mode = 'basic',
	group_name = 'sun',
	color_scheme = _ifset('sun colour', 's'),
	date_mode = true,
	scale_factor = '1',
	label = 'Gns. månedlige [[Solskin|solskinstimer]]',
	annual_mode = 'sum',
},
{---------- DAILY SUNSHINE HOURS ----------
	WANTROW = _ifany('d sun'),
	mode = 'basic',
	group_name = 'd sun',
	color_scheme = _ifset('sun colour', 's'),
	include_space = false,
	scale_factor = '30.44',
	label = 'Gns. daglige solskinstimer',
	annual_mode = 'avg',
},
{---------- DAILY DAYLIGHT HOURS ----------
	WANTROW = _ifany(' light'),
	mode = 'basic',
	group_name = ' light',
	color_scheme = _ifset('sun colour', 's'),
	include_space = false,
	scale_factor = '30.44',
	label = 'Gns. daglige timer dagslys',
	annual_mode = 'avg',
},
{---------- PERCENT SUNSHINE ----------
	WANTROW = _ifany(' percentsun'),
	mode = 'basic',
	group_name = 'percentsun',
	color_scheme = _ifset('sun colour', 's'),
	scale_factor = '7.2',
	label = 'Pct. af muligt solskin',
	annual_mode = 'avg',
},
{---------- ULTRAVIOLET INDEX ----------
	WANTROW = _ifany(' uv'),
	mode = 'basic',
	group_name = 'uv',
	color_scheme = _ifset('uv colour', 'u'),
	scale_factor = '1',
	label = 'Gennemsnitlig [[UV-index]]',
	annual_mode = 'avg',
},
----------- SOURCES ----------
makeSources(frame, args),
}
end

local function makeFrame(self_args, parent_args)
	-- Kludge to pass arguments for a single row to buildRow.
	-- Later: Refactor buildRow so this is not needed.
	return {
		args = self_args,
		getParent = function (self) return makeFrame(parent_args, nil) end,
	}
end

local function main(frame)
	local buildRow = require('Module:Weather box/row').buildRow
	local args = frame:getParent().args
	local results = {}
	for i, def in ipairs(getDefinitions(frame, args)) do
		local row
		if type(def) == 'string' then
			row = def
		elseif def.WANTROW then
			row = buildRow(makeFrame(def, args))
		else
			row = ''
		end
		results[i] = row
	end
	return '<div>\n'..table.concat(results)..'\n</div>'  -- prevent Scribunto from inserting a blank line before the table
end

return {
	main = main,
}