This function returns the constituent name that corresponds to the given constituent index. In case of errors, an empty character string is produced.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(mpas_dynamical_core_type), | intent(in) | :: | self | |||
integer, | intent(in) | :: | constituent_index |
pure function dyn_mpas_get_constituent_name(self, constituent_index) result(constituent_name) class(mpas_dynamical_core_type), intent(in) :: self integer, intent(in) :: constituent_index character(:), allocatable :: constituent_name ! Catch segmentation fault. if (.not. allocated(self % constituent_name)) then constituent_name = '' return end if if (constituent_index < lbound(self % constituent_name, 1) .or. & constituent_index > ubound(self % constituent_name, 1)) then constituent_name = '' return end if constituent_name = trim(adjustl(self % constituent_name(constituent_index))) end function dyn_mpas_get_constituent_name