1

我想将 9 公里网格 ECMWF 太阳表面向下辐射的全球辐射与在丹麦的一个地点测量的倾斜辐射进行比较。然而,结果不是很好,我发现理解非常全面但相当复杂的solar包有很多困难。

library(dplyr)
library(solaR)

从 ECMWF ERA-5 陆地模型https://cds.climate.copernicus.eu/cdsapp#!/dataset/reanalysis-era5-land?tab=overview下载的太阳表面向下辐射 (ssrd) 和 2m 环境温度 (t2m) 2018 年的前 117 小时(输入为从 ecmwfr 下载并非易事)。

ssdr <- c(0,0,0,0,0,0,0,0,0,0,5.5,15.7,22.3,58.5,59.7,34.3,6.9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  0,0,14.1,66.9,116.9,130.2,109.7,61.9,9.3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2.8,7.5,
  12.6,13.2,17.7,11.8,2.2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5.2,22.1,40.4,41.3,30.5,
  17.7,5.4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,31.7,49.8,77.8,51.8,35.6,7.8,0,0,0,0)

t2m <- c(278.6,278.6,278.5,278.4,278.3,278.1,277.9,277.8,278,278.2,278.4,278.5,278.7,278.8,
278.6,278.4,278.1,278,278,277.8,277.7,277.7,278,278.1,278.2,278.1,278.1,278.1,278,
277.9,277.8,278,278.2,278.3,278.6,278.9,279.1,279,278.6,278,277.7,277.3,276.9,276.5,
276.4,276.5,276.4,276.3,276.4,276.5,276.5,276.6,276.4,276.1,275.6,275.4,275,275.1,
275,275.1,275.1,275.4,275.6,275.6,275.7,275.8,275.9,276,276,276,276.1,276.3,276.6,
276.6,276.6,276.6,276.6,276.7,276.7,276.8,276.7,276.5,276.5,276.6,276.5,276.4,276.4,
276.4,276.2,276.1,275.9,275.4,275.4,275.2,275,275.2,274.9,274.7,274.6,274.3,274.5,
274.4,274.4,274.7,274.6,275,275.5,275.9,276.4,276.1,275.8,275.4,275.2,275.1,275,
275.4,275.2)

2018 年前 5 天从 solarheatdata.eu 网站获得的测量值

## site ID of VRA solar plant on solarheatdata.eu
site <- "45"

## start and end data of data request
start_date <- "01-01-2018"
end_date <- "05-01-2018"

##request data from solarheatdata.eu website
sh_raw <- read.csv(file = paste0('http://solarheatdata.eu/modules/sol/histdata.asp?anlaeg=', site, "&fromdate=", start_date,"&todate=",end_date ,"&results=hours&csv=1"), 
               header = FALSE, sep = ';')

## give header correct names
names(sh_raw) <- c('date', 'solar_heat_MWh', 'solar_heat_production_Whm2', 'solar_radiation_Whm2')

## trim data to match ssdr and t2m
sh_raw <- sh_raw[1:NROW(ssdr),]

为solar 函数准备数据。Vra 的纬度为 57.4,面板的角度为 35 度。


## lubridate used to create date variables
library(lubridate)

## create data frame of date, G0 and Ta for solaR
sh_dat <- sh_raw %>% 
  transmute(date = dmy_hm(str_sub(date, 0, -7)),
         G0 = ssdr,
         Ta = t2m-273.15)

##calculate bdI Meteo object
bdi_df = dfI2Meteo(sh_dat, lat = 57.4, time.col = 'date')

## obtain the global, diffuse and direct irradiation and irradiance on the generator plane (which is 35 degrees)
gef <- calcGef(lat = 57.4, modeRad = 'bdI', dataRad = bdi_df, beta = 35)

包含 G 列的输出数据帧,该列是斜面上的全局辐照。然而,用测量值绘制它会得到截然不同的结果。


## output data frame for each hour
output_df <- data.frame(gef@GefI)

##add measured irradiation from site as a column for comparison
output_df$site_Wm2 <- sh_raw$solar_radiation_Whm2
output_df$date <- ymd_hms(row.names(output_df))

## time_dygraph very handy for plotting and visualising time series ## remotes::install_github("skgrange/threadr")
library(threadr)

threadr::time_dygraph(output_df, variable = c('G', 'site_Wm2'))

我知道 ECMWF 数据是针对 9 公里网格的,但是,基本上倾斜值看起来不正确。这也是我的理解,我可以使用不同的模型,但是,对于 calcgef 函数,我看不到这些。

4

1 回答 1

1

让我们将您的数据与该位置的外星辐照度进行比较:

## Extract all the variables as a time series 
z <- as.zooI(gef, complete = TRUE)
## Include the original values of irradiance
z$ssdr <- ssdr 
## Plot both time series together
xyplot(z[, c("Bo0", "ssdr")], superpose = TRUE)

G0 与 Bo0

如图所示,这些时间序列是不同步的。在一天中的某些时间里,水平面上的辐照度大于外星辐照度,这是不可能的。gef这就是您在对象中获得的 NA 值的原因。

您的ssdr时间序列很可能使用当地时间。如果是这种情况,您必须使用该local2Solar功能根据经度将其更改为太阳时(请阅读此功能的帮助页面以获取更多信息)。您应该检查calcG0函数帮助页面的最后一个示例。该示例使用本地时间从 NREL 站下载数据,并使用local2solar.

PD。我不明白你为什么下载数据但你不使用它。

于 2021-11-23T19:26:52.000 回答