Load: new cdo version name causes error
This issue is reported by the external users. The email is below:
I am writing to you for an issue with the Load function that came up after updating our server to Ubuntu 20.04. R and the R libraries have also been updated to the latest versions.
I am actually using the CSTools::CST_Load function that is a wrapper of s2dverification::Load. After the Load function is called I obtain the error you see in the attached screenshot. Enclosed you will also find the simple script I use to load the data)
===================
after my colleague Silvia Terzago wrote you regarding a problem with s2dverification::Load (and CSTools::CST_Load function), I investigated a bit the issue and found the problem.
The problem is at line 209 of Utils.R (of s2dverification) where cdo is interrogated for its version.
In fact our cdo responds with "1.9.9rc1" and this is not something that as.numeric_version can digest.
The solution is changing the code in Utils.R (line 209) to
cdo_version <- strsplit(suppressWarnings(system2("cdo", args = '-V', stderr = TRUE))[[1]], ' ')[[1]][5]
cdo_version <- as.numeric_version(unlist(strsplit(cdo_version, "[A-Za-z]", fixed=FALSE))[[1]])