[
https://issues.apache.org/jira/browse/KYLIN-1040?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14903647#comment-14903647
]
Kim, Jinwon commented on KYLIN-1040:
------------------------------------
Typos in the original text:
"ice/data_source/local.py" --> "cow/data_source/local.py", and
"cow/utils.py" --> "ocw/utils.py"
> update specification of the attribute for variable units in reading netCDF
> files
> --------------------------------------------------------------------------------
>
> Key: KYLIN-1040
> URL: https://issues.apache.org/jira/browse/KYLIN-1040
> Project: Kylin
> Issue Type: Improvement
> Reporter: Kim, Jinwon
>
> Attention: Mike Joyce, Kyo Lee
> Encountered a problem while reading netCDF files for processing. The problem
> is due to the mismatch in the units attribute in the netCDF file and in the
> RCMES code. In the two routines, "ice/data_source/local.py" and
> "cow/utils.py", the attribute to specify variable units is hardwired as
> "units", e.g., "time_format = time_data.units". This crashes the run if the
> units attribute in the netCDF file is different from "units", e.g., "varUnit"
> in WRF. I have temporarily fixed this problem by replacing the line:
> --------------------------------------------------
> time_format = time_data.units
> --------------------------------------------------
> with a try block:
> --------------------------------------------------
> try:
> time_format = time_data.units
> except:
> time_format = time_data.varUnit
> --------------------------------------------------
> With this fix, I can proceed to the next step. This fix is only temporary. In
> creating netCDF files, users can specify any name for the attribute of units
> (also long_name). A more permanent solution may be to have users to specify
> the attribute of units in the config file at the place they specify input
> data from local disk (applies to both the reference and model data).
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)