diff --git a/src/bc/bc.f90 b/src/bc/bc.f90 index 3034b24bcf5..b10910ea121 100644 --- a/src/bc/bc.f90 +++ b/src/bc/bc.f90 @@ -527,7 +527,7 @@ end subroutine bc_list_add !! @param t Current time. !! @param tstep Current time-step. subroutine bc_list_apply_scalar(bclst, x, n, t, tstep) - type(bc_list_t), intent(inout) :: bclst + type(bc_list_t), intent(in) :: bclst integer, intent(in) :: n real(kind=rp), intent(inout), dimension(n) :: x real(kind=rp), intent(in), optional :: t @@ -584,7 +584,7 @@ end subroutine bc_list_apply_scalar !! @param t Current time. !! @param tstep Current time-step. subroutine bc_list_apply_vector(bclst, x, y, z, n, t, tstep) - type(bc_list_t), intent(inout) :: bclst + type(bc_list_t), intent(in) :: bclst integer, intent(in) :: n real(kind=rp), intent(inout), dimension(n) :: x real(kind=rp), intent(inout), dimension(n) :: y diff --git a/src/krylov/bcknd/cpu/bicgstab.f90 b/src/krylov/bcknd/cpu/bicgstab.f90 index 2f024e8dcbe..460320d0f94 100644 --- a/src/krylov/bcknd/cpu/bicgstab.f90 +++ b/src/krylov/bcknd/cpu/bicgstab.f90 @@ -71,11 +71,11 @@ module bicgstab !> Constructor. subroutine bicgstab_init(this, n, max_iter, M, rel_tol, abs_tol, monitor) class(bicgstab_t), intent(inout) :: this - class(pc_t), optional, intent(inout), target :: M + class(pc_t), optional, intent(in), target :: M integer, intent(in) :: n integer, intent(in) :: max_iter - real(kind=rp), optional, intent(inout) :: rel_tol - real(kind=rp), optional, intent(inout) :: abs_tol + real(kind=rp), optional, intent(in) :: rel_tol + real(kind=rp), optional, intent(in) :: abs_tol logical, optional, intent(in) :: monitor @@ -154,12 +154,12 @@ end subroutine bicgstab_free !> Bi-Conjugate Gradient Stabilized method solve function bicgstab_solve(this, Ax, x, f, n, coef, blst, gs_h, niter) result(ksp_results) class(bicgstab_t), intent(inout) :: this - class(ax_t), intent(inout) :: Ax + class(ax_t), intent(in) :: Ax type(field_t), intent(inout) :: x integer, intent(in) :: n - real(kind=rp), dimension(n), intent(inout) :: f + real(kind=rp), dimension(n), intent(in) :: f type(coef_t), intent(inout) :: coef - type(bc_list_t), intent(inout) :: blst + type(bc_list_t), intent(in) :: blst type(gs_t), intent(inout) :: gs_h type(ksp_monitor_t) :: ksp_results integer, optional, intent(in) :: niter @@ -250,18 +250,18 @@ end function bicgstab_solve function bicgstab_solve_coupled(this, Ax, x, y, z, fx, fy, fz, & n, coef, blstx, blsty, blstz, gs_h, niter) result(ksp_results) class(bicgstab_t), intent(inout) :: this - class(ax_t), intent(inout) :: Ax + class(ax_t), intent(in) :: Ax type(field_t), intent(inout) :: x type(field_t), intent(inout) :: y type(field_t), intent(inout) :: z integer, intent(in) :: n - real(kind=rp), dimension(n), intent(inout) :: fx - real(kind=rp), dimension(n), intent(inout) :: fy - real(kind=rp), dimension(n), intent(inout) :: fz + real(kind=rp), dimension(n), intent(in) :: fx + real(kind=rp), dimension(n), intent(in) :: fy + real(kind=rp), dimension(n), intent(in) :: fz type(coef_t), intent(inout) :: coef - type(bc_list_t), intent(inout) :: blstx - type(bc_list_t), intent(inout) :: blsty - type(bc_list_t), intent(inout) :: blstz + type(bc_list_t), intent(in) :: blstx + type(bc_list_t), intent(in) :: blsty + type(bc_list_t), intent(in) :: blstz type(gs_t), intent(inout) :: gs_h type(ksp_monitor_t), dimension(3) :: ksp_results integer, optional, intent(in) :: niter diff --git a/src/krylov/bcknd/cpu/cacg.f90 b/src/krylov/bcknd/cpu/cacg.f90 index 747302ae94f..6293b73dbe8 100644 --- a/src/krylov/bcknd/cpu/cacg.f90 +++ b/src/krylov/bcknd/cpu/cacg.f90 @@ -65,13 +65,13 @@ module cacg !> Initialise a s-step CA PCG solver subroutine cacg_init(this, n, max_iter, M, s, rel_tol, abs_tol, monitor) class(cacg_t), intent(inout) :: this - class(pc_t), optional, intent(inout), target :: M + class(pc_t), optional, intent(in), target :: M integer, intent(in) :: n integer, intent(in) :: max_iter - real(kind=rp), optional, intent(inout) :: rel_tol - real(kind=rp), optional, intent(inout) :: abs_tol + real(kind=rp), optional, intent(in) :: rel_tol + real(kind=rp), optional, intent(in) :: abs_tol logical, optional, intent(in) :: monitor - integer, optional, intent(inout) :: s + integer, optional, intent(in) :: s call this%free() if (present(s)) then @@ -137,12 +137,12 @@ end subroutine cacg_free !> S-step CA PCG solve function cacg_solve(this, Ax, x, f, n, coef, blst, gs_h, niter) result(ksp_results) class(cacg_t), intent(inout) :: this - class(ax_t), intent(inout) :: Ax + class(ax_t), intent(in) :: Ax type(field_t), intent(inout) :: x integer, intent(in) :: n - real(kind=rp), dimension(n), intent(inout) :: f + real(kind=rp), dimension(n), intent(in) :: f type(coef_t), intent(inout) :: coef - type(bc_list_t), intent(inout) :: blst + type(bc_list_t), intent(in) :: blst type(gs_t), intent(inout) :: gs_h type(ksp_monitor_t) :: ksp_results integer, optional, intent(in) :: niter @@ -352,18 +352,18 @@ end subroutine construct_basis_matrix function cacg_solve_coupled(this, Ax, x, y, z, fx, fy, fz, & n, coef, blstx, blsty, blstz, gs_h, niter) result(ksp_results) class(cacg_t), intent(inout) :: this - class(ax_t), intent(inout) :: Ax + class(ax_t), intent(in) :: Ax type(field_t), intent(inout) :: x type(field_t), intent(inout) :: y type(field_t), intent(inout) :: z integer, intent(in) :: n - real(kind=rp), dimension(n), intent(inout) :: fx - real(kind=rp), dimension(n), intent(inout) :: fy - real(kind=rp), dimension(n), intent(inout) :: fz + real(kind=rp), dimension(n), intent(in) :: fx + real(kind=rp), dimension(n), intent(in) :: fy + real(kind=rp), dimension(n), intent(in) :: fz type(coef_t), intent(inout) :: coef - type(bc_list_t), intent(inout) :: blstx - type(bc_list_t), intent(inout) :: blsty - type(bc_list_t), intent(inout) :: blstz + type(bc_list_t), intent(in) :: blstx + type(bc_list_t), intent(in) :: blsty + type(bc_list_t), intent(in) :: blstz type(gs_t), intent(inout) :: gs_h type(ksp_monitor_t), dimension(3) :: ksp_results integer, optional, intent(in) :: niter diff --git a/src/krylov/bcknd/cpu/cg.f90 b/src/krylov/bcknd/cpu/cg.f90 index daea70055e9..06d13383155 100644 --- a/src/krylov/bcknd/cpu/cg.f90 +++ b/src/krylov/bcknd/cpu/cg.f90 @@ -67,10 +67,10 @@ module cg subroutine cg_init(this, n, max_iter, M, rel_tol, abs_tol, monitor) class(cg_t), intent(inout), target :: this integer, intent(in) :: max_iter - class(pc_t), optional, intent(inout), target :: M + class(pc_t), optional, intent(in), target :: M integer, intent(in) :: n - real(kind=rp), optional, intent(inout) :: rel_tol - real(kind=rp), optional, intent(inout) :: abs_tol + real(kind=rp), optional, intent(in) :: rel_tol + real(kind=rp), optional, intent(in) :: abs_tol logical, optional, intent(in) :: monitor call this%free() @@ -137,12 +137,12 @@ end subroutine cg_free !> Standard PCG solve function cg_solve(this, Ax, x, f, n, coef, blst, gs_h, niter) result(ksp_results) class(cg_t), intent(inout) :: this - class(ax_t), intent(inout) :: Ax + class(ax_t), intent(in) :: Ax type(field_t), intent(inout) :: x integer, intent(in) :: n - real(kind=rp), dimension(n), intent(inout) :: f + real(kind=rp), dimension(n), intent(in) :: f type(coef_t), intent(inout) :: coef - type(bc_list_t), intent(inout) :: blst + type(bc_list_t), intent(in) :: blst type(gs_t), intent(inout) :: gs_h type(ksp_monitor_t) :: ksp_results integer, optional, intent(in) :: niter @@ -258,18 +258,18 @@ end subroutine second_cg_part function cg_solve_coupled(this, Ax, x, y, z, fx, fy, fz, & n, coef, blstx, blsty, blstz, gs_h, niter) result(ksp_results) class(cg_t), intent(inout) :: this - class(ax_t), intent(inout) :: Ax + class(ax_t), intent(in) :: Ax type(field_t), intent(inout) :: x type(field_t), intent(inout) :: y type(field_t), intent(inout) :: z integer, intent(in) :: n - real(kind=rp), dimension(n), intent(inout) :: fx - real(kind=rp), dimension(n), intent(inout) :: fy - real(kind=rp), dimension(n), intent(inout) :: fz + real(kind=rp), dimension(n), intent(in) :: fx + real(kind=rp), dimension(n), intent(in) :: fy + real(kind=rp), dimension(n), intent(in) :: fz type(coef_t), intent(inout) :: coef - type(bc_list_t), intent(inout) :: blstx - type(bc_list_t), intent(inout) :: blsty - type(bc_list_t), intent(inout) :: blstz + type(bc_list_t), intent(in) :: blstx + type(bc_list_t), intent(in) :: blsty + type(bc_list_t), intent(in) :: blstz type(gs_t), intent(inout) :: gs_h type(ksp_monitor_t), dimension(3) :: ksp_results integer, optional, intent(in) :: niter diff --git a/src/krylov/bcknd/cpu/cg_coupled.f90 b/src/krylov/bcknd/cpu/cg_coupled.f90 index 12214b2f77c..6ee93ce9d6e 100644 --- a/src/krylov/bcknd/cpu/cg_coupled.f90 +++ b/src/krylov/bcknd/cpu/cg_coupled.f90 @@ -73,10 +73,10 @@ module cg_cpld subroutine cg_cpld_init(this, n, max_iter, M, rel_tol, abs_tol, monitor) class(cg_cpld_t), intent(inout) :: this integer, intent(in) :: max_iter - class(pc_t), optional, intent(inout), target :: M + class(pc_t), optional, intent(in), target :: M integer, intent(in) :: n - real(kind=rp), optional, intent(inout) :: rel_tol - real(kind=rp), optional, intent(inout) :: abs_tol + real(kind=rp), optional, intent(in) :: rel_tol + real(kind=rp), optional, intent(in) :: abs_tol logical, optional, intent(in) :: monitor call this%free() @@ -184,12 +184,12 @@ end subroutine cg_cpld_free function cg_cpld_nop(this, Ax, x, f, n, coef, blst, gs_h, niter) & result(ksp_results) class(cg_cpld_t), intent(inout) :: this - class(ax_t), intent(inout) :: Ax + class(ax_t), intent(in) :: Ax type(field_t), intent(inout) :: x integer, intent(in) :: n - real(kind=rp), dimension(n), intent(inout) :: f + real(kind=rp), dimension(n), intent(in) :: f type(coef_t), intent(inout) :: coef - type(bc_list_t), intent(inout) :: blst + type(bc_list_t), intent(in) :: blst type(gs_t), intent(inout) :: gs_h type(ksp_monitor_t) :: ksp_results integer, optional, intent(in) :: niter @@ -205,18 +205,18 @@ end function cg_cpld_nop function cg_cpld_solve(this, Ax, x, y, z, fx, fy, fz, & n, coef, blstx, blsty, blstz, gs_h, niter) result(ksp_results) class(cg_cpld_t), intent(inout) :: this - class(ax_t), intent(inout) :: Ax + class(ax_t), intent(in) :: Ax type(field_t), intent(inout) :: x type(field_t), intent(inout) :: y type(field_t), intent(inout) :: z integer, intent(in) :: n - real(kind=rp), dimension(n), intent(inout) :: fx - real(kind=rp), dimension(n), intent(inout) :: fy - real(kind=rp), dimension(n), intent(inout) :: fz + real(kind=rp), dimension(n), intent(in) :: fx + real(kind=rp), dimension(n), intent(in) :: fy + real(kind=rp), dimension(n), intent(in) :: fz type(coef_t), intent(inout) :: coef - type(bc_list_t), intent(inout) :: blstx - type(bc_list_t), intent(inout) :: blsty - type(bc_list_t), intent(inout) :: blstz + type(bc_list_t), intent(in) :: blstx + type(bc_list_t), intent(in) :: blsty + type(bc_list_t), intent(in) :: blstz type(gs_t), intent(inout) :: gs_h type(ksp_monitor_t), dimension(3) :: ksp_results integer, optional, intent(in) :: niter diff --git a/src/krylov/bcknd/cpu/cheby.f90 b/src/krylov/bcknd/cpu/cheby.f90 index bc72a517034..706bbe9f7ec 100644 --- a/src/krylov/bcknd/cpu/cheby.f90 +++ b/src/krylov/bcknd/cpu/cheby.f90 @@ -69,10 +69,10 @@ module cheby subroutine cheby_init(this, n, max_iter, M, rel_tol, abs_tol, monitor) class(cheby_t), intent(inout), target :: this integer, intent(in) :: max_iter - class(pc_t), optional, intent(inout), target :: M + class(pc_t), optional, intent(in), target :: M integer, intent(in) :: n - real(kind=rp), optional, intent(inout) :: rel_tol - real(kind=rp), optional, intent(inout) :: abs_tol + real(kind=rp), optional, intent(in) :: rel_tol + real(kind=rp), optional, intent(in) :: abs_tol logical, optional, intent(in) :: monitor call this%free() @@ -113,11 +113,11 @@ end subroutine cheby_free subroutine cheby_power(this, Ax, x, n, coef, blst, gs_h) class(cheby_t), intent(inout) :: this - class(ax_t), intent(inout) :: Ax + class(ax_t), intent(in) :: Ax type(field_t), intent(inout) :: x integer, intent(in) :: n type(coef_t), intent(inout) :: coef - type(bc_list_t), intent(inout) :: blst + type(bc_list_t), intent(in) :: blst type(gs_t), intent(inout) :: gs_h real(kind=rp) :: lam, b, a, rn real(kind=rp) :: boost = 1.2_rp @@ -165,12 +165,12 @@ end subroutine cheby_power function cheby_solve(this, Ax, x, f, n, coef, blst, gs_h, niter) & result(ksp_results) class(cheby_t), intent(inout) :: this - class(ax_t), intent(inout) :: Ax + class(ax_t), intent(in) :: Ax type(field_t), intent(inout) :: x integer, intent(in) :: n - real(kind=rp), dimension(n), intent(inout) :: f + real(kind=rp), dimension(n), intent(in) :: f type(coef_t), intent(inout) :: coef - type(bc_list_t), intent(inout) :: blst + type(bc_list_t), intent(in) :: blst type(gs_t), intent(inout) :: gs_h type(ksp_monitor_t) :: ksp_results integer, optional, intent(in) :: niter @@ -247,18 +247,18 @@ end function cheby_solve function cheby_solve_coupled(this, Ax, x, y, z, fx, fy, fz, & n, coef, blstx, blsty, blstz, gs_h, niter) result(ksp_results) class(cheby_t), intent(inout) :: this - class(ax_t), intent(inout) :: Ax + class(ax_t), intent(in) :: Ax type(field_t), intent(inout) :: x type(field_t), intent(inout) :: y type(field_t), intent(inout) :: z integer, intent(in) :: n - real(kind=rp), dimension(n), intent(inout) :: fx - real(kind=rp), dimension(n), intent(inout) :: fy - real(kind=rp), dimension(n), intent(inout) :: fz + real(kind=rp), dimension(n), intent(in) :: fx + real(kind=rp), dimension(n), intent(in) :: fy + real(kind=rp), dimension(n), intent(in) :: fz type(coef_t), intent(inout) :: coef - type(bc_list_t), intent(inout) :: blstx - type(bc_list_t), intent(inout) :: blsty - type(bc_list_t), intent(inout) :: blstz + type(bc_list_t), intent(in) :: blstx + type(bc_list_t), intent(in) :: blsty + type(bc_list_t), intent(in) :: blstz type(gs_t), intent(inout) :: gs_h type(ksp_monitor_t), dimension(3) :: ksp_results integer, optional, intent(in) :: niter diff --git a/src/krylov/bcknd/cpu/gmres.f90 b/src/krylov/bcknd/cpu/gmres.f90 index 04885e9b543..efd6df4ed1e 100644 --- a/src/krylov/bcknd/cpu/gmres.f90 +++ b/src/krylov/bcknd/cpu/gmres.f90 @@ -72,10 +72,10 @@ subroutine gmres_init(this, n, max_iter, M, lgmres, & class(gmres_t), intent(inout) :: this integer, intent(in) :: n integer, intent(in) :: max_iter - class(pc_t), optional, intent(inout), target :: M - integer, optional, intent(inout) :: lgmres - real(kind=rp), optional, intent(inout) :: rel_tol - real(kind=rp), optional, intent(inout) :: abs_tol + class(pc_t), optional, intent(in), target :: M + integer, optional, intent(in) :: lgmres + real(kind=rp), optional, intent(in) :: rel_tol + real(kind=rp), optional, intent(in) :: abs_tol logical, optional, intent(in) :: monitor if (present(lgmres)) then @@ -170,12 +170,12 @@ end subroutine gmres_free function gmres_solve(this, Ax, x, f, n, coef, blst, gs_h, niter) & result(ksp_results) class(gmres_t), intent(inout) :: this - class(ax_t), intent(inout) :: Ax + class(ax_t), intent(in) :: Ax type(field_t), intent(inout) :: x integer, intent(in) :: n - real(kind=rp), dimension(n), intent(inout) :: f + real(kind=rp), dimension(n), intent(in) :: f type(coef_t), intent(inout) :: coef - type(bc_list_t), intent(inout) :: blst + type(bc_list_t), intent(in) :: blst type(gs_t), intent(inout) :: gs_h type(ksp_monitor_t) :: ksp_results integer, optional, intent(in) :: niter @@ -371,18 +371,18 @@ end function gmres_solve function gmres_solve_coupled(this, Ax, x, y, z, fx, fy, fz, & n, coef, blstx, blsty, blstz, gs_h, niter) result(ksp_results) class(gmres_t), intent(inout) :: this - class(ax_t), intent(inout) :: Ax + class(ax_t), intent(in) :: Ax type(field_t), intent(inout) :: x type(field_t), intent(inout) :: y type(field_t), intent(inout) :: z integer, intent(in) :: n - real(kind=rp), dimension(n), intent(inout) :: fx - real(kind=rp), dimension(n), intent(inout) :: fy - real(kind=rp), dimension(n), intent(inout) :: fz + real(kind=rp), dimension(n), intent(in) :: fx + real(kind=rp), dimension(n), intent(in) :: fy + real(kind=rp), dimension(n), intent(in) :: fz type(coef_t), intent(inout) :: coef - type(bc_list_t), intent(inout) :: blstx - type(bc_list_t), intent(inout) :: blsty - type(bc_list_t), intent(inout) :: blstz + type(bc_list_t), intent(in) :: blstx + type(bc_list_t), intent(in) :: blsty + type(bc_list_t), intent(in) :: blstz type(gs_t), intent(inout) :: gs_h type(ksp_monitor_t), dimension(3) :: ksp_results integer, optional, intent(in) :: niter diff --git a/src/krylov/bcknd/cpu/pipecg.f90 b/src/krylov/bcknd/cpu/pipecg.f90 index 3e121cfe7f3..2c80f1c3eef 100644 --- a/src/krylov/bcknd/cpu/pipecg.f90 +++ b/src/krylov/bcknd/cpu/pipecg.f90 @@ -75,10 +75,10 @@ module pipecg subroutine pipecg_init(this, n, max_iter, M, rel_tol, abs_tol, monitor) class(pipecg_t), intent(inout) :: this integer, intent(in) :: max_iter - class(pc_t), optional, intent(inout), target :: M + class(pc_t), optional, intent(in), target :: M integer, intent(in) :: n - real(kind=rp), optional, intent(inout) :: rel_tol - real(kind=rp), optional, intent(inout) :: abs_tol + real(kind=rp), optional, intent(in) :: rel_tol + real(kind=rp), optional, intent(in) :: abs_tol logical, optional, intent(in) :: monitor call this%free() @@ -158,12 +158,12 @@ end subroutine pipecg_free !> Pipelined PCG solve function pipecg_solve(this, Ax, x, f, n, coef, blst, gs_h, niter) result(ksp_results) class(pipecg_t), intent(inout) :: this - class(ax_t), intent(inout) :: Ax + class(ax_t), intent(in) :: Ax type(field_t), intent(inout) :: x integer, intent(in) :: n - real(kind=rp), dimension(n), intent(inout) :: f + real(kind=rp), dimension(n), intent(in) :: f type(coef_t), intent(inout) :: coef - type(bc_list_t), intent(inout) :: blst + type(bc_list_t), intent(in) :: blst type(gs_t), intent(inout) :: gs_h type(ksp_monitor_t) :: ksp_results integer, optional, intent(in) :: niter @@ -371,18 +371,18 @@ end function pipecg_solve function pipecg_solve_coupled(this, Ax, x, y, z, fx, fy, fz, & n, coef, blstx, blsty, blstz, gs_h, niter) result(ksp_results) class(pipecg_t), intent(inout) :: this - class(ax_t), intent(inout) :: Ax + class(ax_t), intent(in) :: Ax type(field_t), intent(inout) :: x type(field_t), intent(inout) :: y type(field_t), intent(inout) :: z integer, intent(in) :: n - real(kind=rp), dimension(n), intent(inout) :: fx - real(kind=rp), dimension(n), intent(inout) :: fy - real(kind=rp), dimension(n), intent(inout) :: fz + real(kind=rp), dimension(n), intent(in) :: fx + real(kind=rp), dimension(n), intent(in) :: fy + real(kind=rp), dimension(n), intent(in) :: fz type(coef_t), intent(inout) :: coef - type(bc_list_t), intent(inout) :: blstx - type(bc_list_t), intent(inout) :: blsty - type(bc_list_t), intent(inout) :: blstz + type(bc_list_t), intent(in) :: blstx + type(bc_list_t), intent(in) :: blsty + type(bc_list_t), intent(in) :: blstz type(gs_t), intent(inout) :: gs_h type(ksp_monitor_t), dimension(3) :: ksp_results integer, optional, intent(in) :: niter diff --git a/src/krylov/bcknd/device/cg_device.f90 b/src/krylov/bcknd/device/cg_device.f90 index 3b22da276d4..694d020ce0b 100644 --- a/src/krylov/bcknd/device/cg_device.f90 +++ b/src/krylov/bcknd/device/cg_device.f90 @@ -69,11 +69,11 @@ module cg_device !> Initialise a device based PCG solver subroutine cg_device_init(this, n, max_iter, M, rel_tol, abs_tol, monitor) class(cg_device_t), intent(inout) :: this - class(pc_t), optional, intent(inout), target :: M + class(pc_t), optional, intent(in), target :: M integer, intent(in) :: n integer, intent(in) :: max_iter - real(kind=rp), optional, intent(inout) :: rel_tol - real(kind=rp), optional, intent(inout) :: abs_tol + real(kind=rp), optional, intent(in) :: rel_tol + real(kind=rp), optional, intent(in) :: abs_tol logical, optional, intent(in) :: monitor call this%free() @@ -162,12 +162,12 @@ end subroutine cg_device_free !> Standard PCG solve function cg_device_solve(this, Ax, x, f, n, coef, blst, gs_h, niter) result(ksp_results) class(cg_device_t), intent(inout) :: this - class(ax_t), intent(inout) :: Ax + class(ax_t), intent(in) :: Ax type(field_t), intent(inout) :: x integer, intent(in) :: n - real(kind=rp), dimension(n), intent(inout) :: f + real(kind=rp), dimension(n), intent(in) :: f type(coef_t), intent(inout) :: coef - type(bc_list_t), intent(inout) :: blst + type(bc_list_t), intent(in) :: blst type(gs_t), intent(inout) :: gs_h type(ksp_monitor_t) :: ksp_results integer, optional, intent(in) :: niter @@ -237,18 +237,18 @@ end function cg_device_solve function cg_device_solve_coupled(this, Ax, x, y, z, fx, fy, fz, & n, coef, blstx, blsty, blstz, gs_h, niter) result(ksp_results) class(cg_device_t), intent(inout) :: this - class(ax_t), intent(inout) :: Ax + class(ax_t), intent(in) :: Ax type(field_t), intent(inout) :: x type(field_t), intent(inout) :: y type(field_t), intent(inout) :: z integer, intent(in) :: n - real(kind=rp), dimension(n), intent(inout) :: fx - real(kind=rp), dimension(n), intent(inout) :: fy - real(kind=rp), dimension(n), intent(inout) :: fz + real(kind=rp), dimension(n), intent(in) :: fx + real(kind=rp), dimension(n), intent(in) :: fy + real(kind=rp), dimension(n), intent(in) :: fz type(coef_t), intent(inout) :: coef - type(bc_list_t), intent(inout) :: blstx - type(bc_list_t), intent(inout) :: blsty - type(bc_list_t), intent(inout) :: blstz + type(bc_list_t), intent(in) :: blstx + type(bc_list_t), intent(in) :: blsty + type(bc_list_t), intent(in) :: blstz type(gs_t), intent(inout) :: gs_h type(ksp_monitor_t), dimension(3) :: ksp_results integer, optional, intent(in) :: niter diff --git a/src/krylov/bcknd/device/cheby_device.F90 b/src/krylov/bcknd/device/cheby_device.F90 index cde83538503..eef9316db06 100644 --- a/src/krylov/bcknd/device/cheby_device.F90 +++ b/src/krylov/bcknd/device/cheby_device.F90 @@ -73,10 +73,10 @@ module cheby_device subroutine cheby_device_init(this, n, max_iter, M, rel_tol, abs_tol, monitor) class(cheby_device_t), intent(inout), target :: this integer, intent(in) :: max_iter - class(pc_t), optional, intent(inout), target :: M + class(pc_t), optional, intent(in), target :: M integer, intent(in) :: n - real(kind=rp), optional, intent(inout) :: rel_tol - real(kind=rp), optional, intent(inout) :: abs_tol + real(kind=rp), optional, intent(in) :: rel_tol + real(kind=rp), optional, intent(in) :: abs_tol logical, optional, intent(in) :: monitor call this%free() @@ -153,11 +153,11 @@ end subroutine cheby_device_free subroutine cheby_device_power(this, Ax, x, n, coef, blst, gs_h) class(cheby_device_t), intent(inout) :: this - class(ax_t), intent(inout) :: Ax + class(ax_t), intent(in) :: Ax type(field_t), intent(inout) :: x integer, intent(in) :: n type(coef_t), intent(inout) :: coef - type(bc_list_t), intent(inout) :: blst + type(bc_list_t), intent(in) :: blst type(gs_t), intent(inout) :: gs_h real(kind=rp) :: lam, b, a, rn real(kind=rp) :: boost = 1.2_rp @@ -208,12 +208,12 @@ end subroutine cheby_device_power function cheby_device_solve(this, Ax, x, f, n, coef, blst, gs_h, niter) & result(ksp_results) class(cheby_device_t), intent(inout) :: this - class(ax_t), intent(inout) :: Ax + class(ax_t), intent(in) :: Ax type(field_t), intent(inout) :: x integer, intent(in) :: n - real(kind=rp), dimension(n), intent(inout) :: f + real(kind=rp), dimension(n), intent(in) :: f type(coef_t), intent(inout) :: coef - type(bc_list_t), intent(inout) :: blst + type(bc_list_t), intent(in) :: blst type(gs_t), intent(inout) :: gs_h type(ksp_monitor_t) :: ksp_results integer, optional, intent(in) :: niter @@ -294,18 +294,18 @@ end function cheby_device_solve function cheby_device_solve_coupled(this, Ax, x, y, z, fx, fy, fz, & n, coef, blstx, blsty, blstz, gs_h, niter) result(ksp_results) class(cheby_device_t), intent(inout) :: this - class(ax_t), intent(inout) :: Ax + class(ax_t), intent(in) :: Ax type(field_t), intent(inout) :: x type(field_t), intent(inout) :: y type(field_t), intent(inout) :: z integer, intent(in) :: n - real(kind=rp), dimension(n), intent(inout) :: fx - real(kind=rp), dimension(n), intent(inout) :: fy - real(kind=rp), dimension(n), intent(inout) :: fz + real(kind=rp), dimension(n), intent(in) :: fx + real(kind=rp), dimension(n), intent(in) :: fy + real(kind=rp), dimension(n), intent(in) :: fz type(coef_t), intent(inout) :: coef - type(bc_list_t), intent(inout) :: blstx - type(bc_list_t), intent(inout) :: blsty - type(bc_list_t), intent(inout) :: blstz + type(bc_list_t), intent(in) :: blstx + type(bc_list_t), intent(in) :: blsty + type(bc_list_t), intent(in) :: blstz type(gs_t), intent(inout) :: gs_h type(ksp_monitor_t), dimension(3) :: ksp_results integer, optional, intent(in) :: niter diff --git a/src/krylov/bcknd/device/fusedcg_cpld_device.F90 b/src/krylov/bcknd/device/fusedcg_cpld_device.F90 index 1aae06d4680..bf661f77b21 100644 --- a/src/krylov/bcknd/device/fusedcg_cpld_device.F90 +++ b/src/krylov/bcknd/device/fusedcg_cpld_device.F90 @@ -269,11 +269,11 @@ end function device_fusedcg_cpld_part2 subroutine fusedcg_cpld_device_init(this, n, max_iter, M, & rel_tol, abs_tol, monitor) class(fusedcg_cpld_device_t), target, intent(inout) :: this - class(pc_t), optional, intent(inout), target :: M + class(pc_t), optional, intent(in), target :: M integer, intent(in) :: n integer, intent(in) :: max_iter - real(kind=rp), optional, intent(inout) :: rel_tol - real(kind=rp), optional, intent(inout) :: abs_tol + real(kind=rp), optional, intent(in) :: rel_tol + real(kind=rp), optional, intent(in) :: abs_tol logical, optional, intent(in) :: monitor type(c_ptr) :: ptr integer(c_size_t) :: p_size @@ -513,18 +513,18 @@ end subroutine fusedcg_cpld_device_free function fusedcg_cpld_device_solve_coupled(this, Ax, x, y, z, fx, fy, fz, & n, coef, blstx, blsty, blstz, gs_h, niter) result(ksp_results) class(fusedcg_cpld_device_t), intent(inout) :: this - class(ax_t), intent(inout) :: Ax + class(ax_t), intent(in) :: Ax type(field_t), intent(inout) :: x type(field_t), intent(inout) :: y type(field_t), intent(inout) :: z integer, intent(in) :: n - real(kind=rp), dimension(n), intent(inout) :: fx - real(kind=rp), dimension(n), intent(inout) :: fy - real(kind=rp), dimension(n), intent(inout) :: fz + real(kind=rp), dimension(n), intent(in) :: fx + real(kind=rp), dimension(n), intent(in) :: fy + real(kind=rp), dimension(n), intent(in) :: fz type(coef_t), intent(inout) :: coef - type(bc_list_t), intent(inout) :: blstx - type(bc_list_t), intent(inout) :: blsty - type(bc_list_t), intent(inout) :: blstz + type(bc_list_t), intent(in) :: blstx + type(bc_list_t), intent(in) :: blsty + type(bc_list_t), intent(in) :: blstz type(gs_t), intent(inout) :: gs_h type(ksp_monitor_t), dimension(3) :: ksp_results integer, optional, intent(in) :: niter @@ -644,12 +644,12 @@ end function fusedcg_cpld_device_solve_coupled function fusedcg_cpld_device_solve(this, Ax, x, f, n, coef, blst, & gs_h, niter) result(ksp_results) class(fusedcg_cpld_device_t), intent(inout) :: this - class(ax_t), intent(inout) :: Ax + class(ax_t), intent(in) :: Ax type(field_t), intent(inout) :: x integer, intent(in) :: n - real(kind=rp), dimension(n), intent(inout) :: f + real(kind=rp), dimension(n), intent(in) :: f type(coef_t), intent(inout) :: coef - type(bc_list_t), intent(inout) :: blst + type(bc_list_t), intent(in) :: blst type(gs_t), intent(inout) :: gs_h type(ksp_monitor_t) :: ksp_results integer, optional, intent(in) :: niter diff --git a/src/krylov/bcknd/device/fusedcg_device.F90 b/src/krylov/bcknd/device/fusedcg_device.F90 index 151b45742fe..86b68c6b10b 100644 --- a/src/krylov/bcknd/device/fusedcg_device.F90 +++ b/src/krylov/bcknd/device/fusedcg_device.F90 @@ -195,11 +195,11 @@ end function device_fusedcg_part2 subroutine fusedcg_device_init(this, n, max_iter, M, rel_tol, abs_tol, & monitor) class(fusedcg_device_t), target, intent(inout) :: this - class(pc_t), optional, intent(inout), target :: M + class(pc_t), optional, intent(in), target :: M integer, intent(in) :: n integer, intent(in) :: max_iter - real(kind=rp), optional, intent(inout) :: rel_tol - real(kind=rp), optional, intent(inout) :: abs_tol + real(kind=rp), optional, intent(in) :: rel_tol + real(kind=rp), optional, intent(in) :: abs_tol logical, optional, intent(in) :: monitor type(c_ptr) :: ptr integer(c_size_t) :: p_size @@ -318,12 +318,12 @@ end subroutine fusedcg_device_free !> Pipelined PCG solve function fusedcg_device_solve(this, Ax, x, f, n, coef, blst, gs_h, niter) result(ksp_results) class(fusedcg_device_t), intent(inout) :: this - class(ax_t), intent(inout) :: Ax + class(ax_t), intent(in) :: Ax type(field_t), intent(inout) :: x integer, intent(in) :: n - real(kind=rp), dimension(n), intent(inout) :: f + real(kind=rp), dimension(n), intent(in) :: f type(coef_t), intent(inout) :: coef - type(bc_list_t), intent(inout) :: blst + type(bc_list_t), intent(in) :: blst type(gs_t), intent(inout) :: gs_h type(ksp_monitor_t) :: ksp_results integer, optional, intent(in) :: niter @@ -403,18 +403,18 @@ end function fusedcg_device_solve function fusedcg_device_solve_coupled(this, Ax, x, y, z, fx, fy, fz, & n, coef, blstx, blsty, blstz, gs_h, niter) result(ksp_results) class(fusedcg_device_t), intent(inout) :: this - class(ax_t), intent(inout) :: Ax + class(ax_t), intent(in) :: Ax type(field_t), intent(inout) :: x type(field_t), intent(inout) :: y type(field_t), intent(inout) :: z integer, intent(in) :: n - real(kind=rp), dimension(n), intent(inout) :: fx - real(kind=rp), dimension(n), intent(inout) :: fy - real(kind=rp), dimension(n), intent(inout) :: fz + real(kind=rp), dimension(n), intent(in) :: fx + real(kind=rp), dimension(n), intent(in) :: fy + real(kind=rp), dimension(n), intent(in) :: fz type(coef_t), intent(inout) :: coef - type(bc_list_t), intent(inout) :: blstx - type(bc_list_t), intent(inout) :: blsty - type(bc_list_t), intent(inout) :: blstz + type(bc_list_t), intent(in) :: blstx + type(bc_list_t), intent(in) :: blsty + type(bc_list_t), intent(in) :: blstz type(gs_t), intent(inout) :: gs_h type(ksp_monitor_t), dimension(3) :: ksp_results integer, optional, intent(in) :: niter diff --git a/src/krylov/bcknd/device/gmres_device.F90 b/src/krylov/bcknd/device/gmres_device.F90 index 666a19345af..69ec443edab 100644 --- a/src/krylov/bcknd/device/gmres_device.F90 +++ b/src/krylov/bcknd/device/gmres_device.F90 @@ -135,10 +135,10 @@ subroutine gmres_device_init(this, n, max_iter, M, m_restart, & class(gmres_device_t), target, intent(inout) :: this integer, intent(in) :: n integer, intent(in) :: max_iter - class(pc_t), optional, intent(inout), target :: M - integer, optional, intent(inout) :: m_restart - real(kind=rp), optional, intent(inout) :: rel_tol - real(kind=rp), optional, intent(inout) :: abs_tol + class(pc_t), optional, intent(in), target :: M + integer, optional, intent(in) :: m_restart + real(kind=rp), optional, intent(in) :: rel_tol + real(kind=rp), optional, intent(in) :: abs_tol logical, optional, intent(in) :: monitor type(device_ident_t), target :: M_ident type(c_ptr) :: ptr @@ -317,12 +317,12 @@ end subroutine gmres_device_free function gmres_device_solve(this, Ax, x, f, n, coef, blst, gs_h, niter) & result(ksp_results) class(gmres_device_t), intent(inout) :: this - class(ax_t), intent(inout) :: Ax + class(ax_t), intent(in) :: Ax type(field_t), intent(inout) :: x integer, intent(in) :: n - real(kind=rp), dimension(n), intent(inout) :: f + real(kind=rp), dimension(n), intent(in) :: f type(coef_t), intent(inout) :: coef - type(bc_list_t), intent(inout) :: blst + type(bc_list_t), intent(in) :: blst type(gs_t), intent(inout) :: gs_h type(ksp_monitor_t) :: ksp_results integer, optional, intent(in) :: niter @@ -486,18 +486,18 @@ end function gmres_device_solve function gmres_device_solve_coupled(this, Ax, x, y, z, fx, fy, fz, & n, coef, blstx, blsty, blstz, gs_h, niter) result(ksp_results) class(gmres_device_t), intent(inout) :: this - class(ax_t), intent(inout) :: Ax + class(ax_t), intent(in) :: Ax type(field_t), intent(inout) :: x type(field_t), intent(inout) :: y type(field_t), intent(inout) :: z integer, intent(in) :: n - real(kind=rp), dimension(n), intent(inout) :: fx - real(kind=rp), dimension(n), intent(inout) :: fy - real(kind=rp), dimension(n), intent(inout) :: fz + real(kind=rp), dimension(n), intent(in) :: fx + real(kind=rp), dimension(n), intent(in) :: fy + real(kind=rp), dimension(n), intent(in) :: fz type(coef_t), intent(inout) :: coef - type(bc_list_t), intent(inout) :: blstx - type(bc_list_t), intent(inout) :: blsty - type(bc_list_t), intent(inout) :: blstz + type(bc_list_t), intent(in) :: blstx + type(bc_list_t), intent(in) :: blsty + type(bc_list_t), intent(in) :: blstz type(gs_t), intent(inout) :: gs_h type(ksp_monitor_t), dimension(3) :: ksp_results integer, optional, intent(in) :: niter diff --git a/src/krylov/bcknd/device/pipecg_device.F90 b/src/krylov/bcknd/device/pipecg_device.F90 index 183a3b5d2db..c6ed0c31de9 100644 --- a/src/krylov/bcknd/device/pipecg_device.F90 +++ b/src/krylov/bcknd/device/pipecg_device.F90 @@ -170,11 +170,11 @@ end subroutine device_cg_update_xp !> Initialise a pipelined PCG solver subroutine pipecg_device_init(this, n, max_iter, M, rel_tol, abs_tol, monitor) class(pipecg_device_t), target, intent(inout) :: this - class(pc_t), optional, intent(inout), target :: M + class(pc_t), optional, intent(in), target :: M integer, intent(in) :: n integer, intent(in) :: max_iter - real(kind=rp), optional, intent(inout) :: rel_tol - real(kind=rp), optional, intent(inout) :: abs_tol + real(kind=rp), optional, intent(in) :: rel_tol + real(kind=rp), optional, intent(in) :: abs_tol logical, optional, intent(in) :: monitor type(c_ptr) :: ptr integer(c_size_t) :: u_size @@ -336,12 +336,12 @@ end subroutine pipecg_device_free !> Pipelined PCG solve function pipecg_device_solve(this, Ax, x, f, n, coef, blst, gs_h, niter) result(ksp_results) class(pipecg_device_t), intent(inout) :: this - class(ax_t), intent(inout) :: Ax + class(ax_t), intent(in) :: Ax type(field_t), intent(inout) :: x integer, intent(in) :: n - real(kind=rp), dimension(n), intent(inout) :: f + real(kind=rp), dimension(n), intent(in) :: f type(coef_t), intent(inout) :: coef - type(bc_list_t), intent(inout) :: blst + type(bc_list_t), intent(in) :: blst type(gs_t), intent(inout) :: gs_h type(ksp_monitor_t) :: ksp_results integer, optional, intent(in) :: niter @@ -476,18 +476,18 @@ end function pipecg_device_solve function pipecg_device_solve_coupled(this, Ax, x, y, z, fx, fy, fz, & n, coef, blstx, blsty, blstz, gs_h, niter) result(ksp_results) class(pipecg_device_t), intent(inout) :: this - class(ax_t), intent(inout) :: Ax + class(ax_t), intent(in) :: Ax type(field_t), intent(inout) :: x type(field_t), intent(inout) :: y type(field_t), intent(inout) :: z integer, intent(in) :: n - real(kind=rp), dimension(n), intent(inout) :: fx - real(kind=rp), dimension(n), intent(inout) :: fy - real(kind=rp), dimension(n), intent(inout) :: fz + real(kind=rp), dimension(n), intent(in) :: fx + real(kind=rp), dimension(n), intent(in) :: fy + real(kind=rp), dimension(n), intent(in) :: fz type(coef_t), intent(inout) :: coef - type(bc_list_t), intent(inout) :: blstx - type(bc_list_t), intent(inout) :: blsty - type(bc_list_t), intent(inout) :: blstz + type(bc_list_t), intent(in) :: blstx + type(bc_list_t), intent(in) :: blsty + type(bc_list_t), intent(in) :: blstz type(gs_t), intent(inout) :: gs_h type(ksp_monitor_t), dimension(3) :: ksp_results integer, optional, intent(in) :: niter diff --git a/src/krylov/bcknd/sx/cg_sx.f90 b/src/krylov/bcknd/sx/cg_sx.f90 index 7cfd7d1b267..154342fe193 100644 --- a/src/krylov/bcknd/sx/cg_sx.f90 +++ b/src/krylov/bcknd/sx/cg_sx.f90 @@ -62,11 +62,11 @@ module cg_sx !> Initialise a standard PCG solver subroutine sx_cg_init(this, n, max_iter, M, rel_tol, abs_tol, monitor) class(sx_cg_t), intent(inout) :: this - class(pc_t), optional, intent(inout), target :: M + class(pc_t), optional, intent(in), target :: M integer, intent(in) :: n integer, intent(in) :: max_iter - real(kind=rp), optional, intent(inout) :: rel_tol - real(kind=rp), optional, intent(inout) :: abs_tol + real(kind=rp), optional, intent(in) :: rel_tol + real(kind=rp), optional, intent(in) :: abs_tol logical, optional, intent(in) :: monitor call this%free() @@ -129,12 +129,12 @@ end subroutine sx_cg_free !> Standard PCG solve function sx_cg_solve(this, Ax, x, f, n, coef, blst, gs_h, niter) result(ksp_results) class(sx_cg_t), intent(inout) :: this - class(ax_t), intent(inout) :: Ax + class(ax_t), intent(in) :: Ax type(field_t), intent(inout) :: x integer, intent(in) :: n - real(kind=rp), dimension(n), intent(inout) :: f + real(kind=rp), dimension(n), intent(in) :: f type(coef_t), intent(inout) :: coef - type(bc_list_t), intent(inout) :: blst + type(bc_list_t), intent(in) :: blst type(gs_t), intent(inout) :: gs_h type(ksp_monitor_t) :: ksp_results integer, optional, intent(in) :: niter @@ -204,18 +204,18 @@ end function sx_cg_solve function sx_cg_solve_coupled(this, Ax, x, y, z, fx, fy, fz, & n, coef, blstx, blsty, blstz, gs_h, niter) result(ksp_results) class(sx_cg_t), intent(inout) :: this - class(ax_t), intent(inout) :: Ax + class(ax_t), intent(in) :: Ax type(field_t), intent(inout) :: x type(field_t), intent(inout) :: y type(field_t), intent(inout) :: z integer, intent(in) :: n - real(kind=rp), dimension(n), intent(inout) :: fx - real(kind=rp), dimension(n), intent(inout) :: fy - real(kind=rp), dimension(n), intent(inout) :: fz + real(kind=rp), dimension(n), intent(in) :: fx + real(kind=rp), dimension(n), intent(in) :: fy + real(kind=rp), dimension(n), intent(in) :: fz type(coef_t), intent(inout) :: coef - type(bc_list_t), intent(inout) :: blstx - type(bc_list_t), intent(inout) :: blsty - type(bc_list_t), intent(inout) :: blstz + type(bc_list_t), intent(in) :: blstx + type(bc_list_t), intent(in) :: blsty + type(bc_list_t), intent(in) :: blstz type(gs_t), intent(inout) :: gs_h type(ksp_monitor_t), dimension(3) :: ksp_results integer, optional, intent(in) :: niter diff --git a/src/krylov/bcknd/sx/gmres_sx.f90 b/src/krylov/bcknd/sx/gmres_sx.f90 index 498ddb638c8..65e40d435f9 100644 --- a/src/krylov/bcknd/sx/gmres_sx.f90 +++ b/src/krylov/bcknd/sx/gmres_sx.f90 @@ -75,10 +75,10 @@ subroutine sx_gmres_init(this, n, max_iter, M, lgmres, & class(sx_gmres_t), intent(inout) :: this integer, intent(in) :: n integer, intent(in) :: max_iter - class(pc_t), optional, intent(inout), target :: M - integer, optional, intent(inout) :: lgmres - real(kind=rp), optional, intent(inout) :: rel_tol - real(kind=rp), optional, intent(inout) :: abs_tol + class(pc_t), optional, intent(in), target :: M + integer, optional, intent(in) :: lgmres + real(kind=rp), optional, intent(in) :: rel_tol + real(kind=rp), optional, intent(in) :: abs_tol logical, optional, intent(in) :: monitor if (present(lgmres)) then @@ -187,12 +187,12 @@ end subroutine sx_gmres_free !> Standard PCG solve function sx_gmres_solve(this, Ax, x, f, n, coef, blst, gs_h, niter) result(ksp_results) class(sx_gmres_t), intent(inout) :: this - class(ax_t), intent(inout) :: Ax + class(ax_t), intent(in) :: Ax type(field_t), intent(inout) :: x integer, intent(in) :: n - real(kind=rp), dimension(n), intent(inout) :: f + real(kind=rp), dimension(n), intent(in) :: f type(coef_t), intent(inout) :: coef - type(bc_list_t), intent(inout) :: blst + type(bc_list_t), intent(in) :: blst type(gs_t), intent(inout) :: gs_h type(ksp_monitor_t) :: ksp_results integer, optional, intent(in) :: niter @@ -342,18 +342,18 @@ end function sx_gmres_solve function sx_gmres_solve_coupled(this, Ax, x, y, z, fx, fy, fz, & n, coef, blstx, blsty, blstz, gs_h, niter) result(ksp_results) class(sx_gmres_t), intent(inout) :: this - class(ax_t), intent(inout) :: Ax + class(ax_t), intent(in) :: Ax type(field_t), intent(inout) :: x type(field_t), intent(inout) :: y type(field_t), intent(inout) :: z integer, intent(in) :: n - real(kind=rp), dimension(n), intent(inout) :: fx - real(kind=rp), dimension(n), intent(inout) :: fy - real(kind=rp), dimension(n), intent(inout) :: fz + real(kind=rp), dimension(n), intent(in) :: fx + real(kind=rp), dimension(n), intent(in) :: fy + real(kind=rp), dimension(n), intent(in) :: fz type(coef_t), intent(inout) :: coef - type(bc_list_t), intent(inout) :: blstx - type(bc_list_t), intent(inout) :: blsty - type(bc_list_t), intent(inout) :: blstz + type(bc_list_t), intent(in) :: blstx + type(bc_list_t), intent(in) :: blsty + type(bc_list_t), intent(in) :: blstz type(gs_t), intent(inout) :: gs_h type(ksp_monitor_t), dimension(3) :: ksp_results integer, optional, intent(in) :: niter diff --git a/src/krylov/bcknd/sx/pipecg_sx.f90 b/src/krylov/bcknd/sx/pipecg_sx.f90 index fde6f8f9354..b5ab78a5478 100644 --- a/src/krylov/bcknd/sx/pipecg_sx.f90 +++ b/src/krylov/bcknd/sx/pipecg_sx.f90 @@ -68,11 +68,11 @@ module pipecg_sx !> Initialise a pipelined PCG solver subroutine sx_pipecg_init(this, n, max_iter, M, rel_tol, abs_tol, monitor) class(sx_pipecg_t), intent(inout) :: this - class(pc_t), optional, intent(inout), target :: M + class(pc_t), optional, intent(in), target :: M integer, intent(in) :: n integer, intent(in) :: max_iter - real(kind=rp), optional, intent(inout) :: rel_tol - real(kind=rp), optional, intent(inout) :: abs_tol + real(kind=rp), optional, intent(in) :: rel_tol + real(kind=rp), optional, intent(in) :: abs_tol logical, optional, intent(in) :: monitor call this%free() @@ -152,12 +152,12 @@ end subroutine sx_pipecg_free !> Pipelined PCG solve function sx_pipecg_solve(this, Ax, x, f, n, coef, blst, gs_h, niter) result(ksp_results) class(sx_pipecg_t), intent(inout) :: this - class(ax_t), intent(inout) :: Ax + class(ax_t), intent(in) :: Ax type(field_t), intent(inout) :: x integer, intent(in) :: n - real(kind=rp), dimension(n), intent(inout) :: f + real(kind=rp), dimension(n), intent(in) :: f type(coef_t), intent(inout) :: coef - type(bc_list_t), intent(inout) :: blst + type(bc_list_t), intent(in) :: blst type(gs_t), intent(inout) :: gs_h type(ksp_monitor_t) :: ksp_results integer, optional, intent(in) :: niter @@ -266,18 +266,18 @@ end function sx_pipecg_solve function sx_pipecg_solve_coupled(this, Ax, x, y, z, fx, fy, fz, & n, coef, blstx, blsty, blstz, gs_h, niter) result(ksp_results) class(sx_pipecg_t), intent(inout) :: this - class(ax_t), intent(inout) :: Ax + class(ax_t), intent(in) :: Ax type(field_t), intent(inout) :: x type(field_t), intent(inout) :: y type(field_t), intent(inout) :: z integer, intent(in) :: n - real(kind=rp), dimension(n), intent(inout) :: fx - real(kind=rp), dimension(n), intent(inout) :: fy - real(kind=rp), dimension(n), intent(inout) :: fz + real(kind=rp), dimension(n), intent(in) :: fx + real(kind=rp), dimension(n), intent(in) :: fy + real(kind=rp), dimension(n), intent(in) :: fz type(coef_t), intent(inout) :: coef - type(bc_list_t), intent(inout) :: blstx - type(bc_list_t), intent(inout) :: blsty - type(bc_list_t), intent(inout) :: blstz + type(bc_list_t), intent(in) :: blstx + type(bc_list_t), intent(in) :: blsty + type(bc_list_t), intent(in) :: blstz type(gs_t), intent(inout) :: gs_h type(ksp_monitor_t), dimension(3) :: ksp_results integer, optional, intent(in) :: niter diff --git a/src/krylov/krylov.f90 b/src/krylov/krylov.f90 index 5a3723be45e..6e52e76b506 100644 --- a/src/krylov/krylov.f90 +++ b/src/krylov/krylov.f90 @@ -114,12 +114,12 @@ function ksp_method(this, Ax, x, f, n, coef, blst, gs_h, niter) & import rp implicit none class(ksp_t), intent(inout) :: this - class(ax_t), intent(inout) :: Ax + class(ax_t), intent(in) :: Ax type(field_t), intent(inout) :: x integer, intent(in) :: n - real(kind=rp), dimension(n), intent(inout) :: f + real(kind=rp), dimension(n), intent(in) :: f type(coef_t), intent(inout) :: coef - type(bc_list_t), intent(inout) :: blst + type(bc_list_t), intent(in) :: blst type(gs_t), intent(inout) :: gs_h integer, optional, intent(in) :: niter type(ksp_monitor_t) :: ksp_results @@ -152,18 +152,18 @@ function ksp_method_coupled(this, Ax, x, y, z, fx, fy, fz, & import rp implicit none class(ksp_t), intent(inout) :: this - class(ax_t), intent(inout) :: Ax + class(ax_t), intent(in) :: Ax type(field_t), intent(inout) :: x type(field_t), intent(inout) :: y type(field_t), intent(inout) :: z integer, intent(in) :: n - real(kind=rp), dimension(n), intent(inout) :: fx - real(kind=rp), dimension(n), intent(inout) :: fy - real(kind=rp), dimension(n), intent(inout) :: fz + real(kind=rp), dimension(n), intent(in) :: fx + real(kind=rp), dimension(n), intent(in) :: fy + real(kind=rp), dimension(n), intent(in) :: fz type(coef_t), intent(inout) :: coef - type(bc_list_t), intent(inout) :: blstx - type(bc_list_t), intent(inout) :: blsty - type(bc_list_t), intent(inout) :: blstz + type(bc_list_t), intent(in) :: blstx + type(bc_list_t), intent(in) :: blsty + type(bc_list_t), intent(in) :: blstz type(gs_t), intent(inout) :: gs_h integer, optional, intent(in) :: niter type(ksp_monitor_t), dimension(3) :: ksp_results @@ -194,7 +194,7 @@ module subroutine krylov_solver_factory(object, n, type_name, & character(len=*), intent(in) :: type_name integer, intent(in) :: max_iter real(kind=rp), optional :: abstol - class(pc_t), optional, intent(inout), target :: M + class(pc_t), optional, intent(in), target :: M logical, optional, intent(in) :: monitor end subroutine krylov_solver_factory diff --git a/src/krylov/krylov_fctry.f90 b/src/krylov/krylov_fctry.f90 index 23f9786e47f..6a9ba812264 100644 --- a/src/krylov/krylov_fctry.f90 +++ b/src/krylov/krylov_fctry.f90 @@ -81,7 +81,7 @@ module subroutine krylov_solver_factory(object, n, type_name, & character(len=*), intent(in) :: type_name integer, intent(in) :: max_iter real(kind=rp), optional :: abstol - class(pc_t), optional, intent(inout), target :: M + class(pc_t), optional, intent(in), target :: M logical, optional, intent(in) :: monitor character(len=:), allocatable :: type_string