How to specify the sediment source? (Solved)

Hello everybody

Actually have configured successful CROCO model in at area, with this

Climatology configuration

Grid nested offline

River (PSOURCE) : only Temp and Salt specified

Now I want to add sediment at this configuration. But I don’t know how specify the source of sediment (in this case the source is the river), type of sediment (silt) and variability a long time.

Can help me?


Hi Carlos,

In cppdefs.h you have to activate both SEDIMENT and BBL



define BBL (optional, but recommended)

In make sure you have at least five tracer T in your primary history and average fiels, e.g.

primary_history_fields: zeta UBAR VBAR U V wrtT(1:NT)
T T T T T T T T T T 25*F

these 5 extra are for Temp, Salt, and the three components of the simple sediment module in CROCO

also in the psource part

add three T’s one for each of the three sediment components, in each line that defines a river. You have to define also the concentration of each component (sand/silt/clay) at each river, but I am not sure of which comes first nor the units.

psource: Nsrc Isrc Jsrc Dsrc Qbar [m3/s] Lsrc Tsrc
3 54 1 200. T T T T T 5. 0. .1 .2 .3
3 40 0 200. T T T T T 5. 0. .1 .2 .3

This value will be held constant for the duration of the run. You can do monthly runs and each month change the values, or try to use the PSOURCE_NCFILE, but I am not sure if it has been adapted to addo temporal variability of the sediments

Thank you so much, I will try

Hi Andrés and the whole community

I did what you recommended but i had a few problems.

I defined SEDIMENT, BBL , PSOURCE on my simulation and i modified specifying tracers. I have this problem: " READ_INP ERROR while reading block with keyword ‘psource’." I tryed many things but nothing worked. I attach the files out_Psorce_Sediment.txt cppdefs_Psorce_Sediment.h

I did can not resolve this problem then i decided use make_runoff.m to create I defined SEDIMENT, BBL , PSOURCE, PSOURCE_NCFILE_TS on my simulation and i modified specifying psource_ncfile. I have this problem: " STEP2D: ABNORMAL JOB END BLOW UP " . I attach the files. out_ncPsource_Sediment.txt cppdefs_ncPsource_Sediment.h

Finally I defined only SEDIMENT and undefine BBL. with this configuration the simulation did successful but it is not what i expected. The river is not sediment source, apparently only the bottom sediment is moving.
I attach the files. out_ncPsorce_Sediment_NOBBL.txt cppdefs_ncPsorce_Sediment_NOBBL.h. C:\fakepath\Screenshot from 2021-02-17 10-38-33.png C:\fakepath\Screenshot from 2021-02-17 10-39-18.png

Now my questions are:
How do I add a new tracer in make_runoff.m? (actually the script only add T,S or/and NO3)
What name should the sediment tracer variable have?

Note: in line 234 define that is a input file (i not modified nothing)

I attach general files used in my

Thank you

Hi Carlos, a few comments

  1. If you get this:

" " READ_INP ERROR while reading block with keyword ‘psource’." "

the error is in the file. Please post it.

  1. You can´t activate


yo need to activate


but that might not be the problem there. A blowup is generally a CFL problem. Decrease the time step (What is the
flow specified for your river(s)? What is your grid size?

Yes, you need a file if you activate SEDIMENT in the cppdefs.h

Hi Andrés

this is my file for this configuration model: I defined SEDIMENT, BBL and PSOURCE

2.- on my second try I actived SEDIMENT, BBL, PSOURCE_NCFILES and PSOURCE_NCFILE_TS

this is my and this is my cppdefs.h cppdefs.h and this is mi out of model 16135786999468359.txt

I specified one river whit variable caudal (~500 m3/s) in a Netcdf file. my grid size is of 54 x 75.


Hello everybody

Thanks to Andres and the team of CROCO developers. Whit your help i did a configuration successfull.

suggesting: in current version of CROCO (v1.1) it is not possible to read sediment variable from for this reason I suggest that you do not use this option. I tried but had many problems.

1.- define the following in your cppdefs.h


#define BEDLOAD
#define PSOURCE

2.- in modify this section

psource: Nsrc Isrc Jsrc Dsrc Qbar [m3 / s] Lsrc Tsrc
53 51 0 -10000. T T T T 20. 2. 9.9 9.8

where: Nsrc = Number of sources or rivers (1), Isrc and Jsrc = source position in xi and eta (53 51), Dsrc = source direction (0 = zonal), Qbar = flow (-10000, negative value indicate that flow is north / south), Lsrc = tracers (Temp, Salt, Sand_1, Sand_2) and Tsrc = tracers value (20. 2. 9.9 9.8).

3- in modify value of CSED

0.125 0.0 2650. 9.4 25.0e-5 0.05 0.14 0.4 0.4
0.050 0.0 2650. 1.6 4.0e-5 0.01 0.14 0.6 0.6

Change both value to zero. with this change i avoided a lot problems in my model.
Clarifying that this configuration it is for when the sediment comes from a river.