Zppy pcmdi enhancement#815
Conversation
|
@forsyth2: I submit this pull request for some changes I made based on my observations during the testing I did when I try to resolve the reported issues for #807. I noticed in my log file for the mean climate metrics calculation:
I did some debugging and found that there is a missing condition that is not fully handled in https://github.com/E3SM-Project/zppy/pull/815/changes#diff-47eb0fa6e3e0e191a714b640eddb33424a2516b9dab2c7ec57e46193d8e160bdL238-R301 Specifically, for the mean climate metrics calculation of radiative flux variables such as rsut, when CERES-EBAF is used as the observational reference, the observational dataset only covers 2001–2018. If the target model output period is, for example, 1985–1994, which is completely outside the observational coverage period, then the current code path is not able to correctly perform the observational subselection and can lead to unexpected behavior in the downstream metrics calculation. Although the metrics processing will still proceed and produce outputs, this is not the expected behavior. Instead, when this situation occurs, we would expect the workflow to fall back to using the full available observational period (2001–2018 in this case) to calculate the observational climatology for comparison, rather than attempting an invalid temporal subselection. |
ace60e0 to
f50333f
Compare
|
@zhangshixuan1987 Should we convert this PR back to draft? From another thread, we decided that the pcmdi feature will remain as beta version until enso set is being finalized and integrated. We are at the end of e3sm-unified testing period, if you'd like to make more changes, we can choose to review and merge this PR after this e3sm-unified release. |
|
@chengzhuzhang : Sure, I converted this to a draft. Please take any necessary actions and let me know if you need any help from me. |
|
Thank you @zhangshixuan1987. Let's plan to keep this PR open and integrate in the next release. Thanks for the testing and keeping enhance this feature. |
17f1022 to
23dedd1
Compare
zppy/pcmdi_diags.py:
- Replace print() with logger.debug() for prefix logging
- Fix break -> continue in commented-out enso skip block
- Add missing else branch with ValueError in add_pcmdi_dependencies
to prevent UnboundLocalError on invalid run_type
zppy/templates/pcmdi_diags.bash:
- Move $? check before rm in create_links_acyc_climo so ncap2
failures are caught instead of silently swallowed
- Fix .nc file filter from regex =~ ".nc" to glob != *.nc in
create_links_acyc_climo_obs and create_links_ts_obs
- Remove unused dofm variable from create_links_acyc_climo and
create_links_acyc_climo_obs
- Fix double space before --enso_groups in zi-pcmdi-enso command
- Fix Jinja2 spacing: {{var}} -> {{ var }} for model_tableID,
save_all_data, enso_viewer, enso_vars, enso_years
zppy/defaults/default.ini:
- Fix enso_vars default: hflx -> hfls (correct CMIP variable name)
…rnings
zppy/templates/pcmdi_diags.bash:
- Normalize time and time_bnds to the nearest second after ncrcat
subsetting in create_links_ts and create_links_ts_obs to prevent
floating-point precision artifacts causing cftime to decode boundary
values as second=60 (e.g. 2015-12-31 23:59:60 instead of 2016-01-01)
- Guard defdim("bnds",2) with if(!exists("bnds")) in all three ncap2
call sites to suppress spurious warnings when the bnds dimension is
already present in the input file
Here we set default interp_vars to be empty so that it will be a user decideded input parameter to trigger the vertical interpolation code block instead of blindly activate it with file names
This commit contains the changes made to the pcmdi.py so that it will allow users to pass the dependencies of the pcmdi section on the subsection of ts and e3sm_to_cmip
Use a non-interactive Matplotlib backend for batch diagnostics. Safe for workflows that save figures to files and avoids GUI/Tkinter errors on systems without a display.
Split MPAS-Ocean and MPAS-Seaice time-series processing into native ncclimo generation followed by explicit ncremap regridding. This allows the workflow to restore MPAS-native time metadata, construct a CF-style numeric time coordinate from timeMonthly_avg_daysSinceStartOfSim, and preserve missing_value metadata after regridding. For MPAS-Seaice, construct spatial-only SGS helper variables from timeMonthly_avg_iceAreaCell before regridding. This avoids failures when ncremap attempts to use the time-dependent timeMonthly_avg_iceAreaCell field directly as the SGS fraction. Temporary helper variables are removed from final output, and timeMonthly_avg_iceAreaCell is retained only when it is the requested output variable.
1057e0f to
cd718e4
Compare
Summary
Objectives:
Issue resolution:
pcmdi_diags#807.This pull request is to:
Small Change
1. Does this do what we want it to do?
2. Are the implementation details accurate & efficient?
3. Is this well documented?
4. Is this code clean?
-Pre-commit checks: All the pre-commits checks have passed.