The Newton finish's functions: halo's continuity constraints, then KS - phi_min of
the active eclipse rows. A point that can't be evaluated (outside the splined
ephemeris, or an integrator failure) gets large values, so the line search backs off.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(nlesolver_type), | intent(inout) | :: | me | |||
| real(kind=wp), | intent(in), | dimension(:) | :: | x |
halo's scaled variables |
|
| real(kind=wp), | intent(out), | dimension(:) | :: | f |
the functions |
subroutine newton_func(me, x, f) class(nlesolver_type),intent(inout) :: me real(wp),dimension(:),intent(in) :: x !! halo's scaled variables real(wp),dimension(:),intent(out) :: f !! the functions real(wp),dimension(:),allocatable :: ks integer :: m logical :: ok real(wp),parameter :: big = 1.0e10_wp select type (me) type is (eclipse_newton_type) m = me%d%m_halo if (.not. epochs_in_range(me%d, x)) then f = big return end if call me%d%mission%constraint_violations(x, f(1:m)) ! (also puts x in the segments) allocate(ks(size(me%d%rows))) call eval_rows(me%d, ks, ok=ok, only=me%mask) f(m+1:) = ks(me%active) - me%d%mission%eclipse_opt_phi_min if (.not. ok .or. any(me%d%mission%segs%failed)) f = big class default error stop 'newton_func: invalid class' end select end subroutine newton_func