Anda di halaman 1dari 16

RUNNING WRF DI LINUX

1.1. Alur Kerja Model WRF

RUNNING WRF DI LINUX 1.1. Alur Kerja Model WRF Alur diatas kalau disederhanakan menjadi : WRF
Alur diatas kalau disederhanakan menjadi : WRF Terrstrial Data WRF-ARW WPS REAL NCL MODEL Gridded
Alur diatas kalau disederhanakan menjadi :
WRF
Terrstrial
Data
WRF-ARW
WPS
REAL
NCL
MODEL
Gridded Data :
GFS,
Pre-Processing
Post-Processing
WRF MODEL
System
System

Pusat Meteorologi Publik Badan Meteorologi Klimatologi dan Geofisika Buku Panduan Workshop Uji Operasional WRF 2012

1

1.2.

Download WRF

Software WRF-ARF dapat di dowload pada alamat : http://www.mmm.ucar.edu/wrf/users/

1. Masuk ke alamat ucar.edu

1. Masuk ke alamat ucar.edu 2. Untuk yg versi 3 harus registrasi dahulu Pusat

2. Untuk yg versi 3 harus registrasi dahulu

alamat ucar.edu 2. Untuk yg versi 3 harus registrasi dahulu Pusat Meteorologi Publik Badan Meteorologi Klimatologi

Pusat Meteorologi Publik Badan Meteorologi Klimatologi dan Geofisika Buku Panduan Workshop Uji Operasional WRF 2012

2

3.

Registrasi user baru dengam menggunakan email

3. Registrasi user baru dengam menggunakan email 4. Registrasi sukses Pusat Meteorologi Publik Badan Meteorologi

4. Registrasi sukses

user baru dengam menggunakan email 4. Registrasi sukses Pusat Meteorologi Publik Badan Meteorologi Klimatologi dan

Pusat Meteorologi Publik Badan Meteorologi Klimatologi dan Geofisika Buku Panduan Workshop Uji Operasional WRF 2012

3

5.

WRF bisa didownload

5. WRF bisa didownload Pusat Meteorologi Publik Badan Meteorologi Klimatologi dan Geofisika Buku Panduan Workshop Uji

Pusat Meteorologi Publik Badan Meteorologi Klimatologi dan Geofisika Buku Panduan Workshop Uji Operasional WRF 2012

4

6.

Download WPS dan input data Geog

6. Download WPS dan input data Geog Soure WRF yang sudah yang sudah di download :

Soure WRF yang sudah yang sudah di download :

- WRF SOURCE (WRFV3.TAR.gz)

- WPS SOURCE (WPSV3.TAR.gz)

- GEOG DATA (geog.TAR.gz)

Pusat Meteorologi Publik Badan Meteorologi Klimatologi dan Geofisika Buku Panduan Workshop Uji Operasional WRF 2012

5

1.3.

Installing libraries Fedora linux

Untuk menginstal WRF perlu libraries dan bisa dilakukan dengan ”yum” untuk linux fedora

1. Installing libraries untuk compiler dan bahasa c

Model superuser pada linux fedora

Su

Passwd

< goltran GNU Fortran compiler >

yum install gcc-gfortran

< netcdf Network Common Data Form >

yum install netcdf

yum install netcdf-devel

< tsch C shell >

yum install tcsh

2. Installing libraries untuk Graphics dan Compression data

< ncl NCAR Common Language > : for graphics

yum install ncl

yum install ncl-devel

< jasper > : for compression

yum install jasper-devel

yum install jasper-libs

< png Portable Networ Grohics > : for compression

yum install libpng

yum install libpng-devel

< Reboot linux >

reboot now

1.4. Installing WRF Source

1. Coopy dan ekstrak WRF Source

< membuat directory kerja WRF >

mkdir WRF

cd WRF

< pindahkan WRF source ke folder yang telah dibuat >

cd $HOME/WRF

< Unpack WRF Source >

Pusat Meteorologi Publik Badan Meteorologi Klimatologi dan Geofisika Buku Panduan Workshop Uji Operasional WRF 2012

6

tar -zxvf WRFV3.3.1.TAR.gz

< pindah ke folder WRFV3 >

cd WRFV3

Keterangan folder yang berada di dalam folder WRFV3 (modul2 dan script dari model WRF) :

Source code directories:

Directory containing modules for dynamics in WRF ARW core

dyn_em/

Directory containing modules for dynamics in WRF NMM core

dyn_nmm/

Directory for a 'toy' dynamical core

dyn_exp/

Directory containing external packages, such as those for IO, time keeping and MPI

Directory containing modules for WRF framework

external/

frame/

Directory containing include files

inc/

Directory for main routines, such as wrf.F, and all executables after install

main/

Directory for all physics modules

phys/

Directory containing mostly modules for WRF mediation layer and WRF I/O

share/

Directory containing tools

tools/

Scripts:

Script to clean created files, executables

clean

Script for compiling WRF code

compile

Script to configure the configure.wrf file for compile

configure

Makefile

Top-level makefile

Registry/

Directory for WRF Registry file

arch/

Directory where compile options are gathered

run/

Directory where one may run WRF

test/

Directory that contains 7 test case directories, may be used to run

2. Compile dan konfigurasi WRF

< sebelum melakukan konfigurasi platform,pastikan bahwa environmentdari computer telah

diset up dengan benar >

export NETCDF=/usr

bash

or setenv NETCDF /usr/local/netcdf

csh

./configure

< Pilih platforms computer dan compiler >

1. Linux i486 i586 i686, gfortran compiler with gcc (serial)

2. Linux i486 i586 i686, gfortran compiler with gcc (smpar)

3. Linux i486 i586 i686, gfortran compiler with gcc (dmpar)

4. Linux i486 i586 i686, gfortran compiler with gcc (dm+sm)

5. Linux i486 i586 i686, g95 compiler with gcc (serial)

Pusat Meteorologi Publik Badan Meteorologi Klimatologi dan Geofisika Buku Panduan Workshop Uji Operasional WRF 2012

7

6. Linux i486 i586 i686, g95 compiler with gcc (dmpar)

7. Linux i486 i586 i686, PGI compiler with gcc (serial)

8. Linux i486 i586 i686, PGI compiler with gcc (smpar)

9. Linux i486 i586 i686, PGI compiler with gcc (dmpar)

10. Linux i486 i586 i686, PGI compiler with gcc (dm+sm) ……

 

Enter selection [1-26] : 1

Compile for nesting? (0=no nesting, 1=basic, 2=preset moves, 3=vortex following) [default 0]: 1

< buka file configure.wrf kemudian Edit compile options >

 

vi configure.wrf

 

-lnetcdf

-lnetcdff ( at 189line, because of Netcdf4 )

< Compile WRF untuk Modul Real Data Cases >

 

./compile em_real >& wrf.log

< check files (ls al ./main ) >

 

ls al ./main

 

main/wrf.exe

main/real.exe

3.

Install WPS

 

cd $HOME/WRF

tar -zxvf WPSV3.3.1.TAR.gz

cd WPS

./configure

o 14. PC Linux i486 i586 i686, gfortran compiler, serial

Untuk data GRIB2 Membutuhkan libraries, JasPer, PNG and Zlib. Sedangkan Zlib sudah terinstal di kmputer jika menggunakan linux-fedora14. JasPer dan PNG dibutuhkan untuk menjalankan ungrib pada data GRIB versi 2.

< edit configure.wps>

vi configure.wps

bagian yg diedit yaitu :

COMPRESSION_LIBS = -L/data3a/mp/gill/WPS_LIBS/local/lib -ljasper -lpng12 -lpng lz COMPRESSION_LIBS = -L/usr/lib -ljasper -lpng12 -lpng lz

= -I/data3a/mp/gill/WPS_LIBS/local/include = -I/usr/include

COMPRESSION_INC COMPRESSION_INC

NCARG_LIBS

= -L$(NCARG_ROOT)/lib -lncarg -lncarg_gks -lncarg_c

-L/usr/X11R6/lib -lX11

NCARG_LIBS

= -L$(NCARG_LIB) -lncarg -lncarg_gks -lncarg_c

-L/usr/lib -lX11

Pusat Meteorologi Publik Badan Meteorologi Klimatologi dan Geofisika Buku Panduan Workshop Uji Operasional WRF 2012

8

WRF_LIB

WRF_LIB

= … -L$(NETCDF)/lib -lnetcdf

= … -L$(NETCDF)/lib -lnetcdff

./compile >& wps.log < check files >

ls al

geogrid.exe > geogrid/src/geogrid.exe

metgrid.exe > metgrid/src/metgrid.exe

ungrib.exe > ungrib/src/ungrid.exe

ls al ./util/

Generate static data Generate input data for WRFV3 Unpack GRIB data

plotgrids.exe

domains

Generate domain graphics. An exellent tool to configure

before running geogrid.exe (dependent on NCAR

Graphics if you

don't have these libraries, plotgrids.exe will not compile

correctly)

g1print.exe

g2print.exe

List the contents of a GRIB1 file

List the contents of a GRIB2 file

1.5. Running Model

1. Running WPS

a. Running geogrid

cd $HOME/WRF

tar -zxvf geog.tar.gz

cd geog

cd

vi namelist.wps

/WPS

max_dom = 1,

e_we =

e_sn = 61, 97,

dx = 60000,

dy = 60000,

map_proj = 'mercator', map projection

ref_lat = 00.00, ceneter latitude

ref_lon = 115.00, ceneter longitude

truelat1 = 20.0,

truelat2 = 00.0,

stand_lon = 115.0, same as ref_lon

geog_data_path = '/home/wrf/geog‘

74, 112,

./util/plotgrids.exe

idt gmeta

Pusat Meteorologi Publik Badan Meteorologi Klimatologi dan Geofisika Buku Panduan Workshop Uji Operasional WRF 2012

9

Gambar hasil dari menjalankan script “ idt gmeta ” < Menjalankan geogrid >  ./geogrid.exe

Gambar hasil dari menjalankan script “idt gmeta

< Menjalankan geogrid >

./geogrid.exe

< check files>

ls al

geo_em.d01.nc

< Visualization for geogrid data with NCL >

cd $HOME

wget http://www.mmm.ucar.edu/wrf/OnLineTutorial/Graphics/NCL/.hluresfile

< check files >

ls al .hluresfile

.hluresfile

cd WRF/WPS

wget http://www.mmm.ucar.edu/wrf/OnLineTutorial/Graphics/NCL/Examples/BASI

C/wrf_wps_ter6.ncl

< check files >

ls al wrf_wps_ter6.ncl

wrf_wps_ter6.ncl

ncl wrf_wps_ter6.ncl

Pusat Meteorologi Publik Badan Meteorologi Klimatologi dan Geofisika Buku Panduan Workshop Uji Operasional WRF 2012

10

b. ungrib < Download data GFS – GFS >  cd ${HOME}/WRF  mkdir GFS

b. ungrib

< Download data GFS GFS >

cd ${HOME}/WRF

mkdir GFS

cd GFS

ftp ftpprd.ncep.noaa.gov

ID : anonymous, PW : (e-mail)

cd pub/data/nccf/com/gfs/prod

cd gfs.2012091800 (for example)

bi

prompt

mget gfs.t00z.pgrbf00.grib2 gfs.t00z.pgrbf06.grib2 gfs.t00z.pgrbf12.grib2

gfs.t00z.pgrbf06.grib2 gfs.t00z.pgrbf12.grib2  cd ${HOME}/WRF/WPS  vi namelist.wps – start_date
gfs.t00z.pgrbf06.grib2 gfs.t00z.pgrbf12.grib2  cd ${HOME}/WRF/WPS  vi namelist.wps – start_date
gfs.t00z.pgrbf06.grib2 gfs.t00z.pgrbf12.grib2  cd ${HOME}/WRF/WPS  vi namelist.wps – start_date
gfs.t00z.pgrbf06.grib2 gfs.t00z.pgrbf12.grib2  cd ${HOME}/WRF/WPS  vi namelist.wps – start_date

cd ${HOME}/WRF/WPS

vi namelist.wps

start_date = '2012-09-18_00:00:00',

end_date = '2011-09-19_00:00:00', (24hour forecast)

ln s ungrib/Variable_Tables/Vtable.GFS

./Vtable

(link Vtable.GFS file to Vtable in current directory)

./link_grib.csh

(link

/ /gfs/gfs* to GRIBFILE.AAA … in current directory)

/ /gfs//gfs…

Pusat Meteorologi Publik Badan Meteorologi Klimatologi dan Geofisika Buku Panduan Workshop Uji Operasional WRF 2012

11

./ungrib.exe (excute ungrib process)

< check files >

ls al FILE:*

FILE:2012-09-18_00

FILE:2012-09-18_06

FILE:2012-09-18_12

FILE:2012-09-18_18

FILE:2012-09-19_00

c.

Metgrid

 

< Input data >

 
 

FILE:2012-09-18_00

FILE:2012-09-18_06

FILE:2012-09-18_12

FILE:2012-09-18_18

./metgrid.exe (excute metgrid process)

output data

 

-

met_em.d01.2012-09-18_00:00:00.nc

-

met_em.d01.2012-09-18_06:00:00.nc

-

met_em.d01.2012-09-18_12:00:00.nc

-

met_em.d01.2012-09-18_18:00:00.nc

-

met_em.d01.2012-09-19_00:00:00.nc

2.

Running WRF

 

a.

Real

cd $HOME/WRF/WRFV3/run

 

ln -fs ~/WRF/WPS/met_em.d01.* ./

 

vi namelist.input

-

run_hours, start end date (edit)

 

run_hours

= 24

run_minutes

= 0

start_year

= 2012,

start_month

= 09,

start_day

= 18,

start_hours

= 00,

interval_seconds

= 21600

history_interval

= 180

(forecast interval) (save 1000 output-time in one file)

 

frame_per_outfile

= 1000

restart

= .false.

restart_interval

= 18000

 

Pusat Meteorologi Publik Badan Meteorologi Klimatologi dan Geofisika Buku Panduan Workshop Uji Operasional WRF 2012

12

   

! auxinput4_inname

= “wrflowinp_d<domain>”

! auxinput4_interval = 180

io_form_auxinput4

= 2

write_hist_at_0h_rst

= .false.

max_dom

= 1

sst_update

= 0

grid_fdda

= 0,

./real.exe

 

output data

 

-

wrfinput_d01

-

wrfbdy_d01

b.

Running wrf

 

Input data

- wrfinput_d01

- wrfbdy_d01

./wrf.exe

( It takes about a few minutes )

output data

- wrfout_d01_2012-09-18_00:00:00

3. Postprocessing / Visualisasi menggunakan NCL

a. Download script NCL

http://www.mmm.ucar.edu/wrf/OnLineTutorial/Graphics/NCL/NCL_examples.htm

Pusat Meteorologi Publik Badan Meteorologi Klimatologi dan Geofisika Buku Panduan Workshop Uji Operasional WRF 2012

13

 Precipitation forecast  wget http://www.mmm.ucar.edu/wrf/OnLineTutorial/Graphics/NCL/Examples/PRECIP/wr

Precipitation forecast

vi wrf_Precip.ncl (edit date) a = addfile("./wrfout_d01_2012-09-18_00:00:00.nc","r")

type = "x11“ ; type = "pdf"

ncl wrf_Precip.ncl

Visualisasi Output Precipitation dan sea-level pressure dengan NCL

Pusat Meteorologi Publik Badan Meteorologi Klimatologi dan Geofisika Buku Panduan Workshop Uji Operasional WRF 2012

14

Forecast 00 hour Forecast 2 hour Pusat Meteorologi Publik Badan Meteorologi Klimatologi dan Geofisika Buku

Forecast 00 hour

Forecast 00 hour Forecast 2 hour Pusat Meteorologi Publik Badan Meteorologi Klimatologi dan Geofisika Buku Panduan

Forecast 2 hour

Pusat Meteorologi Publik Badan Meteorologi Klimatologi dan Geofisika Buku Panduan Workshop Uji Operasional WRF 2012

15

Forecast 4 hour 4. WRF Running Dengan MPI (Run in parallel mode) Run WRF model

Forecast 4 hour

4. WRF Running Dengan MPI (Run in parallel mode)

Run WRF model in parallel mode

< mpich2 >

yum install mpich2

yum install mpich2-devel

<WRF>

./configure

3. Linux i486 i586 i686, gfortran compiler with gcc (dmpar)

1=basic,

Run WRF model in parallel mode

< mpdboot >

cd $HOME

touch .mpd.conf

chmod 600 .mpd.conf

- and then use an editor to insert a line like

- MPD_SECRETWORD=mr45-j9z

- into the file. (Of course use some other secret word than mr45-j9z.)

mpdboot

< mpirun >

mpirun np 2 ./wrf.exe ( almost half time for same

case )

Pusat Meteorologi Publik Badan Meteorologi Klimatologi dan Geofisika Buku Panduan Workshop Uji Operasional WRF 2012

16