init_xwork Subroutine

private subroutine init_xwork(me, x)

Set the work vector used by perturb_x_and_compute_f and perturb_x_and_compute_f_partitioned to the nominal x. This must be called before a sequence of calls to those routines.

Type Bound

numdiff_type

Arguments

Type IntentOptional Attributes Name
class(numdiff_type), intent(inout) :: me
real(kind=wp), intent(in), dimension(:) :: x

nominal variable vector


Called by

proc~~init_xwork~~CalledByGraph proc~init_xwork numdiff_type%init_xwork proc~compute_jacobian_for_sparsity numdiff_type%compute_jacobian_for_sparsity proc~compute_jacobian_for_sparsity->proc~init_xwork proc~compute_jacobian_partitioned compute_jacobian_partitioned proc~compute_jacobian_partitioned->proc~init_xwork proc~compute_jacobian_standard compute_jacobian_standard proc~compute_jacobian_standard->proc~init_xwork proc~compute_sparsity_random_2 compute_sparsity_random_2 proc~compute_sparsity_random_2->proc~compute_jacobian_for_sparsity

Source Code

    subroutine init_xwork(me,x)

    implicit none

    class(numdiff_type),intent(inout) :: me
    real(wp),dimension(:),intent(in)  :: x   !! nominal variable vector

    if (allocated(me%xwork)) then
        if (size(me%xwork)/=size(x)) deallocate(me%xwork)
    end if
    if (.not. allocated(me%xwork)) allocate(me%xwork(size(x)))
    me%xwork = x

    end subroutine init_xwork