arrow-left

All pages
gitbookPowered by GitBook
1 of 1

Loading...

Source Code

hashtag
Repository Links

  • SWAT+ source code repositoryarrow-up-right

  • SWAT+ Editor source code repositoryarrow-up-right

hashtag
SWAT+ Model Compile Help

The model is written in Fortran and the distributions on this website were compiled using the . This is now freely available for Windows, Linux, and MacOS. First, download and install the . Then download and install the .

For Windows, we also use Visual Studio. Download the file below for settings configuration.

For Linux and MacOS, we currently just use the command line. First, you need to set your Intel environment. Find your installation directory and source setvars.sh.

Linux example:

Or for all users:

MacOS example:

Next, we use the following script to compile the model. Please note: occasionally some extra files get included in the source code repository. If you notice this, it is safe to remove them.

The -static flag in the last line is NOT available on MacOS. Instead, you should link the LAPACK and BLAS libraries and as of macOS Monterey change your library path. The last line should be:

We are new to compiling in Linux and MacOS, so suggestions are more than welcome.

hashtag
SWAT+ Editor Compile Help

First set up your development environment as described in the README in the .

  1. From /src/api run the following depending on your OS:

    • Windows: python-build-windows

    • Linux:

sh python-build-linux.sh
  • MacOS: sh python-build-mac.sh

  • From the root of the source code directory run the following depending on your OS:

    • Windows: npm run build:win

    • Linux: npm run build:linux

    • MacOS: npm run build:mac

  • Program will be in /release/dist

  • QSWAT+ source code repositoryarrow-up-right
    Intel Fortran compilerarrow-up-right
    Intel oneAPI Base Toolkitarrow-up-right
    Intel oneAPI HPC Toolkitarrow-up-right
    file-download
    1MB
    Intel_Fortran_newest_settings.doc
    arrow-up-right-from-squareOpen
    Intel Fortran Visual Studio Settings
    source code repositoryarrow-up-right
    . ~/intel/oneapi/setvars.sh
    . /opt/intel/oneapi/setvars.sh
    . /opt/intel/oneapi/setvars.sh
    ifort -c hru_module.f90 -traceback -O3 -parallel
    ifort -c time_module.f90 -traceback -O3 -parallel
    ifort -c constituent_mass_module.f90 -traceback -O3 -parallel
    ifort -c *_module.f90 -traceback -O3 -parallel
    ifort -c allocate_parms.f90 -traceback -O3 -parallel
    ifort -c *.f90 -traceback -O3 -parallel
    ifort -o swatplus_exe_file_name *.o -static -traceback -O3 -parallel
    ifort -o swatplus_exe_file_name *.o -L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib -llapack -lblas -traceback -O3 -parallel