..... the vagueness continues... not mentioned yet are the dates you'll be there.? and given trains can't go every where, what other mods of transport could you engage with, hired-car or buses, there's a public shared grand taxi system, most of these travel long scheduled routes (limited to a range of a home base/town) some longer trips may involve a process of relay, changing vehicle if your trip crosses more than one taxi range, it happens almost seamlessly, an example of a grand taxi platz beside a bus-station (gare routiere) in Taroudant....
https://www.youtube.com/watch?v=772uOKMHUUs
By train from Casablanca, the small seaside town of El Jadia is easily reached, about an hour and a half, the most popular attraction is the old town cistern featured in Orson Wells film Ortello, this is a stunningly beautiful building and experience, and interesting coastal views and walks. By bus on the coast road route you can travel south to Safi.
Famous for pottery, an old Portuguese fortified coastal town like El Jadia, Essaouira and Asilah.
Travelling farther south Essaouira has striking Portuguese marine fortifications, whie it can be over-run with tourists during the day, by 18.00h. most have left on buses back to Marrakesh or Agadir, then its a nice place to spend the night in.
http://looklex.com/morocco/safi.htm
http://looklex.com/morocco/jadida.htm
http://looklex.com/morocco/essaouira.htm
All of the seaside towns mentioned above are more worth while visiting than Chefchouen which is just another typical Rif mountain village except for an area around the Mellah painted blue, it can be a long slow twisty journey for not very much.
From Fez and Meknes, both Imperial Cities and just 30 minuter by train apart, the Roman Ruins of Volubilis set on an elevated site above the most Sacred Village in Morocco, Moulay Idriss named after its founder, a rebellious Arab Prince fleeing a vengeful uncle in Mecca, brought Islam here and it took root, two interesting locations within an hour of Meknes, a more meaningful cultural experience covering two historical periods.... Roman and Islamic.
http://looklex.com/morocco/moulay_idriss.htm
for travel farther south read.....
https://www.lonelyplanet.com/thorntree/forums/africa/morocco/goulimime-or-tafraoute
https://www.lonelyplanet.com/thorntree/forums/africa/morocco/non-camping-hiking-along-atlantic-coast-ideas