Repository navigation
Conversation
answers. - This is the first part of a list of issues identified by Claude.ai
dabail10
requested review from
NickSzapiro-NOAA,
anton-seaice,
apcraig and
eclare108213
November 9, 2026 23:06
apcraig
reviewed
Nov 12, 2026
apcraig
left a comment
Contributor
There was a problem hiding this comment.
Looks reasonable, I think the main thing is to check the time_rep "inst" vs "avg" logic.
Contributor
|
@dabail10. This seems close, could we get any final changes in, confirm it's ready, and maybe test and merge this week? I can test if you do make the final changes. Thanks. |
Contributor
Author
I think this is ready now. |
Contributor
Author
|
I merged main to hopefully fix the testing. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For detailed information about submitting Pull Requests (PRs) to the CICE-Consortium,
please refer to: https://github.com/CICE-Consortium/About-Us/wiki/Resource-Index#information-for-developers
PR checklist
This is a series of fixes for issues found by Claude.ai in issue Ice BGC and history bugs #1151. These are not answer changing, but will change
answers in some history output.
dabail10 (D. Bailey)
https://github.com/CICE-Consortium/Test-Results/wiki/cice_by_hash_forks#2d271f51648078875165b411150248a73e30e400
These are the summaries from Claude. They will change some of the history / diagnostic output.
High-confidence bugs affecting model output/correctness
1.
ice_history_bgc.F90:1993-1998— ice isotope mass divided by snow density instead of ice densityThe
n_isoice(ice-isotope) term should divide byrhoi, notrhos— the verynext block (aerosols, lines 2017-2024) shows the correct pattern (snow
/rhos,ice
/rhoi). Biases the ice-isotope concentration diagnostic byrhoi/rhos(~3x). Fix: change line 1998's
/rhosto/rhoi.2.
ice_history_bgc.F90:1564-1565— wrong tracer-count variable,n_fedinstead ofn_fepn_fed(dissolved-Fe count) andn_fep(particulate-Fe count) are independent,namelist-configurable tracer counts and can differ. Every other
Fepblock(lines 924, 1020, 1194/1204, 1434, 1686) correctly loops
1, n_fep. Ifn_fed /= n_fep, this under/over-registersn_Fepsnow— likely anout-of-bounds write or missing history fields. Fix: change
n_fedton_fepon line 1565.3.
ice_history_bgc.F90:3363-3366—bgc_hum_cat1registered under the wrong field-index variable (verified)Uses
n_bgc_huminstead ofn_bgc_hum_cat1(declared at line 250, correctlyused in
accum_hist_bgc). Every neighboring_cat1block (e.g.bgc_Sil_cat1immediately above) correctly uses its own dedicated index. Thisoverwrites the plain
bgc_humfield's metadata slot, corrupting thatseparately-used output field (referenced at lines 950, 2090, 3027, 3265).
Fix: change
n_bgc_humton_bgc_hum_cat1on line 3364.4.
ice_history.F90:3197-3202— duplicated accumulation call doublessnowfracn(verified)accum_hist_fieldis additive, so issuing the identical call twice silentlydoubles the time-accumulated
snowfracncategory output. Fix: delete onecopy (lines 3200-3202).
5.
ice_history_bgc.F90:2656-2672— top-boundaryiDilayer overwritten instead of accumulatediDiis dimensioned throughnblyr+1, soiDi(i,j,nblyr+1,n,iblk)is a realboundary value (used correctly by the neighboring
iki/zfswinblocks justabove/below). Here the top layer is simply copied from the interior layer
below instead of being accumulated from its own
iDivalue — the trueboundary value is never used. Fix: accumulate using
iDi(i,j,nblyr+1,n,iblk)the same way the interior layers are.6.
ice_history.F90:3085-3121— staledfreshused whenupdate_ocn_f = .true.dfreshis a loop-scalar with noelsebranch, so whenupdate_ocn_fis.true.it retains the value from the previous grid cell (or is undefined onfirst use) instead of
c0. Corruptsn_siflsaltbot/n_siflfwbotwheneverupdate_ocn_f=.true.. Fix: addelse; dfresh = c0; endif(bothoccurrences), or initialize
dfresh = c0at the top of eachi,jloop.7.
ice_history.F90:2417-2483— unconditional+c180in direction diagnostics (icedir,icedirN,icedirE,atmdir)Single-line
ifcovers only theatan2assignment; the+c180normalizationruns unconditionally, so calm/near-zero-velocity cells report 180° instead of
the sentinel. Inconsistent with the correctly-guarded
ocndirblock justbelow. Fix: wrap both statements in
if (...) then ... endif. (Appearslong-standing, not newly introduced.)
15.
io_binary/ice_history_write.F90:242,266— wrong vertical-dimension loop bound for bio/aerosol 3D history fieldsnzilyr,nzblyr,nzalyrare distinct sizes. Both the netCDF backend(
io_netcdf/ice_history_write.F90:1121,1144) and PIO2 backend(
io_pio2/ice_history_write.F90:1127-1128,1163-1164) correctly use thefield-specific vertical dimension; the binary backend uses
nzilyrfor both,truncating or overrunning bio/aerosol 3D history fields written in binary
format. Fix: use
nzblyron line 242 andnzalyron line 266.16.
io_netcdf/ice_history_write.F90:610-621— "4Df" fields defined without the time dimension, unlike PIO2The PIO2 backend defines the equivalent fields with the full 5-dim
dimidcz(includingtimid). Same logical history variables end up with adifferent rank/shape (static vs. time-dependent) depending on which I/O
backend wrote the file.
Other credible findings (agent-reported, not independently re-verified)
io_binary/ice_history_write.F90— several further binary-backend-onlyissues reported: a
.hdrheader-format argument-count mismatch for the 3Dzloop (format
993expects 2 integers, onlyksupplied); stale/mis-scopednnloop variable reused for 3Db/3Da/3Df.hdrcategory labels (cosmetic,metadata-file only, doesn't affect the actual binary data records); the
"instantaneous vs. averaged" header flag ignores
histfreq_n(so e.g.histfreq='1'withhistfreq_n>1is mislabeled, unlike netCDF/PIO2);nrecused after being incremented unconditionally even though only initialized
on
my_task==master_task(formally undefined, apparently harmless inpractice).
ice_diagnostics.F90:459-491—elseifbetween independent N/Sumax_stabchecks means only the northern warning prints if bothhemispheres exceed the threshold simultaneously. Low impact: gated behind a
hardcoded
.false.debug flag (check_umax), not reachable in normal runs.Minor / cosmetic only
ice_history_bgc.F90:954-958—bgc_PONlong_name text copy-pasted fromthe
Sil(silicate) block above it.ice_history.F90:1424-1427,1439-1442—s22/yieldstress22fielddescriptions say "component s12"/"component 12" instead of 22.
ice_history_bgc.F90:947,952,957— "skelelal" typo for "skeletal".ice_restart_driver.F90(~lines 481, 1411) — two comment-only typos(
stress12_1should saystress12_3;aice_oshould sayaice_m); nofunctional effect.
io_pio2/ice_history_write.F90:1194— loop-closing comment saysnum_avail_hist_fields_3Dbbut closes the 3Da loop.ice_history_mechred.F90— anifcheck missing a(1:1)substringcompared to the file's other checks; confirmed via git blame as unchanged
since file creation, functionally reasonable, not reported as a bug.