Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit

* ice_flux: zero-initialize divu and shear in init_history_dyn

'divu' and 'shear' are accessed in 'accum_hist' when writing the initial
condition before they are initialized at the start of {eap, evp,
implicit_solver}. This leads to runtime error when compiling with NaN

Zero-initialize 'divu' and 'shear' in init_history_dyn, where the
related variable 'strength' is already zero-initialized.

* ice_history_shared: disallow 'x' in history frequency variables f_*'

In the current code, nothing prevents users from leaving 'x' along with
active frequencies in the individual namelist history frequency
variables, for example:

    f_aice = 'xmd'

This configuration does not work correctly, however. The corresponding
history fields are correctly defined in
ice_history_shared::define_hist_field, but since the calls to
ice_history_shared::accum_hist_field in ice_history::accum_hist are only
done after checking that the first element of each frequency variable is
not 'x', the corresponding variables in the history files are all zero.

Prevent that behaviour by actually disallowing 'x' in history frequency
variables if any other frequencies are active. To implement that, add a
check in the loop in define_hist_field, which loops through vhistfreq,
(corresponding to f_aice, etc. in ice_history). Since this subroutine
initializes 'id(:)' to zero and then writes a (non-zero) index in 'id'
for any active frequency, it suffices to check that all previous indices
are non-zero.

* ice_history: remove uneeded conditions around CMIP history variables

In ice_history::accum_hist, after the calls to accum_hist, we loop on
the different output streams, and on the history variables in the
avail_hist_fields array, to mask out land points and convert units for
each output variable.

Since 3c99e10 (Update CICE with CMIP changes. (#191), 2018-09-27), we
also use this loop to do a special treatment for some CMIP variables
(namely, averaging them only for time steps where ice is present, and
masking points where ice is absent).

This adjustment is done if the corresponding output frequency variable
(f_sithick, etc.) does not have 'x' as its first element, and if the
corresponding index in avail_hist_field for that variable/frequency
(n_sithick(ns)) is not zero. Both conditions are in fact uneeded since
they are always true.

The first condition is always true because if the variable is found in
the avail_hist_field array, which is ensured by the condition on line
3645, then necessarily its corresponding namelist output frequency won't
have 'x' as its first character (since this is enforced in

The second condition is always true because if the variable is found in
the avail_hist_field array, then necessarily its index in that array,
n_<var>(ns), is non-zero (see ice_history_shared::define_hist_field).

Remove these uneeded conditions. This commit is best viewed with

    git show --color-moved --color-moved-ws=allow-indentation-change

* ice_history: use loop index directly for CMIP variables

In ice_history::accum_hist, there is a special treatment for some CMIP
variables where they are averaged only for time steps where ice is
present, and points where there is no ice are masked. This is done on
the loop on output streams (with loop index n).

This special averaging is done by accessing a2D and a3Dc using the
variable n_<var>(ns), which corresponds to the index in the
avail_hist_field array where this history variable/frequency is defined.
By construction, this index correponds to the loop index 'n', for both
the 2D and the 3D loops. Simplify the code by using 'n' directly.

* ice_history_shared: add two logical components to ice_hist_field

At the end of ice_history::accum_hist, we do a special processing for
some CMIP variables: we average them only for time steps where ice is
present, and also mask ice-free points. The code to do that is repeated
for each variable to which it applies.

In order to reduce code duplication, let's introduce two new logical
components to our 'ice_hist_field' type, defaulting them to .false., and make them optional
arguments in ice_history_shared::define_hist_field. This allows us to
avoid defining them for each output variable. We'll set them for CMIP
variables in a following commit.

* ice_history: set avg_ice_present, mask_ice_free_points for relevant CMIP variables

In the previous commit, we added two components to type ice_hist_field
(avg_ice_present and mask_ice_free_points), relating to some special
treatment for CMIP variables (whether to average only for time steps
where the ice is present and to mask ice-free points).

Set these to .true. in the call to 'define_hist_field' for the relevant
2D variables [1], and set only 'avg_ice_present' to .true. for the 3D
variables siitdthick and siitdsnthick, corresponding to the code under
the "Mask out land points and convert units" loop in


* ice_history: use avg_ice_present, mask_ice_free_points to reduce duplication

Some CMIP variables are processed differently in
ice_history::accum_hist: they are averaged only for time steps when ice
is present, and points where ice is absent are masked. This processing
is repeated for each of these variables in the 2D and 3Dc loops.

To reduce code duplication, use the new components avg_ice_present and
mask_ice_free_points of ice_hist_field to perform this processing only
for variables that were defined accordingly. The relevant variables
already have those components defined as of the previous commit.

Note that we still need a separate loop for the variable 'sialb' (sea
ice albedo) to mask points below the horizon.

Git stats


Failed to load latest commit information.

GHActions Documentation Status lcov

The CICE Consortium sea-ice model

CICE is a computationally efficient model for simulating the growth, melting, and movement of polar sea ice. Designed as one component of coupled atmosphere-ocean-land-ice global climate models, today’s CICE model is the outcome of more than two decades of community collaboration in building a sea ice model suitable for multiple uses including process studies, operational forecasting, and climate simulation.

This repository contains the files and code needed to run the CICE sea ice numerical model starting with version 6. CICE is maintained by the CICE Consortium. Versions prior to v6 are found in the CICE-svn-trunk repository.

CICE consists of a top level driver and dynamical core plus the Icepack column physics code], which is included in CICE as a Git submodule. Because Icepack is a submodule of CICE, Icepack and CICE development are handled independently with respect to the GitHub repositories even though development and testing may be done together.

The first point of contact with the CICE Consortium is the Consortium Community Forum. This forum is monitored by Consortium members and also opened to the whole community. Please do not use our issue tracker for general support questions.

If you expect to make any changes to the code, we recommend that you first fork both the CICE and Icepack repositories. In order to incorporate your developments into the Consortium code it is imperative you follow the guidance for Pull Requests and requisite testing. Head over to our Contributing guide to learn more about how you can help improve CICE.

Useful links


See our License and Distribution Policy.