WRF関連,  投稿記事

WRFをコンパイルする際の問題

約2ヶ月前に一度実装したが,仮想環境を再インストールした関係で再実装
色々とエラーが出たので備忘録として記述

自分のPC上でも気象モデルを使うためにWRFをダウンロード

使用環境:Ubuntu18.04LTS,gfortran,WRF-4.1

問題① configureの際にnetcdfのエラー

NETCDF4 IO features are requested, but this installation of NetCDF
/usr/local/netcdf-fortran-4.5.2
DOES NOT support these IO features.
Please make sure NETCDF version is 4.1.3 or later and was built with
--enable-netcdf4
OR set NETCDF_classic variable
bash/ksh : export NETCDF_classic=1
echo csh : setenv NETCDF_classic 1
Then re-run this configure script
!!! configure.wrf has been REMOVED !!!

どうやらnetcdfが正しく認識されてない?様子
bash/ksh : export~の指示通りに設定を行い,無事にクリア

問題②libjasper, libpngがない
WPS-4.1において,コンパイルの際に”metgrid.exe”と”geogrid.exe”はコンパイルできるが,ungrib.exeがコンパイルできない
画面に表示されたエラーによると,libjasper-devとlibpng-devがインストールされてないことが発覚.

さらに調べるとUbuntu18.04ではapt installのためにリポジトリを追加する等による作業が必要

sudo add-apt-repository "deb http://security.ubuntu.com/ubuntu xenial-security main"
sudo add-apt-repository "deb http://security.ubuntu.com/ubuntu bionic-security main"

sudo apt update
sudo apt install libjasper1 libjasper-dev
sudo apt install libpng-dev

これによ再度WPSのcompileを行うと無事に成功

以下のサイトを参考にしました
https://qiita.com/usk81/items/98e54e2463e9d8a11415
https://www.it-swarm.dev/ja/python/ubuntu-1704%E3%81%AEopencv/830752233/