The basic processes to make the modified SWAT version work with SWAT Output Viewer has been covered in previous video. Many users wants to have a more detailed, step-by-step tutorial video so they could follow along to compile the viewer-compatible version themselves. So here it is.
Software Required
Source Tree to clone GitHub repository and merge changes.
Intel Fortran to compile the program.
Tortoise Git to resolve conflicts.
GitHub Repository
https://github.com/hawklorry/swat_sqlite
Steps
1. Clone swat_sqlite repository in SourceTree.
2. Create branch based on tag SWAT_Rev664 or SWAT_Rev627. Select them based on your modified version.
3. Copy your modified code to the local directory selected in step 1. Overwrite all existing files.
4. Commit all changes.
5. Merge corresponding SQLite branch. For SWAT v627, select SWAT_SQLITE_Rev627. For SWAT v664, select SWAT_SQLITE_Rev664.
6. Solve conflicts. Conflicts happens when same content is modified differently in two branch. You need to tell Git which version to use. There are various tools to help visually do that. The example here is using TortoiseGit.
7. Give an unique name to the result database in headout_sqlite.f.
8. Create Fortran project with Intel Fortran and add all Fortran source files.
9. Create Static Library for SQLite and add sqlite3.c, sqlite3.h and csqlite.c.
10. Set dependency for Fortran project in Solution Property window.
11. Setup Runtime library.
12. Compile and put the exe file to the swat_exe folder.
13. As the viewer doesn’t automatically support the modified versions, please contact me to enable running it in viewer .