epochs_in_range Function

function epochs_in_range(d, x) result(ok)

If all the node epochs of x (halo's scaled variables) are within the range of the splined ephemeris (2 periods before the reference epoch to 2 periods after the last rev, see initialize_the_mission), less a margin of half a period. A trial point of the optimization can be far off.

Arguments

Type IntentOptional Attributes Name
type(eclipse_opt_data), intent(in) :: d
real(kind=wp), intent(in), dimension(:) :: x

Return Value logical


Called by

proc~~epochs_in_range~~CalledByGraph proc~epochs_in_range epochs_in_range proc~eclipse_fc eclipse_fc proc~eclipse_fc->proc~epochs_in_range proc~eclipse_gjac eclipse_gjac proc~eclipse_gjac->proc~epochs_in_range proc~newton_func newton_func proc~newton_func->proc~epochs_in_range proc~newton_finish newton_finish proc~newton_finish->proc~newton_func proc~eclipse_optimize eclipse_optimize proc~eclipse_optimize->proc~newton_finish interface~eclipse_optimize my_solver_type%eclipse_optimize interface~eclipse_optimize->proc~eclipse_optimize proc~halo_solver_main halo_solver_main proc~halo_solver_main->interface~eclipse_optimize

Source Code

    function epochs_in_range(d, x) result(ok)

    type(eclipse_opt_data),intent(in) :: d
    real(wp),dimension(:),intent(in) :: x
    logical :: ok

    real(wp) :: lo, hi, t
    integer :: i

    lo = -1.5_wp * d%mission%period
    hi = (d%mission%n_revs + 1.5_wp) * d%mission%period
    ok = .true.
    do i = 1, size(x)
        if (.not. d%mission%x_is_epoch(i)) cycle
        t = x(i)*d%mission%xscale(i) + d%mission%xoffset(i)  ! [days from the reference epoch]
        if (t < lo .or. t > hi .or. t /= t) then
            ok = .false.
            return
        end if
    end do

    end function epochs_in_range