This function returns the constituent index that corresponds to the given MPAS scalar index. In case of errors, zero is produced.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(mpas_dynamical_core_type), | intent(in) | :: | self | |||
integer, | intent(in) | :: | mpas_scalar_index |
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