reset_tensor_state Subroutine

subroutine reset_tensor_state(state)

Reset the reusable tensor parser state.

Arguments

Type IntentOptional Attributes Name
type(json_tensor_state_type), intent(inout) :: state

Tensor parser state to reset


Source Code

  subroutine reset_tensor_state(state)
    !! Reset the reusable tensor parser state.
    implicit none

    ! Arguments
    type(json_tensor_state_type), intent(inout) :: state
    !! Tensor parser state to reset

    state%in_object = .false.
    state%object_depth = 0
    state%name = ''
    state%elem_type = 1
    if(allocated(state%dim_values)) deallocate(state%dim_values)
    allocate(state%dim_values(0))

  end subroutine reset_tensor_state