runNMR: Runs NicheMapR model

View source: R/NicheMapRcode.R

runNMRR Documentation

Runs NicheMapR model

Description

Wrapper function for running NicheMapR to derive soil moistures

Usage

runNMR(
  climdata,
  prec,
  lat,
  long,
  Usrhyt,
  Veghyt,
  Refhyt = 2,
  PAI = 3,
  LOR = 1,
  pLAI = 0.8,
  clump = 0,
  REFL = 0.15,
  LREFL = 0.4,
  SLE = 0.95,
  DEP = c(0, 2.5, 5, 10, 15, 20, 30, 50, 100, 200),
  ALTT = 0,
  SLOPE = 0,
  ASPECT = 0,
  ERR = 1.5,
  soiltype = "Loam",
  PE = NA,
  KS = NA,
  BB = NA,
  BD = NA,
  DD = NA,
  cap = 1,
  hori = rep(0, 36),
  maxpool = 1000,
  rainmult = 1,
  SoilMoist_Init = c(0.1, 0.12, 0.15, 0.2, 0.25, 0.3, 0.3, 0.3, 0.3, 0.3),
  animal = FALSE
)

Arguments

climdata

a data.frame of hourly weather variables in same format as weather(). Column obs_time must give times in GMT/UTC.

prec

a vector of daily or hourly precipitation values (mm).

lat

latitude (decimal degrees, positive in northern hemisphere).

long

longitude (decimal degrees, negative west of Greenwich meridian).

Usrhyt

Local height (m) at which air temperature, wind speed and humidity are to be computed (see details).

Veghyt

At of vegetation canopy (see details).

Refhyt

Reference height (m) at which air input climate variables are measured.

PAI

single value or vector of hourly or daily values of total plant area per unit ground area of canopy.

LOR

Campbell leaf angle distrubution coefficient

pLAI

fraction of PAI that is green vegetation.

clump

clumpiness factor for canopy (0 to 1, 0 = even)

REFL

A single numeric value of ground reflectivity of shortwave radiation.

LREFL

A single numeric value of average canopy reflectivity of shortwave radiation.

SLE

Thermal emissivity of ground

DEP

Soil depths at which calculations are to be made (cm), must be 10 values starting from 0, and more closely spaced near the surface.

ALTT

elevation (m) of location.

SLOPE

slope of location (decimal degrees).

ASPECT

aspect of location (decimal degrees, 0 = north).

ERR

Integrator error tolerance for soil temperature calculations.

soiltype

soil type as for soilparams(). Set to NA to use soil parameters specified below.

PE

Air entry potentials (J/kg) (19 values descending through soil for specified soil nodes in parameter DEP and points half way between). Ignored if soil type is given.

KS

Saturated conductivities (kg s/m^3) (19 values descending through soil for specified soil nodes in parameter DEP and points half way between). Ignored if soil type is given.

BB

Campbell's soil 'b' parameter (19 values descending through soil for specified soil nodes in parameter DEP and points half way between). Ignored if soil type is given.

BD

Soil bulk density (Mg/m^3) (19 values descending through soil for specified soil nodes in parameter DEP and points half way between). Ignored if soil type is given.

DD

Soil density (Mg/m^3) (19 values descending through soil for specified soil nodes in parameter DEP and points half way between). Ignored if soil type is given.

cap

Is organic cap present on soil surface? (1 = Yes, 0 = No).

hori

Horizon angles (degrees), from 0 degrees azimuth (north) clockwise in 10 degree intervals.

maxpool

Max depth for water pooling on the surface (mm), to account for runoff.

rainmult

Rain multiplier for surface soil moisture (used to induce runon).

SoilMoist_Init

Initial volumetric soil water content at each soil node (m^3/m^3)

Details

Requires NicheMapR: devtools::install_github('mrke/NicheMapR'). NicheMapR is an integrated soil moisture and temperature model that treats the vegetation as a single layer (https://mrke.github.io/). This wrapper function, runs the NicheMapR::microclimate function with reduced parameter inputs, by specifying sensible default values for other parameters where it is unlikely that these would be known or explicitely measured at the site. The degree of canopy shading is worked out explicitely from PAI at each hourly time interval by estimating canopy tranmission of direct and diffuse radiation, and by adjusting the amount of radiation that would be absorbed at the ground surface for a given slope and aspect. Roughness lengths and zero plane displacement heights are limited to <2m in NicheMapR, so if Veghyt > 2, it is set to 2m. This is adequate for computing soil moisture and total evapotranspiration, but will give false air temperatures for heights below canopy (see runwithNMR(). If soiltype is given, the subsequent soil parameters are computed from soil type. If soiltype is NA, soil paramaters must be specified.

Value

a list with the following components:

metout a data.frame of microclimate variables for each hour at height Usrhyt.

soiltemps a data.frame of hourly soil temperatures for each depth node.

soilmoist a data.frame of hourly soil volumetric water content for each depth node.

snowtemp if snow present, a data,frame of snow temperature (°C), at each of the potential 8 snow layers (see details). 0 if snow not present.

plant a data.frame of plant transpiration rates (g/m^2/hr), leaf water potentials (J/kg) and root water potential (J/kg) at each of the 10 specified depths.

nmrout full NicheMapR output

Author(s)

Ilya Maclean (i.m.d.maclean@exeter.ac.uk) and Urtzi Urzelai (urtzi.enriquez@gmail.com)

Examples

# Run NicheMapR with default parameters and inbuilt weather datasets
library(NicheMapR)
# Plot air temperatures
microout<-runNMR(weather,dailyprecip,50.2178,-5.32656,0.05,0.1,PAI=1)
metout <- microout$metout
tmn <- min(metout$TALOC,metout$TAREF)
tmx <- max(metout$TALOC,metout$TAREF)
dday <- metout$DOY+metout$TIME/1440 # Decimal day
plot(metout$TALOC~dday, type="l", col = "red", ylim=c(tmn,tmx), ylab = "Temperature")
par(new = T)
plot(metout$TAREF~dday, type="l", col = "blue", ylim=c(tmn,tmx), ylab = "", xlab = "")
# Plot soil temperatures
soiltemp<-microout$soiltemps
tmn <- min(soiltemp$D0cm,soiltemp$D30cm)
tmx <- max(soiltemp$D0cm,soiltemp$D30cm)
plot(soiltemp$D0cm~dday, type="l", col = "red", ylim=c(tmn,tmx), ylab = "Temperature")
par(new = T)
plot(soiltemp$D30cm~dday, type="l", col = "blue", ylim=c(tmn,tmx), ylab = "", xlab = "")
# Plot soil moistures
soilm <- microout$soilmoist
mmn <- min(soilm$WC2.5cm,soilm$WC30cm)
mmx <- max(soilm$WC2.5cm,soilm$WC30cm)
plot(soilm$WC2.5cm~dday, type="l", col = "red", ylim=c(mmn,mmx), ylab = "Soil moisture")
par(new = T)
plot(soilm$WC30cm~dday, type="l", col = "blue", ylim=c(mmn,mmx), ylab = "", xlab = "")
Calculate roughness length

ilyamaclean/microclimc documentation built on July 28, 2023, 1:40 a.m.