I am using the ET.PenmanMonteith function from the Evapotranspiration package in R to calculate reference crop evapotranspiration. I have provided the necessary input data, including daily dates, temperature (Tmax, Tmin), relative humidity (RHmax, RHmin), sunshine hours (n), and wind speed (uz). However, when I run the function, I am encountering the following issues:
- The function returns NaN for the mean value, -Inf for the maximum value, and Inf for the minimum value of evapotranspiration.
- I am getting warning messages related to the max and min functions, indicating no non-missing arguments.
Penman-Monteith FAO56 Reference Crop ET
Evaporative surface: FAO-56 hypothetical short grass, albedo = 0.23 ; surface resistance = 70 sm^-1; crop height = 0.12 m; roughness height = 0.02 m
Sunshine hour data have been used for calculating incoming solar radiation
Wind data have been used for calculating the reference crop evapotranspiration
Timestep: daily
Units: mm
Time duration: 2022-01-01 to 2023-05-17
501 ET estimates obtained; 501 NA output entries due to missing data
Basic stats (NA excluded)
Mean: NaN
Max: -Inf
Min: Inf
Warning messages:
1: In max(res_ts, na.rm = T) :
no non-missing arguments to max; returning -Inf
2: In min(res_ts, na.rm = T) :
no non-missing arguments to min; returning Inf
I have already checked for missing values in both the original data (data2) and the formatted data (data), and there are no missing values. I have also ensured that the date column is in the correct format. Any insights or suggestions on what might be causing these issues would be greatly appreciated.
#read
data2<- read.csv("climate_data_2.csv", head = TRUE, sep=",")
# convert data
data2$Date.daily <- as.Date(data2$Date.daily, format = "%Y-%m-%d")
# create list
data <- list(Date.daily = data2$Date.daily,
Date.monthly = format(data2$Date.daily, "%b %Y"))
# Add variable-based elements to the list
variable_names <- c("Tmax", "Tmin", "RHmax", "RHmin", "n", "uz")
for (var_name in variable_names) {
data[[var_name]] <- zoo::zoo(data2[[var_name]], order.by = data2$Date.daily)
}
# ET.PenmanMonteith function
results <- ET.PenmanMonteith(data, constants, ts = "daily", solar = "sunshine hours", wind = "yes",
crop = "short", message = "yes", AdditionalStats = "yes", save.csv = "no")