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

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()

Value

A daily meteorology data.frame (invisibly).

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.

VarunitDefinitionIf missing
DatePOSIXctDate in POSIXct formatComputed from start date parameter, or set a dummy date if missing
yearyearYear of the simulationComputed from Date
DOYdayday of the yearComputed from Date
RainmmRainfallAssume no rain
TairCelsiusAir temperature (above canopy)Computed from Tmax and Tmin
TmaxCelsiusMaximum air temperature during the dayRequired (error)
TminCelsiusMinimum air temperature during the dayRequired (error)
RH%Relative humidityNot used, but prefered over VPD for Rn computation
RADMJ m-2 d-1Incident shortwave radiationComputed from PAR
PressurehPaAtmospheric pressureComputed from VPD, Tair and Elevation, or alternatively from Tair and Elevation.
WindSpeedm s-1Wind speedTaken as constant: Parameters$WindSpeed
CO2ppmAtmospheric CO2 concentrationTaken as constant: Parameters$CO2
DegreeDaysCelsiusGrowing degree daysComputed using GDD()
PARMJ m-2 d-1Incident photosynthetically active radiationComputed from RAD
FDiffFractionDiffuse light fractionComputed using Diffuse_d() using Spitters et al. (1986) formula
VPDhPaVapor pressure deficitComputed from RH
RnMJ m-2 d-1Net radiation (will be depreciated)Computed using Rad_net() with RH, or VPD
DaysWithoutRaindayNumber of consecutive days with no rainfallComputed from Rain
Air_Densitykg m-3Air density of moist air (\(\rho\)) above canopyComputed using bigleaf::air.density()
ZENradianSolar zenithal angle at noonComputed from Date, Latitude, Longitude and Timezone

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().

See also

Examples

if (FALSE) { if(interactive()){ Sys.setenv(TZ="UTC") Met_c= Meteorology() # Get the units of the output variables: attr(Met_c,"unit") } }