Hi Kate,
thanks for the suggestion on adding a bad salinity alarm to diag! I did so and could therefore make the model stop running already when salt goes negative. Looking at the fields in rst then made it obvious that something suddenly goes wrong with the atmosphere-ocean saltflux. After looking into bulk_flux forever trying to find the reason for this, I finally just replaced the routine by the one from your branch and suddenly the problem was gone. I compared the compiled routines and I think (hope!) I found the reason:
For the ICE_MODEL switched on, in
your branch the absolute saltflux is first being calculated by subtracting rain from evaporation and multiplying it by the inverse of freshwater density (cff):
Code: Select all
stflx(i,j,isalt)=cff*(evap(i,j)-rain(i,j))
But before masking the field it is being transferred to a relative flux compared to the ice concentration:
Code: Select all
stflx(i,j,isalt) = (1.0_r8-ai(i,j,listp))*stflx(i,j,isalt)
Then masked and later on passed to the variable EminusP.
In the
COAWST branch EminusP is calculated directly from evap and rain:
Code: Select all
EminusP(i,j)=cff*(evap(i,j)-rain(i,j))
and then masked. It is never transferred into a field relative to the ice concentration.
Not to be confused with evap which is being transferred to a relative field in both branches - however in
your branch it is being done AFTER the calculation of stflx and in the
COAWST branch BEFORE the calculation of EminusP. So in other words: EminusP in
your branch is a totally relative field while in the
COAWST branch it is only evaporation which is being set into relation to the ice concentration. This probably also explains why I had quite high positive values of saltflux into the ocean before and now mostly negative ones.
But I am not 100% sure. The most part of the ice model is still a mystery to me. So I'll leave it to experts to judge whether this could in fact have been the reason...
As far as I can foresee things for my model right now, when starting off with 50% ice concentration everywhere, the model neatly removes ice now where it shouldn't go and grows it to reasonable amounts where it should stabilize. I'm happy.