-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcalculate_ReferenceEvapotranspiration.R
145 lines (136 loc) · 7.88 KB
/
calculate_ReferenceEvapotranspiration.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
#'@title calculating reference evapotranspiration from Penman-Monteith method
#'@description The FAO Penman-Monteith method is maintained as the sole standard
#' method for the computation of ETo from meteorological data.
#'@param delta slope vapour pressure curve (kPa °C). From cal_slopeOfSaturationVapourPressureCurve()
#'@param Rn net Radiation at the crop surface [MJ m-2 day-1]. From cal_netRadiation()
#'@param G soil heat flux density [MJ m-2 day-1].
#'@param gamma psychrometric constant (kPa °C).
#'@param Tem air temperature at 2 m height [°C].
#'@param u2 wind speed at 2 m height [m s-1].
#'@param es saturation vapour pressure [kPa].
#'@param ea actual vapour pressure [kPa].
#'@return A vector for reference evapotranspiration [mm day-1].
#'@export
#'@note Ten-day or monthly time step :
#'
#' Notwithstanding the non-linearity in the Penman-Monteith equation and some weather
#' parameter methods, mean ten-day or monthly weather data can be used to compute the mean
#' ten-day or monthly values for the reference evapotranspiration. The value of the reference
#' evapotranspiration calculated with mean monthly weather data is indeed very similar to the
#' average of the daily ETo values calculated with daily average weather data for that month.
#'
#' When the soil is warming (spring) or cooling (autumn), the soil heat flux (G) for monthly
#' periods may become significant relative to the mean monthly Rn. In these cases G cannot be
#' ignored and its value should be determined from the mean monthly air temperatures of the
#' previous and next month.
#'
#' Daily time step:
#'
#' Calculation of ETo with the Penman-Monteith equation on 24-hour time scales will generally
#' provide accurate results.
#'
#' As the magnitude of daily soil heat flux (G) beneath the reference grass surface is relatively
#' small, it may be ignored for 24-hour time steps.
#'@references Allen, R. G., Pereira, L. S., Raes, D., & Smith, M.
#' FAO Irrigation and drainage paper No. 56. Rome: Food and Agriculture
#' Organization of the United Nations, 1998.
cal_ET0_from_PM<-function(delta,Rn,G,gamma,Tem,u2,es,ea){
# ET0<-((0.408*slopVapourPressureCurve*(netRadiation-soilHeartFluxDensity)+(psychrometricConstant*900*windSpeed*(saturationVapourPressure-actualVapourPressure)))/(airTemperature+273))/(slopVapourPressureCurve+slopVapourPressureCurve*(1+0.34*windSpeed))
ET0<-(0.408*delta*(Rn-G)+gamma*(900/(Tem+273))*u2*(es-ea))/(delta+gamma*(1+0.34*u2))
#(0.408*J2*(Z2-AA2)+K2*900*E2*P2/(C2+273))/(J2+K2*(1+0.34*E2))
#0.408是单位的转换因子
return(ET0)
}
#'@title Calculating reference evapotranspiration from Penman-Monteith for
#' daily
#'@description Based on lat, z, J, Tmax, Tmin, n, RHmax, RHmin, windSpeed parameters,
#' reference evapotranspiration was calculated by Penman-Monteith.
#'@param Latitude latitude (radian), positive for the northern hemisphere and
#' negative for the southern hemisphere.
#'@param Altitude station elevation above sea level [m].
#'@param J is the number of the day in the year between 1 (1 January) and 365 or
#' 366 (31 December).
#'@param Tmax daily maximum air temperature (degrees Celsius).
#'@param Tmin daily minimum air temperature (degrees Celsius).
#'@param Rs Solar radiation [MJ m-2 d-1].
#'@param RHmean daily mean relative humidity \%.
#'@param Wind wind speed at 2 m height [m s-1].
#'@export
#'@return A vector for reference evapotranspiration (mm/day)
#'@references Allen, R. G., Pereira, L. S., Raes, D., & Smith, M.
#' FAO Irrigation and drainage paper No. 56. Rome: Food and Agriculture
#' Organization of the United Nations, 1998.
#'@examples
#' library(simET)
#' data("FIalfalfa")
#' names(FIalfalfa)
#' Result_data<- dplyr::mutate(FIalfalfa,
#' ET0=cal_ET0_from_PM_for_daily(Latitude=Latitude,
#' Altitude=Altitude,
#' J=Julian,
#' Tmax=Tmax,
#' Tmin=Tmin,
#' Rs=Rs,
#' RHmean=RHmean,
#' Wind=Wind))
#' names(Result_data)
cal_ET0_from_PM_for_daily<-function(Latitude,Altitude,J,Tmax,Tmin,Rs,RHmean,Wind){
Tmean=(Tmax+Tmin)/2
P=cal_atmosphericPressure(Altitude)
Delta=cal_slopeOfSaturationVapourPressureCurve(Tmean)
gamma=cal_psychrometriCconstant(P)
es=cal_meanSaturationVapourPressure(Tmax ,Tmin)
ea=cal_ActualVapourPressure_from_RHmean(RHmean,Tmax,Tmin)
Deficit=es-ea
# dr=cal_inverseRelativeDistance_Earth_sun(J)
# Solar_D=cal_solarDeclination_in_FAO(J)
Lat=convert_angert_to_radian(Latitude)
# ws=cal_sunsetHourAngle(Lat,Solar_D)
Ra=cal_extraterrestrialRadiation_for_daily(J,Lat)
# Nmax=cal_daylightHours(ws)
# Rs=cal_solarRadiation(as=0.25,bs=0.5,n=Na,N=Nmax,Ra=Ra)
Rso=cal_skySolarRadiation_withas_elevation(z=Altitude,Ra=Ra)
Rns=cal_netSolarRadiation(alpha=0.23,Rs=Rs)
TKmax=convert_degreesCelsius_to_Fahrenheit(Tmax)
TKmin=convert_degreesCelsius_to_Fahrenheit(Tmin)
Rnl=cal_netLongwaveRadiation(TKmax,TKmin,ea,Rs,Rso)
Rn=cal_netRadiation(Rns,Rnl)
G=0
ET0=cal_ET0_from_PM(Delta,Rn,G,gamma,Tmean,Wind,es,ea)
}
#'@title Calculating reference evapotranspiration from Penman-Monteith method
#' for hourly time step
#'@details In areas where substantial changes in wind speed, dewpoint or
#' cloudiness occur during the day, calculation of the ETo equation using
#' hourly time steps is generally better than using 24-hour calculation
#' time steps. Such weather changes can cause 24-hour means to misrepresent
#' evaporative power of the environment during parts of the day and may
#' introduce error into the calculations. However, under most conditions,
#' application of the FAO Penman-Monteith equation with 24-hour data produces
#' accurate results.
#'@param slopVapourPressureCurve saturation slope vapour pressure curve at Thr [kPa °C].
#'@param netRadiation net radiation at the grass surface [MJ m-2 hour-1].
#'@param soilHeatFlux soil heat flux density [MJ m-2 hour-1].
#'@param psychrometricConstant psychrometric constant [kPa °C].
#'@param meanHourlyTem mean hourly air temperature [°C].
#'@param windSpeed average hourly wind speed [m s-1].
#'@param saturationVapourPressure saturation vapour pressure at air temperature Thr [kPa].
#'@param actualVapourPressure average hourly actual vapour pressure [kPa].
#'@return A vector for reference evapotranspiration [mm hour-1].
#'@export
#'@references Allen, R. G., Pereira, L. S., Raes, D., & Smith, M.
#' FAO Irrigation and drainage paper No. 56. Rome: Food and Agriculture
#' Organization of the United Nations, 1998.
#'@note With the advent of electronic, automated weather stations, weather
#' data are increasingly reported for hourly or shorter periods. Therefore,
#' in situations where calculations are computerized, the FAO Penman-Monteith
#' equation can be applied on an hourly basis with good results. When applying
#' the FAO Penman-Monteith equation on an hourly or shorter time scale, the
#' equation and some of the procedures for calculating meteorological data
#' should be adjusted for the smaller time step.
#'
#' For the calculation of radiation parameters, see P74-75
cal_ET0_from_PM_for_hourly<-function(slopVapourPressureCurve,netRadiation,soilHeatFlux,psychrometricConstant,meanHourlyTem,windSpeed,saturationVapourPressure,actualVapourPressure){
ET0<-(0.408* slopVapourPressureCurve*(netRadiation-soilHeatFlux)+ psychrometricConstant*(37/(meanHourlyTem+273))*windSpeed*(saturationVapourPressure-actualVapourPressure))/(slopVapourPressureCurve+psychrometricConstant*(1+0.34*windSpeed))
return(ET0)
}