Skip to content

Sync to CICE-Consortium (2026-08-19) - #119

Merged
NickSzapiro-NOAA merged 32 commits into
NOAA-EMC:developfrom
NickSzapiro-NOAA:sync_cice_2026-08
Aug 24, 2026
Merged

NickSzapiro-NOAA merged 32 commits into
NOAA-EMC:developfrom
NickSzapiro-NOAA:sync_cice_2026-08

Conversation

@NickSzapiro-NOAA

Copy link
Copy Markdown
Collaborator

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

  • Short (1 sentence) summary of your PR:
    Sync CICE-Consortium/main into EMC fork
  • Developer(s):
    See PRs at CICE-Consortium
  • Suggest PR reviewers from list in the column to the right.
  • Please copy the PR test results link or provide a summary of testing completed below.
    UFS regression testing and preceding CICE-Consortium testing
  • How much do the PR code changes differ from the unmodified code?
    • bit for bit
    • different at roundoff level
    • more substantial : zap residual ice
  • Does this PR create or have dependencies on Icepack or any other models?
    • Yes
    • No
  • Does this PR update the Icepack submodule? If so, the Icepack submodule must point to a hash on Icepack's main branch.
    • Yes
    • No
  • Does this PR add any new test cases?
    • Yes
    • No
  • Is the documentation being updated? ("Documentation" includes information on the wiki or in the .rst files from doc/source/, which are used to create the online technical docs at https://readthedocs.org/projects/cice-consortium-cice/. A test build of the technical docs will be performed as part of the PR testing.)
    • Yes
    • No, does the documentation need to be updated at a later time?
      • Yes
      • No
  • Please document the changes in detail, including why the changes are made. This will become part of the PR commit log.

Sync CICE-Consortium/main into EMC fork, including baseline changes for zapping residual ice, bug fixes in history variables, and new CMIP7 history variables. Adds history restart feature, where say a monthly accumulation in ice history can be continued from a restart during the month. Set rheology to zero for the C-grid when concentration is very small, to address instability. Adds significant refactor of the restoring implementation, separating the exterior halo boundary update and the interior restoring capability. Merges infrastructure/comm mpi and serial code. Resolves hundreds of compiler warnings.

eclare108213 and others added 30 commits November 26, 2025 11:15
…rs to remove residual ice (CICE-Consortium#1067)

Removes residual amounts of ice that are not otherwise handled by the numerics. The controlling parameters (itd_area_min and itd_mass_min, implemented in Icepack) set minimum ice area and mass values below which all ice is removed following the thermodynamics and ridging calculations. For the B-grid, these parameters are currently set to the dynamics stability minima, which are being reduced to extremely small values based on testing in multiple modeling systems. If needed, users can revert these parameters to the original, larger values by adding them to ice_in. Setting them to 0 turns off the new zapping completely. These parameters are set to the larger, original values in the C-grid test scripts, pending further work.

This updates Icepack and changes answers.
After an upgrade, several of Carpenter's modules were removed. These changes update the modules and software versions used to compiler and run CICE.
There is a great deal of confusion about how various history variables are time-averaged, e.g. SIMIP history output implementation CICE-Consortium#1038, Fixes for sitemptop, sitempbot, and sitempsnic. CICE-Consortium#1054. This PR attempts to clarify the situation. These averages are also relevant for conservative coupling.
…ormat) (CICE-Consortium#1079)

Add ability to read an extended grid (supported for pop netcdf file format)

Add subroutine popgrid_nc_ext to read an extended grid pop netcdf file
Add 'nc_ext' option to grid_format namelist
The extended grid will apply to the kmt file as well as these are specified by the same grid_format namelist
Modify gridbox_verts to operate on a local array instead of a global array, this should improve performance and removes redundant extrapolation calculations. This approach also supports both regular and extended grid reads.
The implementation largely duplicates subroutine popgrid_nc but for an extended grid in subroutine popgrid_nc_ext. The extended grid represents the active points plus the full halo. As much as possible, the extended grid (LON, LAT, ANGLE, KMT) is read in on the halo instead of being computed. For some grid metrics (DXT, DYT, DXU, DYU, etc), extrapolation is still required onto the halo.

Remove some trailing blanks is other places as needed.
Adds a namelist flag to allow significant wave height to be passed into the ice model from a coupler. In addition, this PR moves wave_spec_height out of icepack interface argument lists, since it is initialized via icepack_init_parameters.

See CICE-Consortium/Icepack#545

Update Icepack to #0bcde255637a594

Update ice_step_mod.F90 in opticep unit test to be consistent with latest changes

---------

Co-authored-by: apcraig <anthony.p.craig@gmail.com>
Updated all of the variable names, long names, and units to correspond to the CMIP7 data request.
Added new variables requested in the CMIP7 data request.
Added documentation about the CMIP6 to CMIP7 update.
Simplified the accumulation of some fields where possible and added prognostic sea ice density.
Added accumulation of variables relative to aice_init or aice.
Bug fix for flwout (sifllwutop) where aice_init = 0, but aice > 0.
Bug fix for shortwave abosrbed and albedo computation (more coming later)
Bug fix: Some variables that were scaled by aice, should be multiplied by aice (not aice_init) to get the _ai quantities,  including fswabs, fsens, flat, etc.
Removed f_CMIP flag and added set_nml.cmip option instead.
Added comment field for SIMIP variables that uses part of the description field in the CMIP data request table.
Added long_name field to address issue: time_bounds, lat?_bounds, lon?_bounds attributes CICE-Consortium#1057
Partly addresses aice versus aice_init aice vs. aice/aice_init factor in ice_history CICE-Consortium#1033
Partial fix for albedo variables [albedo]_ai history variables over 100% CICE-Consortium#1051
Addresses issue: Some CMIP variables are computed using a mix of U and T quantities CICE-Consortium#904
Add history restart to netcdf and pio IO options. Binary was not included due to the complexity of having to track history fields in binary files. History restart files are written automatically for history streams that are averaged and when a restart is written during the middle of a history accumulation period. There is one history restart file per history stream. File are written in the restart directory using the history name, an appended "_r[histfreq]", and the model date. An ice_read_hist subroutine was added to the ice_history_write.F90 file. For binary, calling this returns with a warning message that history restarts are not implemented. When history restarts are read, the model will only read files and fields that are found and continue with the accumulator initialized to zero for fields that are not found. For production runs, this should work fine. If a user modifies the history streams in the middle or a run, then an assessment should be made of which fields are valid on the first restart run.

The history restart files are basically history files, written at double precision, writing the accumulated fields. In addition, some additional fields are written including time_beg, avgct, albcnt, and snwcnt which represent accumulation counters for time average history output.

A new histall10d set_nml option was added that turns on 3 averaged history streams and all history fields. When used in a restart test, the scripts will verify bit-for-bit history files and history restart files across the restart. Several tests were added to the io_suite to include formal testing of bit-for-bit history restarts. Two fields, mlt_onset and frz_onset and not turned on with histall10d because they do not restart properly and they are unable to restart bit-for-bit on the history file, see CICE-Consortium#1068.

Several history fields have a bug in them and have been written out incorrectly, and these bugs were fixed. The bug in these cases was that the fields were accumulated during the timestep across categories but were not zeroed out at the start of the timestep. As a result, those fields were accumulating over the entire run incorrectly. The fields that had to be zeroed out were evaps and evaps plus upNO, upNH, bTiz, bphi, iDi, and iki associated with bgc. The bit-for-bit history restart test discovered these errors.

Add a new namelist, write_histrest, to turn off history restart writing. The default is that history restarts are on.

Update set_nml.cmip to fix an error in f_apond_ai setting.
Update Copyright to 2026

Remove trailing whitespace

Update Icepack to #2f31ee37f3a70, Icepack v1.5.3
Bug fix for lwout in CESM driver
Also some FSD stuff for coupling
Fix define for sitimefrac
Add the CESM3 namelist changes
…ICE-Consortium#1089)

Update Icepack to #daa41638c6cef to include

Enforce minimum snow grain radius (CICE-Consortium#552)

If the snow grain radius is set to zero, possibly because of zapping small ice or if ice disappears mid-timestep, then updates of snow grain radius will produce NaNs. Snow grain radius is usually bounded between a min and max so this generally doesn't happen, but a recent coupled E3SM bgc run crashed with this error. While the error seems to be relatively rare, this bug fix changes answers when the snow grain radius is nonzero but still less than the minimum.
Derecho shared node jobs intermittently abort with error message
"start failed on dec2436: No reply from shepherd after 108s"
due to PBS/MPI launch conflicts. Derecho qstat output was also recently changed to return output for completed jobs which prevented the job checking scripts from identifying jobs that have completed.

Update derecho shared batch job submission to both increase the number of shared node jobs and control the number of jobs per shared node by submitting the shared jobs on more cores than needed. In the end, an upgrade to PBS seemed to fix the shared node aborts, so this change was commented out in the PR. Derecho will continue to be closely watched.

Fix potential bug in setting ICE_MACHINE_QSTAT if the string has spaces in it.

Update job checking logic to avoid PBS output that shows completed jobs, added -v " historical ". This is far from ideal and not particularly future proof, but PBS qstat has become a mess.

Update create fails to identify test suite jobs that failed to run then generate a script to resubmit them.
Minor fix to initialize worka=0 for sifb history variable accumulation (like elsewhere in ice_history) so don't have uninitialized values being accumulated. This is needed to fix out-of-range history values for sifb (in UFS)
…ium#1094)

PR checklist

    Short (1 sentence) summary of your PR:
    Add zero_gradient and linear_extrap boundary conditions
    Developer(s):
    apcraig
    Suggest PR reviewers from list in the column to the right.
    Please copy the PR test results link or provide a summary of testing completed below.
    All tests pass and bit-for-bit as expected. https://github.com/CICE-Consortium/Test-Results/wiki/cice_by_hash_forks#0e59535ce2009a3175e67156793b3ec83f2a3c69
    How much do the PR code changes differ from the unmodified code?
        bit for bit
        different at roundoff level
        more substantial
    Does this PR create or have dependencies on Icepack or any other models?
        Yes
        No
    Does this PR update the Icepack submodule? If so, the Icepack submodule must point to a hash on Icepack's main branch.
        Yes
        No
    Does this PR add any new test cases?
        Yes
        No
    Is the documentation being updated? ("Documentation" includes information on the wiki or in the .rst files from doc/source/, which are used to create the online technical docs at https://readthedocs.org/projects/cice-consortium-cice/. A test build of the technical docs will be performed as part of the PR testing.)
        Yes
        No, does the documentation need to be updated at a later time?
            Yes
            No
    Please document the changes in detail, including why the changes are made. This will become part of the PR commit log.

Add zero_gradient and linear_extrap boundary conditions

This provides options to set the boundary conditions around the edge for a regional grid. Only halo values on the outside halo are affected. This is implemented largely in the HaloUpdates in ice_boundary.F90, both in the mpi and serial implementations. The boundary conditions are computed locally for each block and don't require any explicit communications. They are implemented consistent with mixing boundary conditions in the ew and ns directions. The zero_gradient boundary condition sets the halo equal to the values on the boundary of the domain, basically zero gradient into the halo. The linear_extrap boundary condition sets the halo values such that the gradient across the halo matches the gradient on the edge of the active domain, basically constant gradient.

The zero_gradient and linear_extrap boundary conditions have been implemented as an interim step toward a regional grid capability. Until restoring options are complete and the regional capability is fully tested, these boundary conditions may produce nonphysical values such as negative ice thickness.

-    Added zero_gradient and linear_extrap code to HaloUpdate subroutines.
-    Refactored the ice_boundary.F90 to leverage automated code generation and sync the mpi and serial versions of the code.
-    Created a generate_haloUpdates.sh script to generate the various haloUpdate subroutines quickly and consistently. This script lives in cicecore/cicedyn/infrastructure/comm/mpi and has a README. This reduces effort and risk if the haloUpdate needs to be updated in the future.
-    Synchronized the mpi and serial versions of ice_boundary.F90. Now the only difference in the files is a #define in the serial version to turn off the MPI code.
-    Update the halochk subroutines to validate zero_gradient and linear_extrap boundary condition options.
-    Updated some initialization to account for the new boundary condition options.
-    Added explicit checks for valid boundary_type settings in ice_domain.F90. This means checks for invalid values later in the code can be removed.
-    Add set_nml.boxgauss which is a box test with a gauss distibution of ice in the center. Added several tests leveraging this new configuration. Added bczerogradient and bclinearextrap set_nml options and tests.
-    Update the set_nml filenames for boundary condition settings, add "bc" to start of string.
-    Update the test suite to cover the new boundary conditions and improve halochk unit test coverage overall.
-    Update the documentation.

Improved the plabeld argument type in debug_ice so the string length is more flexible. This issue was detected while testing.

Update initialization of uvmCD in ice_grid.F90 due to uninitialized values triggering and error in some compilers.
…CE-Consortium#1100)

Update snwredist documentation
Update snwredist setting in set_nml.cesm3
Update icepack to #68097c59aceb20 Apr 9, 2026 includes update to snwredist documentation
The handling of water tracers / isotopes is being overhauled and will look different moving forward.

See also ESCOMP/CMEPS#638
Fix an oversight in the recent implementation of ice_boundary.F90 where the
haloUpdates were communicating doubles instead of the native (dbl,real,int)
type.  Update the new boundary condition calculation to use consistent
types and correct type conversion.  This was fixed in generate_haloUpdates.sh
then applied to the mpi and serial versions of ice_boundary.F90.

Minor cleanup of ice_broadcast and ice_gather_scatter to make mpi variables
consistent with respect to capitalization of names.

These changes are bit-for-bit identical.
…ICE-Consortium#1105)

Reducing dyn_area_min and dyn_mass_min (see PR CICE-Consortium#1055) led to instability with the C-grid. The modifications to the code in this PR correct this problem by setting the rheology term to zero for small values of concentration (<1e-3).

This PR replaces CICE-Consortium#1078. I cherry-picked @JFLemieux73's commits then modified the code to make the new rheology factor optional and remove unused instances of it.

@JFLemieux73 reports in CICE-Consortium#1078 that "the C-grid is now stable but the results are of course not BFB" with the very small, default minimum dynamics parameters. He also ran a QC test on his configuration, which showed non-climate-changing results. Tests were first run with these changes and the old, higher values of dyn_area_min and dyn_mass_min to confirm these changes are bit-for-bit. Tests were then run with the newer lower default values. All tests pass but the gridC and gridCD results are NOT bit-for-bit, as expected. This implementation fixes the instability and allows the smaller values of dyn_area_min and dyn_mass_min to be used with the C and CD grid.

---------

Co-authored-by: Jean-Francois Lemieux <jean-francois.lemieux@canada.ca>
…E-Consortium#1107)

Update Derecho intel and inteloneapi port. Add mpif08 unit test.

Update the inteloneapi compiler version on derecho to 2025.2.1. This is not bit-for-bit for derecho inteloneapi because of the compiler upgrade.

Update the intel and inteloneapi compiler debug options on derecho to better trap and warn. These changes are based on the UFS compiler settings and to help meet UFS requirements. The new settings are

FFLAGS += -O0 -check all -check noarg_temp_created -warn -warn noerrors -fp-stack-check -fstack-protector-all -fpe0 -debug -ftrapuv -init=snan,arrays -link_mpi=dbg

Modify history restart capability, do not write the time bounds with the history restarts as the variable time_end is not defined. This was trapped by the new debug compiler flags and then fixed. Modified netcdf and pio io options.

Add mpif08 unit test to check availability of the mpi_f08 module as we consider an update from "use mpi" to "use mpi_f08" in CICE.
…m#1075)

ufs-community/ufs-weather-model#2884 adds a simple tracing module to UFS and updates some subcomponents' nuopc drivers to produce a trace file which can be used to identify performance issues. The tracing module is not built and used by default. It can be enabled by setting a build option `-DUFS_TRACING=ON'. The generated trace files can be visualized using the chrome-tracing tool or, for example, the Perfetto UI online tool (https://ui.perfetto.dev/) like in ufs-community/ufs-weather-model#2883 . Tracing has been useful in optimizing GFS runtime.
---------

Co-authored-by: Dusan Jovic <dusan.jovic@noaa.gov>
This is a significant refactor of the restoring implementation.  Separated the exterior halo boundary update and the interior restoring capability.  Added namelist set_boundary_flds to set exterior halo values.  Added namelist restore_data, restore_flds, restore_mask, restore_width, and restore_timescale which work when restore_ice is on to computed interior restoring terms.  Calls to initialize and execute the boundary and interior restoring were updated in the code.

In summary, several model defined fields can be restored (controlled by set_boundary_flds and restore_flds) in ice_restoring.F90.  The restoring dataset is specified with restore_data.  Exterior halo values are set with set_boundary_flds.  Interior restoring is turned on with restore_ice and the restoring strength is specified with restore_mask, restore_width, and restore_timescale.  The implementation provides some basic options and a framework for adding new fields, new masks, and new datasets by application users as needed.

The current restore_data options are
   - defined, internally defined state at all time
   - initial, uses the initial model state at all time
   - restartfiles, reads in extended restart files at each timestep, filenames are somewhat hardcoded into the implementation

The fields (set_boundary_flds, restore_flds) currently supported are
   - aicen, restore ice concentration in all categories
   - state, restore aicen, vicen, vsnon, and trcrn
   - trcrn, restore all tracers in all categories
   - vicen, restore ice thickness in all categories
   - vsnon,  restore snow thickness in all categories
   - velocity, restore uvel and vvel

The interior restoring strength is set as follows.  The interior mask (restore_mask) specifies a mask that is applied to interior points based on restore_width (the number of gridcells around the exterior to restore) and restore_timescale (the restoring time in days) as follows
   - all, sets all interior points with full restoring value (restore_timescale)
   - none, no interior restoring is carried out
   - constant, restores restore_width gridpoints on the exterior of the domain with full restoring value (restore_timescale)
   - linear, restores restore_width gridpoints on the exterior of the domain with a linearly decreasing restoring value moving from the exterior (set to restore_timescale) to the interior.

The boundary and interior restoring uses the same internal arrays to hold the restoring data.  The boundary updates always just set the values on the exterior halo to the restoring values.  The interior restoring updates the interior fields with a forcing strength proportional to the model timestep (dt) over the restoring time (restore_timescale).  It's important not to do interior restoring more than once per model timestep for each field.  The halo updates are done via subroutine ice_restoring_halo while the interior restoring is done via calls to subroutine ice_restoring_interior.

A new timer was added, timer_restore, to track restoring time.  Documentation was updated, and several tests were added or updated.  There is a new script, configuration/scripts/tests/full2nest.sh, that provides a basis for extracting a smaller (nest) regional grid from a (full) run and generating the extended restart files to force the boundary and interior for the nest testcase.  The full2nest.sh script describes how to setup that test.

All results are bit-for-bit except the boxrestore test case which was modified to produce new results.

There are still several issues to investigate
  - Can the exterior halo values for grid and technical fields (like the advection metrics) be computed directly and exactly for a regional grid rather than by a "zero_gradient" type implementation?  Up to now, the only time these values were needed on the halo was in cyclic cases and those halo values can be set by the cyclic bc exactly.
  - Can/should we be able to mix "zero_gradient" and "linear_extrapolation" for regional bcs in a model run depending on fields (maybe velocity should be extrapolated and concentration should not?)
  - We should implement restoring for aice, vice, vsno, tracers (not defined by category but then distributed across categories) and maybe subsets of tracer fields (instead of all or none).
  - Will the regional grids work better with 2 or 3 ghost cells?  We need to validate the model with ghost cells greater than 1 and test whether extending the halo and specifying the halo values will improve the regional solutions.
  - Are the restoring calls in the best place in the code?  For instance, can we implement interior restoring in dynamics subcycling (ndtd or ndte) while preserving the restoring forcing strength somehow?

Several other minor modifications were made
  - bound_state was separated from ice_state into it's own module due to some circular dependencies created by adding ice_restoring_halo calls to bound_state to update the exterior halo when required.  Also added an optional argument that turns off any restoring in bound_state, needed during initialization.
  - deprecated restore_bgc feature
  - maxval_spval in runtime_diagnostics was updated to better reflect the implementation
  - the restoring calculation for restore_ocn and restore_bgc was maintained but updated to reduce flops
  - added some memory allocation checks
  - updated some abort_ice calls
  - cleaned up indentation in ice_forcing_bgc.F90
  - updated restoring calls in all drivers including unit test drivers as needed
  - removed a couple of unused variables
  - updated the Boreas port
Update the blueback port after an upgrade, old modules no longer working. The updated setup supports intel, cray, gnu, and aocc. But nvhpc is no longer supported and the new nvidia compiler option also does not seem to work. All results are bit-for-bit with prior modules except cray which changed answers.
…analyses (CICE-Consortium#1118)

* Minor fixes in cicecore/cicedyn/infrastructure/io/io_pio2/ice_history_write.F90

* reorder _FillValue nf90_get_att in case it's missing in diagnostic in cicecore/cicedyn/infrastructure/ice_read_write.F90

* Add ! 3D (category) comment back to cicecore/cicedyn/infrastructure/io/io_pio2/ice_history_write.F90

* mask_restoring log_kind in cicecore/cicedyn/infrastructure/ice_restoring.F90

* use_restart_time = .true was missing trailing period in set_nml.bdyrestornest

* Need num_set_boundary_flds in cice_init2 (not cice_init1)

* Move use num_set_boundary_flds in cicecore/drivers/mapl/geos/CICE_RunMod.F90 too

Close Minor issues in cicecore/cicedyn/infrastructure/io/io_pio2/ice_history_write.F90 CICE-Consortium#1108 Minor possibly uninitialized variable in ice_read_nc_xy diagnostic CICE-Consortium#1112 mask_restoring should be logical (not dbl_kind) CICE-Consortium#1119
…1122)

This should complete the fixes to the uninitialized fill variables. A first fix was applied with CICE-Consortium#1118. This fixes a couple other instances.  Also cleaned up some of the surrounding comments and diagnostic code.

Closes CICE-Consortium#1112
Updated ciceplots.csh to support plots from box tests.  Added ciceplots2dbox.py to support those plots.  The new python script closely mimics the original one, which only made plots on global lat/lon grids. I also altered the filenames and logic in ciceplots.csh. 

I added the advection namelist option to set_nml.boxslotcyl, since that test is aimed at advection and I wanted to check upwind too. The code itself should still be BFB, including slotted cylinder tests.
Merged the comm/serial and comm/mpi directories to the comm directory.  This may impact CICE builds in coupled systems.  Add CPP, NO_MPI, to turn off MPI.

Synchronized the comm/serial and comm/mpi directories moving all files to the comm directory and removing the serial and mpi directories.  Added a CPP, NO_MPI, to turn off MPI in the comm code.  The scripts build and run works the same, instead of choosing a serial or mpi directory, it always grabs the code in the comm directory and sets -DNO_MPI on the compile if serial is being used.

Refactored the ice_gather_scatter.F90 file.  

- Removed the _ext methods by adding an optional argument, grid_ext, to the baseline gather and scatter methods to indicate use of an extended grid field in the call.
- Added a generate_GatherScatter.sh script to generate several overloaded methods quickly.  Updated the README.generate_code in the comm directory to provide documentation of script usage.
- Eliminated scatter_global_stress.  Where this was used, the global read and scatter_global_stress was replaced by an ice_read_global that scatters plus a call to ice_HaloUpdate_stress.
- Updated the i_global (i_glob) and j_global (j_glob) arrays in ice_blocks.F90 to reflect the grid indexing WITHOUT boundary conditions.  The extra logic and special tripole values have been removed.  The halo information is now computed directly in the gather/scatter infrastructure and the tripole logic is triggered by the value of ns_boundary_type.
- Ensured all results were bit-for-bit.  Some issues and bugs are documented separately and may need to be addressed at a later time.

Updated comm infrastructure to consistently use fillValue as the optional argument to specify fill values.

Update comm and IO infrastructure to consistently use grid_ext as the optional argument to specify use of an extended grid field.

Added a gather/scatter unittest and updated the unittest_suite.

Updated some of the halochk unittest implementation.

Added and updated some of the namelist option files to support various mixed boundary conditions better.

Moved ns_boundary_type and ew_boundary_type from ice_domain to ice_blocks to provide access to these variables to the CICE infrastructure.

Cleaned up some unused variables in the comm files.

Fixed an error in the namelist settings in set_nml.bdyrestornest required for the full/nest testing.  This is unrelated to the gather/scatter comm cleanup of this PR.

Updated the documentation.

A significant amount of work was put in to understand the gather/scatter logic and to try to clean up the code (for instance, replace an extended grid scatter with a grid scatter plus a haloUpdate), but problems were constantly created.  The model seems to depend on some of the undocumented features (for instance, the extended scatter uses a fill value of zero by default and if this is changed, the code breaks), and there are other issues that could be fixed as well.

Getting the gather/scatter unit test to work was incredibly challenging and that unit test has a huge number of special cases to validate the checking.  In particular, the gather/scatter must validate for any combination of

- double, real, integer, logical datatypes
- all grids
- all boundary conditions including cyclic, open, closed, tripole, tripoleT, zero_gradient, linear_extrap
- center, north, east, and northeast points
- scaler, vector, and angle fields
- with and without land block elimination especially at the boundary edge or in the corner
- with fill values specified or not
- in cases where the outer halo is specifically not updated
- for extended and non-extended global grids (both for gather and scatter)

The grid scatter updates the halo values.  In the interior, this is relatively trivial.  On the outer boundary, this should behave like a haloUpdate, but it doesn't match perfectly.  Attempts to replace the scatter with a scatter and a haloUpdate caused havoc.

Several issues were identified.  Attempts were made to fix some of them, but this generally led to more model failures.  So for now, the gather/scatter update is bit-for-bit with the prior version even if there has been significant cleanup.  I decided that keeping the code bit-for-bit for this PR was important.  Fixing issues and introducing non bit-for-bit changes can be added incrementally in the future as needed and documented carefully.  This cleanup should make later fixes more tangible.  The gather/scatter unit tester also provides a comprehensive testing capability that can be used as future changes are made.  Some of the issues are

- The haloUpdate fills the local halos including the outside halo depending on the value of the boundary conditions (ew/ns_boundary_type).  The haloUpdate also performs a tripole line synchronization on the zipper which has nothing to do with the haloUpdate.  The scatter method does NOT perform this tripole line synchronization at ny_global.  Ideally, the tripole line synchronization would be removed from the haloUpdate and be called as a separate infrastructure method.  Then the scatter and the haloUpdate should be updated to perform the same computations or even better, the haloUpdate aspect of the scatter should be removed from the scatter and a haloUpdate should be called when needed with a scatter call.
- The grid scatter has a default fill value of zero.  If this is changed to spval (or similar), the code breaks.  I suspect this has to do with the grid scatters that occur in the grid initialization, but it was difficult to identify exactly which fields and which calls are problematic.
- There is some ambiguity whether gridpoints that are not set in the infrastructure (i.e. open and closed bcs) should take on the fill value or keep the values that were passed into the infrastructure.  Different methods may behave differently, this should be clarified.
- Some features of the haloUpdate and scatter methods do not make sense for logicals on the tripole grid (i.e. averaging on the zipper).  This should be clarified.
- The haloUpdate_stress call updates the zipper for the tripoleT but not for the tripole.  I think the tripoleT implementation is incorrect and is a bug in the code.
- If there is land block elimination at the top of the grid for tripole grids, the scatter sets the value to the fill value but then flips the sign of that fill value if the field is "angle" or "vector".  This should not happen for fill values and could cause problems later if that specific fill value is used to check for a fill.
- It's not clear the NW and NE outer halo corners with a tripole grid are handled properly.  I think they are automatically doing an east-west cyclic boundary condition (which is normally how the code is run with tripole grids), but this is not strictly required and is a gap in the ability of the implementation to handle tripole north-south boundary conditions with an arbitrary east-west boundary condition.
…rtium#1126)

Unused variables in code can obscure what the code is doing (like declaring local i,ilo,... block loop variables w/o an actual loop in the code) and lead to compiler warnings (that can block pull requests in host models). But, compiler warnings are not errors and "fixing" them should do no harm. Here we remove a number of local variables that are obviously unused, for clearer code and ~300 fewer warnings. Variables that are unused but mentioned in comments are still kept
---------

Co-authored-by: apcraig <anthony.p.craig@gmail.com>
* Fix ANGLE and tripole closure in MOM supergrid

When building a CICE grid from a MOM6 supergrid (mom_grid), two bugs were fixed:

    * ANGLE sign convention: mom_grid_rotation_angle computed the grid rotation angle using MOM6's atan2-based formula directly, but CICE's ANGLE convention is the opposite sign (positive = counter-clockwise from true north). The angle is now negated, and this convention is documented inline.

    * Top row / tripole closure: mom_corners_global filling of the top row and top right corner is also corrected

---------

Co-authored-by: Dougie Squire <dougie.squire@anu.edu.au>
* Update Icepack to #a348e4c1e189a48, Aug 17, 2026

   * Add conductive flux limiting for vertical thermodynamics when `calc_Tsfc=.false.`
This changes answers when calc_Tsfc=.false.

   * Also updates Icepack documentation and derecho ports.  These do not impact CICE
directly and are bit-for-bit in CICE.

* Update forum links to https://bb.cgd.ucar.edu/cesm/forums/cice-consortium.146/.  This adds fixes to the forum links, has no impact on CICE.
apcraig and others added 2 commits August 18, 2026 12:35
Update Carpenter port, changes answers for some compilers.

Fix missing NO_MPI CPP in ice_communicate and ice_gather_scatter needed for serial builds around the "use mpi" code. This was caught by compilers on Carpenter and Izumi.
@DeniseWorthen
DeniseWorthen requested a review from dpsarmie August 20, 2026 18:02
Comment thread cicecore/cicedyn/analysis/ice_history.F90
@gspetro-NOAA

Copy link
Copy Markdown

RTs completed successfully on ufs-community/ufs-weather-model#3331. This PR can be merged.

@NickSzapiro-NOAA
NickSzapiro-NOAA merged commit 6c1592c into NOAA-EMC:develop Aug 24, 2026
1 check passed
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.

10 participants