-
Notifications
You must be signed in to change notification settings - Fork 3
User Guide
- Requirements(recommended)
- Installation(recommended)
- Usage(recommended)
- Viewing Output
- Usage Further
- Alternative Instructions
- UNIX operating system (tested: CentOS Ubuntu)
-
anaconda python(recommended code works in python 2 and 3)
- requirements in environment.yml (python 3)
- non environment set up can be followed using requirements.txt if desired
- Intel compiler OR executables and library (only for similar architecture as built)
Anaconda python, unix systems (recommended)
git clone https://github.com/cemac/UNRESPForecastingSystem.git
cd UNRESPForecastingSystem
./installcalpuff.sh
conda env create -f environment.yml
For external users, once installed to run full forecast and visualisation with default options:
cd $HOME/UNRESPForecastingSystem
./Run_ext.sh
NB If no intel compilers the executables and libraries must be copied over to CALPUFF_EXE
For help and additional options run .\Run_ext.sh -h
Run_ext.sh
A CEMAC script to Run CALPUFF WITH NAM DATA input
winds and produces plots of SO2 and SO4.
Usage:
.\Run_ext.sh <opts>
No options runs a default production configuration:
Today, Viz on, plots production area (~earunres).
Options:
-d <date> YYYYMMDD DEFAULT: <today's date>
-n <home> name of viz defaults to ~earunres
**
The following switches can be used to overwrite
Default behaviour.
**
-s turn OFF SO4 plotting
-m turn OFF Forecasting model (e.g to run viz only)
-p turn OFF viz steps (no jpgs etc to be produced)
-f turn ON ffmpeg mp4 production
** TROUBLESHOOTING
* Missing .so file --> most like intel library
Try loading system intel e.g. module load intel or set LD_LIBRARY_PATH
* Missing python modules --> mostly likely conda environment failure
try `source activate unresp`
or `conda activate unresp`
or `load your system python libraries`
^^^ these fixes can be added to .env file for bespoke Setup
Run.sh is set up default to leeds production behaviour to run as a chronjob displaying at ~earunres
The output can be viewed by running:
cd $HOME/UNRESPForecastingSystem/VIZ_SITE_CODE/public_html
python -m http.server
And opening http://0.0.0.0:8000/ in any browser
All the code can be transported to desired location e.g. Apache server and the
forecasting scripts ran with a -n
option to move to that location.
- In Run_ext.sh various parameters can be set:
-
res
to alter the resolution between 100 - 1000 m - by default the model run and visualisation can be turned on or off to be
run together or separately however
Run_ext.sh
can be edited to turn off separate parts -
runTERREL=true
- The part of the CALPUFF -
runCTGPROC=true
- The part of the CALPUFF system that grids the land-use data -
runMAKEGEO=true
- The part of the CALPUFF system that combines the gridded terrain and land-use data into a file appropriate for input to CALMET -
run3DDAT=true
- Downloads the required met (NAM) data and runs a python script (Create3DDAT.py) to extract the required data into a file appropriate for input to CALMET. -
runCALMET=true
- The 3-D diagnostic meteorological model part of the CALPUFF system -
runCALPUFF=true
- The main dispersion model part of the CALPUFF system
-
- To forecast for the current day default visualization home to the GitHub repo
Viz site code if stored in home dir (override with
-n
flag):./Run_ext.sh
- To forecast for a specific day:
Note, however, that the external met (NAM) data that the script will try to download is only accessible for around 10 days after the original date before it is removed from the ftp site.
./Run_ext.sh -d YYYYMMDD
- Chronjobs: 2 chronjobs are required
1 . Everyday at 10.30am run the forecast
30 10 * * * cd <path-to-repo> && ./Run.sh
- Everyday at 10.30am etches the IMO CALPUFF output and plots it onto a map for viewing on the web here.
30 10 * * * <path-to-repo/extrascripts> makeMasayaFig.gmt
- transfers the output data from the forecast runs to the shared UNRESP space on the N-drive at 10:45am
45 10 * * * <path-to-repo> updateNDrive.sh
If you do not wish to use Anaconda, this code also works with old python provided you build EcCodes python library
- Python > 2.7
- Standard python libraries + basemap (see requirements.txt) or turn off visualization
- ECMWF EcCodes Python Library (requires build with correct flags)
- Intel compiler
git clone https://github.com/cemac/UNRESPForecastingSystem.git
cd UNRESPForecastingSystem
./installcalpuff.sh
- Install EcCodes and minimum python libraries
An example of running a non recommended set up
is in Run.sh
#!/usr/bin/bash --login # Use users login to pick up environment
module load bit # Leeds specific dependencies
module load intel/17.0.0 # Leeds system uses module
module load python2 python-libs # Load in ancient python
# Force pick up of Eccodes build
export PYTHONPATH="~/eccodes-2.6.0/lib/python2.7/site-packages:${PYTHONPATH}"
# Set default viz location to a strange place
vizhome=~earunres
<Main bulk of code same as Run_ext.sh>
# As visualization is to strange place archive back to sensible place
# Forcing bespoke set up e.g. only using
# On the first day of each month archive last month.
day=`date '+%d'`
if [[ "$day" == 01 ]];
then
echo "### Archiving Previous month ###"
if [[ "$USER" == 'earmgr' ]];
then
./tools/example_archiving/CALPUFFarchive.sh
./tools/example_archiving/NAMarchive.sh
./tools/example_archiving/VIZarchive.sh
else
# This is only set up for Mark at leeds.
echo 'set up for Leeds Production only'
fi
fi