diff --git a/.gitignore b/.gitignore index 2a12b1dfb20cecf3cd2db7b3a5b0ca433a302226..7db8917d079a2249f5153b1681a6b80e0679bae5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ *.nc *.tif *.tif.aux.xml +.env +.venv mapfile/SEPTREFHUM.map diff --git a/log/.gitignore b/log/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..e7a210ec7dcb290f7c9247714741a9caee387a8f --- /dev/null +++ b/log/.gitignore @@ -0,0 +1,3 @@ +* +*/ +!.gitignore \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..e8283df109c2be9b9128c1fd4fa79d41cced74b7 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +Jinja2 +netCDF4 +pytz \ No newline at end of file diff --git a/run_SEPTREFHUM.sh b/run_SEPTREFHUM.sh new file mode 100755 index 0000000000000000000000000000000000000000..56284b11ca0213a551ef928b8a75bf2ff6a8c57a --- /dev/null +++ b/run_SEPTREFHUM.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +# First: Test that we have CDO and GDAL installed +if ! command -v cdo &> /dev/null +then + echo "ERROR: CDO could not be found. Exiting." + exit +fi + +if ! command -v gdal_merge.py &> /dev/null +then + echo "ERROR: GDAL is either not installed, or not built with Python support. Exiting." + exit +fi + +# Defines HOME_DIR +source .env + +# Paths to scripts and requirements +APP_PATH=$HOME_DIR/SEPTREFHUM +LOG_FILE=$APP_PATH/log/SEPTREFHUM.log +REQUIREMENTS=$APP_PATH/requirements.txt + +cd $APP_PATH + +# Create and activate the virtual environment +python3 -m venv .venv +. .venv/bin/activate +python3 -m pip install --upgrade pip +pip install -r $REQUIREMENTS + +# Run the model +echo "==== `date`: Running model" &>> "$LOG_FILE" +python3 $APP_PATH/SEPTREFHUM.py &>> "$LOG_FILE" +echo "==== `date`: DONE running model" &>> "$LOG_FILE" + +# Deactivate the virtual environment +deactivate