CICE-Consortium / Icepack

Development repository for sea-ice column physics
Other
25 stars 131 forks source link

Corrects thin ice/snow treatment of enthalpy and other tracers #454

Closed apcraig closed 1 year ago

apcraig commented 1 year ago

PR checklist

Adopted from https://github.com/E3SM-Project/E3SM/pull/5630

"This fix redistributes enthalpy and other tracers evenly in snow and ice when their respective thicknesses are < 1e-15 . Previously, these tracers were zero'd non-conservatively. Also corrects a bug in the zeroing of snow thicknesses, and removes snow in thickness_changes if the ice vanishes."

apcraig commented 1 year ago

@eclare108213 @njeffery, please have a look at this implementation. I will complete testing and clean up the code once you agree it seems right. In particular, have a look at icepack_therm_vertical, lines 1714:1728. I show the old code from the E3SM columnphysics there as well. In the old code, there was a "tr_snow" and "tr_rsnw". We don't use that anymore. Is "snowgrain" the appropriate if-test for four lines of code in that section? Or is some other logic needed?

apcraig commented 1 year ago

Test results look fine. Everything is running, Icepack is bit-for-bit, CICE is not.

https://github.com/CICE-Consortium/Test-Results/wiki/icepack_by_hash_forks#7e0821dcfe824ae99a3bf0cb957497a8e10c4da7

https://github.com/CICE-Consortium/Test-Results/wiki/cice_by_hash_forks#e8a69abde90b99fc6528d469b8698506a99f6e2a

eclare108213 commented 1 year ago

Is it worth running the QC tests on this, since it's not BFB? I think it's fine without them since the cases when the changes occur ought to be rare, but it would provide some extra confidence.

apcraig commented 1 year ago

Good idea about QC. QC passes with very small differences (this is a standard test with snwgrain off)

INFO:__main__:Running QC test on the following directories:
INFO:__main__:  /glade/scratch/tcraig/CICE_RUNS/cheyenne_intel_qcchk_gx1_144x1_medium_qc_qcchk.cne03
INFO:__main__:  /glade/scratch/tcraig/CICE_RUNS/cheyenne_intel_qcchk_gx1_144x1_medium_qc_qcchk.T230826b
INFO:__main__:Number of files: 1825
INFO:__main__:2 Stage Test Passed
INFO:__main__:Quadratic Skill Test Passed for Northern Hemisphere
INFO:__main__:Quadratic Skill Test Passed for Southern Hemisphere
INFO:__main__:Creating map of the data (ice_thickness_cheyenne_intel_qcchk_gx1_144x1_medium_qc_qcchk.cne03.png)
INFO:__main__:Creating map of the data (ice_thickness_cheyenne_intel_qcchk_gx1_144x1_medium_qc_qcchk.T230826b.png)
INFO:__main__:Creating map of the data (ice_thickness_cheyenne_intel_qcchk_gx1_144x1_medium_qc_qcchk.cne03_minus_cheyenne_intel_qcchk_gx1_144x1_medium_qc_qcchk.T230826b.png)
INFO:__main__:
INFO:__main__:Quality Control Test PASSED

ice_thickness_cheyenne_intel_qcchk_gx1_144x1_medium_qc_qcchk cne03 ice_thickness_cheyenne_intel_qcchk_gx1_144x1_medium_qc_qcchk T230826b ice_thickness_cheyenne_intel_qcchk_gx1_144x1_medium_qc_qcchk cne03_minus_cheyenne_intel_qcchk_gx1_144x1_medium_qc_qcchk T230826b