ARCCSS-extremes/climpact2

Error when calculating heatwave indices

Closed this issue · 1 comments

I'm trying to calculate heatwave frequency from a netcdf file with daily tasmax values.

Firstly, calculating txx works, with this line (so seems I'm having no package problems):
indices=c("txx")

But when using this: indices=c("hw")

The following error pops up:
Error in if (cdx.meta$var.name[i] == "rxdday") { :
missing value where TRUE/FALSE needed
Calls: create.indices.from.files

Do these heatwave metrics require reading in an additional "threshold" file or should one just be able to change the "txx" to "hwf"?

To calculate the "hw" indice, the target netcdf file needs to have both tasmin and tasmax in the file:
vars=c(tmax="tasmax", tmin="tasmin")
If only heatwave metrics based on tasmax are of interest, you can just use dummy data to fill up tasmin.