def get_num_elements(dtype, nelstr):
    """
    Checks if data type is an array or a structure.

    Parameters
    ----------
    dtype : str
        data type specifier

    nelstr : str
        number of elements

    Returns
    -------
    nel : int
        number of elements if type is *ARR or STRUCT. 0 otherwise

    isstruct : bool
        true if the type is STRUCT

    """
    uptype = dtype.upper()
    isstruct = False
    nel = 0
    narr = uptype.count('ARR')
    if uptype == 'STRUCT':
        isstruct = True
    if narr > 0 or isstruct is True:
        nel = int(nelstr[0])
    return nel, isstruct
