xwrf icon indicating copy to clipboard operation
xwrf copied to clipboard

More comprehensive unit harmonization

Open lpilz opened this issue 3 years ago • 2 comments

Change Summary

Unit harmonization is improved by:

  • using a better map parsed from WRF Registries (yes, all of them, but not WPS)
    • translations are generated manually using custom external tool
    • includes all versions from WRFv4.0 onwards
    • makes bracket cleaning superfluous
  • extracting this map from the config yaml to avoid clutter

Related issue number

Checklist

  • [x] Unit tests for the changes exist
  • [x] Tests pass on CI
  • [x] Documentation reflects the changes where applicable

lpilz avatar Oct 24 '22 20:10 lpilz

There are some units which I didn't quite know how to translate:

  • savedtke12d - top level eddy conductivity from previous timestep (W/m.K)
    • is this W m-1 K-1 or W K m-1?
  • maxMF - Maximum mass-flux (neg: all dry, pos: moist) (m/s * area)
    • is this m3 s-1 or m-1 s-1 or even kg m2 s-1 or kg s-1 m-2?

lpilz avatar Oct 24 '22 22:10 lpilz

Small ping on this PR :)

lpilz avatar Nov 08 '22 17:11 lpilz

As far as the units of uncertain translation go:

  • savedtke12d with W/m.K: given how it is used in https://github.com/wrf-model/WRF/blob/master/Registry/registry.lake, I'd say match the thermal conductivity values elsewhere in the same registry...so W m-1 K-1.
  • maxMF with m/s * area: given how it is used in https://github.com/wrf-model/WRF/blob/v4.2/phys/module_bl_mynn.F, it is the product of edmf_a (unit - which becomes dimensionless) and edmf_w (m s-1), which weirdly enough implies that it should be m s-1. I'm not too concerned about getting this perfectly right, as I'd hope that anybody digging that much into the weeds of the MYNN-EDMF scheme knows what they are doing to be able to properly use that field.

jthielen avatar Nov 30 '22 22:11 jthielen

Hey, happy holidays! Sorry for the long delay on my part now... Didn't have too much time to spend on this until now due to AGU.

I added the changes, however I don't quite know what you would like to see here.

add new tests for each of the new categories of units handled in the expanded unit_harmonization_map

What are the new categories you're referring to?

lpilz avatar Dec 28 '22 18:12 lpilz

Small ping here :)

lpilz avatar Feb 03 '23 15:02 lpilz

Thanks for the ping on this, and sorry for the very long delay! Unfortunately I'm a bit swamped with prelim-related stuff at the moment, so I won't be able to get back to this until next week. But, hopefully will be able to then.

jthielen avatar Feb 03 '23 17:02 jthielen

Hey :) just a small reping. If and whenever you find the time of course!

lpilz avatar Mar 07 '23 08:03 lpilz

Hey @jthielen, I'm just going to go ahead and merge this if you don't mind.

lpilz avatar Jul 27 '23 07:07 lpilz

Hey @jthielen, I'm just going to go ahead and merge this if you don't mind.

Yes, please go ahead! Sorry for my continued inattentiveness. Hopefully things will be getting better soon.

jthielen avatar Jul 28 '23 18:07 jthielen