I see that this is a follow-on from your previous thread. There is no particularly direct, convenient route from Gibraltar to Morocco. Royal Air Maroc operates a nonstop flight from Gibraltar to Tangier on some Sundays. More flights options vary by day of week and day of travel, nonstop from Malaga to Tangier and from Seville to Fes and Marrakesh; see www.skyscanner.com.
From Gibraltar/La Linea de Concepcion, you can take a bus to Algeciras or Tarifa, then passenger ferry from Algeciras to Tanger Med Port or from Tarifa to Tanger Ville Port (see locations on Google maps), then taxi or bus from either one of those to Tanger train station, then 5-hour train to Fes (or a bus to Chefchaouen, as in your earlier plan).