Skip to content

Commit

Permalink
ice_dyn_vp: improve default parameters for VP solver
Browse files Browse the repository at this point in the history
During QC testing of the previous commit, the 5 years QC test with the
updated VP solver failed twice with "bad departure points" after a few
years of simulation. Simply bumping the number of nonlinear iterations
(maxits_nonlin) from 4 to 5 makes these failures disappear and allow the
simulations to run to completion, suggesting the solution is not
converged enough with 4 iterations.

We also noticed that in these failing cases, the relative tolerance for
the linear solver (reltol_fmgres = 1E-2) is too small to be reached in
less than 50 iterations (maxits_fgmres), and that's the case at each
nonlinear iteration. Other papers mention a relative tolerance of 1E-1
for the linear solver, and using this value also allows both cases to
run to completion (even without changing maxits_nonlin).

Let's set the default tolerance for the linear solver to 1E-1, and let's
be conservative and bump the number of nonlinear iterations to 10. This
should give us a more converged solution and add robustness to the
default settings.
  • Loading branch information
phil-blain committed Oct 14, 2022
1 parent 8901899 commit 9f1efbb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions cicecore/cicedynB/general/ice_init.F90
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ subroutine input_data
deltaminEVP = 1e-11_dbl_kind ! minimum delta for viscosities (EVP, Hunke 2001)
deltaminVP = 2e-9_dbl_kind ! minimum delta for viscosities (VP, Hibler 1979)
capping_method = 'max' ! method for capping of viscosities (max=Hibler 1979,sum=Kreyscher2000)
maxits_nonlin = 4 ! max nb of iteration for nonlinear solver
maxits_nonlin = 10 ! max nb of iteration for nonlinear solver
precond = 'pgmres' ! preconditioner for fgmres: 'ident' (identity), 'diag' (diagonal),
! 'pgmres' (Jacobi-preconditioned GMRES)
dim_fgmres = 50 ! size of fgmres Krylov subspace
Expand All @@ -431,7 +431,7 @@ subroutine input_data
monitor_pgmres = .false. ! print pgmres residual norm
ortho_type = 'mgs' ! orthogonalization procedure 'cgs' or 'mgs'
reltol_nonlin = 1e-8_dbl_kind ! nonlinear stopping criterion: reltol_nonlin*res(k=0)
reltol_fgmres = 1e-2_dbl_kind ! fgmres stopping criterion: reltol_fgmres*res(k)
reltol_fgmres = 1e-1_dbl_kind ! fgmres stopping criterion: reltol_fgmres*res(k)
reltol_pgmres = 1e-6_dbl_kind ! pgmres stopping criterion: reltol_pgmres*res(k)
algo_nonlin = 'picard' ! nonlinear algorithm: 'picard' (Picard iteration), 'anderson' (Anderson acceleration)
fpfunc_andacc = 1 ! fixed point function for Anderson acceleration:
Expand Down
4 changes: 2 additions & 2 deletions configuration/scripts/ice_in
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
kridge = 1
ktransport = 1
ssh_stress = 'geostrophic'
maxits_nonlin = 4
maxits_nonlin = 10
precond = 'pgmres'
dim_fgmres = 50
dim_pgmres = 5
Expand All @@ -178,7 +178,7 @@
monitor_pgmres = .false.
ortho_type = 'mgs'
reltol_nonlin = 1e-8
reltol_fgmres = 1e-2
reltol_fgmres = 1e-1
reltol_pgmres = 1e-6
algo_nonlin = 'picard'
use_mean_vrel = .true.
Expand Down
4 changes: 2 additions & 2 deletions doc/source/user_guide/ug_case_settings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ dynamics_nml
"``k1``", "real", "1st free parameter for landfast parameterization", "7.5"
"``k2``", "real", "2nd free parameter (N/m\ :math:`^3`) for landfast parameterization", "15.0"
"``maxits_fgmres``", "integer", "maximum number of restarts for FGMRES solver", "1"
"``maxits_nonlin``", "integer", "maximum number of nonlinear iterations for VP solver", "4"
"``maxits_nonlin``", "integer", "maximum number of nonlinear iterations for VP solver", "10"
"``maxits_pgmres``", "integer", "maximum number of restarts for PGMRES preconditioner", "1"
"``monitor_fgmres``", "logical", "write velocity norm at each FGMRES iteration", "``.false.``"
"``monitor_nonlin``", "logical", "write velocity norm at each nonlinear iteration", "``.false.``"
Expand All @@ -482,7 +482,7 @@ dynamics_nml
"", "``ident``", "Don't use a preconditioner for the FGMRES solver", ""
"", "``pgmres``", "Use GMRES as preconditioner for FGMRES solver", ""
"``Pstar``", "real", "constant in Hibler strength formula (N/m\ :math:`^2`)", "2.75e4"
"``reltol_fgmres``", "real", "relative tolerance for FGMRES solver", "1e-2"
"``reltol_fgmres``", "real", "relative tolerance for FGMRES solver", "1e-1"
"``reltol_nonlin``", "real", "relative tolerance for nonlinear solver", "1e-8"
"``reltol_pgmres``", "real", "relative tolerance for PGMRES preconditioner", "1e-6"
"``revised_evp``", "logical", "use revised EVP formulation", "``.false.``"
Expand Down

0 comments on commit 9f1efbb

Please sign in to comment.