Skip to content

Cleanup glc_elevclass_mod and add unit tests - #90

Open
billsacks wants to merge 5 commits into
ESCOMP:mainfrom
billsacks:cleanup_glc_elevclass_mod
Open

billsacks wants to merge 5 commits into
ESCOMP:mainfrom
billsacks:cleanup_glc_elevclass_mod

Conversation

@billsacks

Copy link
Copy Markdown
Member

This PR cleans up glc_elevclass_mod by:

(1) Removing glc_get_elevation_classes subroutines. glc_get_elevation_classes_with_bareland will no longer work following the changes in ESCOMP/CMEPS#720 and the associated CISM changes. glc_get_elevation_classes_without_bareland should still work but wasn't used anywhere, so I'm deleting it to clean up the code.

(2) Improving some comments.

(3) Adding unit tests. This includes (a) bringing over the old unit tests of this module from https://github.com/ESCOMP/CESM_CPL7andDataComps (cleaned up to match the new style of unit tests in this repository), and (b) adding unit tests of glc_get_fractional_icecov.

The unit test changes in 43ac1d9 and 8f91b85 were made by Claude (Opus 5.5), reviewed by myself.

Testing:

  • Ran share unit tests
  • Ran the following tests with baseline comparisons, in the context of cesm3_0_alpha11d with cmeps updated to cmeps1.1.77; all passed and were bit-for-bit:
    • SMS_D_Ld5.f10_f10_ais8gris4_mg37.I1850Clm50SpGag.derecho_gnu.cism-test_coupling
    • ERS_D_Ly3.f09_g17_ais8gris4.T1850Gag.derecho_intel
    • ERS_Ly11.f09_g17_gris20.T1850Gg.derecho_gnu
    • ERS_Ly7.f09_g17_gris4.T1850Gg.derecho_intel

glc_get_elevation_classes_with_bareland will no longer work following
the changes in ESCOMP/CMEPS#720 and the
associated CISM changes.

glc_get_elevation_classes_without_bareland should still work but wasn't
used anywhere, so I'm deleting it to clean up the code.
In this commit, I am simply copying these old unit tests verbatim from
https://github.com/ESCOMP/CESM_CPL7andDataComps
Changes were made by Claude (Opus 5.5), reviewed by myself
Tests were written by Claude (Opus 5.5), reviewed by myself
@billsacks
billsacks requested a review from Katetc November 12, 2026 17:11
@billsacks

Copy link
Copy Markdown
Member Author

@Katetc I'm assigning you as reviewer because I think you'd be the best one to review this, but if you don't have time, let me know and I can assign someone else.

To facilitate review, here is information on each of the commits here:

I have reviewed the production code changes carefully and the unit test changes quickly. I feel like this could safely come in with only a cursory review if time is limited, but I'm also open to a more thorough review if you want.

@whlipscomb - FYI.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant