I am currently running simulations for the Bay of Bengal that include runoff from 15 rivers. When the PSOURCE_NCFILE and PSOURCE_NCFILE_TS Keys are activated, the model fails with the following error:
READ_INP ERROR while reading block with keyword 'psource_ncfile'
I generated the river forcing file using the latest make_rivers.py script with GLOFAS data. However, I am unable to determine why the model is producing this error. My model resolution is 4 km.
When these keys are not activated, the model runs successfully, which suggests that the issue is related to the river forcing configuration. I also attempted using the alternative #psource option, but encountered similar issues.
I would greatly appreciate any suggestions or guidance to resolve this problem.
Which CROCO version are you using? I also use rivers in my domain and I remember that once there was an issue with the specification of the dates. Is “USE_CALENDAR” defined in your cppdefs.h? And in your river netcdf file, how do you specify the units in your “qbar_time”, “temp_src_time”, and “salt_src_time”?
Another suggestion is to check the actual values themselves in the river netcdf files, if the values have the proper units and if there are any unrealistic values or even NaNs generated in the process of generating the river file.
I am using 128 rivers (n_qbar = 128), and I have provided the corresponding configuration in my input files.
My concern
I suspect that the make_river.py script may be selecting river locations that fall on land grid points (i.e., where mask_rho = 0). This could potentially cause inconsistencies when CROCO reads the psource_ncfile.
The runoff file was generated automatically using make_river.py (I have used the latest annd previous versions of make_river.py and still faced the same issue)
It seems there may be a misconfiguration in your param.h. In particular, Msrc is not set to 128. By default, the number of rivers is 30, so you need to increase this value in your case. This parameter can be found around line 364 of param.h.
Regarding the river location, the grid point itself can be masked. What actually matters is the cell face through which the river flows. Here is a small sketch to clarify this point.
Before i also attended PYtools seminar. what i missing.
I also getting similar kind of error with .py and .m. because my number of river 64 (i want add more river and channel). what i need to do. (i also have many tracrs measurements)
218 153 1 -1 T T 28.04745 20.6922
220 158 1 -1 T T 28.04745 20.6922
219 160 1 -1 T T 28.04745 20.6922
219 162 1 -1 T T 28.04745 20.6922
220 167 1 -1 T T 28.04745 20.6922
221 168 1 -1 T T 28.04745 20.6922
222 172 1 -1 T T 28.04745 20.6922
226 174 1 -1 T T 28.04745 20.6922
226 175 1 -1 T T 28.04745 20.6922
227 176 1 -1 T T 28.04745 20.6922
227 177 1 -1 T T 28.04745 20.6922
229 178 1 -1 T T 28.04745 20.6922
231 182 0 1 T T 28.04745 20.6922
230 182 0 1 T T 28.04745 20.6922
Then i received in slurm . Is there any “TYPO”
Computing for Y1M1
Thu Apr 9 16:41:58 IST 2026
Thu Apr 9 16:42:17 IST 2026
Test croco_Y1M1.out
Warning: month not finished properly
READ_INP ERROR: A total of 1 configuration errors discovered.
Resolution
The issue was not due to formatting, encoding, or timestep errors.
The root cause was a mismatch in the expected number of tracers (NT). I had diagnostic tracer options (DIAG_TS) enabled in cppdefs.h, which increased NT beyond what I accounted for in the psource block.
After:
Disabling DIAG_TS, and
Ensuring NT = 2 (for temperature and salinity only)
the error was resolved.
Conclusion
The psource block is highly sensitive to the compile-time definition of NT. Any mismatch between NT and the number of values provided for Lsrc and Tsrc will trigger a parsing failure.
Thanks to everyone who helped; the issue is now resolved.
This read_inp.F problem is sometimes sorted and sometimes not due to Virtualbox (java base). because some time it’s create very large scale stratification in river mouth (like BBL use). some time use WENO9 and some CRWENO or TENO. so the problem is very complex (because its higher order).