Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

precipitation conversion #1

Open
jesusff opened this issue May 14, 2021 · 0 comments
Open

precipitation conversion #1

jesusff opened this issue May 14, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@jesusff
Copy link
Member

jesusff commented May 14, 2021

Hi,

a very common conversion for precipitation is from kg/m2/s to mm/day. This currently fails as the water density is required to convert the kg into volume.

One final attempt to convert the units could be included for precipitation variables here:

if (!ud.are.convertible(u1[x], new.units[x])) stop("Non-convertible units \'ud.are.convertible\' returned FALSE)")

Simply by multiplying the units by the specific volume of water (1 l/kg):

> ud.convert(1, "kg/m^2/s", "mm/day")
Error in ud.convert(1, "kg/m^2/s", "mm/day") :
  Units kg/m^2/s and mm/day are not convertible
> ud.convert(1, "kg/m^2/s*l/kg", "mm/day")
[1] 86400
@jesusff jesusff added the enhancement New feature or request label May 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant