validate_upper_fourier_height Subroutine

public subroutine validate_upper_fourier_height(sim, periodic2, z_top, status, message)

Geometry preflight after mesh construction; called before the cached operator is built.

Arguments

Type IntentOptional Attributes Name
type(sim_config), intent(in) :: sim
type(periodic2_physics_config), intent(in) :: periodic2
real(kind=dp), intent(in) :: z_top
integer(kind=i32), intent(out) :: status
character(len=*), intent(out) :: message

Calls

proc~~validate_upper_fourier_height~~CallsGraph proc~validate_upper_fourier_height validate_upper_fourier_height proc~upper_fourier_auto_height_range upper_fourier_auto_height_range proc~validate_upper_fourier_height->proc~upper_fourier_auto_height_range

Called by

proc~~validate_upper_fourier_height~~CalledByGraph proc~validate_upper_fourier_height validate_upper_fourier_height none~init~6 electrostatic_snapshot_type%init none~init~6->proc~validate_upper_fourier_height proc~prepare_periodic_cache_and_stop prepare_periodic_cache_and_stop proc~prepare_periodic_cache_and_stop->none~init~6 program~main main program~main->proc~prepare_periodic_cache_and_stop

Source Code

  subroutine validate_upper_fourier_height(sim, periodic2, z_top, status, message)
    type(sim_config), intent(in) :: sim
    type(periodic2_physics_config), intent(in) :: periodic2
    real(dp), intent(in) :: z_top
    integer(i32), intent(out) :: status
    character(len=*), intent(out) :: message
    real(dp) :: lower, upper

    status = physics_config_ok
    message = ''
    if (periodic2%upper_fourier_switch == 'off') return
    lower = z_top + 0.1_dp*minval(sim%box_max(1:2) - sim%box_min(1:2))
    upper = sim%box_max(3)
    if (periodic2%upper_fourier_switch == 'auto') then
      call upper_fourier_auto_height_range(sim, z_top, lower, upper)
      if (lower <= upper) return
    else
      if (ieee_is_finite(periodic2%upper_fourier_switch_height)) then
        if (periodic2%upper_fourier_switch_height >= lower .and. &
            periodic2%upper_fourier_switch_height < upper) return
      end if
    end if
    call reject(physics_config_invalid_combination, &
                'upper Fourier switch height must lie above z_top + 0.1 min(Lx,Ly) and below H; auto needs 0.25 clearance.', &
                status, message)
  end subroutine validate_upper_fourier_height