About the SWAT-CUP run issue.

126 views
Skip to first unread message

Diveshwar Shah

unread,
Oct 27, 2024, 1:29:29 PMOct 27
to SWAT-CUP
I have been trying to run SWAT-CUP but have been facing two problems. One as SWAT is not recognized. And other is having 3 jubilant years in my weather data years. Did anyone face this issue. If someone could help me out with this, it will be of great help. Thank You.

Your Sincerely,
Diveshwar Shah
SWATCUP 1st error.png

Yinlong Huang

unread,
Oct 27, 2024, 1:37:31 PMOct 27
to swat...@googlegroups.com
Hi Diveshwar,

You need to copy the swat.txt file from your SWAT program folder (usually located in C drive) into the swat-cup project folder. Assuming you are using swat_64rel.exe, then you just go to the program folder and copy and paste it into the swat cup project folder. For your second question, in your file.cio file, if you have say 366 days at the end of your simulation (for example, if your study period ends in 2004, 2008, etc.,) then you need to set your number of days in your last year in your file.cio file (near the beginning).

Diveshwar Shah <shahdiv...@gmail.com> 于2024年10月27日周日 11:29写道:
I have been trying to run SWAT-CUP but have been facing two problems. One as SWAT is not recognized. And other is having 3 jubilant years in my weather data years. Did anyone face this issue. If someone could help me out with this, it will be of great help. Thank You.

Your Sincerely,
Diveshwar Shah

--
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/e0f98ed8-80d9-4545-aa56-ef4e7a78ce96n%40googlegroups.com.


--

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

Yinlong Huang

unread,
Oct 27, 2024, 1:37:47 PMOct 27
to swat...@googlegroups.com
Sorry I meant swat.exe file.

Diveshwar Shah <shahdiv...@gmail.com> 于2024年10月27日周日 11:29写道:
I have been trying to run SWAT-CUP but have been facing two problems. One as SWAT is not recognized. And other is having 3 jubilant years in my weather data years. Did anyone face this issue. If someone could help me out with this, it will be of great help. Thank You.

Your Sincerely,
Diveshwar Shah

--
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/e0f98ed8-80d9-4545-aa56-ef4e7a78ce96n%40googlegroups.com.

Yinlong Huang

unread,
Oct 27, 2024, 1:38:31 PMOct 27
to swat...@googlegroups.com
And also remember to change the .exe file name. If you copied swat_64rel.exe in your swat-cup folder, then you need to change the name into swat.exe

Diveshwar Shah <shahdiv...@gmail.com> 于2024年10月27日周日 11:29写道:
I have been trying to run SWAT-CUP but have been facing two problems. One as SWAT is not recognized. And other is having 3 jubilant years in my weather data years. Did anyone face this issue. If someone could help me out with this, it will be of great help. Thank You.

Your Sincerely,
Diveshwar Shah

--
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/e0f98ed8-80d9-4545-aa56-ef4e7a78ce96n%40googlegroups.com.

sami ayele

unread,
Oct 29, 2024, 2:36:45 PMOct 29
to swat...@googlegroups.com

Hi for the first problem copy swat2012.exe file from swat and copy it into swatcup program file then rename it to swat.exe its works for me


--

Diveshwar Shah

unread,
Nov 3, 2024, 1:48:34 PMNov 3
to SWAT-CUP
Thank you for the response. Due to your guidance i was able to resolve the 1st problem but still getting the leap year error even after using 366 as no of days in a year. Hope to hear from you soon. Thank you.

Your Sincerely,
Diveshwar Shah

Screenshot 2024-11-03 134628.png
2nd error.png
swatcup.png

Yinlong Huang

unread,
Nov 3, 2024, 1:59:15 PMNov 3
to swat...@googlegroups.com
Hi Diveshwar, 

Someone posted a similar post that has exactly the same issue you are having here. I wasn't able to solve this because I never encountered this before. Just a few things that you might want to check:

1. Do you have any warm-up periods? I noticed that your observed file starts from 2014-1, but if you have warm-up periods, then your observed file should exclude the warm-up periods. For example, if you have 3 years of warm up period, then your first observed data point should start from 2017. Just in case if you are not setting it correctly. 

2. Given that you have 10 years of simulation, your end year should be 2023, not 2024, so your ending Julian day should be 365, not 366. 



Diveshwar Shah <shahdiv...@gmail.com> 于2024年11月3日周日 11:48写道:
--
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.

Diveshwar Shah

unread,
Nov 3, 2024, 2:12:36 PMNov 3
to swat...@googlegroups.com
Hey Yinlong,
I have taken a date from 2010 and have a warm up period of 4 years so stimulation starts from 2014 and ends at mid of 2024. which has 2 jubilant years in between. If possible could you please look into my file and let me know if there is any
  problem with it. Hope to hear from you soon. Thank You.

Your Sincerely,
Diveshwar Shah

Yinlong Huang

unread,
Nov 3, 2024, 2:14:33 PMNov 3
to swat...@googlegroups.com
Ok then in that case, in your file.cio, your starting year should be 2010, not 2014. 

Diveshwar Shah <shahdiv...@gmail.com> 于2024年11月3日周日 12:12写道:

Diveshwar Shah

unread,
Nov 3, 2024, 2:19:30 PMNov 3
to swat...@googlegroups.com
I tried that too with 2010 but faced the same problem. Thank you.


Yinlong Huang

unread,
Nov 3, 2024, 2:20:32 PMNov 3
to swat...@googlegroups.com
In that case then I'm not sure what's the problem. The other post had the same problem and I couldn't figure out why.

Cheers

Diveshwar Shah <shahdiv...@gmail.com> 于2024年11月3日周日 12:19写道:

Diveshwar Shah

unread,
Nov 3, 2024, 2:21:51 PMNov 3
to swat...@googlegroups.com
Could you ones please look into the zip file and see if any changes have to be made? Hope to hear from you soon. Thank you.

Yours Sincerely,
Diveshwar Shah

Yinlong Huang

unread,
Nov 3, 2024, 2:38:23 PMNov 3
to swat...@googlegroups.com
Ok, a few things to notice here:

1. Since your simulation ends on day 121 of 2024, your ending julian day is not actually 365 or 366, but it's in the middle of 2024, so I checked your pcp1.pcp file and turns out your climate data also stopped at day 121, the middle of 2024. I wasn't sure how it works but if it does work this way,then in your file.cio, you should put 15 years as number of years simulated, and your ending julian day should be 121, not 365 nor 366.

2. There's an inconsistency of your variable extraction and file.cio. In your file.cio, your IPRINT is set to be 2, meaning that you are printing yearly output, but in your SUFI2_extract_rch.def, you are printing daily output. Maybe make them consistent, and if you want to print daily output, change the IPRINT in file.cio into 0, which would give you daily output. 

So far these are the things I noticed. 

Diveshwar Shah <shahdiv...@gmail.com> 于2024年11月3日周日 12:21写道:

Diveshwar Shah

unread,
Nov 3, 2024, 2:47:48 PMNov 3
to swat...@googlegroups.com
After I made the changes you suggested it got stuck at variable #1 and not moving ahead and not even showing any errors. Hope to hear from you soon. Thank you.

Your Sincerely,
Diveshwar Shah

blabla.png

Yinlong Huang

unread,
Nov 3, 2024, 2:57:21 PMNov 3
to swat...@googlegroups.com
Ok, now the leap year issue is resolved. Maybe try this: instead of simulating until day 121 of 2024, change it to the end of 2023. In that case, change your number of years into 14, ending julian day to be 365, and save a copy of your existing observed.txt and observed_rch.txt file and rename them just in case if you need them later. Create new observed.txt and observed_rch.txt, and instead of having your last observed data point to be day 121, 2024, make it day 365, 2023 (delete the last 121 observed data points for both files), and remember to change the number of data points in observed.txt file. Usually, when I see this kind of message, it means that your extraction order is wrong (say if you are extracting 3 outflow files and they are labeled as 1,3,5, they should be labeled in an increasing order), but since you only have 1 variable to be extracted here, that's not the case. Try this first and let's see. 

Diveshwar Shah <shahdiv...@gmail.com> 于2024年11月3日周日 12:47写道:

Diveshwar Shah

unread,
Nov 3, 2024, 3:07:07 PMNov 3
to swat...@googlegroups.com
After making the changes as you suggested, I'm still facing the same error. Hope to hear from you soon. Thank You.

Yinlong Huang

unread,
Nov 3, 2024, 3:14:28 PMNov 3
to swat...@googlegroups.com
Try deleting this line here:
image.png

There are 2 lines here, try deleting one of them.



Diveshwar Shah <shahdiv...@gmail.com> 于2024年11月3日周日 13:07写道:

Diveshwar Shah

unread,
Nov 3, 2024, 3:25:37 PMNov 3
to swat...@googlegroups.com
I deleted both the lines and changed the end stimulation year to 2023 but still the same. Hope to hear from you soon. Thank you.

Your Sincerely,
Diveshwar Shah


Yinlong Huang

unread,
Nov 3, 2024, 3:26:21 PMNov 3
to swat...@googlegroups.com
Don't delete both lines, just one of them. 

Diveshwar Shah <shahdiv...@gmail.com> 于2024年11月3日周日 13:25写道:

Diveshwar Shah

unread,
Nov 3, 2024, 3:29:12 PMNov 3
to swat...@googlegroups.com
Even after just deleting one line. Still the same. 


Yinlong Huang

unread,
Nov 3, 2024, 3:35:27 PMNov 3
to swat...@googlegroups.com
Then I'm not sure why that's the case. There was one post in the past that resolved the issue with this method but I'm not sure why this is not working now.

Diveshwar Shah <shahdiv...@gmail.com> 于2024年11月3日周日 13:29写道:

Diveshwar Shah

unread,
Nov 3, 2024, 3:37:45 PMNov 3
to swat...@googlegroups.com
Could you please try running that zip file with the ways you asked me to because it didnt work with me. It would be of great help if I could get to figure out the problem. Hope to hear from you soon. Thank you.

Your Sincerely,
Diveshwar Shah
Reply all
Reply to author
Forward
0 new messages