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_brine exception #129

Closed
apcraig opened this issue Feb 6, 2018 · 7 comments
Closed

ice_brine exception #129

apcraig opened this issue Feb 6, 2018 · 7 comments

Comments

@apcraig
Copy link
Contributor

apcraig commented Feb 6, 2018

Hitting another error with bgc in ice_brine.F90,

write(99,) subname,' tcx3',-darcy_coeff, (-darcy_coeff/bphi_mindt)
call flush(99)
hbrocn_new = hbrocnexp(-darcy_coeff/bphi_mindt)

The exp is blowing up with gnu and debug flags. The last two values before blowup are

(update_hbrine) tcx3 -1.1392520136377392E-009 -2.3407096177064297E-003
(update_hbrine) tcx3 -0.56199991572839070 -3597.1318270922047

The last set of values are creating problems with exp(-3597.). I can keep adding checks for exps that are too large or too small, but if those values are not physical, then there are underlying issues that need to be fixed. Thoughts?

@njeffery
Copy link
Contributor

njeffery commented Feb 6, 2018

@apcraig Which test are you running?

@njeffery
Copy link
Contributor

njeffery commented Feb 6, 2018

@apcraig: I've looked a bit closer at the code. There is nothing physically wrong the exp(-3597). The solution hbrocn_new = 0 is valid. Go ahead and add an if "darcy_coeff/bphi_min*dt" is larger than numerically feasible, hbrocn_new = 0.

@apcraig
Copy link
Contributor Author

apcraig commented Feb 8, 2018

I have implemented an underflow fix that is commented out in PR #126 and will change answers. That fix needs some review. At the present time, this is still causing some cases to underflow when testing with the debug flags. But the science should be ok with the underflow as we underflow to zero by design.

@eclare108213
Copy link
Contributor

@apcraig I think you should go ahead and fix this in Icepack, and then check it in CICE using the quality control test. There is another exp() immediately below the one you fixed and commented out, which could be causing the other underflows. I think what you're doing is correct.
As you're doing this, please record all the steps you took to make the change in icepack and then do the regular and QC tests in cice, so the rest of us will know how to handle such a case. Thx

@apcraig
Copy link
Contributor Author

apcraig commented Feb 10, 2018

Will do. I haven't done the QC tests before. Is there documentation or scripts? thanks.

@eclare108213
Copy link
Contributor

I think @mattdturner put it into the testing scripts for cice. Maybe -qc. I ran it but didn't get as far as plotting the output. It is documented in the sphinx (cice) testing section, I believe.

@eclare108213 eclare108213 added this to To Do in Icepack tasks for v1.0 release via automation Feb 10, 2018
@eclare108213 eclare108213 moved this from To Do to In Progress in Icepack tasks for v1.0 release Feb 10, 2018
@apcraig apcraig moved this from In Progress to Done in Icepack tasks for v1.0 release Feb 12, 2018
@apcraig
Copy link
Contributor Author

apcraig commented Feb 12, 2018

fixed with PR #158

@apcraig apcraig closed this as completed Feb 12, 2018
lettie-roach pushed a commit to lettie-roach/Icepack that referenced this issue Oct 18, 2022
update test coverage and test options
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

No branches or pull requests

3 participants