Skip to content

precipitation conversion #1

@jesusff

Description

@jesusff

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions