pcmdi_metrics icon indicating copy to clipboard operation
pcmdi_metrics copied to clipboard

Update MoV code to use xCDAT

Open lee1043 opened this issue 1 year ago • 5 comments

This is a draft PR, opened for tracking changes.

lee1043 avatar Jan 11 '24 02:01 lee1043

Progress note:

  • Reproduced demo notebook with new code, and results are consistent.
  • Rigorous test: code conducted for all models, and found calendar related issue
  • Next step: fix the calendar related issue

lee1043 avatar Feb 22 '24 17:02 lee1043

Progress note:

  • Calendar issue fixed
  • Rigorous testing (running for all models) in progress

lee1043 avatar Feb 26 '24 21:02 lee1043

Progress note: Rigor test -- inconsistency found for PDO

  • land masking error for a few models -- found data error (lon inconsistent between sftlf and ts) -- workaround applied
  • error in pcor (stat larger than 1) -- need to investigate

lee1043 avatar Mar 07 '24 02:03 lee1043

Progress note: the error in pcor that became over 1 is caused by doing regrid2 for field filled NaN (e.g., landmask) which results field filled with zero.

Related xcdat issue: https://github.com/xCDAT/xcdat/issues/580 Resolved by: https://github.com/xCDAT/xcdat/pull/533

After updating xcdat, pcor now look more reasonable in a simple case test.

Solution for now: keep xcdat version as its latest main branch Permanent solution: once xcdat new version releases, update pmp dependency version in dev.yml accordingly.

lee1043 avatar Mar 12 '24 03:03 lee1043

Progress note: essential dependency update: xcdat, 0.6.1 to 0.7.0, due to update of regrid2 for its nan value handling

lee1043 avatar Apr 05 '24 20:04 lee1043

Progress note: sign flip issue (which was revealed from RMSE for SAM, left in below figure) is now resolved (right).

Screenshot 2024-04-16 at 8 52 34 AM

lee1043 avatar Apr 16 '24 16:04 lee1043

Bug in centered RMSE calcaulation (left) is resolved (right).

Screenshot 2024-04-22 at 2 04 03 PM

More results: PMP_MoV_xCDAT_rigor_test_20240422.pdf

lee1043 avatar Apr 22 '24 21:04 lee1043

Progress note: next component that is needed is the custom season capability

lee1043 avatar Apr 22 '24 21:04 lee1043

@acordonez when you have a chance could you please check if the demo4 notebook is working fine with this PR?

lee1043 avatar Apr 24 '24 22:04 lee1043

@lee1043 The demo notebook ran successfully. Is it correct that some figures were removed from Section 3.3.2?

acordonez avatar Apr 26 '24 16:04 acordonez

@lee1043 The demo notebook ran successfully. Is it correct that some figures were removed from Section 3.3.2?

@acordonez thanks for checking. Yes, that is correct. For AMO I removed monthly example and kept only yearly example which likely be more interest.

lee1043 avatar Apr 26 '24 18:04 lee1043

@acordonez thanks for reviewing. I also asked Alex (LANL) and Shiheng (LLNL) for testing this code for their analysis. I am holding merge for their result.

lee1043 avatar Apr 26 '24 19:04 lee1043

Test results from Alex: test_AJ_LANL_20240427.pdf "Everything worked without errors. The results look the same, although they are not identical (the 3rd NAO EOF came out to have a negative center of activity with my old code and a positive one with the new code version. Patterns look the same though."

My comment: Seeing consistent results between the old and new codes is great, although the sign reversion of the EOF3. Unless that reversion would significantly impact your analysis, I don’t worry too much about that as the EOF signs are determined arbitrarily even with a very subtle difference in the input. I suspect the change in building block (CDMS to xCDAT) may have resulted difference in higher decimal numbers. Relevant discussion can be found here.

lee1043 avatar Apr 28 '24 06:04 lee1043