The SUEWS model that speaks Python.
Project description
SUEWS
This is a public repo for SUEWS source code and documentation.
Documentation
-
Documentation site: https://suews.readthedocs.io/
-
Documentation source:
docs
folder in this repo
Compilation
Prerequisites
Essential
Recommended
- WSL - for Linux-like environment on Windows
- VS Code - for code editing
- VS Code Co-pilot - for AI-assisted code writing (free for academic use)
Compilation
- Since SUEWS includes a dependency package SPARTACUS, one needs to initialise this submodule by:
git submodule init
git submodule update
Then source code of SPARTACUS will be loaded into SUEWS-SourceCode/ext_lib/spartacus-surface
Note: if a permission denied
error occurs, one usually needs to fix the SSH connection to GitHub by following the official guide here.
- Configure mamba environment by:
mamba env create -f env.yml
This will create a new environment named suews-dev
with all the required packages installed.
- Activate the environment by:
make activate suews-dev
- Compile SUEWS
4.1 compile the code and perform all tests
make
4.2 only compile the code
make dev
This will install a python package supy-driver
and supy
into the current environment (i.e., suews-dev
).
Also, several command-line tools will be installed under bin
folder, which can be used to perform SUEWS simulations:
suews-run
: the main SUEWS binarysuews-convert
: a tool to convert SUEWS input files from old format to new format the usage of both of which can be checked by--help
option (e.g.,suews-run --help
).
- Check if
supy
is installed by:
pip show supy
Developer Note
[!NOTE] the following is deprecated and will be updated
Debugging with GDB
GDB is a generic debugging tool used along with gfortran. Here are some tips to debug SUEWS code:
GDB on macOS
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 opinion, to avoid hacking your macOS, is to use Linux docker images with gfortran & gdb installations: e.g., alpine-gfortran
(otherwise, this guide might be useful for installation of GDB on macOS; also run set startup-with-shell off
inside GDB before run
the debuggng process)
Once the docker image is installed, simply run this from the SUEWS root folder for debugging:
docker run --rm -it -v $(pwd):/source sunt05/alpine-gfortran /bin/bash
which will mount the current SUEWS
directory to docker's path /source
and enter the interactive mode for debugging.
debugging with GDB
- enable the debugging related flags in
Makefile
underSUEWS-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.
Questions
- Please raise issues for questions in the development so our progress can be well managed.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for supy-2024.8.2.dev0-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9ce86d899fa604ffc9d0e6191ee631a3c19a54a8170e4299ebde2c45fdb09b8d |
|
MD5 | 5afcc1c54cbb1f3a7162bcc9fc9dd631 |
|
BLAKE2b-256 | 6897d07110fa7559248e2b0be822ec6a78d04913a3504e100b9e70a3ccc58d5a |
Hashes for supy-2024.8.2.dev0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd9286843e65205faf703b5c01b0503e3cc87e36bc5d6b3cc15903c659a9f825 |
|
MD5 | 2149c418a4c2d507ec2e392b1b20229d |
|
BLAKE2b-256 | 2186f69d16f15ab6172e6ac4759787d1296338ac4acaa0dccece39660d3ddd9b |
Hashes for supy-2024.8.2.dev0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 795b19c9adf719b0b0e764e7e5a7dca412bc8e034a4f4e45d88b2ee157785bfb |
|
MD5 | 87d9a2a4681686086ac641d9f6e9934d |
|
BLAKE2b-256 | 66ee54cd170eaaeb104bb1928b35e2a657091a4140edd5d7528737a0430a90a1 |
Hashes for supy-2024.8.2.dev0-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c394a41cd50e9d3905c84f9d3e4f9e0cce62fa63d2b5159cef4601faeecf895a |
|
MD5 | 05fe45bde8d851de8299fafceddee5fc |
|
BLAKE2b-256 | e76bdaaf50298fe3051ccfe5afa248f1f91ff29a39eedc9c21ae93fc7c677372 |
Hashes for supy-2024.8.2.dev0-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a0ae406a0bbc07e1292830767e8c4430944e92f1cd3d006b12fb1081a73ee8a |
|
MD5 | c483a2b0102fd90c6d273d70fa026faa |
|
BLAKE2b-256 | 19cc277ef7acb132ae4144a321607fb20be16a9c9e10e96499f2ae916efb3d92 |
Hashes for supy-2024.8.2.dev0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 64e70a92792fb370ebd70247715c6c4647cab28eb293ba9e3da2d29440ad38ab |
|
MD5 | 95ef5c0c65fb2e71127e624cb25f13ff |
|
BLAKE2b-256 | 7c23e641f51cb9b9b0ba3d266949002fef5900a6630bf102167b2564d61dab56 |
Hashes for supy-2024.8.2.dev0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0548922f98e83ab1b9e898a5af82d85478e5ca4ca2e8d302ad892241cd040ab |
|
MD5 | 2492e682cbf4441a6ea6bfc16ae12498 |
|
BLAKE2b-256 | 68ffd2278ae054a9164e8d9f66f64daf425585c033b3d2780a8b2742ad618149 |
Hashes for supy-2024.8.2.dev0-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee0eb540d48fdfff11d713250a2dea8ab39cf96c13a963dec20f72fc283eb36d |
|
MD5 | 84af8ab40fbc05f4abe31d99c7562cef |
|
BLAKE2b-256 | 8a41ea6b977f5c5b947ad54733b23152f755e5bae86dd313184d4179b5fe714b |
Hashes for supy-2024.8.2.dev0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ac72e3955d1f439c43ef5175c596763969fb67b4222dcc3287923656b143d99 |
|
MD5 | 784bfe2d33b431b622def8be10491394 |
|
BLAKE2b-256 | ae87a46a24bcafe59e55e780282162ffb060b85c370bf6eb1da753f1a9cb2438 |
Hashes for supy-2024.8.2.dev0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4d2904c60cde634b371c6fb038941563bd8caebd9a76cbca6aa16c3de8a1705 |
|
MD5 | 3d1a990ab33a206394fd3ea7ad451069 |
|
BLAKE2b-256 | 8060dea1e1d2945f28ea3d4b863f1e9a825246804c41025b8c91304ab4516039 |
Hashes for supy-2024.8.2.dev0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a9ac844f43a6ec880ddd52221c649d9a13de7187cc4beef142d35c62cc492dbc |
|
MD5 | 6b416f85bde936c042293b9e43cf2f86 |
|
BLAKE2b-256 | e7acaee37ae69445752c9c887eb3fa47ab62c1df5438f19cd3a53f4b572f7fc6 |
Hashes for supy-2024.8.2.dev0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7f8ecae6287eb2b302eeddfd13a13066764f75722bcd77c0e5f1601922b13e1 |
|
MD5 | a81ab27dd50259af9bffb7aad5fdc371 |
|
BLAKE2b-256 | 4de749dd1b8db87449dee0e49428385e8702fd96069099d2ae5c82ff86cda5a6 |