-
Notifications
You must be signed in to change notification settings - Fork 71
Pass new seaice_melt
field from SIS2 to MOM6
#710
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
base: dev/gfdl
Are you sure you want to change the base?
Conversation
seaice_melt
field through the GFDL MOM6-SIS2 coupler
Some other minor bug fixes
seaice_melt
field through the GFDL MOM6-SIS2 couplerseaice_melt
field from SIS2 to MOM6
seaice_melt
field from SIS2 to MOM6seaice_melt
field from SIS2 to MOM6
Were you able to test the changes to the non-FMS caps with the associated couplers? |
Is the expected behavior here that |
Yes, that is the expected behavior. I have not done a careful side by side comparison to verify they are the same, but visually they look like it. What kind of workflow do you use to directly compare two configurations? Checkout the different commits and manually run different configurations and compare the outputs? |
No, I've only tested with the |
Yes. Checkout and compile the dev/gfdl code, run and save lprec. Then recompile with all changes are rerun the experiment saving lprec and seaice_melt. I think it would be sufficient to test the final versions of MOM6, SIS2, and the coupler and not every commmit along the way (assuming of course that it works). |
@theresa-morrison, are these particular experiments I should test with? I guess all of the ones named |
Below is a comparison between the current ![]() I do not have any idea why the two are different. I don't see how I could have gone wrong in separating the diagnostics in the source code... |
There should be no parameter changes between the two experiments! |
Okay, yeah that makes sense. I'll figure out how to do that and regenerate these plots. |
Some additional comments
|
Okay, I did a clean comparison where the only changes were those in my three branches, and I confirmed there were no differences between the |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev/gfdl #710 +/- ##
============================================
- Coverage 37.03% 35.91% -1.13%
============================================
Files 273 270 -3
Lines 82538 81496 -1042
Branches 15441 15427 -14
============================================
- Hits 30568 29269 -1299
- Misses 46253 46458 +205
- Partials 5717 5769 +52 ☔ View full report in Codecov by Sentry. |
This recent SIS2 commit (NOAA-GFDL/SIS2@5ecae71) to the related PR NOAA-GFDL/SIS2#214 fixes the bug discussed in the above #710 (comment). Essentially, I had removed the line of code that reset the calculation of the sea ice melt rate to zero every timestep, net_melt(:,:) = 0. and was just accumulating larger and larger melt rates every timestep... After fixing this, this PR (and the related ones) now correctly separates the liquid precipitation and sea ice melt rate ocean diagnostics, as demonstrated by tests of the ![]() |
@marshallward and @theresa-morrison, I think this is ready for review now! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is incomplete. Because fluxes%seaice_melt
was separated out from fluxes%lprec
, they should always occur together. As such, I suspect that there need to be changes added to diagnostics/MOM_sum_output.F90, ice_shelf/MOM_marine_ice.F90 and ice_shelf/MOM_ice_shelf.F90, and there are still about 2 dozen places in MOM_forcing_types.F90 where fluxes%lprec
is used but fluxes%seaice_melt
is not. Please reexamine the indicated files for the missing code additions.
@@ -604,7 +611,7 @@ subroutine convert_IOB_to_fluxes(IOB, fluxes, index_bounds, Time, valid_time, G, | |||
if (CS%use_net_FW_adjustment_sign_bug) sign_for_net_FW_bug = -1. | |||
do j=js,je ; do i=is,ie | |||
net_FW(i,j) = US%RZ_T_to_kg_m2s* & | |||
(((fluxes%lprec(i,j) + fluxes%fprec(i,j)) + & | |||
((((fluxes%lprec(i,j) + fluxes%seaice_melt(i,j)) + fluxes%fprec(i,j)) + & | |||
(fluxes%lrunoff(i,j) + fluxes%frunoff(i,j))) + & | |||
(fluxes%evap(i,j) + fluxes%vprec(i,j)) ) * US%L_to_m**2*G%areaT(i,j) | |||
! The following contribution appears to be calculating the volume flux of sea-ice |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that seaice_melt might now be removed from the summation above, since the purpose of the code below appears to be to remove it from the net_FW flux.
We recently noticed some diagnosed imbalances in ice+ocean water conservation in OM5 with (CS%adjust_net_fresh_water_to_zero=.true.). If I understood the comments below, then I think this PR would take care of that non-conservation by no longer using the imperfect estimate for seaice_melt below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I see. I will try to replacenet_FW
with fluxes%seaice_melt
directly then.
Continues to address @Hallberg-NOAA's [concern](NOAA-GFDL/SIS2#214 (comment)) that these diagnostics could change with the level of compiler optimization by adding parentheses to preserve the order in which fluxes are added together. However, there are some locations where I did not see how this was possible, as in this comment: NOAA-GFDL/SIS2#214 (comment)
@@ -2496,6 +2489,9 @@ subroutine get_net_mass_forcing(fluxes, G, US, net_mass_src) | |||
if (associated(fluxes%lprec)) then ; do j=js,je ; do i=is,ie | |||
net_mass_src(i,j) = net_mass_src(i,j) + fluxes%lprec(i,j) | |||
enddo ; enddo ; endif | |||
if (associated(fluxes%seaice_melt)) then ; do j=js,je ; do i=is,ie |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving up the contribution of fluxes%seaice_melt
will change answers for people who are using the NUOPC coupler. Adding the contributions from fluxes%lprec
and fluxes%seaice_melt
separately will change answers for people using the FMS coupler. I suspect that we are going to need a runtime logical flag here as well to avoid changing somebody's answers.
if (associated(fluxes%heat_content_lprec)) then | ||
if (fluxes%lprec(i,j) > 0.0) then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe that these changes will change answers for people (like EMC and NCAR) that were already using fluxes%seaice_melt
. We are probably going to need to control this with a runtime logical flag.
@@ -631,12 +634,9 @@ subroutine extractFluxes1d(G, GV, US, fluxes, optics, nsw, j, dt, & | |||
if (fluxes%evap(i,j) < 0.0) netMassOut(i) = netMassOut(i) + fluxes%evap(i,j) | |||
! if (associated(fluxes%heat_content_cond)) fluxes%heat_content_cond(i,j) = 0.0 !??? --AJA | |||
|
|||
! lprec < 0 means sea ice formation taking water from the ocean. | |||
! smg: we should split the ice melt/formation from the lprec | |||
if (fluxes%lprec(i,j) < 0.0) netMassOut(i) = netMassOut(i) + fluxes%lprec(i,j) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes in the next ~8 lines will change answers for people who are using the NUOPC coupler and are already using fluxes%seaice_melt
. A runtime flag might be needed here as well to recreate previous answers.
+ fluxes%vprec(i,j) ) & | ||
+ fluxes%seaice_melt(i,j)) & | ||
+ fluxes%frunoff(i,j) )) | ||
+ fluxes%seaice_melt(i,j)) & |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both this reordering of the math and the one in about another 10 lines are needed to preserve answers with the FMS coupler, but will change answers with the NUOPC coupler. A runtime logical flag might be needed here to preserve both sets of answers, and make the default the setting that is needed with the NUOPC coupler, since active intervention will be needed to use seaice_melt with the FMS coupler.
See companion PRs NOAA-GFDL/SIS2#214 and NOAA-GFDL/FMScoupler#145