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

ice_dyn_vp: express rheology in terms of bulk and shear viscosities #647

Merged
merged 11 commits into from
Oct 21, 2021

Conversation

JFLemieux73
Copy link
Contributor

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:
    Modified implicit solver code for consistency with viscous coeff and rep_pressure as used in EVP.
  • Developer(s):
    @JFLemieux73
  • Suggest PR reviewers from list in the column to the right. @phil-blain @apcraig
  • Please copy the PR test results link or provide a summary of testing completed below.
    see issue Make implicit solver code more consistent with recent changes to rheology #646
  • 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 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 provide any additional information or relevant details below:
    *** as described in the issue, all the regression tests pass except the one for the implicit solver. However, ncdiff of the restart files show they are the same. Furthermore, I ran a five year QC tests (I just changed kdyn from 1 to 3) and the results are BFB. This is a bit contradictory but I would say that to the worst there are roundoff errors (only for kdyn=3).

@phil-blain phil-blain self-requested a review October 19, 2021 12:32
@phil-blain
Copy link
Member

Small suggestion, I would re-title this PR so that it describes the code changes themselves, something like:

ice_dyn_vp: express rheology in terms of bulk and shear viscosities

@JFLemieux73 JFLemieux73 changed the title Make implicit solver code more consistent with recent changes to rheology ice_dyn_vp: express rheology in terms of bulk and shear viscosities Oct 19, 2021
Comment on lines 641 to 647
divune, divunw, divusw, divuse , & ! divergence
tensionne, tensionnw, tensionsw, tensionse, & ! tension
shearne, shearnw, shearsw, shearse , & ! shearing
Deltane, Deltanw, Deltasw, Deltase , & ! Delt
zetax2ne, zetax2nw, zetax2sw, zetax2se , & ! 2 x zeta (visc coeff)
etax2ne, etax2nw, etax2sw, etax2se , & ! 2 x eta (visc coeff)
rep_prsne, rep_prsnw, rep_prssw, rep_prsse, & ! replacement pressure
Copy link
Member

Choose a reason for hiding this comment

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

These changes to the argument declaration are not strictly needed and add noise to the diff, personally I would drop them.

Copy link
Member

Choose a reason for hiding this comment

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

Same thing for the arguments to viscous_coeffs_and_rep_pressure below

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok corrected.

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

!-----------------------------------------------------------------
! Initialize
!-----------------------------------------------------------------

str(:,:,:) = c0
capping = .true. ! to be improved
Copy link
Member

Choose a reason for hiding this comment

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

Do we want to keep that comment ? as it stands I find it a little confusing, i.e. it could mean either "the fact that capping is hardcoded here could be improved" or "it would be an improvement to allow capping = .false. here"...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

replaced by: ! could be later included in ice_in

Comment on lines 918 to 926
call formDiag_step1 (nx_block , ny_block , &
icellu (iblk) , &
indxui (:,iblk) , indxuj(:,iblk), &
dxt (:,:,iblk) , dyt (:,:,iblk), &
dxhy (:,:,iblk) , dyhx(:,:,iblk), &
cxp (:,:,iblk) , cyp (:,:,iblk), &
cxm (:,:,iblk) , cym (:,:,iblk), &
zetax2 (:,:,iblk,:), etax2(:,:,iblk,:), &
diag_rheo(:,:,:))
Copy link
Member

Choose a reason for hiding this comment

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

Can we avoid changing the whitespace in these lines ? it also adds noise to the diff so it's harder to spot what is really changing...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

corrected

Comment on lines 1376 to 1384
subroutine viscous_coeffs_and_rep_pressure (strength, tinyarea, &
Deltane, Deltanw, &
Deltase, Deltasw, &
Deltasw, Deltase, &
zetax2ne, zetax2nw, &
zetax2se, zetax2sw, &
zetax2sw, zetax2se, &
etax2ne, etax2nw, &
etax2se, etax2sw, &
etax2sw, etax2se, &
rep_prsne, rep_prsnw,&
rep_prsse, rep_prssw,&
rep_prssw, rep_prsse,&
Copy link
Member

Choose a reason for hiding this comment

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

In fact, I'm kind of on the fence about changing the order in the interface also. What's the justification ? it because other subroutines use this order? which ones?

@phil-blain phil-blain requested a review from apcraig October 19, 2021 17:43
@JFLemieux73
Copy link
Contributor Author

@apcraig I think we can merge this. See issue #646.

Note that I would like to revisit this issue of order of operations. I just opened a new issue (#648) for future work.

Copy link
Contributor

@apcraig apcraig 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 fine to me. If you'd like me to run the full suite on 3 compilers on cheyenne, I can do that. Given this only affects a few tests (vp) and that the non-vp cases are working and bit-for-bit in testing thus far, I think it's all good.

@JFLemieux73
Copy link
Contributor Author

Please go ahead for the test on cheyenne. Thanks!

@apcraig
Copy link
Contributor

apcraig commented Oct 20, 2021

I will merge when GHActions are done. I don't think we need to be that concerned with the non bit-for-bit results. It's not surprising to me that refactoring the code introduced a roundoff level change somewhere. The greater concern was the confusion between cmp and ncdiff, but we understand that now. If you feel the non bit-for-bit is unexpected, then feel free to pursue further. But given the results are scientifically identical, that it's just a diagnostic quantity in this implementation that is non bit-for-bit, and that it can be explained by the code changes, I see no reason to do so.

@apcraig
Copy link
Contributor

apcraig commented Oct 20, 2021

OK, I'll test on cheyenne today then we can merge once we confirm those results.

@apcraig
Copy link
Contributor

apcraig commented Oct 21, 2021

Testing on cheyenne looks good, https://github.com/CICE-Consortium/Test-Results/wiki/cice_by_hash_forks#6f25d10df03158a9f03f02ea4f08fa0d83b59f8f. The dynpicard changes answers as we expect. There is also something funny going on with the regression test of the gx1prod 10 year run. I've diffed a few log files and there are some diagnostics that are different but the science result seems to be identical. I need to look into that more as a separate task. I'll merge now.

@apcraig apcraig merged commit 4147db4 into CICE-Consortium:main Oct 21, 2021
@JFLemieux73 JFLemieux73 deleted the eta_for_VP branch October 26, 2021 19:56
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.

3 participants