Open DWesl opened 2 months ago
@DWesl - are you planning to put in a PR for this issue?
Created #355
Created #356 since I figured out how to make a PR with just the relevant commits.
@DWesl - thanks for making the changes against the dev/emc branch and submitting a new PR
Describe the bug
The netCDF history outputs some pressure variables with units of "pa" or "mb". The netCDF Users' Guide and Climate and Forecast (CF) conventions both recommend making the
units
attribute of a netCDF variable machine-readable, specifically by the UDUNITS software package. This package interprets "pa" as picoannum, a unit of time roughly equal to a microsecond, and "mb" as millibarn, a unit of area used in atomic scattering, rather than as units of pressure.To Reproduce
Steps to reproduce the behavior: Run the model and let it produce netCDF history files. Inspect the
units
attribute of the pressure variables (surface pressure and vertical coordinate are the most likely). Ask udunits2 (or another unit-processing software package) to convert from one pressure unit to the other, or to a known pressure unit (atm, torr, or psi should work).Expected behavior
I expected my unit-processing software package to be able to convert the surface pressure to the same coordinates as the pressure of the vertical layers.
System Environment
Describe the system environment, include:
Additional context
Either of the two following
sed
scripts should fix the units in the output files. I tried running these on my version of the repository in a NOAA-EMC/global-workflow clone and my software can convert the pressure variables to atm and torr without guidance from me.I couldn't figure out how to make a PR with just three commits instead of 50, so I saved the commits as patches with
git format-patch
and attached the result as updated_units_patch.zip. They should apply cleanly withgit am
.