dyn_mpas_map_constituent_index Function

private pure function dyn_mpas_map_constituent_index(self, mpas_scalar_index) result(constituent_index)

This function returns the constituent index that corresponds to the given MPAS scalar index. In case of errors, zero is produced.

Type Bound

mpas_dynamical_core_type

Arguments

Type IntentOptional Attributes Name
class(mpas_dynamical_core_type), intent(in) :: self
integer, intent(in) :: mpas_scalar_index

Return Value integer


Called by

proc~~dyn_mpas_map_constituent_index~~CalledByGraph proc~dyn_mpas_map_constituent_index mpas_dynamical_core_type%dyn_mpas_map_constituent_index none~set_mpas_state_scalars set_mpas_state_scalars none~set_mpas_state_scalars->proc~dyn_mpas_map_constituent_index none~set_physics_state_external set_physics_state_external none~set_physics_state_external->proc~dyn_mpas_map_constituent_index proc~dyn_exchange_constituent_states dyn_exchange_constituent_states none~set_physics_state_external->proc~dyn_exchange_constituent_states proc~dyn_exchange_constituent_states->proc~dyn_mpas_map_constituent_index 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_external proc~dynamics_to_physics_coupling->proc~dyn_exchange_constituent_states proc~physics_to_dynamics_coupling physics_to_dynamics_coupling proc~physics_to_dynamics_coupling->proc~dyn_exchange_constituent_states proc~set_analytic_initial_condition->none~set_mpas_state_scalars 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

Source Code

    pure function dyn_mpas_map_constituent_index(self, mpas_scalar_index) result(constituent_index)
        class(mpas_dynamical_core_type), intent(in) :: self
        integer, intent(in) :: mpas_scalar_index

        integer :: constituent_index

        ! Catch segmentation fault.
        if (.not. allocated(self % index_mpas_scalar_to_constituent)) then
            constituent_index = 0

            return
        end if

        if (mpas_scalar_index < lbound(self % index_mpas_scalar_to_constituent, 1) .or. &
            mpas_scalar_index > ubound(self % index_mpas_scalar_to_constituent, 1)) then
            constituent_index = 0

            return
        end if

        constituent_index = self % index_mpas_scalar_to_constituent(mpas_scalar_index)
    end function dyn_mpas_map_constituent_index