-
Notifications
You must be signed in to change notification settings - Fork 40
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
[Bug]: wrong unit conversion in mean climate diagnostics #1128
Comments
Hi @zhangshixuan1987, thank you for the post. I see your point that it could be problematic particularly when the plev in the data is not [Pa]. As PMP has been developed with multi-model context, [Pa] for plev has been expected for the most of time as a result of CMOR. The current code works as follows:
But as you pointed, above 4 can be problematic if ds.plev.units != "Pa" because then it is adding false info. To keep it simple, I like the change you proposed in #1132. |
Closing the issue as it was resolved by merging PR #1132. |
related to #1128 In previous commit, changes in mean_climate_driver.py were made to remove the forced unit conversion for pressure level. Accordingly, the forced unit change in read_json_mean_clim.py should be removed as well. Otherwise, the Metrics () fuction call to decode the metrics json files will return wrong variable names.
Modify read_json_mean_clim.py module to be consistent with the changes related to #1128 In previous commit related to #1128, changes in mean_climate_driver.py were made to remove the forced unit conversion for pressure level. Accordingly, the forced unit change in read_json_mean_clim.py should be removed as well. Otherwise, the Metrics () fuction to decode the metrics json files will return wrong variable names.
related to #1128 In previous commit, changes in mean_climate_driver.py were made to remove the forced unit conversion for pressure level. Accordingly, the forced unit change in read_json_mean_clim.py should be removed as well. Otherwise, the Metrics () fuction call to decode the metrics json files will return wrong variable names.
What happened?
The library of mean climate diagnostics includes a "load_and_regrid.py" module which attempts to extract the test and reference data at the pressure level. In the following lines:
below code block was added:
While in the ``mean_climate_driver.py" module, following
code block show up:
This seems to be problematic, as you have converted the unit of level from hPa to Pa in mean_climate_driver.py, and then in the load_and_regrid.py, level times 100 again when the unit of plev in data file is "Pa". Usually, the unit convention for plev should be "Pa", although the unit of plev can be "hPa" or "mb" sometimes (depend on how user prepare the data).
Overall, I think that the unit conversion in the mean_climate_driver.py should be removed, and it is better to let the load_and_regrid.py deal with the unit conversion properly.
What did you expect to happen? Are there are possible answers you came across?
No response
Minimal Complete Verifiable Example (MVCE)
No response
Relevant log output
No response
Anything else we need to know?
No response
Environment
I am using the PCMDI master branch and run it on Argon Chryslis machine.
The text was updated successfully, but these errors were encountered: