fitmicro: Fits micro- or mesoclimate model

View source: R/othertools.R

fitmicroR Documentation

Fits micro- or mesoclimate model

Description

fitmicro is used to fit a micro- or mesoclimate model using field temperature readings, and estimates of reference temperature, net radiation and wind speed at the locations of those readings.

Usage

fitmicro(
  microfitdata,
  alldata = FALSE,
  windthresh = NA,
  continuous = FALSE,
  iter = 999
)

Arguments

microfitdata

a data.frame with at least the following columns (see, for example, microfitdata):

temperature

microclimate temperature readings

reftemp

Reference (e.g. coarse-scale or weather station) temperatures

wind

Wind speeds

netrad

Net radiation values

alldata

an optional logical value indicating whether to fit the model using all data (TRUE) or using a randomization procedure (FALSE). See details.

windthresh

an optional single numeric value indicating the threshold wind speed above which an alternative linear relationship between net radiation the microclimate temperature anomoly is fitted. See details.

continuous

an optional logical value indicating whether to treat wind speed as a continuous variable.

iter

a single integer specifying the iterations to perform during randomization. Ignored if alldata = TRUE.

Details

If modelling mesoclimate, it is assumed that altitudinal, coastal and cold-air drainage effects have already been accounted for in the calculation of reftemp. It is therefore assumed that the most important energy fluxes determining near-surface temperature are those due to the radiation flux and convection that occurs at the surface-atmosphere boundary. Heat fluxes into the soil and latent heat exchange are considered to be small and proportional to the net radiation flux, and the heat capacity of the vegetation is considered to be small so that, compared to the time-scale of the model, surface temperature rapidly reach equilibrium. In consequence, the difference between the near-ground temperature and the ambient temperature is a linear function of netrad. The gradient of this linear relationship is a measure of the thermal coupling of the surface to the atmosphere. If this relationship is applied to vegetation, assuming the canopy to act like a surface, while air density and the specific heat of air at constant pressure are constant, the slope varies as a function of a wind speed factor, such that different slope values are assumed under high and low wind conditions. Hence, as a default, fitmicro fits a linear model of the form lm((temperature - reftemp) ~ netrad * windfact) where windfact is given by ifelse(wind > windthresh, 1, 0) If continuous is set to TRUE, then a linear model of the form ⁠lm((temperature - reftemp) ~ netrad * log(wind + 1)⁠ is fitted. If alldata is FALSE, random subsets of the data are selected and the analyses repeated iter times to reduce the effects of of temporal autocorrelation. Parameter estimates are derived as the median of all runs. If continuous is set to FALSE and no value is provided for windthresh, it is derived by iteratively trying out different values, and selecting that which yields the best fit. The gradient of the relationship is also dependent on vegetation structure, and in some circumstances it may therefore be advisable to fit seperate models for each vegetation type.

Value

a data,frame with the following columns:

Estimate

parameter estimates and windthresh

Std.Dev

Standard deviation of parameter estimates

P

Two-tailed p-value

Examples

fitmicro(microfitdata)
fitmicro(mesofitdata, alldata = TRUE)
fitmicro(mesofitdata, alldata = TRUE, continuous = TRUE)

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