upper_fourier_auto_height_range Subroutine

public pure subroutine upper_fourier_auto_height_range(sim, z_top, lower, upper)

Candidate interval [lower, upper] of the automatic upper Fourier switch height. Shared by the preflight and the snapshot's candidate planes. lower keeps the 0.25 min(Lx,Ly) clearance above the mesh top; upper sits 1e-9 of the box height below H, and at least one float below H when that margin is under H's ULP, so the interval depends on the box geometry and not on the sign or magnitude of the absolute z coordinate.

Arguments

Type IntentOptional Attributes Name
type(sim_config), intent(in) :: sim
real(kind=dp), intent(in) :: z_top
real(kind=dp), intent(out) :: lower
real(kind=dp), intent(out) :: upper

Called by

proc~~upper_fourier_auto_height_range~~CalledByGraph proc~upper_fourier_auto_height_range upper_fourier_auto_height_range proc~validate_upper_fourier_height validate_upper_fourier_height proc~validate_upper_fourier_height->proc~upper_fourier_auto_height_range 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

  pure subroutine upper_fourier_auto_height_range(sim, z_top, lower, upper)
    type(sim_config), intent(in) :: sim
    real(dp), intent(in) :: z_top
    real(dp), intent(out) :: lower, upper

    lower = z_top + 0.25_dp*minval(sim%box_max(1:2) - sim%box_min(1:2))
    upper = min(sim%box_max(3) - 1.0e-9_dp*(sim%box_max(3) - sim%box_min(3)), nearest(sim%box_max(3), -1.0_dp))
  end subroutine upper_fourier_auto_height_range