hourlytemp: Derives hourly temperatures from daily data

View source: R/othertools.R

hourlytempR Documentation

Derives hourly temperatures from daily data

Description

hourlytemp is used to derive hourly temperatures from daily maxima and minima.

Usage

hourlytemp(
  julian,
  em = NA,
  h,
  n,
  p = 100346.13,
  dni,
  dif,
  mintemp,
  maxtemp,
  lat,
  long,
  merid = round(long/15, 0) * 15,
  dst = 0
)

Arguments

julian

vector of julian days expressed as integers for every day for which mintemp and maxtemp are provided, as returned by function julday().

em

an optional vector of hourly emissivities. If not provided, calculated from h, n and p.

h

a vector of hourly specific humidities (kg kg-1 ). Ignored if em provided.

n

a vector of hourly fractional cloud cover values (range 0 - 1). Ignored if em provided.

p

an optional vector of hourly atmospheric pressure values (Pa). Ignored if em provided.

dni

a vector of hourly direct radiation values normal to the solar beam (MJ m-2 hr-1).

dif

a vector of hourly diffuse radiation values (MJ m-2 hr-1).

mintemp

a vector of daily minimum temperatures (ºC).

maxtemp

a bector of daily maximum temperatures (ºC).

lat

a single numeric value representing the latitude of the location for which hourly temperatures are required (decimal degrees, -ve south of equator).

long

a single numeric value representing the longitude of the location for which hourly temperatures are required (decimal degrees, -ve west of Greenwich meridian).

merid

an optional numeric value representing the longitude (decimal degrees) of the local time zone meridian (0 for GMT). Default is round(long / 15, 0) * 15

dst

an optional numeric value representing the time difference from the timezone meridian (hours, e.g. +1 for BST if merid = 0).

Details

A warning is returned if any of following conditions are not met. (1) h, n, dif and dct differ in length. (2) julian, mintemp and maxtemp differ in length. (3) E.g. h / 24 is not an integer. (4) the length of e.g. h is not equal to the length of e.g. mintemp x 24.

Value

a vector of hourly temperatures (ºC).

Examples

jd <- julday(2010, 5 , c(1,2))
ht <- hourlytemp(jd, NA, microvars$humidity[1:48], microvars$cloudcover[1:48],
                 microvars$pressure[1:48], dni = microvars$dni[1:48],
                 dif = microvars$dif[1:48], c(7.5, 7.2), c(14.6, 15.2),
                 49.968, -5.216)
plot(ht ~ c(0:47),type="l", xlab = "Hour", ylab = "Temperature",
     main = paste("tmins:", 7.2, 7.5, "tmaxs:", 14.6, 15.2))

ilyamaclean/microclima documentation built on Oct. 31, 2023, 11:41 p.m.