Skip to content

Commit

Permalink
ice_history: remove uneeded conditions around CMIP history variables
Browse files Browse the repository at this point in the history
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. (CICE-Consortium#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
ice_history_shared::define_hist_field).

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
  • Loading branch information
phil-blain committed Nov 7, 2023
1 parent b563409 commit 17aab6a
Showing 1 changed file with 363 additions and 443 deletions.
Loading

0 comments on commit 17aab6a

Please sign in to comment.