Compile and Debug SWAT with gfortran and Eclipse

As a SWAT modeller and programmer, it’s very natural that I want to go deep into the SWAT source codes whenever questions come out. And again, it would be better to run SWAT live and look into values of all the variables to help trouble shooting. To do this, there are two options: commercial Intel fortran compiler and free gfortran. It’s hard to say which one is better. I chose gfortran for its price, freedom, cross-platform and multi-language compiling ability. For some reason, not all SWAT source code files follow the same standard. Compiling SWAT with gfortran is not as easy as Intel fortran. After some research, it comes out the best way to compile SWAT with gfortran. All the necessary steps are documented in one single user guide document with the hope it would be helpful.

All the efforts was recorded in following posts. And here are some important links.

Compile and Debug SWAT with GFortran and Eclipse (Windows version)

https://docs.google.com/document/d/16Do2U1_v4mZZBOV0hmcs6Gh1UvAUAXOMidpB-SE203A/edit?usp=sharing

Makefile

https://drive.google.com/file/d/0B16YhFB_9MejSG15ai0zYS1fMkU/edit?usp=sharing

Makefile Generator

https://drive.google.com/file/d/0B16YhFB_9MejZkxiakdLTHhMVlU/edit?usp=sharing

Posts

February 28, 2014 Single Document about Compiling and Debugging SWAT with GFortran and Eclipse

February 18, 2014 Makefile Updated – 1) No Need to Modify main.f any more; 2) A Single Makefile; 3) 64-bit Build

February 2, 2014 SWAT Makefile Updated – Ignore Underflow

January 28, 2014 MinGW Installation Guide for SWAT Debugging

January 28, 2014 Debug SWAT in Eclipse – Utilize Makefile

January 24, 2014 SWAT Makefile Updated – Stop running when overflow happens

January 23, 2014 Makefile – Compile SWAT using gfortran without modification

January 5, 2014 Compile and Run SWAT with Photran + MinGW – the easiest way to remove mathematical errors from SWAT

3 Replies to “Compile and Debug SWAT with gfortran and Eclipse”

  1. Hello,
    Thanks for sharing. This is very helpful for my study.
    I successfully modified swat code and compiled.
    Recently, I want to modify source code of swatplus and compile by following this method.
    If you have, can you share the makefile for swatplus?

    Thanks
    Okamoto

Leave a Reply to Takuya Okamoto Cancel reply