How to run SWAT Source Code

1,799 views
Skip to first unread message

Bhabani Sankar

unread,
May 15, 2017, 9:06:50 AM5/15/17
to SWAT-user
Hello Everyone,

I want to run SWAT model (not the GUI Version); I have the source code with me and already set one project in intel Fortran compiler. I need to put all required input files which is different than the GUI version, of course. Has anyone run this model with source code? It will be very helpful, if anyone can guide me or suggest me some guidelines (or manual) to setup the model.

Thank you in advance.

Jim Almendinger

unread,
May 15, 2017, 9:47:47 AM5/15/17
to Bhabani Sankar, SWAT-user
SWAT is not run from its FORTRAN source code -- it's run from its compiled executable that reads and writes text files.  These text files are the same whether you write them yourself, or use the ArcSWAT or QSWAT interfaces.  The interfaces are so established and efficient at this that I have to think it's a waste of your time to re-invent writing all the input files yourself, unless I'm missing something obvious here. 
-- Jim


--
You received this message because you are subscribed to the Google Groups "SWAT-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swatuser+u...@googlegroups.com.
To post to this group, send email to swat...@googlegroups.com.
Visit this group at https://groups.google.com/group/swatuser.
For more options, visit https://groups.google.com/d/optout.


--
Dr. James E. Almendinger
St. Croix Watershed Research Station
Science Museum of Minnesota
16910 152nd St N
Marine on St. Croix, MN  55047
tel: 651-433-5953 ext 19

Bhabani Sankar

unread,
May 15, 2017, 10:05:46 AM5/15/17
to SWAT-user, er.bhab...@gmail.com
Thanks Jim. I know we can compile and run from the executable, which I did. I got the inputs by running MWSWAT. But I am getting some errors like below:

[SWAT_Test.exe has triggered a breakpoint.
The thread 0x5cc has exited with code 24 (0x18).
The thread 0x520 has exited with code 24 (0x18).
The thread 0x53c has exited with code 24 (0x18).
The thread 0x172c has exited with code 24 (0x18).
The program '[4612] SWAT_Test.exe' has exited with code 24 (0x18).]

You are right, but actually I am going to use this model for larger scale like continental scale. And I think GUI version can not handle that large scale of data and may take longer time. And also, I am interested only in Stream flow output so, I am planning to exclude sediment, nutrient and other routines.

Bandara Mudiyanselage Thilakarathne

unread,
May 16, 2017, 11:16:06 AM5/16/17
to SWAT-user
I think there is a limit on number of HRUs. However there are some presentations about a SWAT-GLOBAL model.

Kathy Breen

unread,
May 18, 2017, 5:37:58 PM5/18/17
to SWAT-user
Hi Bhabani,

I'm debugging a few issues myself using the source code.  You'll need to set the path for the location of your TxtInOut folder in whichever development environment you're using.  I'm using Visual Studio with the Intel Fortran Compiler.  To set your working directory in this IDE, go to Project > [Project Name] Properties > Debugging, then copy and paste the path to your in/out files in the space next to "Working Directory".  Then you can run the model, and it should work just like you've seen using the GUI. 

Kathy

Bhabani Sankar

unread,
May 23, 2017, 12:16:25 PM5/23/17
to SWAT-user
Hi Kathy,

Thank you for the help. I did what you suggested and it worked.:) Thanks again.

-Bhabani

Arnab Bandyopadhyay

unread,
Oct 6, 2020, 7:21:50 AM10/6/20
to SWAT-user
Hi,

I have just setup Intel Fortran compiler in VS 2015 shell. And I have downloaded the SWAT source code. Can anyone here tell me the steps to be followed to compile/run the SWAT Fortran codes using Intel Fortran compiler? I have tried three four different ways but all of them are giving me more than 5000 errors.

I need to do this as I need to modify the SWAT source code a bit for specific application.

Arnab
Reply all
Reply to author
Forward
0 new messages