Meteorology: Import Meteorology for model input

Description Usage Arguments Details Value Note Author(s) See Also Examples

View source: R/1-Meteo.R

Description

Import the meteorology data, check its format, and eventually compute missing variables.

Usage

1
Meteorology(file = NULL, Period = NULL, Parameters = Import_Parameters())

Arguments

file

Either the file name to read, a shell command that preprocesses the file (e.g. fread("grep filename")) or the input itself as a string, see data.table::fread(). In both cases, a length 1 character string. A filename input is passed through path.expand for convenience and may be a URL starting http:// or file://. Default to NULL to return the Aquiares() example data from the package.

Period

A vector of two POSIX dates that correspond to the min and max dates for the desired time period to be returned.

Parameters

A list of parameters:

  • Start_Date: optional, the Posixct date of the first meteo file record. Only needed if the Date column is missing.

  • FPAR : Fraction of global radiation corresponding to PAR radiation, only needed if either RAD or PAR is missing.

  • Elevation : elevation of the site (m), only needed if atmospheric pressure is missing

  • Latitude : latitude of the site (degree), only needed if the diffuse fraction of light is missing

  • WindSpeed : constant wind speed (m s-1), only needed if windspeed is missing

  • CO2 : constant atmospheric CO_2 concentration (ppm), only needed if CO_2 is missing

  • MinTT : minimum temperature threshold for degree days computing (Celsius), see GDD()

  • albedo : site shortwave surface albedo, only needed if net radiation is missing, see Rad_net()

Details

The imported file is expected to be at daily time-step. The albedo is used to compute the system net radiation that is then used to compute the soil net radiation using an extinction coefficient with the plot LAI following the Shuttleworth & Wallace (1985) formulation. This computation is likely to be depreciated in the near future as the computation has been replaced by a metamodel. It is kept for information for the moment.

Var unit Definition If missing
Date POSIXct Date in POSIXct format Computed from start date parameter, or set a dummy date if missing
year year Year of the simulation Computed from Date
DOY day day of the year Computed from Date
Rain mm Rainfall Assume no rain
Tair Celsius Air temperature (above canopy) Computed from Tmax and Tmin
Tmax Celsius Maximum air temperature during the day Required (error)
Tmin Celsius Minimum air temperature during the day Required (error)
RH % Relative humidity Not used, but prefered over VPD for Rn computation
RAD MJ m-2 d-1 Incident shortwave radiation Computed from PAR
Pressure hPa Atmospheric pressure Computed from VPD, Tair and Elevation, or alternatively from Tair and Elevation.
WindSpeed m s-1 Wind speed Taken as constant: Parameters$WindSpeed
CO2 ppm Atmospheric CO2 concentration Taken as constant: Parameters$CO2
DegreeDays Celsius Growing degree days Computed using GDD()
PAR MJ m-2 d-1 Incident photosynthetically active radiation Computed from RAD
FDiff Fraction Diffuse light fraction Computed using Diffuse_d() using Spitters et al. (1986) formula
VPD hPa Vapor pressure deficit Computed from RH
Rn MJ m-2 d-1 Net radiation (will be depreciated) Computed using Rad_net() with RH, or VPD
DaysWithoutRain day Number of consecutive days with no rainfall Computed from Rain
Air_Density kg m-3 Air density of moist air (ρ) above canopy Computed using bigleaf::air.density()
ZEN radian Solar zenithal angle at noon Computed from Date, Latitude, Longitude and Timezone

Value

A daily meteorology data.frame (invisibly).

Note

It is highly recommended to set the system environment timezone to the one from the meteorology file. If not, the function try to use the Timezone from the parameter files to set it. When in doubt, set it to UTC (Sys.setenv(TZ="UTC")), as for Aquiares().

Author(s)

R. Vezy; O. Roupsard

See Also

DynACof()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
if(interactive()){
 Sys.setenv(TZ="UTC")
 Met_c= Meteorology()

 # Get the units of the output variables:
 attr(Met_c,"unit")
 }

## End(Not run)

VEZY/DynACof documentation built on Feb. 3, 2021, 8:52 p.m.