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

Updates to wave fracture, including a bug fix #299

Merged
merged 20 commits into from
Feb 20, 2020

Conversation

lettie-roach
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:
    Updates to wave fracture, including a bug fix
  • Developer(s):
    Lettie Roach
  • 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.
    I ran the base_suite. All tests passed except cheyenne_intel_smoke_gx3_8x2_diag24_fsd12ww3_medium_run1day.
    I then ran the QC test with these namelist options. QC tests pass.
  • 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 provide any additional information or relevant details below:

Changes to the wave fracture: fixes a bug in equation for strain that arose from a typo in Horvat & Tziperman (2015); removed the unnecessary conversion of the wave spectrum to be defined in terms of wavelengths; allow the possibility to run the wave fracture to convergence if wave_spec_type=‘random’, and added more description of this to the documentation.

@lettie-roach lettie-roach changed the title Ifsd3 Updates to wave fracture, including a bug fix Feb 11, 2020
@apcraig apcraig requested review from eclare108213 and removed request for eclare108213 February 11, 2020 19:30
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.

I don't have a good sense of what you've done here. Especially if this is different from what's already been published, it would be good to add a couple of sentences to the documentation regarding exactly what's happening now. On the other hand, if you @lettie-roach view these changes as minor, then I'm fine with it as-is.

@@ -688,29 +710,44 @@ subroutine get_fraclengths(X, eta, fraclengths, hbar, e_stop)

! calculate strain
if (is_triplet(j)) then
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this guarantee that delta* in the denominator are all nonzero?

@lettie-roach
Copy link
Contributor Author

lettie-roach commented Feb 11, 2020 via email

@eclare108213
Copy link
Contributor

  1. No need to point this out in the documentation if it's just a typo, but if you have the same equation in there, then do fix it (maybe with a comment). I suggest putting a simple comment in the code like

! correct form of the strain equation in HT2015

  1. In the documentation, please add this additional information for greater clarity:

the fracture code is run to convergence -- we generate realizations of sea surface height with random phase and add the fractures to a histogram, until successive histograms are the same to within some small error tolerance.

thanks!

@apcraig
Copy link
Contributor

apcraig commented Feb 12, 2020

Also noted in #298.

I ran full test suites on conrad with 4 compilers using master + dtlatm ( #298 ) + ifsd3 ( #299 ) and everything looks good. Ran both icepack and cice suites. fsd tests fail regression but that's expected. Think both #298 and #299 are fine. Test results are here,

https://github.com/CICE-Consortium/Test-Results/wiki/icepack_by_hash_forks#122fb3d35defebafb202cb576309ba34b23b01d9
https://github.com/CICE-Consortium/Test-Results/wiki/cice_by_hash_forks#0bd9cdc1574fe86110039c43fd53ce5e2b1c5548

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 PR is almost ready, but I just noticed a 'stop' command which needs to be fixed. Sorry I didn't notice that earlier.

@lettie-roach
Copy link
Contributor Author

lettie-roach commented Feb 14, 2020 via email

@eclare108213
Copy link
Contributor

eclare108213 commented Feb 14, 2020 via email

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.

I like the warning message. But since there's still a print, which needs to be fed up through the icepack interface via the warning system. Icepack column physics isn't supposed to do any I/O itself. I can help with this but it might be some days, maybe @apcraig can help with it first.

@eclare108213 eclare108213 requested a review from apcraig February 14, 2020 21:45
@lettie-roach
Copy link
Contributor Author

Ah right. I tried to add in the icepack warning calls instead of the print statements, just by following the other examples in that routine

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 okay to me, but I'll ask @apcraig to take a look at the warning stuff to make sure it'll work as expected, before merging.

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.

The icepack_warnings_add calls looks fine. If you ever want/need to abort at some point, you would add the following before or after the warnings_add call.

call icepack_warnings_setabort(.true.,FILE,LINE)

But I have one other request. After every call from every subroutine in icepack, there should be a

if (icepack_warnings_aborted(subname)) return

The idea here is that icepack cannot write any I/O nor can it abort/stop because it doesn't know how to do it. It doesn't know anything about parallelization among many other things. So we have this warning module. You add output to the warning module by calling icepack_warnings_add(string). You turn on the abort flag by calling call icepack_warnings_setabort(.true.,FILE,LINE). And finally, within icepack, if a subroutine has set the abort flag, you want icepack to return up the calling tree to whatever called it (icepack driver, CICE, some other model, etc) and then that model can check the abort flag and write out the icepack warning messages to the log file. So that means within icepack, you want to add the "if (icepack_warnings_aborted(subname)) return" statement after every call inside icepack (except calls to the icepack_warnings module). You can also see how that's setup in other subroutines.

A quick look suggests that is needed at on a call to wave_frac and to icepack_fsd_cleanup, but it may be needed other places in the icepack fsd implementation. I think we forgot to check that before. If you want some help going thru your code to find these situations, let me know.

@lettie-roach
Copy link
Contributor Author

lettie-roach commented Feb 15, 2020 via email

@lettie-roach
Copy link
Contributor Author

I tried to add those icepack warnings checks now. I'm not sure about the ones I added in icepack_init_fsd_bounds

@apcraig
Copy link
Contributor

apcraig commented Feb 18, 2020

Thanks @lettie-roach, I'll have a look and run some tests later today.

@apcraig
Copy link
Contributor

apcraig commented Feb 19, 2020

@lettie-roach, we do NOT want the calls to

if (icepack_warnings_aborted(subname)) return

implemented after calls to

icepack_warnings_add(string)

It doesn't hurt to do that, but it doesn't add anything. Could you remove those again? I see some in icepack_fsd and icepack_wavefracspec. Sorry about that. I probably wasn't clear. The other additions look fine.

@lettie-roach
Copy link
Contributor Author

OK, I removed those now

@apcraig
Copy link
Contributor

apcraig commented Feb 19, 2020

@lettie-roach, I just PR'ed a few changes to your ifsd3 icepack branch. These include removing a few final icepack abort checks where they are not needed and converting tabs to spaces. None of this is critical and it could be fixed later as well. If you are interested, please consider having a quick look and then you can merge the PR to your branch. Or if you prefer, I can push directly to your branch.

You will also get a icepack master update that happens to be in my working branch. I think that should be fine.

I am running full test suites on conrad with 4 compilers for icepack and cice. They already passed without my proposed changes, but just to be sure, I'm going to run them again.

@apcraig
Copy link
Contributor

apcraig commented Feb 20, 2020

The test suites are looking good and I think this is ready to merge.

https://github.com/CICE-Consortium/Test-Results/wiki/icepack_by_hash_forks#a8711fb8887e47f64a30c27af7c8bf57e071e223

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

If nobody objects, I'll merge this in the next day or two. @eclare108213, feel free to merge if you agree it's ready. Thanks @lettie-roach

@eclare108213 eclare108213 merged commit 243ac61 into CICE-Consortium:master Feb 20, 2020
lettie-roach pushed a commit to lettie-roach/Icepack that referenced this pull request Oct 18, 2022
* implement bfb for mpi comm global sums, fix compile issue with cpps, remove unused cpps

* add set_nml.reprosum

* update global reductions for serial mode to leverage bfbflag in the same way as mpi mode

* update and fix bfb compare feature

* add comparelog.csh script and logbfb test

* update travis gcc, fix tdir feature with tests

* update Makefile for c compiles, update Macros files to support c compile and serial/parallel compiles better and cleaner

* modify report results script to address grep for bfbcomp cases, add first_suite.ts

* fix Macros.onyx_intel, accidently removed debug flags in earlier commit

* update travis c build

* fix script logic for more threads than tasks per node

* update scripts to address CICE-Consortium#299, poll_queue script and CICE-Consortium#301, single test bgen default use

* add QSTAT variables to fram and cesium
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants