reverse Function

public pure function reverse(array)

Uses

    • shr_kind_mod
  • proc~~reverse~~UsesGraph proc~reverse reverse shr_kind_mod shr_kind_mod proc~reverse->shr_kind_mod

Helper function for reversing the order of elements in array. (KCW, 2024-07-17)

Arguments

Type IntentOptional Attributes Name
real(kind=kind_r8), intent(in) :: array(:)

Return Value real(kind=kind_r8), (size(array))


Called by

proc~~reverse~~CalledByGraph proc~reverse reverse none~init_shared_variables init_shared_variables none~init_shared_variables->proc~reverse none~set_mpas_physics_tendency_rtheta set_mpas_physics_tendency_rtheta none~set_mpas_physics_tendency_rtheta->proc~reverse none~set_mpas_physics_tendency_ru set_mpas_physics_tendency_ru none~set_mpas_physics_tendency_ru->proc~reverse none~set_mpas_state_rho_theta set_mpas_state_rho_theta none~set_mpas_state_rho_theta->proc~reverse none~set_mpas_state_scalars set_mpas_state_scalars none~set_mpas_state_scalars->proc~reverse none~set_mpas_state_u set_mpas_state_u none~set_mpas_state_u->proc~reverse none~set_physics_state_column set_physics_state_column none~set_physics_state_column->proc~reverse proc~dyn_exchange_constituent_states dyn_exchange_constituent_states proc~dyn_exchange_constituent_states->proc~reverse none~set_physics_state_external set_physics_state_external none~set_physics_state_external->proc~dyn_exchange_constituent_states proc~dyn_init dyn_init proc~dyn_init->proc~dyn_exchange_constituent_states proc~set_analytic_initial_condition set_analytic_initial_condition proc~dyn_init->proc~set_analytic_initial_condition proc~dynamics_to_physics_coupling dynamics_to_physics_coupling proc~dynamics_to_physics_coupling->none~set_physics_state_column proc~dynamics_to_physics_coupling->proc~dyn_exchange_constituent_states proc~dynamics_to_physics_coupling->none~set_physics_state_external proc~physics_to_dynamics_coupling physics_to_dynamics_coupling proc~physics_to_dynamics_coupling->none~set_mpas_physics_tendency_rtheta proc~physics_to_dynamics_coupling->none~set_mpas_physics_tendency_ru proc~physics_to_dynamics_coupling->proc~dyn_exchange_constituent_states proc~set_analytic_initial_condition->none~init_shared_variables proc~set_analytic_initial_condition->none~set_mpas_state_rho_theta proc~set_analytic_initial_condition->none~set_mpas_state_scalars proc~set_analytic_initial_condition->none~set_mpas_state_u proc~stepon_run2 stepon_run2 proc~stepon_run2->proc~physics_to_dynamics_coupling proc~stepon_timestep_init stepon_timestep_init proc~stepon_timestep_init->proc~dynamics_to_physics_coupling

Variables

Type Visibility Attributes Name Initial
integer, private :: n

Source Code

    pure function reverse(array)
        ! Module(s) from CESM Share.
        use shr_kind_mod, only: kind_r8 => shr_kind_r8

        real(kind_r8), intent(in) :: array(:)
        real(kind_r8) :: reverse(size(array))

        integer :: n

        n = size(array)

        ! There is nothing to reverse.
        if (n == 0) then
            return
        end if

        reverse(:) = array(n:1:-1)
    end function reverse