Skip to content

Flux coupling edits#8

Draft
kieranricardo wants to merge 30 commits intomainfrom
flux-coupling-edits
Draft

Flux coupling edits#8
kieranricardo wants to merge 30 commits intomainfrom
flux-coupling-edits

Conversation

@kieranricardo
Copy link

@kieranricardo kieranricardo commented Feb 3, 2026

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:
    This introduces changes when running icepack in calc_tsfc=.false. mode for coupling with fluxes supplied from an atmosphere model.

  • Developer(s):
    @kieranricardo @blimlim

  • 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.
    ENTER INFORMATION HERE

  • 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 CICE or any other models?

    • 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/.)

    • 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.

When calc_tsfc=.false. the conductive flux is now capped, and it is also reduced during temperature_changes if the thermo solve is struggling to converge. The excess flux is accounted for in the energy calculations.

Also, hs_min is made configurable. A larger value than the default is needed for numerical stability when run with calc_tsfc=.false..

@kieranricardo
Copy link
Author

kieranricardo commented Feb 3, 2026

hey @anton-seaice, can you give this a look over before I make a PR into the CICE-consortium icepack? 👀

Copy link
Collaborator

@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.

I will look properly, but i think split this into two changes, one for hs_min and one for the cap_fluxes stuff

@kieranricardo
Copy link
Author

@anton-seaice yeah good point, I've remove the hs_min configurable stuff now

Copy link
Collaborator

@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.

In general - are these changes due to undiscovered issues with the way the UM -> CICE coupling works? Or are these changes unavoidable ? Well need to have a good justification to get these into the consortium repo

(Oh and some extra notes in the documentation_

character(len=*),parameter :: subname='(set_sfcflux)'

raicen = c1
raicen = c1 / aicen
Copy link
Collaborator

Choose a reason for hiding this comment

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

So this is the same as line 360 now?

The comment says (When in standalone mode, fluxes ! are input as per ice area.) does that mean there is a standalone icepack using this subroutine, or the comment is out of date ?

Copy link
Author

@kieranricardo kieranricardo Feb 25, 2026

Choose a reason for hiding this comment

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

I've changed this to use an #idfef(ACCESS3_CICE) (which is now defined in CICE)


real (kind=dbl_kind) :: fcondtopn_solve

real (kind=dbl_kind), parameter :: ratio_Wm2_m = 1000.0, cold_temp_flag = c0 - 60.0
Copy link
Collaborator

Choose a reason for hiding this comment

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

I guess we should put these in icepack_parameter.F90 , and add them to icepack_init_parameters


!=======================================================================

function cap_conductive_flux(nilyr, nslyr, fcondtopn, hin, zTsn, zTin, hslyr) result(fcondtopn_solve)
Copy link
Collaborator

Choose a reason for hiding this comment

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

should this be a subroutine? is there a particular reason to have a function ?

Copy link
Author

Choose a reason for hiding this comment

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

this just returns a single float, so a function felt cleaner to me here.


else ! ktherm
fcondtopn_solve = cap_conductive_flux(nilyr, nslyr, fcondtopn, hin, zTsn, zTin, hslyr)
fcondtopn_extra = fcondtopn - fcondtopn_solve
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this need an if ( .not. calc_Tsfc ) ?

If CICE is internally calculating the conductive flux then there is hopefully no issue that would mean the flux needs capping ?

Copy link
Author

Choose a reason for hiding this comment

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

good catch. this shouldn't be doing anything if calc_Tsfc=true bc fcondtop will be calculated in the following routine, but we should be needlessly capping a flux that potentially isn't even defined.

!=======================================================================

function cap_conductive_flux(nilyr, nslyr, fcondtopn, hin, zTsn, zTin, hslyr) result(fcondtopn_solve)

Copy link
Collaborator

Choose a reason for hiding this comment

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

This will need a description of some form

Co-authored-by: Anton Steketee <79179784+anton-seaice@users.noreply.github.com>
@kieranricardo
Copy link
Author

kieranricardo commented Feb 25, 2026

@anton-seaice nah these issues have been known for a long time, and CM2 actually had these same changes. If the fluxes are too large, then the ice can keep going above the melting point, and resetting infinitely - never converging!

These code changes basically reduce the conductive flux if this happens, and pass the extra energy to the ocean.

There's some mention of this in the Icepack documentation, e.g. second paragraph here: https://cice-consortium-icepack.readthedocs.io/en/main/science_guide/sg_boundary_forcing.html

And towards of this section here: https://cice-consortium-icepack.readthedocs.io/en/main/science_guide/sg_thermo.html#bitz-and-lipscomb-thermodynamics-ktherm-1

@anton-seaice
Copy link
Collaborator

This looks good Kieran - feel free to submit upstream, where I expect there will be some questions about the details. I can run the Icepack repro tests after a first review.

Note that this is already covered in the documentation - and give it a clear description (e.g. something like ("Cap effective conductive when calc_tsfc = .false. )

Comment on lines +571 to +580
! Alex West: return this energy to the ocean

dqmat_sn = (zTsn(k)*cp_ice - Lfresh)*rhos - zqsn(k)

! Alex West: If this is the second time in succession that Tsn(1) has been
! reset, tell the solver to reduce the forcing at the top, and
! pass the difference to the array enum where it will eventually
! go into the ocean
! This is done to avoid an 'infinite loop' whereby temp continually evolves
! to the same point above zero, is reset, ad infinitum
Copy link
Collaborator

Choose a reason for hiding this comment

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

This will need a neater comment as well

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.

3 participants