refresh_periodic_shell_mean_state Subroutine

public subroutine refresh_periodic_shell_mean_state(plan, charge, state)

線源電荷から S と dS/dz の格子値を作る。

Arguments

Type IntentOptional Attributes Name
type(periodic_shell_mean_plan_type), intent(in) :: plan
real(kind=dp), intent(in) :: charge(:)
type(periodic_shell_mean_state_type), intent(inout) :: state

Called by

proc~~refresh_periodic_shell_mean_state~~CalledByGraph proc~refresh_periodic_shell_mean_state refresh_periodic_shell_mean_state proc~core_update_state_impl core_update_state_impl proc~core_update_state_impl->proc~refresh_periodic_shell_mean_state

Source Code

  subroutine refresh_periodic_shell_mean_state(plan, charge, state)
    type(periodic_shell_mean_plan_type), intent(in) :: plan
    real(dp), intent(in) :: charge(:)
    type(periodic_shell_mean_state_type), intent(inout) :: state

    if (.not. plan%ready) return
    if (size(charge) /= size(plan%value, 2)) error stop 'periodic shell-mean charge size mismatch.'
    if (.not. allocated(state%value)) allocate (state%value(plan%nz), state%slope(plan%nz))
    if (size(state%value) /= plan%nz) then
      deallocate (state%value, state%slope)
      allocate (state%value(plan%nz), state%slope(plan%nz))
    end if
    state%value = matmul(plan%value, charge)
    state%slope = matmul(plan%slope, charge)
  end subroutine refresh_periodic_shell_mean_state