Skip to content

Updates for CMIP7#1066

Merged
eclare108213 merged 48 commits intoCICE-Consortium:mainfrom
ESCOMP:cmip7
Jan 16, 2026
Merged

Updates for CMIP7#1066
eclare108213 merged 48 commits intoCICE-Consortium:mainfrom
ESCOMP:cmip7

Conversation

@dabail10
Copy link
Contributor

@dabail10 dabail10 commented Nov 13, 2025

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:
    Starting this in draft mode. This is a big PR with all of the SIMIP updates for CMIP7.
  • Developer(s):
    dabail10 (D. Bailey)
  • 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.
    io_suite results here
    https://github.com/CICE-Consortium/Test-Results/wiki/cice_by_hash_forks#6b7cd825797762e22fe0a05342917d574a980966
  • 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.

This PR should address issue #1048 and #1038.

  • I have updated all of the variable names, long names, and units to correspond to the CMIP7 data request.
  • I have added new variables requested in the CMIP7 data request.
  • I have added documentation about the CMIP6 to CMIP7 update.
  • I have simplified the accumulation of some fields where possible and added prognostic sea ice density.
  • I have 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. This includes fswabs, fsens, flat, ...
  • Remove f_CMIP flag and add set_nml.cmip option instead.
  • Added comment field for SIMIP variables that uses part of the description field in the CMIP data request table.
  • Add long_name field for time_bounds, lon?_bounds and lat?_bounds. Issue time_bounds, lat?_bounds, lon?_bounds attributes #1057
  • Partly address aice versus aice_init aice vs. aice/aice_init factor in ice_history #1033
  • Partial fix for albedo variables [albedo]_ai history variables over 100% #1051
  • Also addresses issue Some CMIP variables are computed using a mix of U and T quantities #904
  • Updated test results

Closes #904
Closes #1033
Closes #1038
Closes #1048
Closes #1057

variables for CMIP7.

- Add new variables that were not there before
- Change names for some of the variables
- Add an f_CICE flag to be able to turn off CICE duplicate variables
- Added more variables to the daily stream
Copy link
Contributor

@anton-seaice anton-seaice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @dabail10 - I will give this a proper review next week

I dropped a couple of comments - i am not sure about mask_ice_free_points=.true. for extensive variables

In general the cell_methods in the data request are a bit of a mess now, there are several methods more then there used to be and some errors. If we want to be setting them directly in CICE it will take some work (e.g. its more than just one for intensive and one for extensive!)

- add a few more SIMIP variables (sisndmasswind, ...)
- remove sialb as this is no longer in the CMIP7 table
- start some work on the aice versus aice_init thing
@apcraig
Copy link
Contributor

apcraig commented Nov 17, 2025

Documentation will need to be updated. I'm also confused about the f_CICE and f_CMIP implementation. Why not just set all the CMIP f_variables=f_CMIP? And are all or some of the CMIP variables also exposed independently with f_ namelist and which takes priority and/or should there be an ability to "merge" the independent setting and the f_CMIP value instead of overwriting? If the implementation introduces limitations on the settings, we should make that clear in the documentation.

@dabail10
Copy link
Contributor Author

Documentation will need to be updated. I'm also confused about the f_CICE and f_CMIP implementation. Why not just set all the CMIP f_variables=f_CMIP? And are all or some of the CMIP variables also exposed independently with f_ namelist and which takes priority and/or should there be an ability to "merge" the independent setting and the f_CMIP value instead of overwriting? If the implementation introduces limitations on the settings, we should make that clear in the documentation.

This is a good question. This was the way I thought I would deal with some variables only on the monthly stream and some variables on the daily stream with the one flag, f_CMIP. I'm open to other ideas.

- change avg_ice_present to be a character array
- add capability to average when aice_init > 0
- add long_name (title) for SIMIP variables from the CMIP7 table
- update some ice density calculations to use the mushy-layer brine+ice
  density
@dabail10
Copy link
Contributor Author

Just added a whole bunch of changes. I think this is getting pretty close. I have a one-month run with the output here. Outstanding issues:

  1. I have added the CF long_name from the CMIP7 table. Do we want more in the comment field here?
  2. I'm still not happy with fllwutop. I am getting some excessively large values here at points with very tiny ice concentration (1.0e-8). Maybe this is just what it it is. @eclare108213 and I have been iterating on the math.
  3. Still working on the siitd fields.

@eclare108213 eclare108213 mentioned this pull request Nov 20, 2025
18 tasks
@anton-seaice
Copy link
Contributor

should there be an ability to "merge" the independent setting and the f_CMIP value instead of overwriting?

This would be great but i can't think of how to implement it within the current framework. (e.g. something like, if the variable is in the ice_in file, then override with the f_CMIP or f_CICE value)

My view is that all diagnostics should just be off by default, and then let the user set the ones they want. That would break a lot of configurations though, so takes some care if others agree!

Copy link
Contributor

@anton-seaice anton-seaice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @dabail10

I didn't go through everything, but the main themes are:

  1. in some places this used fixed values of rhoi, rhos and in others they come from icepack. Is this correct ?
  2. Melt processes should always be less than 0 in cmip diagnostics
  3. There's lots of loops that aren't needed once if aice>puny condition is removed, they can just be call accum_hist_field(n_..., iblk, ...(:,:,iblk), a2D)
  4. Can all the _ai variables be saved before scale_fluxes is called rather than recalculating them

@dabail10
Copy link
Contributor Author

Just added a whole bunch of changes. I think this is getting pretty close. I have a one-month run with the output here. Outstanding issues:

  1. I have added the CF long_name from the CMIP7 table. Do we want more in the comment field here?
  2. I'm still not happy with fllwutop. I am getting some excessively large values here at points with very tiny ice concentration (1.0e-8). Maybe this is just what it it is. @eclare108213 and I have been iterating on the math.
  3. Still working on the siitd fields.

I have fixed the fllwutop field and the siitd fields. Thoughts on what to put in the comments field? The description from the table? the CF standard_name?

@dabail10
Copy link
Contributor Author

Thanks @dabail10

I didn't go through everything, but the main themes are:

  1. in some places this used fixed values of rhoi, rhos and in others they come from icepack. Is this correct ?
  2. Melt processes should always be less than 0 in cmip diagnostics
  3. There's lots of loops that aren't needed once if aice>puny condition is removed, they can just be call accum_hist_field(n_..., iblk, ...(:,:,iblk), a2D)
  4. Can all the _ai variables be saved before scale_fluxes is called rather than recalculating them
  • I have fixed all occurrences of rhoi as a constant to use the brine + ice density.
  • changed the melt processes to negative
  • removed the unnecessary accumulation in worka where appropriate.

@dabail10
Copy link
Contributor Author

Thanks @dabail10

I didn't go through everything, but the main themes are:

  1. in some places this used fixed values of rhoi, rhos and in others they come from icepack. Is this correct ?
  2. Melt processes should always be less than 0 in cmip diagnostics
  3. There's lots of loops that aren't needed once if aice>puny condition is removed, they can just be call accum_hist_field(n_..., iblk, ...(:,:,iblk), a2D)
  4. Can all the _ai variables be saved before scale_fluxes is called rather than recalculating them

On point 4, this is a larger issue. Ultimately we want to get rid of the _ai quantities. However, that is for a future PR.

@anton-seaice
Copy link
Contributor

Thanks for your work @dabail10 !

Can this calculation be a subroutine or done once in the file and stored, rather than repeated through the code ? :

       if (ktherm == 2) then
                 rho_ocn = icepack_mushy_density_brine(sss(i,j,iblk))
                 rho_ice = c0
                 salt_ice = c0
                 do k = 1, nzilyr
                    Tice = icepack_mushy_temperature_mush(trcr(i,j,nt_qice+k-1,iblk),trcr(i,j,nt_sice+k-1,iblk))
                    Sbr = trcr(i,j,nt_sice+k-1,iblk)
                    salt_ice = salt_ice + Sbr / real(nzilyr,kind=dbl_kind)
                    phi = icepack_mushy_liquid_fraction(Tice,Sbr)
                    rhob = icepack_mushy_density_brine(Sbr)
                    rho_ice = rho_ice + min(phi*rhob+(c1-phi)*rhoi,rho_ocn)
                 enddo
                 rho_ice = rho_ice / real(nzilyr,kind=dbl_kind)

@anton-seaice
Copy link
Contributor

Thoughts on what to put in the comments field? The description from the table? the CF standard_name?

Description field can be quite long ? It's a bit of an annoying thing to hard-code .

I don't have a strong view

@dabail10
Copy link
Contributor Author

Thanks for your work @dabail10 !

Can this calculation be a subroutine or done once in the file and stored, rather than repeated through the code ? :

       if (ktherm == 2) then
                 rho_ocn = icepack_mushy_density_brine(sss(i,j,iblk))
                 rho_ice = c0
                 salt_ice = c0
                 do k = 1, nzilyr
                    Tice = icepack_mushy_temperature_mush(trcr(i,j,nt_qice+k-1,iblk),trcr(i,j,nt_sice+k-1,iblk))
                    Sbr = trcr(i,j,nt_sice+k-1,iblk)
                    salt_ice = salt_ice + Sbr / real(nzilyr,kind=dbl_kind)
                    phi = icepack_mushy_liquid_fraction(Tice,Sbr)
                    rhob = icepack_mushy_density_brine(Sbr)
                    rho_ice = rho_ice + min(phi*rhob+(c1-phi)*rhoi,rho_ocn)
                 enddo
                 rho_ice = rho_ice / real(nzilyr,kind=dbl_kind)

You know, I bet there is a mushy function for this already ...

@anton-seaice
Copy link
Contributor

I still think there is something inconsistent with snowfrac / sisnconc:

Snowfrac is per grid cell area

call define_hist_field(n_snowfrac,"snowfrac","1",tstr2D, tcstr, &
"grid cell mean snow fraction", &
"snow fraction per unit grid cell area", c1, c0, &
ns1, f_snowfrac)

Sisnconc is per sea ice area (and extensive)

call define_hist_field(n_sisnconc,"sisnconc","%",tstr2D, tcstr, &
"snow area percentage", &
"percentage of the sea-ice surface that is covered by snow", &
c100, c0, &
ns1, f_sisnconc, avg_ice_present='none', mask_ice_free_points=.false.)

But they are calculated the same:

if (f_snowfrac(1:1) /= 'x') &
call accum_hist_field(n_snowfrac, iblk, snowfrac(:,:,iblk), a2D)

if (f_sisnconc(1:1) /= 'x') then
call accum_hist_field(n_sisnconc, iblk, snowfrac(:,:,iblk), a2D)
endif

@dabail10
Copy link
Contributor Author

I still think there is something inconsistent with snowfrac / sisnconc:

Snowfrac is per grid cell area

call define_hist_field(n_snowfrac,"snowfrac","1",tstr2D, tcstr, &
"grid cell mean snow fraction", &
"snow fraction per unit grid cell area", c1, c0, &
ns1, f_snowfrac)

Sisnconc is per sea ice area (and extensive)

call define_hist_field(n_sisnconc,"sisnconc","%",tstr2D, tcstr, &
"snow area percentage", &
"percentage of the sea-ice surface that is covered by snow", &
c100, c0, &
ns1, f_sisnconc, avg_ice_present='none', mask_ice_free_points=.false.)

But they are calculated the same:

if (f_snowfrac(1:1) /= 'x') &
call accum_hist_field(n_snowfrac, iblk, snowfrac(:,:,iblk), a2D)

if (f_sisnconc(1:1) /= 'x') then
call accum_hist_field(n_sisnconc, iblk, snowfrac(:,:,iblk), a2D)
endif

Ah, I think I understand. The variable snowfrac is only the fraction on the sea ice. This comment is incorrect.

@dabail10
Copy link
Contributor Author

In icepack we have the following:

            snowfracn(n) = fsn ! for history

Where fsn is the snow fraction on the sea ice per category and this is aggregated like apeff_ai.

                  apeff_ai(i,j,iblk) = apeff_ai(i,j,iblk) &
                       + apeffn(i,j,n,iblk)*aicen(i,j,n,iblk)
                  snowfrac(i,j,iblk) = snowfrac(i,j,iblk) &
                       + snowfracn(i,j,n,iblk)*aicen(i,j,n,iblk)

I will modify the comment.

Copy link
Contributor

@eclare108213 eclare108213 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After an ENORMOUS amount of work by @dabail10 following up on tons of critiques, I think this is ready to go! Just one more very minor request from me. Thank you @dabail10!

@dabail10
Copy link
Contributor Author

@apcraig
Copy link
Contributor

apcraig commented Jan 15, 2026

Getting a lot of compare fails.

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

It looks like your branch was created off a version of CICE on Nov 12. There was a commit to main on Nov 26 that changed answers. You either need to compare to the version of CICE you branched from or update your branch to something more recent.

If this is ready, I can run some tests again. What I do is checkout CICE main then merge the PR branch into my sandbox. This duplicates what will happen when we merge the PR and also ensures testing is done relative the latest main version. You could create a sandbox like this was for testing, you do not necessarily have to update your branch to the latest CICE main.

Just to check again, do we think modifications are complete at this point. If so, I will test too.

@dabail10
Copy link
Contributor Author

Oh shoot. I forgot about that. I will update the base branch.

@dabail10
Copy link
Contributor Author

There it was a clean update with no conflict. I will rerun my tests.

@dabail10
Copy link
Contributor Author

dabail10 commented Jan 16, 2026

I am now getting some compile errors. I guess the merge was not as clean as I hoped.

/glade/work/dbailey/CICE_ESCOMP/cicecore/cicedyn/general/ice_step_mod.F90(685): error #6627: This is an actual argument keyword name, and not a dummy argument name. [WAVE_HEIGHT_TYPE_OUT]
wave_height_type_out=wave_height_type)
------------------------------------^
/glade/work/dbailey/CICE_ESCOMP/cicecore/cicedyn/general/ice_step_mod.F90(948): error #6627: This is an actual argument keyword name, and not a dummy argument name. [WAVE_HEIGHT]
wave_height = wave_sig_ht (i,j, iblk))
-------------------------------------------^

I didn't update icepack appropriately.

@dabail10
Copy link
Contributor Author

Much better. 3 PEND and 2 FAIL. I think this is expected for the hdf5/cdf tests?

https://github.com/CICE-Consortium/Test-Results/wiki/cice_by_hash_forks#3a220fa2de4ffe3ba93b69f02d3ff2bc146f9624

@apcraig
Copy link
Contributor

apcraig commented Jan 16, 2026

Much better. 3 PEND and 2 FAIL. I think this is expected for the hdf5/cdf tests?

https://github.com/CICE-Consortium/Test-Results/wiki/cice_by_hash_forks#3a220fa2de4ffe3ba93b69f02d3ff2bc146f9624

Yes, that looks like what we expect.

@eclare108213
Copy link
Contributor

Are you both done with your testing? @dabail10 have you gone through all of the history fields to make sure they look reasonable?

Before it's merged, please add PR header statements like "closes issue #[whatever]" so that we don't have to close them manually. It would be nice to merge this today for weekend testing!

@dabail10
Copy link
Contributor Author

Are you both done with your testing? @dabail10 have you gone through all of the history fields to make sure they look reasonable?

Before it's merged, please add PR header statements like "closes issue #[whatever]" so that we don't have to close them manually. It would be nice to merge this today for weekend testing!

I have looked through all the fields numerous times and I am happy. I have copied one year of data to here:

https://ftp.cgd.ucar.edu/pub/dbailey/cicecmip/

It would be great if others had a look in case I missed something. My io_suite test did as expected. I will investigate how to do the automatic closing of issues.

@apcraig
Copy link
Contributor

apcraig commented Jan 16, 2026

I have run a partial test suite on Derecho with 4 compilers and feel like this is ready to be merged. I will merge this afternoon unless someone does it before me or anyone notes any last minute concerns.

@apcraig
Copy link
Contributor

apcraig commented Jan 16, 2026

So, are there five issues that should close?

"To automatically close issues when merging a pull request (PR), use specific keywords like
closes, fixes, or resolves followed by the issue number (e.g., closes #123) in the PR's description or commit message, which triggers the closure upon merging into the default branch on platforms like GitHub and GitLab."

It looks like you added the issues that are related, please update the PR description to explicitly add phrasing like

closes #123

for any issue that should automatically close.

@dabail10
Copy link
Contributor Author

So, are there five issues that should close?

"To automatically close issues when merging a pull request (PR), use specific keywords like closes, fixes, or resolves followed by the issue number (e.g., closes #123) in the PR's description or commit message, which triggers the closure upon merging into the default branch on platforms like GitHub and GitLab."

It looks like you added the issues that are related, please update the PR description to explicitly add phrasing like

closes #123

for any issue that should automatically close.

Added. I thought if they were linked it would do the same.

@apcraig
Copy link
Contributor

apcraig commented Jan 16, 2026

Added. I thought if they were linked it would do the same.

Maybe they do, it's hard to know for sure. Thanks for adding that text.

@eclare108213 eclare108213 merged commit 27a4982 into CICE-Consortium:main Jan 16, 2026
2 checks passed
@eclare108213
Copy link
Contributor

Merged. Yay! Take the weekend off, will you? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

5 participants