CICE-Consortium / Icepack

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

Update 5-band dEdd to support test data #472

Closed apcraig closed 10 months ago

apcraig commented 10 months ago

PR checklist

Add an interpolation method in icepack_shortwave.F90 for rsnw

Refactor portions of icepack_shortwave to improve robustness

Add snicar and snicartest test cases

Update the 5-band snicar shortwave rsnw_snicar_tab interpolation. This changes answers but QC tests pass. The new implementation checks whether the rsnw_snicar_tab is an array of integer values with deltas of value 1 (and sets the rsnw_snicar_chk variable). If so, it uses a shortcut to find the rsnw_snicar_tab bounds for interpolation, otherwise it calls the shortwave_search routine. In testing, the shortcut did not change performance much, but that could change in the future.

eclare108213 commented 10 months ago

@proteanplanet I invite you to take a look at this PR. @apcraig is setting up an Icepack test for the 5-band shortwave and needed to generalize the hardwired 5-band coding to do that. Personally, I think we should fix the hard-wired weirdnesses in here (see the code diff) to just do the linear interpolation all the time, but that will change answers. @apcraig has modified the code in a way that allows our testing without changing the 5-band shortwave answers. We can fix this later, but I'm pinging you here in case you'd like it done sooner. I'm not very happy with the current 5-band coding.

apcraig commented 10 months ago

I just updated the implementation to cleanup the standard snicar 5-band rsnw_snicar_tab interpolation. This changes answers, but QC tests pass and the differences cannot be seen on the QC diff plot (attached). I ran run a small test suite focused on the snicar changes and that all works as expected. I am running a full test suite now, but don't expect any problems.

ice_thickness_cheyenne_intel_smoke_gx1_72x1_medium_qc_snicar qst1

ice_thickness_cheyenne_intel_smoke_gx1_72x1_medium_qc_snicar qsb1_minus_cheyenne_intel_smoke_gx1_72x1_medium_qc_snicar qst1

apcraig commented 10 months ago

Full test suite on latest changes passes.

apcraig commented 10 months ago

Latest full test suite results,

https://github.com/CICE-Consortium/Test-Results/wiki/icepack_by_hash_forks#741f301381b0281d2bcbb726968153eb3178c514

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