The phrase "Write me when you are back" has ambiguous meaning. It might mean - write me the day you have arrived or write me when you are planning to be back. What is the minimal addition/change in the phrase so that it's not ambiguous anymore.
She went to Brazil for two years, but now she's back (=has returned ).
She is back = She has returned.
But normally a simple present tense in the 'when-clause' has a future reference.
So, 'when your are back' means 'once you have returned' (in future).
'Write (to) me after you have returned' won't create any ambiguity.