# reference
Youtube: How to install WRF on Ubuntu Version 1804 (Part 1/2)(2019)
https://www.youtube.com/watch?v=9aqeaSdZZao
### install software by apt-get ###
(本当に必要なものだけかの確認はしていないので、
余計なものも含まれている可能性がある)
gcc
gfortran
csh
m4
build-essential
nasm
cmake
unzip
libxml-dev(見当たらない)
lib cairo-dev(見当たらない)
libbz2-dev
libxaw7-dev
libx11-dev
org-dev(見当たらない)
flex
bison
libhdf5-mpich-dev
limpng-dev
libnetcdff-dev
netcdf-bin
zlib1g-dev
### compile from source ###
(WRFのインストールでは各ライブラリのバージョン違いが
原因のことも多いので、コンパイルに成功した人の使ったバージョンを
正確になぞることを推奨)
netcdf ver 4.1.3 (—disable-dap —disable-netcdf-4 —disable-shared)
ADD VARIABLES:
PATH="netcdf/bin:${PATH}"
NETCDF=netcdf-path
mpich-3.2 (configureはprefixのみ)
ADD VARIABLES:
PATH=mpich/bin
zlib-1.2.8 (configureはprefix=${DIR}/grib2のみ)
ADD VARIABLES:
LDFLAGS=‘-L${DIR}/grib2/lib'
CPPFLAGS=‘-I${DIR}/grib2/include'
limping-1.6.34 (configureはprefix=${DIR}/grib2のみ)
ADD VARIABLES:
LD_LIBRARY_PATH=“${DIR}/grib2/lib:${LD_LIBRARY_PATH}"
jasper-1.9000.1 (configureはprefix=${DIR}/grib2のみ)
ADD VARIABLES:
PATH=“${DIR}/grib2//bin:${PATH}"
JASPERLIB=“${DIR}/grib2/lib"
JASPERINC=“${DIR}/grib2/include"
nil_ncarg-6.5.0 (任意、configure option無し)
MAKE LINK:
ln -sf /usr/include/freetype2/ft2build.h /usr/include
Interactive mode:
Parent install dir: ${DIR}/ncl
Build netcdf support: n
Build hdf4 support: n
Build hdf4 support into raster library: n
Build triangle support: n
If using netcdf4, enable netcdf4 support: n
netcdf with OPeNDAP: n
Build GDAL support: n
Build xxx support: n (build xxxとなるものすべてno)
Enter local library path: /usr/lib/x86_64-linux-gnu
Enter local include path: /usr/include/X11
Go back and make more change: n
Save current configuration: y
COMPILE:
>> make Everything >& make-output &
ADD VARIABLES:
NCARG_ROOT=${DIR}/ncl
PATH=“${NCARG_ROOT}/bin:${PATH}"
TEST NCL:
>> nil -V
hdf5-1.10.5(WRFPLUSのコンパイルに必要)
COMMENT:
WRFPLUSをinstallする場合にはhdf5のfortran libraryが要求される。
fortran libraryを作成するには、hdf5のconfigureで下記オプションをつける。
>> ./configure —enable-fortran
ADD_VARIABLES:
HDF5=“where_your_HDF5_dir/hdf5-1.10.5"
### install WRF core ###
(ver 3.9.1.1)
ADD VARIABLES into .bashrc:
ulimit -s unlimited
MALLOC_CHECK=0
WRF_EM_CORE=1
WRFIO_NCD_LARGE_FILE_SUPPORT=1
CONFIGURE:
select: 34 (dmper + GNU)
nesting: 1 (basic)
MODIFY configure.wrf:
CPP = cpp -P -nostdinc(なくてもコンパイルできた)
COMPILE:
>> ./compile em_real >& log_compile
(終わったらrun/に.exeが4つできているか確認)
### install WPS ###
(ver 3.9.1.1)
CONFIGURE:
select: 3 (dmper + GNU)
MODIFY configure.wrf:
COMPRESSION_LIBS = -L${DIR}/grib2/lib -ljasper -lpng -lz (フルパス表記)
COMPRESSION_INC = -I${DIR}/grib2/include (フルパス表記)
DM_FC = mpif90
WRF_LIB = -lgomp を末尾に追加
COMPILE:
>> ./compile >& log_compile
(終わったら.exeが3つできているか確認)
### install WRFPLUS ###
(ver 3.9.1.1)
CONFIGURE:
>> ./configure wrfplus
select: (dmper + GNU)
COMPILE:
>> ./compile wrf >& log_compile
(終わったらrun/にwrf.exeができているか確認)
※ HDF5のfortran libraryが無いと、コンパイル時にエラーが出る。
ADD_VARIABLES:
export WRFPLUS_DIR=“where_your_wrfplus/WRFPLUSV3"
### install WRFDA (4DVAR) ###
(ver 3.9.1.1)
※ 4DVARでコンパイルすれば、3DVARも利用可能
CONFIGURE:
>> ./configure 4dvar
select: (dmper + GNU)
COMPILE:
>> ./compile all_wrfvar >& log_compile
(終わったら下記2つのディレクトリに、計44個の.exeができているか確認)
var/build/ (43個)
var/obsproc/ (1個)