SWAT source code modification

622 views
Skip to first unread message

Xiaohua Lin

unread,
Sep 8, 2021, 4:32:53 PM9/8/21
to SWAT-user
Hi,

I'm a begginer for compiling SWAT source code. I have a question about the working flow of SWAT code modification.

If I'd like to modify the source code, i.e. I want to improve the swat model from some aspects, First is to modify the source code then compile the source code by (VS, this is the tool I am using), if the compile process works sucessfully, the executable of SWAT will be generate. Is this the modified  executable? and can I use ArcSWAT run the simulation by choosing this executable to obtain my results of the modified model?



Kind regards,
Xiaohua
Message has been deleted

abolfazl heydari

unread,
Oct 24, 2021, 8:51:57 AM10/24/21
to SWAT-user
Hi,
Dear Xiaohua,

Your work and your objective are so great. I am working with the source code of SWAT. You had modified the source code of SWAT according to your scenario, now, you should build your .exe file. It is possible for you in 4 modes: 1)Debug x64,  2)Debug x32, 3)Release x64, and 4)Release x32. 
I had done all of these with Microsoft Visual Studio (with the Compiler of Fortran). Also, after you make your .exe file, you should run it in the TextInOut file.

Yours Sincerely,
Abolfazl Heydari

nhn...@gmail.com

unread,
Apr 26, 2022, 10:26:30 AM4/26/22
to SWAT-user
Hi Abolfazl,

Could you please show me a starting point to modify the source code? I am trying to simulate pesticide fate and transport in wetlands/ponds. But the current version is not capable. I want to add the same codes of fate and transport in lakes/reservoirs. If you have any ideas, could you please share me? 

Regards,
Fatma Nihan  (nhn...@gmail.com)

abolfazl heydari

unread,
May 17, 2022, 6:04:23 PM5/17/22
to SWAT-user
Hi again,
What is your version? For adding your code, you should add it to the code of Subbasin. If you need more information, please ask your questions clearly and thoroughly.

yas sabzevari

unread,
Mar 27, 2025, 11:50:48 AM3/27/25
to SWAT-user
Hello to all,

I want to compile and modify SWAT snom.f subroutin, I want first read original subroutin, then apply may changes in that and, compile again. in first I have an error:
"Cannot open module file 'parm.mod' for reading at (1): No such file or directory",
Can anybody guide me please? is my direction incorrect?


abolfazl heydari در تاریخ چهارشنبه ۱۸ مهٔ ۲۰۲۲ ساعت ۰:۰۴:۲۳ (UTC+2) نوشت:

Nancy B. Sammons

unread,
Mar 28, 2025, 7:47:28 AM3/28/25
to yas sabzevari, SWAT-user

Yas Sabzevari:

I can help you with compiling, but I would strongly suggest that you use the SWAT+ model versus SWAT.  This models’ code has been improved and is easier for developers to follow and add code.  There are interfaces to build projects and Google groups for support.  I have included a link below for your review.  If possible, it would beneficial to switch to SWAT+. 

Have a good day,

Nancy

 

https://swat.tamu.edu/software/plus/

 

From: swat...@googlegroups.com <swat...@googlegroups.com> On Behalf Of yas sabzevari
Sent: Thursday, March 27, 2025 3:54 AM
To: SWAT-user <swat...@googlegroups.com>
Subject: [SWAT-user:13111] Re: SWAT source code modification

 

You don't often get email from yas.sa...@gmail.com. Learn why this is important

--
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 view this discussion visit https://groups.google.com/d/msgid/swatuser/527f4500-56c4-4836-9931-84b40b13412bn%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages