-
Notifications
You must be signed in to change notification settings - Fork 139
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
Add probabilistic grounding scheme for landfast ice #565
Conversation
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 looks okay to me, just reading through the code changes. There are a lot of potential divides-by-zero or logarithm issues. How extensively has this been tested?
Shouldn't the new flag kseabed be added to the three tests for which seabedstress=T? And at least one of them be set for the new parameterization?
Hi @eclare108213 , I don't think we should have problems with division by zero...as long as there is some sea ice. The calculations are only done if the total concentration is greater than 0.05 [ if (atot .gt. 0.05_dbl_kind) ], We also have (max(acat(n), puny)) where there could be a div by zero. What do you mean by logarithm issues? In terms of tests, we ran 1 year of gx3 and 1 year of gx1. Using our in-house code (cice5 with modifications including the same seabed2 algorithm) we ran many 10 year hindcast simulations (resolution of 0.25 degree). No crash. I could add a new test in another PR. |
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.
Should kseabed be a character string rather than "1" and "2"? I think we'd like to work towards that implementation when we can.
There should be an abort somewhere if kseabed is not set to a valid option.
The value of kseabed should be written out in ice_init.F90 as a readable character string. (probably only when seabedstress is true)
kseabed needs to be added to the namelist documention.
I think we should also add a test with kseabed=2 assuming it's ready to use. I can provide some guidance on what and how to do this if needed. |
Thanks @apcraig. kseabed is inspired from kstrength, kdyn, ktherm...I will think about good character strings to replace these. I will do the other changes requested. Just to clarify...If I just push the same branch, will this update the PR? |
@JFLemieux73, You can push to the same branch. The PR will update and all the checks will automatically rerun including documentation generation. It's very typical that a PR is updated as part of the draft and review process in this way. Thanks. |
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 noted a few things below. One general comment about naming: in the spirit of writing self-documenting code, I would prefer mean_thickness_seabed_stress_factor
and probabilistic_seabed_stress_factor
over seabed1_stress_factor
and seabed2_stress_factor
.
case (1) | ||
call seabed1_stress_factor (nx_block, ny_block, & | ||
icellu (iblk), & | ||
indxui(:,iblk), indxuj(:,iblk), & | ||
vice(:,:,iblk), aice(:,:,iblk), & | ||
hwater(:,:,iblk), Tbu(:,:,iblk)) | ||
case (2) | ||
call seabed2_stress_factor (nx_block, ny_block, & | ||
icellt(iblk), indxti(:,iblk), indxtj(:,iblk), & | ||
icellu(iblk), indxui(:,iblk), indxuj(:,iblk), & | ||
aicen(:,:,:,iblk), vicen(:,:,:,iblk), & | ||
hwater(:,:,iblk), Tbu(:,:,iblk)) |
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.
Here and for seabed2 below, the first ampersand is not aligned with those below:
case (1) | |
call seabed1_stress_factor (nx_block, ny_block, & | |
icellu (iblk), & | |
indxui(:,iblk), indxuj(:,iblk), & | |
vice(:,:,iblk), aice(:,:,iblk), & | |
hwater(:,:,iblk), Tbu(:,:,iblk)) | |
case (2) | |
call seabed2_stress_factor (nx_block, ny_block, & | |
icellt(iblk), indxti(:,iblk), indxtj(:,iblk), & | |
icellu(iblk), indxui(:,iblk), indxuj(:,iblk), & | |
aicen(:,:,:,iblk), vicen(:,:,:,iblk), & | |
hwater(:,:,iblk), Tbu(:,:,iblk)) | |
case (1) | |
call seabed1_stress_factor (nx_block, ny_block, & | |
icellu (iblk), & | |
indxui(:,iblk), indxuj(:,iblk), & | |
vice(:,:,iblk), aice(:,:,iblk), & | |
hwater(:,:,iblk), Tbu(:,:,iblk)) | |
case (2) | |
call seabed2_stress_factor (nx_block, ny_block, & | |
icellt(iblk), indxti(:,iblk), indxtj(:,iblk), & | |
icellu(iblk), indxui(:,iblk), indxuj(:,iblk), & | |
aicen(:,:,:,iblk), vicen(:,:,:,iblk), & | |
hwater(:,:,iblk), Tbu(:,:,iblk)) |
call icepack_query_parameters(puny_out=puny) | ||
|
||
Tbt=c0 | ||
sigma_b = 2.5d0 ! Standard deviation of bathymetry. |
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 does not change in the subroutine so could be a parameter
|
||
atot = sum(aicen(i,j,1:ncat)) | ||
|
||
if (atot .gt. 0.05_dbl_kind .and. hwater(i,j) .lt. max_depth) 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 think we prefer to use <
and >
in new code instead of .lt.
and .gt.
x_k = (/(wid_i*(i*c1-0.5d0), i=1, ncat_i)/) | ||
y_n = (/( (mu_b-c3*sigma_b)+(i*c1-0.5d0)*(c2*c3*sigma_b/ncat_b), i=1, ncat_b )/) |
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 these formula would be more legible with a little more whitespace
! x95 = exp(mu_i + sqrt(c2*sigma_i)*1.1631d0) | ||
! x99 = exp(mu_i + sqrt(c2*sigma_i)*1.6450d0) | ||
! x995 = exp(mu_i + sqrt(c2*sigma_i)*1.8214d0) | ||
! x996 = exp(mu_i + sqrt(c2*sigma_i)*1.8753d0) | ||
x997 = exp(mu_i + sqrt(c2*sigma_i)*1.9430d0) | ||
! x998 = exp(mu_i + sqrt(c2*sigma_i)*2.0352d0) | ||
! x999 = exp(mu_i + sqrt(c2*sigma_i)*2.1851d0) | ||
! xinf = exp(mu_i + sqrt(c2*sigma_i)*4.4981d0) ! 0.9999999999 |
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 don't think we want to keep those commented lines. If we want to keep the ability to tweak the factor in the square root more easily, why not declare a local parameter variable ?
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 agree it's better not to have commented lines like this if they aren't ever expected to be used again. Presumably Dupont et al documents the procedure and the values that were tried, so this information shouldn't need to be kept in the code.
do n =1, ncat_i | ||
if (x_k(n) .gt. x_kmax) P_x(n)=c0 | ||
enddo |
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.
minor: I think maybe this loop could be rewritten with where
statement
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.
and > instead of .gt.
and below, < for .le., == for .eq.
@@ -71,7 +71,7 @@ subroutine cice_init | |||
use ice_domain, only: init_domain_blocks | |||
use ice_domain_size, only: ncat, nfsd | |||
use ice_dyn_eap, only: init_eap, alloc_dyn_eap | |||
use ice_dyn_shared, only: kdyn, init_dyn, basalstress, alloc_dyn_shared | |||
use ice_dyn_shared, only: kdyn, init_dyn, seabedstress, alloc_dyn_shared |
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 variable is not used in that driver, so we might as well remove it from that line:
use ice_dyn_shared, only: kdyn, init_dyn, seabedstress, alloc_dyn_shared | |
use ice_dyn_shared, only: kdyn, init_dyn, alloc_dyn_shared |
@@ -236,8 +236,31 @@ pending further testing. | |||
Seabed stress | |||
*************** | |||
|
|||
The parameterization for the seabed stress is described in :cite:`Lemieux16`. The components of the basal seabed stress are | |||
:math:`\tau_{bx}=C_bu` and :math:`\tau_{by}=C_bv`, where :math:`C_b` is a coefficient expressed as | |||
CICE now includes two options for calculating the seabed stress, |
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.
minor: I would not use words such as "now" (or "new", a little bit below), since it is not clear to the reader when is "now". The documentation reflects the actual state of the code, so just "CICE includes two options..." would be better in my opinion.
on the probability of contact between the ice thickness distribution | ||
(ITD) and the seabed. Multi-thickness category models such as CICE typically use a | ||
few thickness categories (5-10). This crude representation of the ITD | ||
does not resolve the tail of the ITD which is crucial for grounding |
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.
does not resolve the tail of the ITD which is crucial for grounding | |
does not resolve the tail of the ITD, which is crucial for grounding |
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.
@phil-blain you seem to have good ideas...Right now we choose the method with the integer kseabed. @apcraig would prefer character strings...any suggestions (should be short I guess)?
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 mean_thickness
and probabilistic
would be fit well.
Note: you should be able to click the "Accept suggestion" button on the suggestions I made above, and then they will be committed to your branch (on GitHub). You will then be able to pull these changes locally if you want to tweak the PR further.
Co-authored-by: Philippe Blain <levraiphilippeblain@gmail.com>
I reran the test suite with the latest changes: 269 measured results of 269 total results I am almost done... |
@apcraig I have made the changes requested. The only thing missing is an additional test for the new seabed stress method. Is it ok if we do it in another PR? |
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 have a few suggestions for improvements, nothing major. A test for the new parameterization can be added in a separate PR, although it would be nice to have it in this one.
! x95 = exp(mu_i + sqrt(c2*sigma_i)*1.1631d0) | ||
! x99 = exp(mu_i + sqrt(c2*sigma_i)*1.6450d0) | ||
! x995 = exp(mu_i + sqrt(c2*sigma_i)*1.8214d0) | ||
! x996 = exp(mu_i + sqrt(c2*sigma_i)*1.8753d0) | ||
x997 = exp(mu_i + sqrt(c2*sigma_i)*1.9430d0) | ||
! x998 = exp(mu_i + sqrt(c2*sigma_i)*2.0352d0) | ||
! x999 = exp(mu_i + sqrt(c2*sigma_i)*2.1851d0) | ||
! xinf = exp(mu_i + sqrt(c2*sigma_i)*4.4981d0) ! 0.9999999999 |
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 agree it's better not to have commented lines like this if they aren't ever expected to be used again. Presumably Dupont et al documents the procedure and the values that were tried, so this information shouldn't need to be kept in the code.
do n =1, ncat_i | ||
if (x_k(n) .gt. x_kmax) P_x(n)=c0 | ||
enddo |
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.
and > instead of .gt.
and below, < for .le., == for .eq.
Ok I have modified the routine following the comments of @eclare108213. Just to be safe I reran the test suite: 269 measured results of 269 total results Is it ok? |
Looks good to me. Let's let @apcraig update his review. Thanks JF! |
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 can add a test separately or we can do it now. Is the "probabilistic" option ready to test? Right now alt01, alt03, and boxrestore seem to have seabed_stress set to true. I assume that means they are all using the LKD method? How about if we add "seabed_stress_method='probabilistic'" to alt01 or alt03? That will change the answers there, but that's OK. Is there any reason why that might be a problem or an unreasonable way to proceed?
One other thing, seabed_stress_method still needs to be documented in the namelist section (doc/source/case_settings/ug_case_settings.rst). Also, the seabedstress documentation in the same section needs to be moved down in the appropriate location for alphabetization. |
Hi @apcraig , Yes "probabilistic" is ready to test. Replacing LKD by "seabed_stress_method='probabilistic'" for alt01 or alt03 is a good plan. I could do it. I guess I just have to modify the set_nml.alt file? |
Exactly, just modify the appropriate set_nml file. You should be able to run a quick test with the updated file leveraging -s to specify the option. If you have questions, let me know. thanks! |
Ok the new test seems to work. |
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.
Looks good, thanks JF. I will merge this afternoon unless there are other comments.
I just ran a full test suite. The changes to the seabed_stress_method from LKD to probabilistic in the alt01 case did not change any answers. I think this suggests we are not getting any grounding in the alt01 short test runs. Does that sound plausible? It also suggests we may not be getting any grounding in any short runs, so we're not actually testing the grounding scheme in our tests even when seabed_stress = .true. Any thoughts? |
I think the ice is too thin to get grounding. As the runs are short it does not have time to get thicker. Just to be clear, these simulations start on 1 January and run just for a few days, right? If you look here: I could investigate what is going on in the alt01 test. |
This is a good reason to start from new restart files that have included the landfast ice parameterization. |
I setup the test: taubx and tauby are indeed zero. |
I think the best way to test both LKD and probabilistic schemes would be to restart in April. The ice would then be thick enough to get grounding. |
@apcraig I would like to submit a PR with minor modifications to the documentation and ice_in. Should I work at the same time on improving our tests for grounding (i.e. restart in April) or you had planned to do that? |
@JFLemieux73, please feel free to go ahead and submit a PR now. I think we should wait to add the new "April" tests until we have the new ics from JRA55 as well as the new time manager. Let me create an issue for this so we don't forget. |
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
Implementation of new grounding scheme based on a probabilistic approach
JF Lemieux, D. Dumont, E. Dumas-Lefebvre, and F. Dupont.
269 measured results of 269 total results
269 of 269 tests PASSED
0 of 269 tests PENDING
0 of 269 tests MISSING data
0 of 269 tests FAILED
We think that the expression "seabed stress" is more appropriate than "basal stress" We have therefore changed the code and the documentation.