Tuesday, December 18, 2018

Research Note #18 - Installing WRF-Chem with Kinetic Pre-Processor (KPP)

The installation process is basically similar with typical WRF-Chem, with the additional steps to set KPP environment variables and flex library installation. To make it simple, these are the steps to install WRF-Chem with KPP. It assumes that 'yacc' (yet another compiler) has been installed into the system.

1. Install Flex Library
Flex library could be free-downloaded easily from many sources on internet. For this case, GNU flex used could be obtained from this link.

After downloading, extract the files into any desired directory. Next, run configuration script, and compile as usual. Simple as that.

$ ./configure --prefix=$PACSLIB/flex
$ make
$ make check
$ make install

Make sure that file libfl.a exists in $PACSLIB/flex/lib directory after compilation.
More detailed steps could be found here.

2. Setting the Environment Variables
This step is available on WRF-Chem manual. Just set the environment variables on bash shell for these values:

$ export WRF_KPP=1
$ export YACC="/usr/bin/yacc -d"
$ export FLEX_LIB_DIR=$PACSLIB/flex/lib

The most important thing, add the path of flex shared library (libfl.so.2) to the LD_LIBRARY_PATH of .bash_profile, otherwise, the installation of WRF-Chem will fail. For example:

$ export LD_LIBRARY_PATH=/home/opt/local/cores/intel/impi/2018.1.163/intel64/lib:/home/opt/local/cores/intel/compilers_and_libraries_2018.1.163/linux/compiler/lib/intel64:/home/opt/local/cores/intel/compilers_and_libraries_2018.1.163/linux/mkl/lib/intel64:/home/opt/local/cores/intel/compilers_and_libraries_2018.1.163/linux/compiler/lib/intel64:/home/opt/local/cores/intel/compilers_and_libraries_2018.1.163/linux/compiler/lib/intel64_lin:/home/opt/local/cores/intel/compilers_and_libraries_2018.1.163/linux/mpi/intel64/lib:/home/opt/local/cores/intel/compilers_and_libraries_2018.1.163/linux/mpi/mic/lib:/home/opt/local/cores/intel/compilers_and_libraries_2018.1.163/linux/ipp/lib/intel64:/home/opt/local/cores/intel/compilers_and_libraries_2018.1.163/linux/compiler/lib/intel64:/home/opt/local/cores/intel/compilers_and_libraries_2018.1.163/linux/mkl/lib/intel64:/home/opt/local/cores/intel/compilers_and_libraries_2018.1.163/linux/tbb/lib/intel64/gcc4.7:/home/opt/local/cores/intel/debugger_2018/libipt/intel64/lib:/home/opt/local/cores/intel/compilers_and_libraries_2018.1.163/linux/daal/lib/intel64_lin:/home/opt/local/cores/intel/compilers_and_libraries_2018.1.163/linux/daal/../tbb/lib/intel64_lin/gcc4.7:/home/opt/local/cores/intel/compilers_and_libraries_2018.1.163/linux/daal/../compiler/lib/intel64_lin:/work/gi55/c24223/libs/grib2/lib:/work/gi55/c24223/libs/netcdf/lib:/work/gi55/c24223/libs/flex/lib

Re-run the bash_profile script:

$ . ~/.bash_profile

3. Install the WRF-Chem
Finally, install WRF-Chem as described on this previous post. If the bash_profile file has already listed netcdf libraries and impi libraries, just go straight to step #3.

The compilation of WRF-Chem's executables with KPP is somehow longer than typical model. New updates and details will be added after WPS compilation. 



No comments:

Post a Comment