read_matching_plane_summary_key Subroutine

public subroutine read_matching_plane_summary_key(key, value, receipt, found)

receipt のキーだけ value を読み戻す。found は表と同じ添字で、重複の検出に使う。

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: key
character(len=*), intent(in) :: value
type(matching_plane_stats), intent(inout) :: receipt
logical, intent(inout) :: found(matching_plane_summary_key_count)

Calls

proc~~read_matching_plane_summary_key~~CallsGraph proc~read_matching_plane_summary_key read_matching_plane_summary_key proc~is_decimal_integer_token is_decimal_integer_token proc~read_matching_plane_summary_key->proc~is_decimal_integer_token proc~is_logical_token is_logical_token proc~read_matching_plane_summary_key->proc~is_logical_token proc~read_matching_summary_real read_matching_summary_real proc~read_matching_plane_summary_key->proc~read_matching_summary_real proc~lower_ascii lower_ascii proc~is_logical_token->proc~lower_ascii proc~is_decimal_real_token is_decimal_real_token proc~read_matching_summary_real->proc~is_decimal_real_token

Source Code

  subroutine read_matching_plane_summary_key(key, value, receipt, found)
    character(len=*), intent(in) :: key, value
    type(matching_plane_stats), intent(inout) :: receipt
    logical, intent(inout) :: found(matching_plane_summary_key_count)
    integer :: k, ios, real_index
    real(dp) :: x, real_values(receipt_real_count)

    k = key_index(key)
    if (k == 0) return
    if (.not. receipt_keys(k)%restored) return
    if (receipt_keys(k)%unique) then
      if (found(k)) error stop 'Resume checkpoint summary contains duplicate matching-plane key: '//trim(key)
    end if
    found(k) = .true.
    select case (receipt_keys(k)%value_kind)
    case (value_logical)
      call read_matching_summary_logical(value, key, receipt%state_valid)
    case (value_integer)
      call read_matching_summary_integer(value, key, receipt%iterations)
    case (value_spectrum)
      read (value, *, iostat=ios) receipt%photoelectron_spectrum_m2_s
      if (ios /= 0) error stop 'Resume checkpoint matching-plane photoelectron spectrum could not be parsed.'
    case (value_real)
      call read_matching_summary_real(value, key, x)
      real_values = receipt_real_values(receipt)
      real_index = count(receipt_keys(:k)%value_kind == value_real)
      real_values(real_index) = x
      call restore_receipt_real_values(receipt, real_values)
    end select
  end subroutine read_matching_plane_summary_key