Issue with loaded prlr data due to esarchive file units
Hi @vagudets,
I have noticed that there is an issue when loading prlr data with some systems, due to their units format in esarchive.
In esarchive most systems have their prlr units as m s**-1
, whilst the recon ERA5 data has the following units m s-1
.
I see that you have included a units conversion for prlr data to from ms-1 to mm/day, depending on the following conditions:
if (variable == "prlr") {
# Verify that the units are m/s and the same in obs and hcst
if ((attr(obs$Variable, "variable")$units !=
attr(hcst$Variable, "variable")$units) &&
(attr(obs$Variable, "variable")$units == "m s-1")) {
In most cases this conversion is applied since the units in esarchive between the exp and recon data are written differently.
However, in the case of system5cs3 the units in esarchive are m s-1
, matching those of the reference ERA5, therefore this conversion is not applied since the first condition is not fulfilled.
To overcome this issue, in my branch I have removed these conditions for now so that the conversion is applied to all prlr data, though I'm not sure if there may be cases where the units do not need to be converted.
Another thing, I think the conversion factor you used may be incorrect, should it not be 86400 instead of 84000?
Cheers,
Nadia
FYI @nperez