module subroutine compute_type_hydraulic_crs(self, domain, property, pressure, temperature, porosity, ice, controls, bc)
implicit none
class(type_hydraulic_crs), intent(inout) :: self
type(type_domain), intent(inout) :: domain
type(type_properties_manager), intent(in) :: property
type(type_variable), intent(inout) :: pressure
type(type_variable), intent(inout) :: temperature
type(type_variable), intent(inout) :: porosity
type(type_variable), intent(inout) :: ice
type(type_controls), intent(inout) :: controls
type(type_bc), intent(inout) :: bc
integer(int32) :: actual_order
integer(int32) :: mode_bc
call controls%time%profile_start("Setup")
select case (self%algorithm)
case ("none")
mode_bc = mode_value
case default
mode_bc = mode_nr
end select
call controls%time%profile_stop("Setup")
NR_LOOP_THERMAL: do while (controls%iteration%should_continue())
call controls%time%profile_start("Setup")
call controls%iteration%increment_step()
call controls%time%profile_stop("Setup")
call controls%time%profile_start("Assemble")
actual_order = min(self%order, controls%iteration%get_step())
! J, R, domain, pressure, temperature, porosity, ice, &
! properties, controls, actual_order
call self%assemble_global(self%KH_star, self%PHIH, domain, pressure, temperature, ice, porosity, &
property, controls, actual_order)
call controls%time%profile_stop("Assemble")
call controls%time%profile_start("Setup")
call bc%apply_crs(boundary_target='hydraulic', &
current_time=controls%time%get_time(), &
A=self%KH_star, &
b=self%PHIH, &
Domain=Domain, &
mode=mode_bc)
if (controls%iteration%get_step() == 1) call controls%iteration%set_initial_norms(res_vec=self%PHIH)
call controls%time%profile_stop("Setup")
call controls%time%profile_start("Solve")
call self%solve(pressure, controls)
call controls%time%profile_stop("Solve")
call controls%time%profile_start("Setup")
if (controls%iteration%get_step() == 1) call controls%iteration%set_initial_norms(upd_vec=pressure%dif(:))
call controls%iteration%check_convergence(self%PHIH, pressure%dif(:))
pressure%pre(:) = pressure%new(:)
call controls%time%profile_stop("Setup")
end do NR_LOOP_THERMAL
end subroutine compute_type_hydraulic_crs