Skip to content

Conversation

@TonyB9000
Copy link
Contributor

Description

The v3.LR cases failed to support the CMIP6 variable `CFmon.clisccp" due to NaNs in the data where the standard FILL_Value was expected. Code is supplied in the cmor_handlers/vars/clisccp.py module that forces the replacement with the required FILL_Value, prior to calling cmor.write().

Checklist

  • [y] My code follows the style guidelines of this project
  • [y] I have performed a self-review of my own code
  • [?] My changes generate no new warnings
  • [na] Any dependent changes have been merged and published in downstream modules

If applicable:

  • New and existing unit tests pass with my changes (locally and CI/CD build)
  • I have added tests that prove my fix is effective or that my feature works
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have noted that this is a breaking change for a major release (fix or feature that would cause existing functionality to not work as expected)

import xarray as xr

from e3sm_to_cmip._logger import _setup_child_logger
from e3sm_to_cmip.cmor_handlers import FILL_VALUE
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pushed a commit to use an already defined FILL_VALUE

@tomvothecoder tomvothecoder changed the title added force replace NaNs with required FILL_value in handler clisccp.py Replace np.nan with FILL_VALUE in clisccp.py for cmor.write Oct 21, 2025
@tomvothecoder
Copy link
Collaborator

tomvothecoder commented Oct 21, 2025

I will merge once the GitHub Actions build is complete. Thanks @TonyB9000!

@tomvothecoder tomvothecoder merged commit 861dbf7 into master Oct 21, 2025
6 checks passed
@tomvothecoder tomvothecoder deleted the 326-force-NAN-replacement branch October 21, 2025 18:14
@github-project-automation github-project-automation bot moved this from In progress to Done in E3SM to CMIP Development Oct 21, 2025
@chengzhuzhang
Copy link
Collaborator

Thanks for the PR. @TonyB9000 and @tomvothecoder . I think we should consider apply the same fix for https://github.com/E3SM-Project/e3sm_to_cmip/blob/master/e3sm_to_cmip/cmor_handlers/vars/clmodis.py before a new e3sm_to_cmip release.

@tomvothecoder
Copy link
Collaborator

tomvothecoder commented Oct 21, 2025

I just released v1.13.0rc2 on GitHub and almost done on conda-forge.

I'll quickly apply this fix to clmodis and do a v1.13.0rc3.

@TonyB9000
Copy link
Contributor Author

@tomvothecoder Excellent. Thanks Tom!

@tomvothecoder
Copy link
Collaborator

@tomvothecoder Excellent. Thanks Tom!

e3sm_to_cmip 1.13.0rc3 will be ready within the next hour: conda-forge/e3sm_to_cmip-feedstock#44

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

[Bug]: failure to cmorize v3.LR variable CFmon.clisccp due to NaNs in data

4 participants