Commit 5566c429 authored by Ralf Greve's avatar Ralf Greve
Browse files

New parameter for the nonlinear iterations of the SSA/SStA solver:

minimum number of iterations N_ITER_SSA_MIN (default 1).
parent e9d3ef7f
......@@ -5,7 +5,7 @@
!
#define MODEL_SICOPOLIS
#define VERSION '5-dev'
#define DATE '2022-06-06'
#define DATE '2022-06-11'
!
!> @mainpage
!!
......
......@@ -808,6 +808,9 @@ write(10, fmt=trim(fmt3)) 'tol_iter_ssa =', TOL_ITER_SSA
#if (defined(N_ITER_SSA))
write(10, fmt=trim(fmt2)) 'n_iter_ssa = ', N_ITER_SSA
#endif
#if (defined(N_ITER_SSA_MIN))
write(10, fmt=trim(fmt2)) 'n_iter_ssa_min = ', N_ITER_SSA_MIN
#endif
#if (defined(ITER_INIT_SSA))
write(10, fmt=trim(fmt2)) 'iter_init_ssa = ', ITER_INIT_SSA
#endif
......
......@@ -954,6 +954,9 @@ write(10, fmt=trim(fmt3)) 'tol_iter_ssa =', TOL_ITER_SSA
#if (defined(N_ITER_SSA))
write(10, fmt=trim(fmt2)) 'n_iter_ssa = ', N_ITER_SSA
#endif
#if (defined(N_ITER_SSA_MIN))
write(10, fmt=trim(fmt2)) 'n_iter_ssa_min = ', N_ITER_SSA_MIN
#endif
#if (defined(ITER_INIT_SSA))
write(10, fmt=trim(fmt2)) 'iter_init_ssa = ', ITER_INIT_SSA
#endif
......
......@@ -672,6 +672,9 @@ write(10, fmt=trim(fmt3)) 'tol_iter_ssa =', TOL_ITER_SSA
#if (defined(N_ITER_SSA))
write(10, fmt=trim(fmt2)) 'n_iter_ssa = ', N_ITER_SSA
#endif
#if (defined(N_ITER_SSA_MIN))
write(10, fmt=trim(fmt2)) 'n_iter_ssa_min = ', N_ITER_SSA_MIN
#endif
#if (defined(ITER_INIT_SSA))
write(10, fmt=trim(fmt2)) 'iter_init_ssa = ', ITER_INIT_SSA
#endif
......
......@@ -1373,7 +1373,7 @@ implicit none
real(dp), intent(in) :: dxi, deta, dzeta_c, dzeta_t
integer(i4b) :: i, j, kc, kt, m
integer(i4b) :: iter_ssa
integer(i4b) :: iter_ssa_min, iter_ssa_max
real(dp), dimension(0:JMAX,0:IMAX) :: vx_m_prev, vy_m_prev
real(dp) :: tol_ssa, rel_ssa
real(dp) :: res_vxy_m_ssa_1, res_vxy_m_ssa_2, res_vxy_m_ssa
......@@ -1399,15 +1399,26 @@ pi_inv = 1.0_dp/pi
#if (defined(TOL_ITER_SSA))
tol_ssa = TOL_ITER_SSA ! tolerance of iterations
#else
tol_ssa = 0.1_dp ! default value
tol_ssa = 0.025_dp ! default value
#endif
#if (defined(N_ITER_SSA))
iter_ssa = max(N_ITER_SSA, 1) ! max. number of iterations
iter_ssa_max = max(N_ITER_SSA, 1) ! max. number of iterations
#else
iter_ssa = 3 ! default value
iter_ssa_max = 10 ! default value
#endif
#if (defined(N_ITER_SSA_MIN))
iter_ssa_min = max(N_ITER_SSA_MIN, 1) ! min. number of iterations
#else
iter_ssa_min = 1 ! default value
#endif
if (iter_ssa_min > iter_ssa_max) then
errormsg = ' >>> calc_vxy_ssa: N_ITER_SSA_MIN > N_ITER_SSA_MAX not allowed!'
call error(errormsg)
end if
#if (defined(RELAX_FACT_SSA))
rel_ssa = RELAX_FACT_SSA ! relaxation factor
#else
......@@ -1431,7 +1442,9 @@ res_vxy_m_ssa = 1.11e+11_dp ! initial, very large value of the residual
m=0
do while ((m < iter_ssa).and.(res_vxy_m_ssa > tol_ssa))
do while ( (m < iter_ssa_min) &
.or. &
((m < iter_ssa_max).and.(res_vxy_m_ssa > tol_ssa)) )
m = m+1
......
......@@ -805,6 +805,9 @@ write(10, fmt=trim(fmt3)) 'tol_iter_ssa =', TOL_ITER_SSA
#if (defined(N_ITER_SSA))
write(10, fmt=trim(fmt2)) 'n_iter_ssa = ', N_ITER_SSA
#endif
#if (defined(N_ITER_SSA_MIN))
write(10, fmt=trim(fmt2)) 'n_iter_ssa_min = ', N_ITER_SSA_MIN
#endif
#if (defined(ITER_INIT_SSA))
write(10, fmt=trim(fmt2)) 'iter_init_ssa = ', ITER_INIT_SSA
#endif
......
......@@ -949,6 +949,9 @@ write(10, fmt=trim(fmt3)) 'tol_iter_ssa =', TOL_ITER_SSA
#if (defined(N_ITER_SSA))
write(10, fmt=trim(fmt2)) 'n_iter_ssa = ', N_ITER_SSA
#endif
#if (defined(N_ITER_SSA_MIN))
write(10, fmt=trim(fmt2)) 'n_iter_ssa_min = ', N_ITER_SSA_MIN
#endif
#if (defined(ITER_INIT_SSA))
write(10, fmt=trim(fmt2)) 'iter_init_ssa = ', ITER_INIT_SSA
#endif
......
......@@ -912,6 +912,9 @@ write(10, fmt=trim(fmt3)) 'tol_iter_ssa =', TOL_ITER_SSA
#if (defined(N_ITER_SSA))
write(10, fmt=trim(fmt2)) 'n_iter_ssa = ', N_ITER_SSA
#endif
#if (defined(N_ITER_SSA_MIN))
write(10, fmt=trim(fmt2)) 'n_iter_ssa_min = ', N_ITER_SSA_MIN
#endif
#if (defined(ITER_INIT_SSA))
write(10, fmt=trim(fmt2)) 'iter_init_ssa = ', ITER_INIT_SSA
#endif
......
......@@ -949,6 +949,9 @@ write(10, fmt=trim(fmt3)) 'tol_iter_ssa =', TOL_ITER_SSA
#if (defined(N_ITER_SSA))
write(10, fmt=trim(fmt2)) 'n_iter_ssa = ', N_ITER_SSA
#endif
#if (defined(N_ITER_SSA_MIN))
write(10, fmt=trim(fmt2)) 'n_iter_ssa_min = ', N_ITER_SSA_MIN
#endif
#if (defined(ITER_INIT_SSA))
write(10, fmt=trim(fmt2)) 'iter_init_ssa = ', ITER_INIT_SSA
#endif
......
......@@ -912,6 +912,9 @@ write(10, fmt=trim(fmt3)) 'tol_iter_ssa =', TOL_ITER_SSA
#if (defined(N_ITER_SSA))
write(10, fmt=trim(fmt2)) 'n_iter_ssa = ', N_ITER_SSA
#endif
#if (defined(N_ITER_SSA_MIN))
write(10, fmt=trim(fmt2)) 'n_iter_ssa_min = ', N_ITER_SSA_MIN
#endif
#if (defined(ITER_INIT_SSA))
write(10, fmt=trim(fmt2)) 'iter_init_ssa = ', ITER_INIT_SSA
#endif
......
......@@ -938,6 +938,9 @@ write(10, fmt=trim(fmt3)) 'tol_iter_ssa =', TOL_ITER_SSA
#if (defined(N_ITER_SSA))
write(10, fmt=trim(fmt2)) 'n_iter_ssa = ', N_ITER_SSA
#endif
#if (defined(N_ITER_SSA_MIN))
write(10, fmt=trim(fmt2)) 'n_iter_ssa_min = ', N_ITER_SSA_MIN
#endif
#if (defined(ITER_INIT_SSA))
write(10, fmt=trim(fmt2)) 'iter_init_ssa = ', ITER_INIT_SSA
#endif
......
......@@ -869,6 +869,9 @@ write(10, fmt=trim(fmt3)) 'tol_iter_ssa =', TOL_ITER_SSA
#if (defined(N_ITER_SSA))
write(10, fmt=trim(fmt2)) 'n_iter_ssa = ', N_ITER_SSA
#endif
#if (defined(N_ITER_SSA_MIN))
write(10, fmt=trim(fmt2)) 'n_iter_ssa_min = ', N_ITER_SSA_MIN
#endif
#if (defined(ITER_INIT_SSA))
write(10, fmt=trim(fmt2)) 'iter_init_ssa = ', ITER_INIT_SSA
#endif
......
......@@ -1072,6 +1072,9 @@ write(10, fmt=trim(fmt3)) 'tol_iter_ssa =', TOL_ITER_SSA
#if (defined(N_ITER_SSA))
write(10, fmt=trim(fmt2)) 'n_iter_ssa = ', N_ITER_SSA
#endif
#if (defined(N_ITER_SSA_MIN))
write(10, fmt=trim(fmt2)) 'n_iter_ssa_min = ', N_ITER_SSA_MIN
#endif
#if (defined(ITER_INIT_SSA))
write(10, fmt=trim(fmt2)) 'iter_init_ssa = ', ITER_INIT_SSA
#endif
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment