SWAT-CUP run problem

207 views
Skip to first unread message

riad arefin

unread,
Oct 27, 2024, 9:37:42 PMOct 27
to SWAT-CUP
Dear Friends,

I am facing the following problem regarding my model calibration using SWAT_CUP. Could anyone please suggest something to get a proper solution to this problem:


Regards
-Riad-
Absolute_SWAT_Values.txt
SWAT-CUP problem.jpg
file.cio
var_file_name.txt
observed.txt
observed_rch.txt
SUFI2_extract_rch.def
var_file_rch.txt

Yinlong Huang

unread,
Oct 27, 2024, 9:42:02 PMOct 27
to swat...@googlegroups.com
Hi Riad,

In your file.cio file, in the top section, there’s a line saying “ending Julian day of simulation”. If your end year is leap year, then put 366 instead of 365 in that line.

Yinlong (David) Huang 
B.Sc Engineering(Civil), M.Sc, Ph.D student

Watershed Science and Modelling Laboratory

https://cms.eas.ualberta.ca/faramarzilab/

University of Alberta
Department of Earth and Atmospheric Sciences
Edmonton, AB  T6G 2E3, Canada
1-26 Earth Sciences Building


--
You received this message because you are subscribed to the Google Groups "SWAT-CUP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swat-cup+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/swat-cup/98716e04-06bb-423a-a189-b766fb461328n%40googlegroups.com.

riad arefin

unread,
Oct 27, 2024, 9:46:16 PMOct 27
to swat...@googlegroups.com
Hi  Yinlong,

Thank you for your reply.

My simulation period started from 01-01- 1990 to 08/31/2024. and the ArcSWAT output file is showing 244 at the end e.g., 08-31-2024. 

Do I need to change it 245?


Regards

Yinlong Huang

unread,
Oct 27, 2024, 9:55:25 PMOct 27
to swat...@googlegroups.com
Hi Riad,

I find it a bit tricky because in file.cio, you need to specify both number of years and ending Julian day of the simulation year, but in your case, you have extra few months. The end days should be 244 and you are correct there, I’m just not sure how to incorporate the extra few months. 

I can’t view file.cio file now because I’m using my phone, but if you’re starting from 1990-2024, I’m assuming that the number of years you put here is 34 or 35 years, but because your simulation ended in the middle, year 2024 is technically not simulated fully. Maybe try to run it until the end of 2023, and in this case, change your number of years into 34, and ending Julian day into 365 (also remember to change the SUFI2_extract_rch.def file) and see if error message shows up again?


Yinlong (David) Huang 
B.Sc Engineering(Civil), M.Sc, Ph.D student

Watershed Science and Modelling Laboratory

https://cms.eas.ualberta.ca/faramarzilab/

University of Alberta
Department of Earth and Atmospheric Sciences
Edmonton, AB  T6G 2E3, Canada
1-26 Earth Sciences Building

riad arefin

unread,
Oct 27, 2024, 10:23:07 PMOct 27
to swat...@googlegroups.com
Hi,

Interesting! However, same issue!



Regards

image.png

Yinlong Huang

unread,
Oct 27, 2024, 11:07:42 PMOct 27
to swat...@googlegroups.com
Hi Riad,

Can you share the screenshots for your file.cio, SUFI2_extract_rch.def, observed_rch.txt and observed.txt file?



riad arefin <riad...@gmail.com> 于2024年10月27日周日 20:23写道:


--

riad arefin

unread,
Oct 28, 2024, 6:24:41 AMOct 28
to swat...@googlegroups.com
Hi Yinlong,

These are my files!


Thanks
-Riad-

observed.txt
observed_rch.txt
file.cio.jpg
SUFI2_extract_rch.def.jpg

Yinlong Huang

unread,
Oct 28, 2024, 2:07:08 PMOct 28
to swat...@googlegroups.com
Hi Riad,

Your files look good to me. Not sure why this is happening. You did have some missing days in your obs files but I see that you got them labeled correctly. When you run the model if you ends at 12-31-2023, maybe you want to change your observed.txt and observed_rch.txt file so that the observed files are consistent with your time span, and then give it another try? I just feel that it has something to do with your observed file. So maybe try another time, set your number of simulation to be 34 years, ending Julian day to be 365, and save a copy of your original observed files, and create new sets of observed files that ends at 2023-12-31.  


riad arefin <riad...@gmail.com> 于2024年10月28日周一 04:24写道:

ambi...@gmail.com

unread,
Oct 29, 2024, 5:17:41 AMOct 29
to SWAT-CUP
Hi Riad,

Since you are simulating from 1990 until 2023 ( i assume you have omitted 2024), the number of years for simulation will be 34 and for extraction, excluding the warm up period, it will be 31 years of data which will give you 11322 data points for daily data (24*365+7*366). please check the observed.rch file.


ambili

riad arefin

unread,
Oct 30, 2024, 1:37:00 AMOct 30
to swat...@googlegroups.com

Hi Ambili,

I did not get your point. As my model have started simulation from 1993 without warm up therefore i need to arrange the observed data for calibration from 1993 to 2024 like this.

Regards
-Riad-


--
You received this message because you are subscribed to the Google Groups "SWAT-CUP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swat-cup+u...@googlegroups.com.

Yinlong Huang

unread,
Oct 30, 2024, 1:42:04 AMOct 30
to swat...@googlegroups.com
Hi Riad,

I reviewed your observed file again and I realized that what Ambili meant was that your observed file actually started in 1990, not 1993. I took a look at your observed file, and both your observed.txt and observed_rch.txt starts from 1990-01-01, not 1993-01-01, and because you need to exclude your warm-up period in your observed file, you need to eliminate the first 3 years of observation data.

riad arefin <riad...@gmail.com> 于2024年10月29日周二 23:37写道:

riad arefin

unread,
Nov 5, 2024, 10:25:34 PMNov 5
to swat...@googlegroups.com
HI,

I rearranged the data and tried to run it with 2 iteration numbers but it still gave an error.

I ran ArcSWAT from 1990 up to 2023. then run the SWAT exe file in the SwatCUP folder. then ran the SWAT CUP project but still a problem.



Regards
-Riad-


image.png

riad arefin

unread,
Nov 6, 2024, 6:46:29 PMNov 6
to swat...@googlegroups.com
Hi Yinlong,

Still I am facing problems. I am attaching my files here. Observed data has been arranged from 1993 to 2023. I checked all the arrangements.


Regards
-Riad-

image.png




par_inf.txt
SUFI2_extract_rch.def
file.cio
var_file_name.txt
SUFI2_swEdit.def
observed_rch.txt
var_file_rch.txt
observed.txt

Yinlong Huang

unread,
Nov 6, 2024, 9:25:51 PMNov 6
to swat...@googlegroups.com
Sorry, I really have no idea here. There's another post that posted exactly the same problem you are facing here. I suggest you reach out to Dr. Karim Abbaspour. 

riad arefin <riad...@gmail.com> 于2024年11月6日周三 16:46写道:

riad arefin

unread,
Nov 9, 2024, 8:52:04 AMNov 9
to SWAT-CUP
Hi Guyes,

I arranged all files newly. I corrected all data from climate to model.

However, same problem. I developed the model for shorter time like 5 years, arranging climate data for this model, using Arcswat then calibrated using SWAT-Cup. in this case it worked. 

However, when I developed the ARCSWAT model from 1990 to 2023, arranging all climate data accordingly, then again leap year problem. 

I saw climate data, SWAT output data, Observed data arrangement all are correct. Even, I simulated for 10 observed data and for one variable.

I am attaching the error. 

I need help to get out from this problem

Regards
-Riad-
2.jpg
1.jpg

ambi...@gmail.com

unread,
Nov 11, 2024, 10:02:34 AMNov 11
to SWAT-CUP
Hi Riad,
You may have to run your model for a complete year, if you don't have data till 365 days in 2023, please run it till 2022 only. Your file.cio says the run starts from 1990 with 3 years of warm up, so the observed.txt should start from 01/01/1993. That will give you 11322 datapoints. please see the attached file.

ambili

date.xlsx

riad arefin

unread,
Nov 18, 2024, 8:14:44 AMNov 18
to SWAT-CUP
Dear Yinlong,

I was facing the prolem now fixed that. my model is running smoothly.

However, I did not understand how to fix the variable and observed stations. Note: I have 42 watersheds. I want to calibrate for two variables, namely, stream flow (column 7) and NO3CONC (mg/l) (column 50). Among these watersheds, I have observed stream flow data for calibration for 11 points and two points for NO3CONC.

 How can I calibrate? Do I need to calibrate these points individually? 

I am using the following parameters for the calibration:

r__CN2.mgt -0.4 0.2 v__ALPHA_BF.gw 0 0.6 v__GW_DELAY.gw 90 200 v__GWQMN.gw 0 2 v__GW_REVAP.gw 0 0.2 v__RCHRG_DP.gw 0 1 v__CH_N2.rte 0 0.3 v__CH_K2.rte 5 100 v__ALPHA_BNK.rte 0 1 r__SOL_AWC(1).sol -0.2 0.4 r__SOL_K(1).sol -0.8 0.8 r__SOL_BD(1).sol -0.5 0.6 v__SMFMX.bsn 0 20 v__SMFMN.bsn 0 20 v__SMTMP.bsn -5 5 v__SFTMP.bsn -5 5 v__TIMP.bsn 0 1 v__TLAPS.sub -20 20 v__PLAPS.sub -300 300 v__ESCO.hru 0 1 v__SNOCOVMX.bsn 0 400 v__SNO50COV.bsn 0.1 0.6


I need your suggestion.


Regards
-Riad-

Yinlong Huang

unread,
Nov 18, 2024, 12:05:42 PMNov 18
to swat...@googlegroups.com
What I would usually do is to calibrate the variables from upstream to downstream. Because both your variables are from output.rch file so I suppose that you can calibrate them at once without separating these two variables, but I never tried that before. 

To calibrate the model, find your most upstream station and start there. The idea is that you need to regionalize your subbasins, so if you have the most upstream station, find the subbasins that all drains to that station, and calibrate these stations all together. Then, move downstream one by one, find other subbasins that drains to downstream station and calibrate them all at once. 

Another thing that I would pay attention on is soil and land cover, especially soil, meaning that if there are say two different soil types that drains to one station, very likely that you want to further separate that into different soil zones, because if you calibrate parameters such as CN, ALPHA_BF, sol_BD and sol_awc, they are clearly different on one soil than the others.

In short, start from upstream, and maybe pay attention on soil and land characteristics to properly regionalize your subbasins. 

riad arefin <riad...@gmail.com> 于2024年11月18日周一 06:14写道:

riad arefin

unread,
Nov 18, 2024, 3:21:03 PMNov 18
to swat...@googlegroups.com

Dear Yinlong,

Thank you for your reply. I think it is better solution for me. However, I am feeling confused.

Could you please explain with example?

I am setting an example here for my study area.

In my study area, there are, 4 branches in upstream.

First Branch:

Where Branch 1 most left side. Here 3, 4, 7,8 , 42 (reservoir point therefore single point),  9,10, 41 and 11, where 3 and 4 contribute the 7 later 7 and 8 to the 42 no point. 42 again contributing to the 9. Again 9 (with 3,4,7,8,42) and 10 contributed the 41 later 41 contributed 11. Here, end up the 11. Note: conjugal points (3, 4, 7, 8, 9, 10)  are the main point but single points (42, 41, 34)  are dams that are added manually to generate the watershed. You can find these explanations in the figure.  

Second Branch:

Then the second branch just right side of the first branch, it is consists of 40, 5, 6, 39, 37, 38, 36 are the points for this branch from up to down. Final point 12.

Confluence this FIRST and SECOND branch again meet at 34 point.

 

For calibration:

For the first branch: for 3 and 4 there are calibration data for stream flow,  also for 7, 9 and 10.

For the second branch, there is no calibration point.


But, where these two branches (First and second) meet e.g., 34 no point, there is an observed point for calibration. Figure added. 


And for 3 and 11 there are only NO3CON mg/l observed data available for calibration.

 



Could you please explain kindly? 


Regards

-Riad_


Problem Example.png

Yinlong Huang

unread,
Nov 18, 2024, 3:34:52 PMNov 18
to swat...@googlegroups.com
Your branch doesn't matter, the key point is where are your hydrometric stations. For example, if your most upstream hydrometric stations are located at the outlet of 42 and 37, which are located on 2 different branches, then you can start calibrating with either of them because they won't affect each other. In this case, consider 3 4 7 8 42 as a group, 5 6 37 39 40 as another group, and you can calibrate these two simultaneously.

However, in another case, if your hydrometric stations are located at, say 42 and 34, then you need to consider everything upstream of subbasin 42 as a group, calibrate this region first, then move downstream to 34, which includes all other subbasins (except for the ones that are upstream of sub 42 which you have already calibrated). In this case, because you are considering too many subbasins as one region, you better further refine the subbasins into different smaller groups, which can be dependent on soil, or land use. 

riad arefin <riad...@gmail.com> 于2024年11月18日周一 13:21写道:

riad arefin

unread,
Nov 18, 2024, 4:20:58 PMNov 18
to swat...@googlegroups.com
Dear Yinlong,

Great! 
Thank you for your clear response.

Regards
-Riad_

riad arefin

unread,
Dec 3, 2024, 1:24:00 AM (8 days ago) Dec 3
to SWAT-CUP
Dear Yinlong,

I tried calibrating with multiple points in SWAT CUP. However, it was difficult, and there was no improvement. Therefore, I took a single point. I used the following parameters for stream flow calibration purposes:

v__CN2.mgt    -0.2   0.2
v__ALPHA_BF.gw             0.1       0.9
v__GW_DELAY.gw            0.0      500.0
v__GWQMN.gw                0.0       2.0

v__SMTMP.bsn    -5   5
v__SFTMP.bsn     -5   5
v__TLAPS.sub          -10    -3
v__SOL_AWC().sol    -0.2   0.2
v__OV_N.hru          0.01   30
v__PLAPS.sub    -10   -3
v__SMFMX.bsn    1   10
v__SMFMN.bsn    0   5
v__TIMP.bsn    0.01   1
V__SMTMP.bsn    -5   5

During the simulation time, I used 200 steps for each iteration. Then, I adjusted the best parameters range to see if it exceeded or lowered the first used range. However, after the sixth iteration, I found the following graphs, after this step, there was no improvement. After the 6th step, the NS value is -0.47, this value did not change from the 1st iteration to the 6th iteration.

Could you give me any suggestions? 

Regards
-Riad-




Screenshot 2024-12-03 002209.jpg

Oscar M Cabezas-Nivin

unread,
Dec 8, 2024, 2:04:13 PM (2 days ago) Dec 8
to SWAT-CUP
Hi,

I do not know why you are getting the 95PPU in the period where you do not have any observations, maybe, due to this, after simulating your model and assessing the performance of it the overall performance decreases.

About your model results, it seems that you need to increase infiltration to obtain an accurate result of your dry season and increase the runoff parameters-related to catch the peaks (which are quite large, >1000m3/s). In my experience, SWAT is quite decent calibrating flow at daily scale, but it is far better at monthly scale.

Regards,
Oscar M Cabezas Nivin
Reply all
Reply to author
Forward
0 new messages