Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate zsalinity #448

Merged
merged 3 commits into from
Aug 22, 2023
Merged

Deprecate zsalinity #448

merged 3 commits into from
Aug 22, 2023

Conversation

apcraig
Copy link
Contributor

@apcraig apcraig commented Jul 29, 2023

PR checklist

  • Short (1 sentence) summary of your PR:
    Deprecate zsalinity

  • 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.
    Icepack test suite is bit-for-bit on cheyenne with intel, gnu, and pgi EXCEPT for pgi with bgc (this must be a compiler optimization issue with the code changes). https://github.com/CICE-Consortium/Test-Results/wiki/icepack_by_hash_forks#13e1c1dc418c7c38dedb1b9e76b6f72e53dd801a. Final CICE with zsalinity deprecation testing is underway, but expected to be bit-for-bit in full test suite on cheyenne with intel, gnu, pgi EXCEPT pgi with bgc on (passes but not bit-for-bit). Results for CICE for gnu and pgi are here, https://github.com/CICE-Consortium/Test-Results/wiki/cice_by_hash_forks#f836c7d5b39f7c3dc272ab50f6db615341110343

  • How much do the PR code changes differ from the unmodified code?

    • bit for bit except PGI with bgc turned on
    • 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 provide any additional information or relevant details below:

  • Closes Deprecate zsalinity #439

  • Remove basic zsalinity code, but maintain Icepack interfaces for backwards compatibility. If solve_zsal is set to true, Icepack will abort.

  • Includes removing "bgc_S" variables and implementation

  • Update documentation

  • Will PR CICE changes and update Icepack in CICE once this PR is merged.

  • Also tested this version of Icepack with an unmodified version of CICE to confirm backwards compatibility. CICE will build and run bit-for-bit with this version of Icepack with deprecated zsalinity.

@eclare108213 eclare108213 self-assigned this Jul 31, 2023
@eclare108213
Copy link
Contributor

@njeffery - Can the brine height tracer be run without zsalinity, i.e. with mushy thermo? My plan has been to deprecate zsalinity but not hbrine, and I'm wondering whether that make sense. Our tests only have them both turned on, not hbrine by itself.

@njeffery
Copy link
Contributor

njeffery commented Jul 31, 2023 via email

@eclare108213
Copy link
Contributor

Excellent. Correction: we do have tests with brine tracer on and zsalinity off in both icepack and cice. They are both on only for the zsal test.

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.

Some questions -

@@ -1000,7 +765,8 @@ end subroutine icepack_init_hbrine

!=======================================================================
!autodocument_start icepack_init_zsalinity
! Initialize zSalinity
! **DEPRECATED**, all code removed
! Interface provided for backwards compatibility
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure I understand what would break if this were removed. Could the interface be put in an 'ifdef undeprecate' for the next release and then removed completely after that? Actually, since we had partially deprecated salinity earlier, it was broken and so I think notice has been served -- no one should be calling it at this point. Is the backwards compatibility issue just so that other (non-CICE) drivers can update icepack without having to make changes in the driver itself?

@@ -96,7 +96,7 @@ module icepack_tracers
nt_bgc_PON = 0, & ! zooplankton and detritus
nt_bgc_hum = 0, & ! humic material
nt_zbgc_frac = 0, & ! fraction of tracer in the mobile phase
nt_bgc_S = 0 ! Bulk salinity in fraction ice with dynamic salinity (Bio grid)
nt_bgc_S = 0 ! Bulk salinity in fraction ice with dynamic salinity (Bio grid) (deprecated)
Copy link
Contributor

Choose a reason for hiding this comment

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

why does nt_bgc_S need to be kept?


use icepack_brine, only: icepack_init_hbrine
use icepack_brine, only: icepack_init_zsalinity
use icepack_brine, only: icepack_init_zsalinity ! DEPRECATED
Copy link
Contributor

Choose a reason for hiding this comment

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

why not remove this line?

@@ -436,7 +436,7 @@ zbgc_nml
"``f_exude_l``", "real", "fraction of exudation to DOC lipids", "1.0"
"``f_exude_s``", "real", "fraction of exudation to DOC saccharids", "1.0"
"``grid_o``", "real", "z biology for bottom flux", "5.0"
"``grid_oS``", "real", "z salinity for bottom flux", "5.0"
"``grid_oS``", "real", "DEPRECATED", ""
Copy link
Contributor

Choose a reason for hiding this comment

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

@apcraig
Copy link
Contributor Author

apcraig commented Jul 31, 2023

Good questions about the deprecation. I kept the zsalinity public interfaces and arguments for the time being for backwards compatibility. They are not needed for the Icepack driver or a future version of CICE, but other users might need them. If a user has an older version of CICE or uses Icepack in their ice model (MPASSI), then an upgrade to this version of Icepack should not break anything. They can compile and run (with zsalinity off) without having to change any of their code. If they turn on zsalinity, the code should abort. If we remove the public interfaces and arguments, then an Icepack upgrade could/will immediately fail to build and the user will have to modify calls into Icepack to get things working again, even if they are not using zsalinity.

So we can take either approach. Provide full backwards compatibility by maintaining zsalinity arguments/interfaces that have no impact on the code. Or remove that code and possibly force all users to update their "driver" when they bring in a new version of Icepack, with no real benefit. There are pros and cons to both approaches.

I tested the updated version of Icepack (the one in this PR) with the baseline version of CICE (with all the zsalinity code/calls) to make sure it truly is backwards compatible and bit-for-bit. Of coarse, CICE only works in that mode if zsalinity is off.

@apcraig
Copy link
Contributor Author

apcraig commented Jul 31, 2023

If you feel we should fully deprecate the Icepack interfaces for zsalinity, I can certainly do that easily.

@apcraig
Copy link
Contributor Author

apcraig commented Jul 31, 2023

I think hbrine is tested with bgc. Do we need to add a test to Icepack and/or CICE with just hbrine without bgc? Is that possible? If so, what other options should be turned on with it?

@apcraig apcraig mentioned this pull request Aug 3, 2023
18 tasks
@apcraig
Copy link
Contributor Author

apcraig commented Aug 3, 2023

Is there anything else to do with the PR, is it ready to merge? Please see also CICE-Consortium/CICE#851, that also needs a review.

@apcraig apcraig self-assigned this Aug 3, 2023
@apcraig
Copy link
Contributor Author

apcraig commented Aug 22, 2023

I just rebased this, should be ready for review and merge.

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.

This looks good to me. I'd like to see more of the deprecated code disappear completely, but I agree that it's better to not break users' codes when they try to build. Maybe we can get rid of the rest of it when we make a major release (which might break other things too - fix them all at once).

My one concern is that we not break the brine tracer. It looks like zbgc is tested in both icepack and cice with tr_brine=T, so this should be okay, especially since we'll be thoroughly testing the new BGC code as part of the E3SM/Icepack merge, and that will include the brine module.

@apcraig
Copy link
Contributor Author

apcraig commented Aug 22, 2023

I'm pretty sure the brine tracer is preserved with these changes. The full test suite runs and is basically bit-for-bit. Maybe we need to add a new brine tracer test at some point.

@apcraig apcraig merged commit f5e093f into CICE-Consortium:main Aug 22, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deprecate zsalinity
3 participants