dyn_mpas_map_mpas_scalar_index Function

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

This function returns the MPAS scalar index that corresponds to the given constituent 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) :: constituent_index

Return Value integer


Called by

proc~~dyn_mpas_map_mpas_scalar_index~~CalledByGraph proc~dyn_mpas_map_mpas_scalar_index mpas_dynamical_core_type%dyn_mpas_map_mpas_scalar_index none~init_shared_variables~2 init_shared_variables none~init_shared_variables~2->proc~dyn_mpas_map_mpas_scalar_index proc~dyn_exchange_constituent_states dyn_exchange_constituent_states proc~dyn_exchange_constituent_states->proc~dyn_mpas_map_mpas_scalar_index proc~dyn_init dyn_init proc~dyn_init->proc~dyn_mpas_map_mpas_scalar_index proc~dyn_init->proc~dyn_exchange_constituent_states none~set_physics_state_external set_physics_state_external none~set_physics_state_external->proc~dyn_exchange_constituent_states proc~dynamics_to_physics_coupling dynamics_to_physics_coupling proc~dynamics_to_physics_coupling->none~init_shared_variables~2 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->proc~dyn_exchange_constituent_states 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_mpas_scalar_index(self, constituent_index) result(mpas_scalar_index)
        class(mpas_dynamical_core_type), intent(in) :: self
        integer, intent(in) :: constituent_index

        integer :: mpas_scalar_index

        ! Catch segmentation fault.
        if (.not. allocated(self % index_constituent_to_mpas_scalar)) then
            mpas_scalar_index = 0

            return
        end if

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

            return
        end if

        mpas_scalar_index = self % index_constituent_to_mpas_scalar(constituent_index)
    end function dyn_mpas_map_mpas_scalar_index