resolve_irradiation_cell_contract Subroutine

public subroutine resolve_irradiation_cell_contract(app, contract, status, message)

preflight 済み設定から run に不変な前提を一度解決する。free-space 参照構成も保持する。

Arguments

Type IntentOptional Attributes Name
type(app_config), intent(in) :: app
type(irradiation_cell_contract_type), intent(out) :: contract
integer(kind=i32), intent(out) :: status
character(len=*), intent(out) :: message

Calls

proc~~resolve_irradiation_cell_contract~~CallsGraph proc~resolve_irradiation_cell_contract resolve_irradiation_cell_contract proc~lower_ascii lower_ascii proc~resolve_irradiation_cell_contract->proc~lower_ascii

Called by

proc~~resolve_irradiation_cell_contract~~CalledByGraph proc~resolve_irradiation_cell_contract resolve_irradiation_cell_contract proc~evaluate_surface_current_model evaluate_surface_current_model proc~evaluate_surface_current_model->proc~resolve_irradiation_cell_contract proc~solve_zhao_outflow_closure solve_zhao_outflow_closure proc~solve_zhao_outflow_closure->proc~resolve_irradiation_cell_contract proc~evaluate_surface_closure evaluate_surface_closure proc~evaluate_surface_closure->proc~evaluate_surface_current_model

Source Code

  subroutine resolve_irradiation_cell_contract(app, contract, status, message)
    type(app_config), intent(in) :: app
    type(irradiation_cell_contract_type), intent(out) :: contract
    integer(i32), intent(out) :: status
    character(len=*), intent(out) :: message

    contract = irradiation_cell_contract_type()
    status = irradiation_cell_ok
    message = ''
    contract%wall_position = app%sim%box_max(contract%wall_axis)
    contract%periodic_axes = app%sim%bc_low == bc_periodic .and. app%sim%bc_high == bc_periodic
    contract%lower_boundary_model = lower_ascii(trim(app%periodic2%lower_boundary_model))
    ! 壁を選ぶ公開設定はない。periodic2 の方向は physics preflight と同じ x/y 周期に限る。
    if (trim(lower_ascii(app%sim%field_bc_mode)) == 'periodic2') then
      if (.not. app%sim%use_box .or. .not. all(contract%periodic_axes(1:2)) .or. &
          app%sim%bc_low(3) == bc_periodic .or. app%sim%bc_high(3) == bc_periodic) then
        status = irradiation_cell_invalid
        message = 'Irradiation cell requires a finite [domain] with x/y periodic and z nonperiodic axes.'
        return
      end if
    end if
    select case (trim(contract%lower_boundary_model))
    case ('not_applicable', 'legacy_implicit', 'e_bottom_zero', 'symmetric_vacuum', 'e_top_from_sheath')
      continue
    case default
      status = irradiation_cell_invalid
      message = 'Unsupported fields.periodic.lower_boundary_model in irradiation cell contract.'
    end select
  end subroutine resolve_irradiation_cell_contract