def get_util2d_shape_for_layer(model, layer=0):
    """
    Define nrow and ncol for array (Util2d) shape of a given layer in
    structured and/or unstructured models.

    Parameters
    ----------
    model : model object
        model for which Util2d shape is sought.
    layer : int
        layer (base 0) for which Util2d shape is sought.

    Returns
    ---------
    (nrow,ncol) : tuple of ints
        util2d shape for the given layer
    """
    nr, nc, _, _ = model.get_nrow_ncol_nlay_nper()
    if nr is None:  # unstructured
        nrow = 1
        ncol = nc[layer]
    else:  # structured
        nrow = nr
        ncol = nc

    return (nrow, ncol)