-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompile_WRF_stampede2.sh
46 lines (35 loc) · 1.17 KB
/
compile_WRF_stampede2.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
export WRF_SRC_ROOT_DIR=$PWD
cd $WRF_SRC_ROOT_DIR
# Fresh config
./clean -a
# Load system modules
module reset # Should include intel/18.0.2 impi/18.0.2
module load netcdf/4.6.2 pnetcdf/1.11.0 phdf5/1.10.4
export LIBS=${WRF_SRC_ROOT_DIR}/../LIBRARIES
export CC=icc
export CXX=icpc
export FC=ifort
export FCFLAGS=-m64
export F77=ifort
export FFLAGS=-m64
export JASPERLIB=$LIBS/grib2/lib
export JASPERINC=$LIBS/grib2/include
export LDFLAGS=-L$LIBS/grib2/lib
export CPPFLAGS=-I$LIBS/grib2/include
export PATH=${TACC_NETCDF_BIN}:${TACC_PNETCDF_BIN}:$PATH
export NETCDF=${TACC_NETCDF_DIR}
export PNETCDF=${TACC_PNETCDF_DIR}
export PHDF5=${TACC_HDF5_DIR}
export WRFIO_NCD_LARGE_FILE_SUPPORT=1
export WRF_EM_CORE=1
export KMP_STACKSIZE=512m
#export LDFLAGS="-lm -lnetcdff -lnetcdf -L${TACC_NETCDF_LIB}"
export LDFLAGS="-lm -lnetcdff -lnetcdf -L${TACC_PNETCDF_LIB}"
# input 15 (icc/ifort) and 1 (basic nesting) to configure script
echo '15\n1\n' | ./configure
# modifications for Intel
sed -i -e 's/gcc/icc/' ./configure.wrf
awk -v add=" -L${LIBS}/zlib-1.2.7" '/^ZLIB/ {$0=$0add} 1' configure.wrf > temp && mv temp configure.wrf
# Compile
time ./compile em_real >& compile_em_real.log