Endogenous separation

Dears,I’m struggling with endogenous separation. Do you know how can I write an endogenous separation that applies when it reaches a given threshold value, namely ρt=F(at_bar)=at_bar where pt is the endogenous separation and at_bar is the cutoff value endogenously determined by the model? Moreover at is the productivity of the worker that follows a Markov process and when at<at_bar then pt takes place. Can you help me? Thank you very much

I am no expert on this, but the only Dynare-solvable model I know that features endogenous separation is Christiano/Trabandt/Walentin (2011): Introducing financial frictions and unemployment into
a small open economy model.