Print how far the optimization moved the solution.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(mission_type), | intent(inout) | :: | mission | |||
| real(kind=wp), | intent(in), | dimension(:) | :: | x0 | ||
| real(kind=wp), | intent(in), | dimension(:) | :: | x |
subroutine report_change(mission, x0, x) class(mission_type),intent(inout) :: mission real(wp),dimension(:),intent(in) :: x0, x integer :: i, n_full, k, cc integer,dimension(:),allocatable :: removed real(wp) :: dt_max, dr_max, dv_max, d call mission%define_problem_size(n=n_full, full_problem=.true.) removed = mission%removed_columns() dt_max = zero; dr_max = zero; dv_max = zero k = 0 do i = 1, n_full if (any(removed==i)) cycle k = k + 1 d = abs(x(k) - x0(k)) * mission%xscale(k) ! unscaled cc = mod(i-1,7) + 1 select case (cc) case (1); dt_max = max(dt_max, d) case (2:4); dr_max = max(dr_max, d) case (5:7); dv_max = max(dv_max, d) end select end do write(*,'(A,F10.3,A,F12.3,A,F10.3,A)') ' largest change of a node: ', dt_max*24.0_wp, ' h in epoch, ', & dr_max, ' km in position, ', dv_max*1000.0_wp, ' m/s in velocity' end subroutine report_change