I get very low negative suspended load concentration values (down to several hundreds of kg/m^3) near river runoff. I have no sediment input via rivers. But the initial concentration in the water column is zero so I wonder what exactly a negative concentration should mean. Is there a way to prevent this? So far I just cut off anything below zero in the fields in order to make the "real" concentration visible. But I don't understand how these negative values come to be...
There are many reasons why there can be negative concentration values, but most likely it may be from the advection scheme. Suggest you use TS_MPDATA, that should remain positive. Also, we have added a new scheme called TS_HSIMT into COAWST that is also positive definite, it is based on some flux limter approaches (see Wu and Zhu https://doi.org/10.1016/j.ocemod.2009.12.001).
Most importantly though: you need to add up all the negatives and positives to achieve mass conservation. So cutting the negative values off is not a good idea.
You want to limit sharp horizontal gradients. What is happening at the first rho point next to teh river source? is all that sed being resuspended?
Speaking of sharp horizontal gradients: I do indeed discover erroneous negative rho values (in fact of the same order as the susp. load concentration) next to the river discharge, so maybe this isn't exactly a sediment issue. T and S look fine, though. The errors occur after several months of simulation and happen to evolve from just one spot. Also, they seem to start rather from the bottom than the surface. Here is my include so you can see which flags I chose. Maybe some of them are prone to instabilities in combination... Unfortunately, I don't have enough experience to spot issues right away but I try hard to understand a little more each day.
so a suggestion would be to change
define TS_U3HADVECTION
to
define TS_MPDATA
and see how that looks.
Also, just a question: are the river sources all putting flow into the domain? some people use tidal river forcing that oscillates +/- to simulate a tidal flow.
when you say negative sediment next to the river discharge. is that the first rho point adjacent to the source? does bed_mass go to 0 before the negative conc? trying to think of some ways to help.
MPDATA did really solve the problem which does of course make sense because it just restricts the local simulation results. Even though I am always a bit concerned with too much correction terms in the calculation, I think switching to MPDATA was a really good idea. Thank you for this great advice!
Regarding your other questions: I have only momentum and tracer (T and S, no discharge - I am still considering this, though) transport from the rivers. No volume (ergo water mass) is being introduced.
The negative concentrations seemingly didn't appear right at the first rho point from the river point source but rather in their vicinity. And I don't extract bed mass so far (reducing simulation time) but bed thickness was not much affected at the areas of question...
So I guess it was more some kind of instability that the MPDATA scheme is capable of constraining. It would have taken me forever to find this myself.
...
Hout(idmud) == T ! mud_01, ... suspended concentration
Hout(iMfrac) == T ! mudfrac_01, ... bed layer fraction
Hout(iMmass) == T ! mudmass_01, ... bed layer mass
Hout(iMUbld) == F ! bedload_Umud_01, ... bed load at U-points
Hout(iMVbld) == F ! bedload_Vmud_01, ... bed load at V-points
...
I also tried to switch on bed layer fraction in order to test this one and it gets written out.
...
DO itrc=1,NST
i=idfrac(itrc)
IF (Hout(i,ng)) WRITE (out,160) Hout(i,ng), &
& 'Hout(idfrac)', &
& 'Write out bed fraction, sediment ', itrc, &
& TRIM(Vname(1,i))
END DO
DO itrc=1,NST
i=idBmas(itrc)
IF (Hout(i,ng)) WRITE (out,160) Hout(i,ng), &
& 'Hout(idfrac)', &
& 'Write out mass, sediment ', itrc, &
& TRIM(Vname(1,i))
END DO
...
I thought it must be "idBmas" instead of "idfrac" for the MASS instead. But this didn't solve the problem. In the output there is no mention of writing out bed mass. So somehow it is simply not processed and therefore doesn't matter what it says in the bed mass case.
does it report in the std out at the top with all the other zob, tcline, etc etc stuff, then it gets to sediment, it should report the sed classes, then does it say it will Hout().... and write out the sediment mass??
Sediment Parameters, Grid: 01
=============================
Size Sd50 Csed Srho Wsed Erate poros
Class (mm) (kg/m3) (kg/m3) (mm/s) (kg/m2/s) (nondim)
1 0.0000E+00 0.0000E+00 1.8000E+03 1.0000E-01 5.0000E-04 9.0000E-01
tau_ce tau_cd nl_tnu2 nl_tnu4 Akt_bak Tnudg
(N/m2) (N/m2) (m2/s) (m4/s) (m2/s) (day)
1 1.0000E-01 1.0000E-01 0.0000E+00 0.0000E+00 5.0000E-06 0.0000E+00
morph_fac
(nondim)
1 1.0000E+00
New bed layer formed when deposition exceeds 0.10000E-01 (m).
Two first layers are combined when 2nd layer smaller than 0.00000E+00 (m).
Rate coefficient for bed load transport = 0.50000E-01
F LtracerSponge(03Turning OFF sponge on tracer 03: mud_01
F LtracerSrc(03) Turning OFF point sources/Sink on tracer 03: mud_01
F LtracerCLM(03) Turning OFF processing of climatology tracer 03: mud_01
F LnudgeTCLM(03) Turning OFF nudging of climatology tracer 03: mud_01
T Hout(idTvar) Write out sediment01: mud_01
T Hout(idfrac) Write out bed fraction, sediment 01: mudfrac_01
T Hout(idSbed) Write out BED property 01: bed_thickness
T Hout(idSbed) Write out BED property 02: bed_age
T Aout(idTvar) Write out averaged sediment01: mud_01
I looked into all routines that could possibly be processing bed mass but I found nothing (except for the one in sediment_inp.h). I am lost here.
in sediment_inp.h there is a section of code
CASE ('Qout(iMmass)')
Npts=load_l(Nval, Cval, NCS, Ngrids, Lmud)
DO ng=1,Ngrids
DO itrc=1,NCS
i=idBmas(itrc)
Hout(i,ng)=Lmud(itrc,ng)
END DO
END DO
but that 6th line should be
Qout(i,ng)=Lmud(itrc,ng)
So the Hout was being overwritten. Can you find that section of code and modify
Hout(i,ng)=Lmud(itrc,ng)
to
Qout(i,ng)=Lmud(itrc,ng)