Cara Install WRF-ARW di Windows Subsystem for Linux (WSL) Windows 10

Installing WRF on WSL Windows 10 – Part 1
Installing WRF on WSL Windows 10 – Part 2
  1. Install ubuntu dari microsoft store
  2. Aktifkan Windows Subsystem for Linux di Turn Windows Features on or off dan restart pc
  3. Buka ubuntunya
  4. Buat username dan password (tidak keliatan)
  5. Update ubuntu

sudo apt-get update
sudo apt-get install build-essential csh gfortran m4 zlib1g-dev

sudo apt-get install default-jdk -y && sudo apt install default-jre -y && sudo apt install grads -y

Buat folder wrf di local disk (misal D)

Buat link directory ke Disk D di Home Directory ubuntunya

cd ~
ln -sf /mnt/d/wrf WRF

Edit bashrc

sudo nano ~/.bashrc

export DIR=/home/namauser/WRF/LIBRARIES
export CC=gcc
export CXX=g++
export FC=gfortran
export FCFLAGS=-m64
export F77=gfortran
export FFLAGS=-m64
export PATH=$DIR/netcdf/bin:$PATH
export NETCDF=$DIR/netcdf
export PATH=$DIR/mpich/bin:$PATH
export LDFLAGS=-L$DIR/grib2/lib
export CPPFLAGS=-I$DIR/grib2/include
export JASPERLIB=$DIR/grib2/lib
export JASPERINC=$DIR/grib2/include
export DISPLAY=localhost:0.0

export GRD=/mnt/d/grads
export GASCRP=$GRD/gscript

Simpan dengan Ctrl+O -> enter -> Ctrl+X

source ~/.bashrc

Restart PC!

Download file WRF_LIBRARIES:

Buat folder LIBRARIES di /mnt/d/wrf

cd /mnt/d/wrf
mkdir LIBRARIES
cd LIBRARIES

Copy kan jasper1900, libpng125, zlib1211, mpich 304, netcdf413 ke dalam folder LIBRARIES

Ekstrak semua

tar xzvf namafile.tar.gz

Build netcdf

cd ke /home/namauser/WRF/LIBRARIES/netcdf-xxxx

./configure --prefix=$DIR/netcdf --disable-dap --disable-netcdf-4 --disable-shared && make && make install

Build mpich

cd ke /home/namauser/WRF/LIBRARIES/mpich-xxxxx
./configure --prefix=$DIR/mpich && make && make install

Build zlib

cd ke /home/namauser/WRF/LIBRARIES/zlib-xxxxx
./configure --prefix=$DIR/grib2 && make && make install && cd ..

Build libpng

cd ke /home/namauser/WRF/LIBRARIES/libpng-xxxx
./configure --prefix=$DIR/grib2 && make && make install && cd ..

Build jasper

cd ke /home/namauser/WRF/LIBRARIES/jasper-xxxxx
./configure --prefix=$DIR/grib2 && make && make install && cd ..

Copy kan file WRF WPS WRFDA ARWpost geog_complete ke folder wrf yang di buat di local disk D

Ekstrak semua file

tar xzvf namafile.tar.gz atau
tar xf namafile.tar atau namafile.tar.bz2

atau clone WRF, WPS, WRFDA dari GitHub wrf-model

git clone https://github.com/wrf-model/WRF.git
git clone https://github.com/wrf-model/WRF.git WRFDA
git clone https://github.com/wrf-model/WPS.git

Build WRF

cd ke /home/namauser/WRF/WRFV3

./configure

pilih nomor yang “(dmpar)” dengan baris “GNU (gfortran/gcc)”
pilih 34 dan basic isi nomor 1.

./compile em_real && ls -ls main/*.exe

dan cek pastikan terinstall : ndown.exe, real.exe, tc.exe, wrf.exe.

Building WPS

cd ke /home/namauser/WRF/WPS
./clean
./configure

pilih nomor yang “gfortran (serial)”
pilih nomor 3

./compile && ls -ls *.exe

pastikan terinstall : geogrid.exe, netgrid.exe, ungrib.exe

Static Geography data

Download static geography data di
http://www2.mmm.ucar.edu/wrf/users/download/get_sources_wps_geog.html

Jika folder “modis_landuse_20class_30s_with_lakes” di luar geog -> gabungkan ke dalam folder geog

mv modis_landuse_20class_30s_with_lakes geog

cd /home/namauser/WRF/WPS
nano namelist.wps

dan isi pada baris ini dan sesuaikan directorinya:
geog_data_path = '/mnt/d/wrf/geog'

Build ARWpost

cd ke /home/namauser/WRF/ARWpost
./configure

dan pilih nomor yang “(gfortran compiler)”

cd ke /ARWpost/src
cd src
nano Makefile

sesuaikan baris ini dengan menjadi seperti ini (dihapus dan dipastekan dengan ini):
-L$(NETCDF)/lib -lnetcdf -lnetcdff -I$(NETCDF)/include -lnetcdf

lalu save dan keluar (Ctrl + O -> enter -> Ctrl + X

cd ..

cd ke /ARWpost
nano configure.arwp

sesuaikan baris ini dengan menjadi seperti ini :
CFLAGS = -fPIC -m64
CPP = /lib/cpp -P -traditional

lalu save dan keluar

./compile && ls -ls *.exe

Build WRFDA

cd ke /home/namauser/WRF/WRFDA
./configure wrfda

pilih nomor 34

./compile all_wrfvar &&
ls -ls var/build/*.exe

pastikan ada da_update_bc.exe dan da_wrfvar.exe

Buat folder kerja

#!/bin/bash
export usr=~
cd $usr
cd /home/mahron/WRF/
mkdir TASK
cd TASK
mkdir data
mkdir output
mkdir wrf
cd wrf
ln -sf /home/mahron/WRF/WRF/run/* .
ln -sf /home/mahron/WRF/WPS/link_grib.csh && ln -sf /home/mahron/WRF/WPS/geogrid && ln -sf /home/mahron/WRF/WPS/geogrid/geogrid.exe && ln -sf /home/mahron/WRF/WPS/metgrid && ln -sf /home/mahron/WRF/WPS/metgrid/metgrid.exe && ln -sf /home/mahron/WRF/WPS/ungrib && ln -sf /home/mahron/WRF/WPS/ungrib/ungrib.exe
cp /home/mahron/WRF/WPS/namelist.wps /home/mahron/WRF/WPS/util/plotgrids_new.ncl .
ln -sf /home/mahron/WRF/WPS/ungrib/Variable_Tables/Vtable.GFS Vtable
cd ..
mkdir asimilasi
cd asimilasi
ln -sf /home/mahron/WRF/WRFDA/var/external/crtm_2.3.0 .
ln -sf /home/mahron/WRF/WRFDA/var/da .
ln -sf /home/mahron/WRF/WRFDA/var/da/da_radiance .
ln -sf /home/mahron/WRF/WRFDA/var/run/radiance_info .
cp /home/mahron/WRF/WRFDA/var/run/be.dat.cv3 be.dat
ln -sf /home/mahron/WRF/WRFDA/var/build/da_wrfvar.exe .
ln -sf /home/mahron/WRF/WRFDA/var/build/da_update_bc.exe .
ln -sf /home/mahron/WRF/WRFDA/var/da/da_sound .
ln -sf /home/mahron/WRF/WRFDA/run/*TBL .
cp /home/mahron/WRF/WRFDA/var/test/update_bc/parame.in .
cp /home/mahron/WRF/WRFDA/var/run/VARBC.in .
cp /home/mahron/WRF/WRFDA/var/run/leapsec.dat .
cp /home/mahron/WRF/WRFDA/var/test/radiance/namelist.input namelist.input
cp /home/mahron/WRF/WRFDA/var/da/da_radar/da_radar_rf.inc .
cp /home/mahron/WRF/WRFDA/var/da/da_radar/da_radial_velocity.inc .
ln -sf /home/mahron/WRF/WRFDA/var/da/da_radar .
cd ..
mkdir arwpost
cd arwpost
ln -sf /home/mahron/WRF/ARWpost /home/mahron/WRF/ARWpost/src/ARWpost.exe .
ln -sf /home/mahron/WRF/ARWpost/src .
ln -sf /home/mahron/WRF/ARWpost/scripts .
cp /home/mahron/WRF/ARWpost/namelist.ARWpost namelist.ARWpost

Atau download file berikut:

sudo chmod +x make_folder_kerja

Running WRF di WSL WIndows 10

Error di ungrib.exe

./ungrib.exe: error while loading shared libraries: libpng12.so.0 cannot open shared object file: No such file or directory

sudo ln -sf /home/mahron/WRF/LIBRARIES/grib2/lib/libpng12.so.0 /usr/lib/x86_64-linux-gnu/libpng12.so.0

Leave a comment

Your email address will not be published. Required fields are marked *