Hello,
When you say "in the last few simulations the code just hangs just before the simulation finishes.", is it the same simulation you try to run or different ones? Does it stop at the same physical time (if it is a different simulation or not)? What did you change between now and when it worked? If you change the number of time steps (less or more than the number of iterations when it stops), does your simulation stop at the same time step?
Before deleting the computation with qdel, in the temporary directory, can you check the hour when the last changed appeared (it is a way to see if there is a trouble in your computation, one core (at least) waiting for another one.
You do not seem to reach the wall time, but I just want to check with you that it is not the problem (it was the problem of one previous user, he confessed).
Anyway, can you try to run the same simulation with another number of cores (e.g. 8, 12 or 32 if you can) and check if the problem still occurs? Otherwise, you can try to compute just before the iteration when your problem occurs and try to restart from this field.
Hope this helps,
Chi-Tuan