Skip to content

Commit

Permalink
Removed unnecessary explicit reference to kwargs in log/check calls t…
Browse files Browse the repository at this point in the history
…o make the code more readable.
  • Loading branch information
Simkern committed Feb 5, 2025
1 parent 7069474 commit 5079289
Show file tree
Hide file tree
Showing 43 changed files with 785 additions and 748 deletions.
12 changes: 6 additions & 6 deletions example/ginzburg_landau/Ginzburg_Landau.f90
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ complex(kind=wp) function dot(self, vec) result(alpha)
type is (state_vector)
alpha = dot_product(self%state, vec%state)
class default
call stop_error("The intent [IN] argument 'vec' must be of type 'state_vector'", module=this_module, procedure='dot')
call stop_error("The intent [IN] argument 'vec' must be of type 'state_vector'", this_module, 'dot')
end select
end function dot

Expand All @@ -291,7 +291,7 @@ subroutine axpby(self, alpha, vec, beta)
type is (state_vector)
self%state = alpha*self%state + beta*vec%state
class default
call stop_error("The intent [IN] argument 'vec' must be of type 'state_vector'", module=this_module, procedure='axpby')
call stop_error("The intent [IN] argument 'vec' must be of type 'state_vector'", this_module, 'axpby')
end select
end subroutine axpby

Expand Down Expand Up @@ -348,10 +348,10 @@ subroutine direct_solver(self, vec_in, vec_out)
vec_out%state%re = state_fc(:nx)
vec_out%state%im = state_fc(nx + 1:)
class default
call stop_error("The intent [OUT] argument 'vec_out' must be of type 'state_vector'", module=this_module, procedure='direct_solver')
call stop_error("The intent [OUT] argument 'vec_out' must be of type 'state_vector'", this_module, 'direct_solver')
end select
class default
call stop_error("The intent [IN] argument 'vec_in' must be of type 'state_vector'", module=this_module, procedure='direct_solver')
call stop_error("The intent [IN] argument 'vec_in' must be of type 'state_vector'", this_module, 'direct_solver')
end select
end subroutine direct_solver

Expand Down Expand Up @@ -383,10 +383,10 @@ subroutine adjoint_solver(self, vec_in, vec_out)
vec_out%state%re = state_fc(:nx)
vec_out%state%im = state_fc(nx + 1:)
class default
call stop_error("The intent [OUT] argument 'vec_out' must be of type 'state_vector'", module=this_module, procedure='adjoint_solver')
call stop_error("The intent [OUT] argument 'vec_out' must be of type 'state_vector'", this_module, 'adjoint_solver')
end select
class default
call stop_error("The intent [IN] argument 'vec_in' must be of type 'state_vector'", module=this_module, procedure='adjoint_solver')
call stop_error("The intent [IN] argument 'vec_in' must be of type 'state_vector'", this_module, 'adjoint_solver')
end select
end subroutine adjoint_solver

Expand Down
22 changes: 11 additions & 11 deletions example/roessler/roessler.f90
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ real(wp) function dot(self, vec) result(alpha)
type is (state_vector)
alpha = self%x*vec%x + self%y*vec%y + self%z*vec%z + self%T*vec%T
class default
call stop_error("The intent [IN] argument 'vec' must be of type 'state_vector'", module=this_module, procedure='dot')
call stop_error("The intent [IN] argument 'vec' must be of type 'state_vector'", this_module, 'dot')
end select
end function dot

Expand All @@ -122,7 +122,7 @@ subroutine axpby(self, alpha, vec, beta)
self%z = alpha*self%z + beta*vec%z
self%T = alpha*self%T + beta*vec%T
class default
call stop_error("The intent [IN] argument 'vec' must be of type 'state_vector'", module=this_module, procedure='axpby')
call stop_error("The intent [IN] argument 'vec' must be of type 'state_vector'", this_module, 'axpby')
end select
end subroutine axpby

Expand Down Expand Up @@ -272,10 +272,10 @@ subroutine nonlinear_map(self, vec_in, vec_out, atol)
! Add period residual
vec_out%T = 0.0_wp
class default
call stop_error("The intent [OUT] argument 'vec_out' must be of type 'state_vector'", module=this_module, procedure='nonlinear_map')
call stop_error("The intent [OUT] argument 'vec_out' must be of type 'state_vector'", this_module, 'nonlinear_map')
end select
class default
call stop_error("The intent [IN] argument 'vec_in' must be of type 'state_vector'", module=this_module, procedure='nonlinear_map')
call stop_error("The intent [IN] argument 'vec_in' must be of type 'state_vector'", this_module, 'nonlinear_map')
end select
end subroutine nonlinear_map

Expand Down Expand Up @@ -322,10 +322,10 @@ subroutine linear_map(self, vec_in, vec_out)
call compute_fdot(pos_in(:npts), vec)
vec_out%T = vec_in%dot(vec)
class default
call stop_error("The intent [OUT] argument 'vec_out' must be of type 'state_vector'", module=this_module, procedure='linear_map')
call stop_error("The intent [OUT] argument 'vec_out' must be of type 'state_vector'", this_module, 'linear_map')
end select
class default
call stop_error("The intent [IN] argument 'vec_in' must be of type 'state_vector'", module=this_module, procedure='linear_map')
call stop_error("The intent [IN] argument 'vec_in' must be of type 'state_vector'", this_module, 'linear_map')
end select
end subroutine linear_map

Expand Down Expand Up @@ -360,10 +360,10 @@ subroutine monodromy_map(self, vec_in, vec_out)
! Pass-back the state.
call set_position(pos_out(npts + 1:), vec_out)
class default
call stop_error("The intent [OUT] argument 'vec_out' must be of type 'state_vector'", module=this_module, procedure='monodromy_map')
call stop_error("The intent [OUT] argument 'vec_out' must be of type 'state_vector'", this_module, 'monodromy_map')
end select
class default
call stop_error("The intent [IN] argument 'vec_in' must be of type 'state_vector'", module=this_module, procedure='monodromy_map')
call stop_error("The intent [IN] argument 'vec_in' must be of type 'state_vector'", this_module, 'monodromy_map')
end select
end subroutine monodromy_map

Expand All @@ -381,7 +381,7 @@ subroutine get_position(vec_in, pos)
pos(2) = vec_in%y
pos(3) = vec_in%z
class default
call stop_error("The intent [IN] argument 'vec_in' must be of type 'state_vector'", module=this_module, procedure='get_position')
call stop_error("The intent [IN] argument 'vec_in' must be of type 'state_vector'", this_module, 'get_position')
end select
end subroutine get_position

Expand All @@ -392,7 +392,7 @@ subroutine get_period(vec_in, period)
type is (state_vector)
period = vec_in%T
class default
call stop_error("The intent [IN] argument 'vec_in' must be of type 'state_vector'", module=this_module, procedure='get_period')
call stop_error("The intent [IN] argument 'vec_in' must be of type 'state_vector'", this_module, 'get_period')
end select
end subroutine get_period

Expand All @@ -405,7 +405,7 @@ subroutine set_position(pos, vec_out)
vec_out%y = pos(2)
vec_out%z = pos(3)
class default
call stop_error("The intent [OUT] argument 'vec_out' must be of type 'state_vector'", module=this_module, procedure='set_position')
call stop_error("The intent [OUT] argument 'vec_out' must be of type 'state_vector'", this_module, 'set_position')
end select
end subroutine set_position

Expand Down
10 changes: 5 additions & 5 deletions example/roessler/roessler_OTD.f90
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ real(wp) function dot_p(self, vec) result(alpha)
type is (pos_vector)
alpha = self%x*vec%x + self%y*vec%y + self%z*vec%z
class default
call stop_error("The intent [IN] argument 'vec' must be of type 'pos_vector'", module=this_module, procedure='dot_p')
call stop_error("The intent [IN] argument 'vec' must be of type 'pos_vector'", this_module, 'dot_p')
end select
end function dot_p

Expand All @@ -100,7 +100,7 @@ subroutine axpby_p(self, alpha, vec, beta)
self%y = alpha*self%y + beta*vec%y
self%z = alpha*self%z + beta*vec%z
class default
call stop_error("The intent [IN] argument 'vec' must be of type 'pos_vector'", module=this_module, procedure='axpby_p')
call stop_error("The intent [IN] argument 'vec' must be of type 'pos_vector'", this_module, 'axpby_p')
end select
end subroutine axpby_p

Expand Down Expand Up @@ -217,7 +217,7 @@ subroutine OTD_step(integrator, bf, vec_in, FTLE_in, time, Tstep, vec_out, FTLE_
FTLE_out = pos_out(npts*(r + 1) + 1:)
time = time + Tstep
class default
call stop_error("The intent [INOUT] argument 'integrator' must be of type 'rks54_class'", module=this_module, procedure='OTD_step')
call stop_error("The intent [INOUT] argument 'integrator' must be of type 'rks54_class'", this_module, 'OTD_step')
end select
end subroutine OTD_step

Expand Down Expand Up @@ -306,7 +306,7 @@ subroutine get_pos(vec_in, pos)
pos(2) = vec_in%y
pos(3) = vec_in%z
class default
call stop_error("The intent [IN] argument 'vec' must be of type 'pos_vector'", module=this_module, procedure='get_pos')
call stop_error("The intent [IN] argument 'vec' must be of type 'pos_vector'", this_module, 'get_pos')
end select
end subroutine get_pos

Expand All @@ -319,7 +319,7 @@ subroutine set_pos(pos, vec_out)
vec_out%y = pos(2)
vec_out%z = pos(3)
class default
call stop_error("The intent [IN] argument 'vec' must be of type 'pos_vector'", module=this_module, procedure='set_pos')
call stop_error("The intent [IN] argument 'vec' must be of type 'pos_vector'", this_module, 'set_pos')
end select
end subroutine set_pos

Expand Down
36 changes: 18 additions & 18 deletions src/AbstractTypes/AbstractLinops.f90
Original file line number Diff line number Diff line change
Expand Up @@ -483,11 +483,11 @@ subroutine reset_counter(self, trans, procedure, counter, reset_timer, soft_rese
if ( count_old /= 0 .or. counter_ /= 0) then
if (trans) then
write(msg,'(A,I0,A,I0,A)') 'Total number of rmatvecs: ', count_old, '. Resetting counter to ', counter_, '.'
call log_message(msg, module=this_module, procedure='reset_counter('//trim(procedure)//')')
call log_message(msg, this_module, 'reset_counter('//trim(procedure)//')')
self%rmatvec_counter = counter_
else
write(msg,'(A,I0,A,I0,A)') 'Total number of matvecs: ', count_old, '. Resetting counter to ', counter_, '.'
call log_message(msg, module=this_module, procedure='reset_counter('//trim(procedure)//')')
call log_message(msg, this_module, 'reset_counter('//trim(procedure)//')')
self%matvec_counter = counter_
end if
end if
Expand Down Expand Up @@ -554,12 +554,12 @@ subroutine apply_matvec_rsp(self, vec_in, vec_out)
character(len=128) :: msg
self%matvec_counter = self%matvec_counter + 1
write(msg,'(I0,1X,A)') self%matvec_counter, 'start'
call log_debug(msg, module=this_module, procedure='matvec')
call log_debug(msg, this_module, 'matvec')
call self%matvec_timer%start()
call self%matvec(vec_in, vec_out)
call self%matvec_timer%stop()
write(msg,'(I0,1X,A)') self%matvec_counter, 'end'
call log_debug(msg, module=this_module, procedure='matvec')
call log_debug(msg, this_module, 'matvec')
return
end subroutine apply_matvec_rsp

Expand All @@ -571,12 +571,12 @@ subroutine apply_rmatvec_rsp(self, vec_in, vec_out)
character(len=128) :: msg
self%rmatvec_counter = self%rmatvec_counter + 1
write(msg,'(I0,1X,A)') self%rmatvec_counter, 'start'
call log_debug(msg, module=this_module, procedure='rmatvec')
call log_debug(msg, this_module, 'rmatvec')
call self%rmatvec_timer%start()
call self%rmatvec(vec_in, vec_out)
call self%rmatvec_timer%stop()
write(msg,'(I0,1X,A)') self%rmatvec_counter, 'end'
call log_debug(msg, module=this_module, procedure='rmatvec')
call log_debug(msg, this_module, 'rmatvec')
return
end subroutine apply_rmatvec_rsp
subroutine apply_matvec_rdp(self, vec_in, vec_out)
Expand All @@ -587,12 +587,12 @@ subroutine apply_matvec_rdp(self, vec_in, vec_out)
character(len=128) :: msg
self%matvec_counter = self%matvec_counter + 1
write(msg,'(I0,1X,A)') self%matvec_counter, 'start'
call log_debug(msg, module=this_module, procedure='matvec')
call log_debug(msg, this_module, 'matvec')
call self%matvec_timer%start()
call self%matvec(vec_in, vec_out)
call self%matvec_timer%stop()
write(msg,'(I0,1X,A)') self%matvec_counter, 'end'
call log_debug(msg, module=this_module, procedure='matvec')
call log_debug(msg, this_module, 'matvec')
return
end subroutine apply_matvec_rdp

Expand All @@ -604,12 +604,12 @@ subroutine apply_rmatvec_rdp(self, vec_in, vec_out)
character(len=128) :: msg
self%rmatvec_counter = self%rmatvec_counter + 1
write(msg,'(I0,1X,A)') self%rmatvec_counter, 'start'
call log_debug(msg, module=this_module, procedure='rmatvec')
call log_debug(msg, this_module, 'rmatvec')
call self%rmatvec_timer%start()
call self%rmatvec(vec_in, vec_out)
call self%rmatvec_timer%stop()
write(msg,'(I0,1X,A)') self%rmatvec_counter, 'end'
call log_debug(msg, module=this_module, procedure='rmatvec')
call log_debug(msg, this_module, 'rmatvec')
return
end subroutine apply_rmatvec_rdp
subroutine apply_matvec_csp(self, vec_in, vec_out)
Expand All @@ -620,12 +620,12 @@ subroutine apply_matvec_csp(self, vec_in, vec_out)
character(len=128) :: msg
self%matvec_counter = self%matvec_counter + 1
write(msg,'(I0,1X,A)') self%matvec_counter, 'start'
call log_debug(msg, module=this_module, procedure='matvec')
call log_debug(msg, this_module, 'matvec')
call self%matvec_timer%start()
call self%matvec(vec_in, vec_out)
call self%matvec_timer%stop()
write(msg,'(I0,1X,A)') self%matvec_counter, 'end'
call log_debug(msg, module=this_module, procedure='matvec')
call log_debug(msg, this_module, 'matvec')
return
end subroutine apply_matvec_csp

Expand All @@ -637,12 +637,12 @@ subroutine apply_rmatvec_csp(self, vec_in, vec_out)
character(len=128) :: msg
self%rmatvec_counter = self%rmatvec_counter + 1
write(msg,'(I0,1X,A)') self%rmatvec_counter, 'start'
call log_debug(msg, module=this_module, procedure='rmatvec')
call log_debug(msg, this_module, 'rmatvec')
call self%rmatvec_timer%start()
call self%rmatvec(vec_in, vec_out)
call self%rmatvec_timer%stop()
write(msg,'(I0,1X,A)') self%rmatvec_counter, 'end'
call log_debug(msg, module=this_module, procedure='rmatvec')
call log_debug(msg, this_module, 'rmatvec')
return
end subroutine apply_rmatvec_csp
subroutine apply_matvec_cdp(self, vec_in, vec_out)
Expand All @@ -653,12 +653,12 @@ subroutine apply_matvec_cdp(self, vec_in, vec_out)
character(len=128) :: msg
self%matvec_counter = self%matvec_counter + 1
write(msg,'(I0,1X,A)') self%matvec_counter, 'start'
call log_debug(msg, module=this_module, procedure='matvec')
call log_debug(msg, this_module, 'matvec')
call self%matvec_timer%start()
call self%matvec(vec_in, vec_out)
call self%matvec_timer%stop()
write(msg,'(I0,1X,A)') self%matvec_counter, 'end'
call log_debug(msg, module=this_module, procedure='matvec')
call log_debug(msg, this_module, 'matvec')
return
end subroutine apply_matvec_cdp

Expand All @@ -670,12 +670,12 @@ subroutine apply_rmatvec_cdp(self, vec_in, vec_out)
character(len=128) :: msg
self%rmatvec_counter = self%rmatvec_counter + 1
write(msg,'(I0,1X,A)') self%rmatvec_counter, 'start'
call log_debug(msg, module=this_module, procedure='rmatvec')
call log_debug(msg, this_module, 'rmatvec')
call self%rmatvec_timer%start()
call self%rmatvec(vec_in, vec_out)
call self%rmatvec_timer%stop()
write(msg,'(I0,1X,A)') self%rmatvec_counter, 'end'
call log_debug(msg, module=this_module, procedure='rmatvec')
call log_debug(msg, this_module, 'rmatvec')
return
end subroutine apply_rmatvec_cdp

Expand Down
12 changes: 6 additions & 6 deletions src/AbstractTypes/AbstractLinops.fypp
Original file line number Diff line number Diff line change
Expand Up @@ -231,11 +231,11 @@ contains
if ( count_old /= 0 .or. counter_ /= 0) then
if (trans) then
write(msg,'(A,I0,A,I0,A)') 'Total number of rmatvecs: ', count_old, '. Resetting counter to ', counter_, '.'
call log_message(msg, module=this_module, procedure='reset_counter('//trim(procedure)//')')
call log_message(msg, this_module, 'reset_counter('//trim(procedure)//')')
self%rmatvec_counter = counter_
else
write(msg,'(A,I0,A,I0,A)') 'Total number of matvecs: ', count_old, '. Resetting counter to ', counter_, '.'
call log_message(msg, module=this_module, procedure='reset_counter('//trim(procedure)//')')
call log_message(msg, this_module, 'reset_counter('//trim(procedure)//')')
self%matvec_counter = counter_
end if
end if
Expand Down Expand Up @@ -303,12 +303,12 @@ contains
character(len=128) :: msg
self%matvec_counter = self%matvec_counter + 1
write(msg,'(I0,1X,A)') self%matvec_counter, 'start'
call log_debug(msg, module=this_module, procedure='matvec')
call log_debug(msg, this_module, 'matvec')
call self%matvec_timer%start()
call self%matvec(vec_in, vec_out)
call self%matvec_timer%stop()
write(msg,'(I0,1X,A)') self%matvec_counter, 'end'
call log_debug(msg, module=this_module, procedure='matvec')
call log_debug(msg, this_module, 'matvec')
return
end subroutine apply_matvec_${type[0]}$${kind}$

Expand All @@ -320,12 +320,12 @@ contains
character(len=128) :: msg
self%rmatvec_counter = self%rmatvec_counter + 1
write(msg,'(I0,1X,A)') self%rmatvec_counter, 'start'
call log_debug(msg, module=this_module, procedure='rmatvec')
call log_debug(msg, this_module, 'rmatvec')
call self%rmatvec_timer%start()
call self%rmatvec(vec_in, vec_out)
call self%rmatvec_timer%stop()
write(msg,'(I0,1X,A)') self%rmatvec_counter, 'end'
call log_debug(msg, module=this_module, procedure='rmatvec')
call log_debug(msg, this_module, 'rmatvec')
return
end subroutine apply_rmatvec_${type[0]}$${kind}$
#:endfor
Expand Down
Loading

0 comments on commit 5079289

Please sign in to comment.