Tutorial WRF
Tutorial WRF
sudo apt-get install csh && sudo apt-get install gfortran && sudo apt-get
install m4 && sudo apt-get install mpich && sudo apt-get install libhdf5-
mpich-dev && sudo apt-get install libpng-dev && sudo apt-get install
libjasper-dev && sudo apt-get install libnetcdff-dev && sudo apt-get install
netcdf-bin
wget
https://www2.mmm.ucar.edu/wrf/OnLineTutorial/compile_tutorial/tar_files/Fort
ran_C_NETCDF_MPI_tests.tar && tar -xvf Fortran_C_NETCDF_MPI_tests.tar && cp
${NETCDF}/include/netcdf.inc . && gfortran -c 01_fortran+c+netcdf_f.f && gcc
-c 01_fortran+c+netcdf_c.c && gfortran 01_fortran+c+netcdf_f.o
01_fortran+c+netcdf_c.o -L${NETCDF}/lib -lnetcdff -lnetcdf && ./a.out && cp
${NETCDF}/include/netcdf.inc . && mpif90 -c 02_fortran+c+netcdf+mpi_f.f &&
mpicc -c 02_fortran+c+netcdf+mpi_c.c && mpif90 02_fortran+c+netcdf+mpi_f.o
02_fortran+c+netcdf+mpi_c.o -L${NETCDF}/lib -lnetcdff -lnetcdf && mpirun
./a.out
./compile em_real >& compile.log & tail -f compile.log && ls -ls main/*.exe
export JASPERLIB=$DIR/grib2/lib
export JASPERINC=$DIR/grib2/include
grads
sdfopen fnl_20171126_18_00.nc
q file
Descriptor: fnl_20171126_18_00.nc
Binary: fnl_20171126_18_00.nc
Type = Gridded
Xsize = 360 Ysize = 181 Zsize = 1 Tsize = 1 Esize = 1
Number of Variables = 26
u 1 t,z,y,x U component of wind
v 1 t,z,y,x V component of wind
vrate 1 t,z,y,x Ventilation Rate
gust 0 t,y,x Wind speed (gust)
hindex 0 t,y,x Haines Index
mslet 0 t,y,x MSLP (Eta model reduction)
sp 0 t,y,x Surface pressure
orog 0 t,y,x Orography
t_2 0 t,y,x Temperature
sdwe 0 t,y,x Water equivalent of accumulated snow depth (deprecated)
sde 0 t,y,x Snow depth
cpofp 0 t,y,x Percent frozen precipitation
wilt 0 t,y,x Wilting Point
fldcp 0 t,y,x Field Capacity
sunsd 0 t,y,x Sunshine Duration
lftx 0 t,y,x Surface lifted index
cape 0 t,y,x Convective available potential energy
cin 0 t,y,x Convective inhibition
gh_4 0 t,y,x Geopotential Height
r_3 0 t,y,x Relative humidity
4lftx 0 t,y,x Best (4-layer) lifted index
hpbl 0 t,y,x Planetary boundary layer height
lsm 0 t,y,x Land-sea mask
ci 0 t,y,x Sea ice area fraction
prmsl 0 t,y,x Pressure reduced to MSL
landn 0 t,y,x Land-sea coverage (nearest neighbor) [land=1,sea=0]
WPS Running with WRFDomainWizard
Masuk folder WRFDomainWizard
./run_DomainWizard
AWS Digi Stamet Maritim Tanjung Mas Semarang -6.95; 110.41817
Mercator
Grid point 27 km
nesting:
domain 2 = 3 ; 2m
domain 3 = 3 ; 30s
Set:
&time_control
run_days = 2,
run_hours = 0,
run_minutes = 0,
run_seconds = 0,
start_year = 2021, 2021, 2021,
start_month = 02, 02, 02,
start_day = 04, 04, 04,
start_hour = 06, 06, 06,
start_minute = 00, 00, 00,
start_second = 00, 00, 00,
end_year = 2021, 2021, 2021,
end_month = 02, 02, 02,
end_day = 06, 06, 06,
end_hour = 06, 06, 06,
end_minute = 00, 00, 00,
end_second = 00, 00, 00,
interval_seconds = 21600,
input_from_file = .true., .true., .true.,
history_interval = 180, 60, 60,
frames_per_outfile = 1000, 1000, 1000,
&domains
time_step = 150,
time_step_fract_num = 0,
time_step_fract_den = 1,
max_dom = 3,
e_we = 100, 88, 76,
e_sn = 100, 88, 76,
e_vert = 35, 35, 35,
num_metgrid_levels = 34,
dx = 27000, 9000, 3000,
dy = 27000, 9000, 3000,
&physics
mp_physics = 6, 6, 6,
ra_lw_physics = 4, 4, 4,
ra_sw_physics = 4, 4, 4,
radt = 30, 30, 30,
sf_sfclay_physics = 91, 91, 91,
sf_surface_physics = 2, 2, 2,
bl_pbl_physics = 1, 1, 1,
cu_physics = 16, 16, 0,
WPS Running
Manual
(Open Terminal di Folder WRF)
mkdir latihan1
cd latihan1
mkdir arwpost
mkdir data
mkdir ARW
cd ARW
ln -sf /home/wahyu/WRF/WPS/link_grib.csh /home/wahyu/WRF/WPS/geogrid
/home/wahyu/WRF/WPS/geogrid/geogrid.exe /home/wahyu/WRF/WPS/metgrid
/home/wahyu/WRF/WPS/metgrid.exe /home/wahyu/WRF/WPS/ungrib
/home/wahyu/WRF/WPS/ungrib/ungrib.exe /home/wahyu/WRF/WRFV4/run/*.TBL
/home/wahyu/WRF/WRFV4/run/*.exe /home/wahyu/WRF/WRFV4/run/RRTM*
/home/wahyu/WRF/WRFV4/run/ozone* .
ln -sf /home/wahyu/WRF/WPS/metgrid/METGRID.TBL .
ln -sf /home/wahyu/WRF/WPS/geogrid/GEOGRID.TBL .
cp /home/wahyu/WRF/WPS/namelist.wps ~/WRF/WPS/util/plotgrids_new.ncl .
cp /home/wahyu/WRF/WPS/ungrib/Variable_Tables/Vtable.GFS Vtable
cp /home/wahyu/WRF/WRFV4/run/namelist.input namelist.input
cd ..
cd arwpost
ln -sf /home/wahyu/WRF/ARWpost /home/wahyu/WRF/ARWpost/src/ARWpost.exe .
ln -sf /home/wahyu/WRF/ARWpost/src .
ln -sf /home/wahyu/WRF/ARWpost/script .
cp /home/wahyu/WRF/ARWpost/namelist.ARWpost .
Berikut beberapa yang harus didownload dan di ekstrak pada folder wps geog
WPS Geographical Input Data Mandatory for Specific Applications
Thompson28 and Chem Tar File
Urban Tar File (Urban Physics (sf_urban_physics=1, 2, or 3)) dan SSiB LSM
(sf_surface_physics=8)
Lake Model (sf_lake_physics=1)
NMM Dynamical Core
Optional WPS Geographical Input Data
Simulations Older than Year 2000
Alternative Data Source for all LSM's
cd libpng-1.2.54
./autogen.sh
./configure
make -j8
sudo make install
prior to any of this assure you machine has these preliminary packages installed ... baseline for any
dev kit
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install libtool autoconf build-essential pkg-config automake tcsh
WRF Running 2 Juni 2021
Manual
(Open Terminal di folder /WRF/latihan1/ARW)
./real.exe
mpirun -np 4 ./wrf.exe
Membuka Terminal Lain, lalu ketikkan: tail -f rsl.out.0000
Contoh Error:
&datetime
start_date = '2021-02-04_06:00:00',
end_date = '2021-02-06_06:00:00',
interval_seconds = 3600,
tacc = 0,
debug_level = 0,
/
&io
input_root_name = './wrfout_d03_2021-02-04_06:00:00'
output_root_name = './D3'
plot = 'all_list'
fields =
'height,geopt,theta,tc,tk,td,td2,rh,rh2,umet,vmet,pressure,u10m,v10m,wdir,wspd,wd10,ws10,sl
p,mcape,mcin,lcl,lfc,cape,cin,dbz,max_dbz,clfr'
Menjalankan ARWpost
./ARWpost.exe
Skrip CAPE
reinit
open D3.ctl
set grid off
set arrlab off
set grads off
set timelab off
set csmooth on
set font 1
set time 19Z05FEB2021
set map 1 1 3
set xlint 5.0
set ylint 2.0
set gxout shaded
set clevs 500 1000 1500 2000 2500 3000 3500
d CAPE
/home/wahyu/grads/cbarn.gs
draw xlab LONGITUDE
set strsiz 0.13
set string 1 bl 6 0
draw string 9.4 1.8 (J/kg)
draw title CAPE 19 UTC 05-02-2021
printim CAPE1905.png white
c
;----------------------------------------------------------------------
; WRF_pcp_2.ncl
;
; Concepts illustrated:
; - Plotting WRF data
; - Overlaying WRF precipitation on terrain map using gsn_csm functions
; - Setting the correct WRF map projection using wrf_map_resources
; - Creating two contour plots with two sets of filled contours
; - Explicitly setting contour levels
; - Drawing fully transparent filled contours
; - Turning the tickmarks inward on the X and Y axes
; - Moving the contour informational label into the plot
; - Customizing the contour informational label
;----------------------------------------------------------------------
; This script shows how to plot WRF rain totals on a WRF terrain map,
; using transparency for all rain totals below a certain level.
;----------------------------------------------------------------------
; This script was contributed by Xiao-Ming Hu (xhu@ou.edu)
; Center for Analysis and Prediction of Storms
; University of Oklahoma
;----------------------------------------------------------------------
; These files are loaded by default in NCL V6.2.0 and newer
; load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
; load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
; load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
begin
idomain = 3 ; 3,3
;---Rain data
f0 = addfile("wrfout_d0"+idomain+"_2021-02-06_00:00:00.nc","r")
Times = f0->Times
dims = dimsizes(Times)
RAINC = f0->RAINC(0,:,:)
RAINNC = f0->RAINNC(0,:,:)
RainTotal = RAINC(:,:)
;---Terrain data
fmap = addfile("wrfinput_d0"+idomain+".nc","r")
HGT = fmap->HGT(0,:,:)
HGT =(/HGT/1000./)
res_ter@gsnFrame = False
res_ter@gsnDraw = False
res_ter@tfDoNDCOverlay = True
res_ter@mpOutlineBoundarySets = "AllBoundaries"
res_ter@mpDataSetName = "Earth..4" ; Gives us provincial
boundaries
res_ter@mpGeophysicalLineThicknessF = 1.5 ; thickness of map outlines
res_ter@mpProvincialLineThicknessF = 2.
res_ter@mpProvincialLineColor = "black"
cmap := read_colormap_file("BlAqGrYeOrReVi200")
cmap(0,:) = (/0,0,0,0/) ; make first color fully transparent
res_tot@cnFillOn = True
res_tot@cnFillMode = "RasterFill"
res_tot@cnFillPalette = cmap
res_tot@cnLinesOn = False ; turn off contour lines
res_tot@cnLineLabelsOn = False ; turn off contour labels
res_tot@cnFillOpacityF = 1. ; .85
res_tot@tfDoNDCOverlay = True
res_tot@cnLevelSelectionMode = "ManualLevels"
res_tot@cnMaxLevelValF = 42
res_tot@cnMinLevelValF = 2
res_tot@cnLevelSpacingF = 4
res_tot@cnInfoLabelOn = True
res_tot@cnInfoLabelString = "Min= $ZMN$ Max= $ZMX$"
res_tot@cnInfoLabelOrthogonalPosF = -0.104 ; move info label into plot
res_tot@tiMainFont = "Helvetica-bold"
res_tot@tiMainFontHeightF = 0.018
res_tot@gsnRightString = "RAIN, mm"
res_tot@gsnLeftString = ""
overlay(plot_terrain, plot_raintot)
draw(plot_terrain)
frame(wks)
end do ; ihour
end
menjalankannya dengan
ncl SkripNCL.ncl
Untuk mengecek urutan waktu pada WRFout (untuk mengisi waktu awal hujan di Skrip NCL)
ncdump -v Times wrfout_d03_2021-02-17_18\:00\:00
Hasilnya:
Times =
0 "2021-02-04_06:00:00",
1 "2021-02-04_07:00:00",
2 "2021-02-04_08:00:00",
3 "2021-02-04_09:00:00",
4 "2021-02-04_10:00:00",
5 "2021-02-04_11:00:00",
6 "2021-02-04_12:00:00",
7 "2021-02-04_13:00:00",
8 "2021-02-04_14:00:00",
9 "2021-02-04_15:00:00",
10 "2021-02-04_16:00:00",
11 "2021-02-04_17:00:00",
12 "2021-02-04_18:00:00",
13 "2021-02-04_19:00:00",
14 "2021-02-04_20:00:00",
15 "2021-02-04_21:00:00",
16 "2021-02-04_22:00:00",
17 "2021-02-04_23:00:00",
18 "2021-02-05_00:00:00",
19 "2021-02-05_01:00:00",
20 "2021-02-05_02:00:00",
21 "2021-02-05_03:00:00",
22 "2021-02-05_04:00:00",
23 "2021-02-05_05:00:00",
24 "2021-02-05_06:00:00",
25 "2021-02-05_07:00:00",
26 "2021-02-05_08:00:00",
27 "2021-02-05_09:00:00",
28 "2021-02-05_10:00:00",
29 "2021-02-05_11:00:00",
30 "2021-02-05_12:00:00",
31 "2021-02-05_13:00:00",
32 "2021-02-05_14:00:00",
33 "2021-02-05_15:00:00",
34 "2021-02-05_16:00:00",
35 "2021-02-05_17:00:00",
36 "2021-02-05_18:00:00",
37 "2021-02-05_19:00:00",
38 "2021-02-05_20:00:00",
39 "2021-02-05_21:00:00",
40 "2021-02-05_22:00:00",
41 "2021-02-05_23:00:00",
42 "2021-02-06_00:00:00",
43 "2021-02-06_01:00:00",
44 "2021-02-06_02:00:00",
45 "2021-02-06_03:00:00",
46 "2021-02-06_04:00:00",
47 "2021-02-06_05:00:00",
48 "2021-02-06_06:00:00" ;
}
Instalasi wrf-python:
conda install -c conda-forge wrf-python
# Add the 500 hPa wind barbs, only plotting every 125th data point.
plt.barbs(to_np(lons[::5,::5]), to_np(lats[::5,::5]),
to_np(u_500[::5, ::5]), to_np(v_500[::5, ::5]),
transform=crs.PlateCarree(), length=6)
ax.gridlines()
plt.show()
set t 20 43
set lat -6.97611
set lon 110.378
Pastikan python 3 versi terbaru sudah terinstall untuk menjalankan Anaconda Navigator
Persiapan:
Libraries: jasper-1.900.1, libpng-1.2.5-, mpich-3.0.4, netcdf4-4.1.3, zlib-1.2.7, hdf5-1.10.4
Download:
www.ece.uvic.ca/-frodo/jasper
www.libpng.org/pub/png/libpng.html
www.mpich.org/downloads/
www.unidata.ucar.edu/software/netcdf/
www.zlib.net/
https://support.hdfgroup.org/
Building Libraries
FNL Data
NCEP Global Analyses on 1x1 degree grids are available every six hours. The analyses are from the
NCEP Final Analyses (FNL). These were operationally prepared by NCEP, but are available for
download from NCAR/RDA.
For further information about the FNL archives at NCAR: See, http://rda.ucar.edu/datasets/ds083.2.
Type: GRIB2 data
Resolution:
1deg global data
Output frequency 6 hourly
34 pressure levels
Availability: These data are available at NCAR/RDA since July 30, 1999
From the web:
http://rda.ucar.edu/datasets/ds083.2
Follow the tab to "Data Access -> Internet Download". You must register (it is free) to
access the data.
Vtable: Vtable.GFS
Sample data (Boulder, CO, U.S. Snowstorm, Nov. 2019)
These data are available for the period November 25 at 12 UTC, through November 27 at 00 UTC,
2019 (data frequency is 6 hourly).
6. ./ungrib.exe
This will create an ungrib.log for your records.
7. Examine the intermediate files, e.g.,
./util/rd_intermediate.exe FILE:2019-11-25_12
ncl /util/plotfmt.ncl 'filename="FILE:2019-11-25_12"'
Sumber: https://www2.mmm.ucar.edu/wrf/OnLineTutorial/DATA/FNL/fnl.php
GFS Data
GFS (Global Forecast System) is a model product from NCEP.
Type: GRIB1 / GRIB2 data
Resolution:
0.25 deg global data
Output frequency 3 hourly
34 pressure levels
Availability:
From NCAR's RDA site: https://rda.ucar.edu/datasets/ds084.1/
Since Jan 15, 2015
Vtable: Vtable.GFS
Sample data (Colorado, U.S. Blizzard, Nov-Dec. 2019)
These data are GRIB2, with output frequency of 3 hourly.
The data are available for the period November 29 at 12 UTC, through December
01 at 00 UTC, 2019.
Notes on running UNGRIB for this data
1. Download data and place in directory ../DATA/co_blizzard, and then
unpack the file
./util/g2print.exe
../DATA/co_blizzard/gfs.0p25.2019112912.f000.grib2
start_date = '2019-11-29_12:00:00',
end_date = '2019-12-01_00:00:00',
interval_seconds = 10800,
prefix = 'FILE',
6. ./ungrib.exe
./util/rd_intermediate.exe FILE:2019-11-29_12
ncl /util/plotfmt_ncl 'filename="FILE:2019-11-29_12"'
Sumber: https://www2.mmm.ucar.edu/wrf/OnLineTutorial/DATA/GFS/gfs.php