Closed chengzhuzhang closed 1 year ago
Hi @chengzhuzhang, I had a few notes and questions.
The root cause I think is that land fraction (cmip name: sftlf) is a fixed variable without time variation. Though E3SM output LANDFRAC as a time depended variable, and in e3sm_to_cmip, the handler is also coded as a regular variable ,i.e., with a time dimension.
If I'm understanding correctly, LANDFRAC
has a time dimension but we need to CMORize to sftlf
without a time dimension since this is a fixed variable without time variation?
Possible solution is to separately generate a handler script for sftlf, following what has been done for PHIS (cmip name: orog), surface geopotential, which is also a fixed variable, but the E3SM output it with time dimension.
I moved legacy handlers that I didn't refactor in PR #103 yet into cmor_handlers/vars
. These handler modules don't use the generic handle_simple()
and handle_variables()
functions (maybe due to being fixed time variables) which makes them less straightforward to refactor.
We should probably avoid defining new handlers as Python modules.
We might be able to update the generic handle_variables()
method instead. We'll need some logic to detect fixed time dimension and CMORize without it.
If I'm understanding correctly,
LANDFRAC
has a time dimension but we need to CMORize tosftlf
without a time dimension since this is a fixed variable without time variation?Yes! We should probably avoid defining new handlers as Python modules.
Alternative solution
We might be able to update the generic
handle_variables()
method instead. We'll need some logic to detect fixed time dimension and CMORize without it.* https://github.com/E3SM-Project/e3sm_to_cmip/blob/c25eb2741d0e1096e7698b36af1edad152eb62c6/e3sm_to_cmip/cmor_handlers/handler.py#L155-L202 * https://github.com/E3SM-Project/e3sm_to_cmip/blob/c25eb2741d0e1096e7698b36af1edad152eb62c6/e3sm_to_cmip/lib.py#L439-L605
I agree it is better to try move away from legacy way and identify new python modules for handlers. Though the lib.py already has lots of logics to handle corner cases, and needs a refactor. I'm still challenged to make modification to lib.py at this point.
I will plan to add another PR to add two regular variables. If it is possible, I hope they can be included in the e3sm-unified
, because there are development in zppy
ongoing to make cmorizing a standard task. Having both updates in e3sm_to_cmip to be included in unified
will be really helpful..
I ran into error for
sftlf
when processing 165 years of simulation data. Error message as follows:The root cause I think is that land fraction (cmip name: sftlf) is a fixed variable without time variation. Though E3SM output LANDFRAC as a time depended variable, and in e3sm_to_cmip, the handler is also coded as a regular variable ,i.e., with a time dimension. Possible solution is to separately generate a handler script for sftlf, following what has been done for PHIS (cmip name: orog), surface geopotential, which is also a fixed variable, but the E3SM output it with time dimension.