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