Skip to content

Commit

Permalink
KPP/WKC, WPS ungrib debug/test
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Alexander committed Mar 8, 2020
1 parent 61b7aaa commit 3a15abb
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 24 deletions.
27 changes: 16 additions & 11 deletions README
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
README WRF Environment Installation script facilitates the installation of the dependencies of WRF/WPS.
README WRF Environment Installation script facilitates the installation of the dependencies
for WRF/WRF-Chem/WPS.

Buildtime: All the necessary parameterization is to fill out the block marked for required parameters.

Expand All @@ -16,11 +17,11 @@ The Intel compilers, Intel MPI, cmake and perl need to be loadable through the m
This script requires 2 passes to build WRF, 3 for WRF/WPS.


(1) Edit the script worf.sh parameter block top of the file to match the localenvironment.
(1) Edit the script worf.sh parameter block top of the file to match the local environment.

(2) Change to the script directory and run it from a bash shell: bash ./worf.sh

(3) if testing was enabled (test='test') then the total compile time for the environment
(3) If testing was enabled (test='test') then the total compile time for the environment
dependencies on a 2020 high-end SMP is around an hour wallclock time; without testing about 20'/

(4) Check if the dependencies have all been deployed to
Expand All @@ -47,7 +48,9 @@ This script requires 2 passes to build WRF, 3 for WRF/WPS.
a 2020 high-end SMP machine takes around an hour -O3 optmized wallclock compile time;
about 10' unoptimized.

(8) Configure WPS: run: bash worf.sh wps
(8) For WRF-Chem compile the external emissions conversion as well: ./compile emi_conv

(9) Configure WPS: run: bash worf.sh wps
for a WPS build environment and follow the screen-printed instructions

run ./configure and select option 19 for Intel/distributed memory parallelism
Expand All @@ -57,22 +60,24 @@ This script requires 2 passes to build WRF, 3 for WRF/WPS.
DM_CC: mpiicc
LDFAGS: -qoopenmp

then enter the library and include paths from the generated wrf_environment.sh file
(see paramter section for location)
then edit the library and include paths from the generated wrf_environment.sh file
(see paramter section and wrf_environment.sh for the respective locations)

COMPRESSION_LIBS=-L<jasperpath>/lib -L<zlibpath>/lib -L<libpngpath>/lib -lpng -lz
COMPRESSION_LIBS=-L<jasperpath>/lib -L<zlibpath>/lib -L<libpngpath>/lib -ljasper -lpng -lz
COMPRESSION_INC=-I<jasperpath>/include -I<zlibpath>/include -I<libpngpath>/include

Example:
COMPRESSION_LIBS=-L/opt/worf/jasper/lib -L/opt/worf/zlib/lib -L/opt/worf/libpng/lib -ljasper -lpng -lz
COMPRESSION_INC=-I/opt/worf/jasper/include -L/opt/worf/zlib/lib -L/opt/worf/libpng/lib

COMPRESSION_LIBS=-L/gpfs/data/home/username/opt/jasper/lib64 -L/gpfs/data/data/home/usernameme/opt/zlib/lib -L/gpfs/data/data/home/username/opt/libpng/lib -ljasper -lpng -lz
COMPRESSION_INC=-I/gpfs/data/home/username/opt/jasper/include -L/gpfs/data/home/username/opt/zlib/lib -L/gpfs/data/home/username/opt/libpng/lib

then run ./compile

look for geogrid.exe and metgrid.exe in the wps package directory for a successful build
geogrid.exe, metgrid.exe and ungrib.exe in the wps package directory signify a successful build



Runtime:
Runtime/Batch:

Always first source the WRF_ENVIRONMENT file (default location: ${PREFIX}/${PACKAGES}/wrf_environment.sh)
e.g. source wrf_environment.sh
Expand Down
30 changes: 17 additions & 13 deletions worf.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

<<scriptdoc
This WRF environment installation script facilitates the building the dependencies of WRF/WPS.
This WRF environment installation script facilitates the building the dependencies of WRF/WRF-Chem/WPS.
All the necessary parameterization is to fill out the block marked for
required parameters and adapt the respective module environment_version names/versions.
Expand All @@ -17,7 +17,7 @@ scriptdoc
### begin required parameters ###

initialize() {
export PREFIX=/gpfs/data/fs71391/malexand/342c # format: <PREFIX>/{<CATEGORY>, <PACKAGES>}
export PREFIX=/gpfs/data/home/username/mywrf # format: <PREFIX>/{<CATEGORY>, <PACKAGES>}
export CATEGORY='opt'
export PACKAGES='pkg'

Expand All @@ -33,15 +33,10 @@ initialize() {
environment_version[help2man]='help2man/1.47.8-intel-19.0.5.281-k3tb6t4'

WRF_ENVIRONMENT=${PREFIX}/${PACKAGES}/wrf_environment.sh # location for generated wrf environment file
WRF_CHEM=1
WRF_KPP=1
WRF_CHEM=0
WRF_KPP=0
WRFIO_NCD_LARGE_FILE_SUPPORT=1

# todo kpp
export KPP_HOME=/gpfs/data/fs71391/malexand/342c/pkg/wrf/chem/KPP/kpp/kpp-2.1/
# add path /gpfs/data/fs71391/malexand/342c/pkg/wrf/chem/KPP/kpp/kpp-2.1/bin
# configure_kpp script broken ./chem/KPP/configure_kpp

export OPTI=O0

### end required parameters ###
Expand Down Expand Up @@ -91,6 +86,7 @@ initialize() {
[[ $wps != 'wps' ]] && check_intelgnu
}


buildclean () {
unset src_packages
unset src_packages_version
Expand Down Expand Up @@ -148,6 +144,7 @@ buildclean () {
fi
}


git_lazy_clone() {
local this_package=$1

Expand Down Expand Up @@ -179,6 +176,7 @@ git_lazy_clone() {
fi
}


check_intelgnu() {
if [[ ${intelgnu} == 'intel' ]]; then
for i_module in "${!environment_version[@]}"; do
Expand All @@ -205,6 +203,7 @@ line_printer() {
echo -e "\n\n\n[info] building $1"
}


zlib () {
local this_package=${FUNCNAME[0]}
line_printer ${FUNCNAME[0]}
Expand All @@ -229,6 +228,7 @@ zlib () {
printf "export ZLIB=%s\n" "$ZLIB" >> ${WRF_ENVIRONMENT}
}


curl () {
local this_package=${FUNCNAME[0]}
line_printer ${FUNCNAME[0]}
Expand All @@ -252,6 +252,7 @@ curl () {
printf "export CURL=%s\n" "$CURL" >> ${WRF_ENVIRONMENT}
}


hdf5 () {
local this_package=${FUNCNAME[0]}
line_printer ${FUNCNAME[0]}
Expand Down Expand Up @@ -569,7 +570,7 @@ yacc() {


persist_ld_library_path () {
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH_INITIAL:${HDF5}/lib:${ZLIB}/lib:${NETCDF_CF}/lib:${CURL}/lib:${PNETCDF}/lib:${LIBPNG}/lib:${NETCDF_C}/lib:${NETCDF_F}/lib:${JASPER}/lib64:${FLEX}:/lib"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH_INITIAL:${HDF5}/lib:${ZLIB}/lib:${NETCDF_CF}/lib:${CURL}/lib:${PNETCDF}/lib:${LIBPNG}/lib:${NETCDF_C}/lib:${NETCDF_F}/lib:${JASPER}/lib64:${FLEX}/lib"
printf "export LD_LIBRARY_PATH=%s\n" "$LD_LIBRARY_PATH" >> ${WRF_ENVIRONMENT}
}

Expand Down Expand Up @@ -683,7 +684,7 @@ wps () {
################################################################################################
run ./configure and select option 19 for Intel/distributed memory parallelism
run ./configure and select option 19 for Intel/distributed memory parallelism (dmpar)
edit the resulting file configure.wps with:
DM_FC: mpiifort
DM_CC: mpiicc
Expand All @@ -696,8 +697,9 @@ wps () {
COMPRESSION_INC=-I<jasperpath>/include -I<zlibpath>/include -I<libpngpath>/include
Example:
COMPRESSION_LIBS=-L/opt/worf/jasper/lib -L/opt/worf/zlib/lib -L/opt/worf/libpng/lib -ljasper -lpng -lz
COMPRESSION_INC=-I/opt/worf/jasper/include/jasper -L/opt/worf/zlib/lib -L/opt/worf/libpng/lib
COMPRESSION_LIBS=-L/gpfs/data/home/username/opt/jasper/lib64 -L/gpfs/data/data/home/usernameme/opt/zlib/lib -L/gpfs/data/data/home/username/opt/libpng/lib -ljasper -lpng -lz
COMPRESSION_INC=-I/gpfs/data/home/username/opt/jasper/include -L/gpfs/data/home/username/opt/zlib/lib -L/gpfs/data/home/username/opt/libpng/lib
then run ./compile
issue clean before making changes to recompile or clean -a which also overwrites configure.wps
Expand All @@ -707,6 +709,7 @@ wps () {
EOF
}


main () {
buildclean
initialize
Expand All @@ -727,6 +730,7 @@ main () {
wrf
}


if [[ "$1" == 'wps' ]]; then
export wps='wps'
initialize
Expand Down

0 comments on commit 3a15abb

Please sign in to comment.