Skip to content

Commit

Permalink
intent(in) for Ax, f, blst in _solve()
Browse files Browse the repository at this point in the history
  • Loading branch information
tuananhdao committed Nov 8, 2024
1 parent d5ada89 commit bd9e275
Show file tree
Hide file tree
Showing 18 changed files with 176 additions and 176 deletions.
4 changes: 2 additions & 2 deletions src/bc/bc.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
20 changes: 10 additions & 10 deletions src/krylov/bcknd/cpu/bicgstab.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
20 changes: 10 additions & 10 deletions src/krylov/bcknd/cpu/cacg.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
20 changes: 10 additions & 10 deletions src/krylov/bcknd/cpu/cg.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
20 changes: 10 additions & 10 deletions src/krylov/bcknd/cpu/cg_coupled.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
24 changes: 12 additions & 12 deletions src/krylov/bcknd/cpu/cheby.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
20 changes: 10 additions & 10 deletions src/krylov/bcknd/cpu/gmres.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
20 changes: 10 additions & 10 deletions src/krylov/bcknd/cpu/pipecg.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
20 changes: 10 additions & 10 deletions src/krylov/bcknd/device/cg_device.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading

0 comments on commit bd9e275

Please sign in to comment.