THIS PROJECT IS ARCHIVED AND NOW MAINTAINED BY @UMEP-dev.
This is a public repo for SUEWS source code and documentation.
Documentation site: https://suews-docs.readthedocs.io/
Documentation source: docs
folder in this repo
These branches are regularly curated by admin members with specific purposes and set with triggers for automatic deployment (via MS Azure Pipeline) in the releases page named Latest Release Test:
master
:
push
is restricted to admin members.develop
:
push
is restricted to admin members.Whenever changes are made, please run make test
in the repo root to check if your changes are working or not.
If any error, please resolve it or justify that the test is giving false alarm.
make test
will perform the following checks:
BaseRun
): to check if any non-functional changes would break the current code;The test workflow is as follows (details refer to the Makefile test
recipe and related python code):
SUEWS_{version}
binary to the temporary folder;Release/InputTables/{version}
to the temporary folder (see below for its preparation);Prepare a base run:
Test/BaseRun
, create a folder named with version/feature info (e.g., 2019a
);Note: all the above input files will be automatically copied under Release/InputTables
with explicit version/feature (e.g., Release/InputTables/2019a
) and later archived in public releases for users; so carefully construct test data to include in the input files.
Configure test namelist file Test/code/BTS_config.nml
:
name_exe
: the SUEWS binary name that will be used for testing.dir_exe
: the directory to copy name_exe
.dir_input
: the directory to copy input files; suggested to be Release/InputTables/{version}
.dir_baserun
: the base run against which to test identity in results.GDB is a generic debugging tool used along with gfortran. Here are some tips to debug SUEWS code:
Recent macOS (since High Sierra) introduces extra security procedures for system level operations that makes installation GDB more tedious than before. The best practice, in TS's option, to avoid hacking your macOS, is to use Linux docker images with gfortran&gdb installations: e.g., alpine-gfortran.
Once the docker image is installed, simply run this from the SUEWS root folder for debugging:
docker run --rm -it -v $(pwd):/source cmplopes/alpine-gfortran /bin/bash
which will mount the current SUEWS
directory to docker's path /source
and enter the interactive mode for debugging.
Makefile
under SUEWS-SourceCode
by removing the #
after the equal sign =
:FCNOOPT = -O0
FFLAGS = -O3 $(STATIC) $(FCDEBUG) -Wall -Wtabs -fbounds-check -cpp \
-Wno-unused-dummy-argument -Wno-unused-variable
fully clean and recompile SUEWS
:
make clean; make
copy the recompiled SUEWS
binary into your SUEWS testing folder (e.g., Test/BaseRun/2019a
) and load it into GDB:
gdb SUEWS
run
then you should have stack info printed out by GDB if any runtime error occurs.
More detailed GDB tutorial can be found here.