Skip to content
Snippets Groups Projects
Commit 67d42ce6 authored by Michael Blaschek's avatar Michael Blaschek :bicyclist:
Browse files

wrf updates

parent 1dfe00b9
Branches
No related tags found
No related merge requests found
#!/bin/sh
# overwrite any existing runscript
# add IMGW customized PROMPT_COMMAND
# add IMGW customized PROMPT_COMMAND -> PS1
if [ $# -gt 0 ]; then
# run cmd line options
exec "$@"
else
# interactive
echo "Welcome inside an IMGW container!"
echo "Get help: singularity run-help $SINGULARITY_NAME"
echo "[OUTSIDE] run: singularity run-help $SINGULARITY_NAME"
# Look for apps?
if [ -d /scif/apps ]; then
echo "[OUTSIDE] Available Apps: $(ls /scif/apps)"
echo "[OUTSIDE] run: singularity run-help --app [] $SINGULARITY_NAME"
fi
echo "[INSIDE] Welcome inside an IMGW container!"
exec /.singularity.d/actions/shell "$@"
fi
\ No newline at end of file
......@@ -11,8 +11,13 @@ WRF_VERSION=4.4.1
if [ $# -ne 0 ]; then
WRF_VERSION=$1
fi
echo "[WRF.dev] Downloading WRF $WRF_VERSION from github:"
curl -SL -o WRF-${WRF_VERSION}.tar.gz https://github.com/wrf-model/WRF/releases/download/v${WRF_VERSION}/v${WRF_VERSION}.tar.gz
if [ ! -f WRF-${WRF_VERSION}.tar.gz ]; then
echo "[wrf.dev] Downloading WRF $WRF_VERSION from github:"
curl -SL -o WRF-${WRF_VERSION}.tar.gz https://github.com/wrf-model/WRF/releases/download/v${WRF_VERSION}/v${WRF_VERSION}.tar.gz
else
echo "[wrf.dev] Source found: WRF-${WRF_VERSION}.tar.gz"
fi
%apphelp downloadwrf
[WRF] APP: downloadwrf
......@@ -26,8 +31,12 @@ WPS_VERSION=4.4
if [ $# -ne 0 ]; then
WPS_VERSION=$1
fi
echo "[WRF.dev] Downloading WPS $WPS_VERSION from github:"
curl -SL -o WPS-${WPS_VERSION}.tar.gz https://github.com/wrf-model/WPS/archive/refs/tags/v${WPS_VERSION}.tar.gz
if [ ! -f WPS-${WPS_VERSION}.tar.gz ]; then
echo "[wrf.dev] Downloading WPS $WPS_VERSION from github:"
curl -SL -o WPS-${WPS_VERSION}.tar.gz https://github.com/wrf-model/WPS/archive/refs/tags/v${WPS_VERSION}.tar.gz
else
echo "[wrf.dev] Source found: WPS-${WPS_VERSION}.tar.gz"
fi
%apphelp downloadwps
[WRF] APP: downloadwps
......
Bootstrap: localimage
From: wrf.dev
From: wrf.dev.sif
Stage: build
# Two Stage Build of WRF
......@@ -12,8 +12,8 @@ Stage: build
maintainer IT-IMGW <it.img-wien@univie.ac.at>
%files
WRF*.tar.gz /wrf
WPS*.tar.gz /wrf
WRF*.tar.gz /wrf/WRF.tar.gz
WPS*.tar.gz /wrf/WPS.tar.gz
%post
# Build a WRF release from the sandbox
......@@ -24,10 +24,11 @@ JASPERLIB=/usr/lib64/
NETCDF=/usr/lib64/openmpi/
mkdir -vp /wrf/WRF /wrf/WPS \
&& cat /wrf/WRF*.tar.gz | tar --no-same-owner --strip-components=1 -zxC /wrf/WRF \
&& cat /wrf/WPS*.tar.gz | tar --no-same-owner --strip-components=1 -zxC /wrf/WPS
&& cat /wrf/WRF.tar.gz | tar --no-same-owner --strip-components=1 -zxC /wrf/WRF \
&& cat /wrf/WPS.tar.gz | tar --no-same-owner --strip-components=1 -zxC /wrf/WPS
# Build WRF with Option 34 and 1
# GCC with openmpi
cd /wrf/WRF \
&& ./configure <<< $'34\r1\r' \
&& sed -i -e '/^DM_CC/ s/$/ -DMPI2_SUPPORT/' ./configure.wrf \
......@@ -49,7 +50,7 @@ mkdir -p /wrf/run /wrf/bin \
&& cp /wrf/WPS/namelist* /wrf/run
Bootstrap: localimage
From: wrf.dev
From: wrf.dev.sif
Stage: final
%files from build
......
Bootstrap: localimage
From: sandbox.wrf.dev
From: wrf.dev.sif
Stage: build
# Two Stage Build of WRF
......@@ -11,6 +11,10 @@ Stage: build
%labels
maintainer IT-IMGW <it.img-wien@univie.ac.at>
%files
WRF*.tar.gz /wrf/WRF.tar.gz
WPS*.tar.gz /wrf/WPS.tar.gz
%post
# Build a WRF release from the sandbox
WRF_BUILD_TARGET=em_real
......@@ -19,9 +23,14 @@ JASPERINC=/usr/include/jasper/
JASPERLIB=/usr/lib64/
NETCDF=/usr/lib64/openmpi/
mkdir -vp /wrf/WRF /wrf/WPS \
&& cat /wrf/WRF.tar.gz | tar --no-same-owner --strip-components=1 -zxC /wrf/WRF \
&& cat /wrf/WPS.tar.gz | tar --no-same-owner --strip-components=1 -zxC /wrf/WPS
# Build WRF with Option 34 and 1
# GCC with openmpi
cd /wrf/WRF \
&& ./configure <<< $'34\r1\r' \
&& ./configure <<< $'2\r1\r' \
&& sed -i -e '/^DM_CC/ s/$/ -DMPI2_SUPPORT/' ./configure.wrf \
&& sed -i '/BUILD_RRTMG_FAST/d' ./configure.wrf \
&& /bin/csh ./compile $WRF_BUILD_TARGET 2>&1 | tee compile_wrf_arw_opt34.1.log
......@@ -41,27 +50,33 @@ mkdir -p /wrf/run /wrf/bin \
&& cp /wrf/WPS/namelist* /wrf/run
Bootstrap: localimage
From: sandbox.wrf.dev
From: wrf.dev.sif
Stage: final
%files from build
# Copy only executables from WRF to directory
/wrf/bin /wrf/bin
/wrf/run /wrf/run
# WPS
/wrf/WPS/link_grib.csh /wrf/bin
/wrf/WPS/ungrib/Variable_Tables /wrf/run
/wrf/WPS/geogrid/GEOGRID* /wrf/run/geogrid/
/wrf/WPS/geogrid/gribmap.txt /wrf/run/geogrid/
/wrf/WPS/metgrid/METGRID* /wrf/run/metgrid/
/wrf/WPS/metgrid/gribmap.txt /wrf/run/metgrid/
# Log files
/wrf/WRF/compile_wrf_arw_opt34.1.log /wrf
/wrf/WPS/compile_wps.log /wrf
%files
runscript /.singularity.d/runscript
run-help /.singularity.d/runscript.help
./scripts/runscript /.singularity.d/runscript
./scripts/run-help /.singularity.d/runscript.help
%post
# compress
gzip -f /wrf/*.log
# remove src tree (is insidie sandbox)
rm -rf /wrf/WRF /wrf/WPS
# remove src tree (is inside sandbox)
# rm -rf /wrf/WRF /wrf/WPS
# Strip the binaries to reduce the size of the image
find -L /wrf/* -type f -exec readlink -f '{}' \; | \
xargs file -i | \
......
......@@ -6,12 +6,12 @@ if [ $# -gt 0 ]; then
echo "[WRF] Copying default run files here"
cp -rvu /wrf/run/* .
exit 0
elif [ ! -f namelist.input ]; then
# copy necessary files to current directory
echo "[WRF] Updating default/missing run files here"
cp -rvu /wrf/run/* .
else
echo "[WRF] no automatic copying"
# elif [ ! -f namelist.input ]; then
# # copy necessary files to current directory
# echo "[WRF] Updating default/missing run files here"
# cp -rvu /wrf/run/* .
# else
# echo "[WRF] no automatic copying"
fi
# run cmd line options
echo "[WRF] Executing"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment