def fill_fuel_array_from_patch(fuelarray, patchmask, propertyvector, np, nx, ny):
    """Fill fuel array considering a mask

    Parameters
    ----------

    fuelarray : numpy.ndarray
        Array to modify according to `propertyvector` and `patchmask`.
    patchmask : numpy.ndarray
        Mask array.
    propertyvector : numpy.ndarray
        Vector of properties to fill in the fuel array.
    np : int
        Property vector size
    nx : int
        Fire mesh size on x axis
    ny : int
        Fire mesh size on y axis

    Returns
    -------

    fuelarray : numpy.ndarray
        Modified array according to `propertyvector` and `patchmask`.
    """
    # property loop
    for k in range(np):
        # y axis loop
        for j in range(ny):
            # x axis loop
            for i in range(nx):
                # check mask value
                if patchmask[j, i] == 1:
                    fuelarray[k, j, i] = propertyvector[k]
    return fuelarray