clamp_int32 Function

private pure elemental function clamp_int32(x, xmin, xmax) result(clamp)

Uses

  • proc~~clamp_int32~~UsesGraph proc~clamp_int32 clamp_int32 iso_fortran_env iso_fortran_env proc~clamp_int32->iso_fortran_env

Clamp/Limit the value of x to the range of [xmin, xmax], where x, xmin, and xmax are all integers. No check is performed to ensure xmin < xmax. (KCW, 2025-07-16)

Arguments

Type IntentOptional Attributes Name
integer(kind=int32), intent(in) :: x
integer(kind=int32), intent(in) :: xmin
integer(kind=int32), intent(in) :: xmax

Return Value integer(kind=int32)


Called by

proc~~clamp_int32~~CalledByGraph proc~clamp_int32 clamp_int32 interface~clamp clamp interface~clamp->proc~clamp_int32 none~update_shared_variables update_shared_variables none~update_shared_variables->interface~clamp proc~dyn_mpas_init_phase1 mpas_dynamical_core_type%dyn_mpas_init_phase1 proc~dyn_mpas_init_phase1->interface~clamp proc~dyn_readnl dyn_readnl proc~dyn_readnl->proc~dyn_mpas_init_phase1 proc~dynamics_to_physics_coupling dynamics_to_physics_coupling proc~dynamics_to_physics_coupling->none~update_shared_variables interface~dyn_readnl dyn_readnl interface~dyn_readnl->proc~dyn_readnl interface~dynamics_to_physics_coupling dynamics_to_physics_coupling interface~dynamics_to_physics_coupling->proc~dynamics_to_physics_coupling proc~stepon_timestep_init stepon_timestep_init proc~stepon_timestep_init->interface~dynamics_to_physics_coupling

Source Code

    pure elemental function clamp_int32(x, xmin, xmax) result(clamp)
        use, intrinsic :: iso_fortran_env, only: int32

        integer(int32), intent(in) :: x, xmin, xmax
        integer(int32) :: clamp

        clamp = max(min(x, xmax), xmin)
    end function clamp_int32