WRF demo/tutorial

63
WRF demo/tutorial 12-13-2004 Robert Fovell [email protected]

description

WRF demo/tutorial. 12-13-2004 Robert Fovell [email protected]. Background on WRF model. “Weather Research and Forecasting” Co-developed by research and operational communities Replaces MM5 and Eta models Current version 2.0.3.1 - PowerPoint PPT Presentation

Transcript of WRF demo/tutorial

Page 1: WRF demo/tutorial

WRF demo/tutorial

12-13-2004Robert Fovell

[email protected]

Page 2: WRF demo/tutorial

Background on WRF model

• “Weather Research and Forecasting”

• Co-developed by research and operational communities

• Replaces MM5 and Eta models

• Current version 2.0.3.1

• Platforms (for model): Linux, IBM/AIX, SGI, Cray, Darwin… and Sun (hideous)

Page 3: WRF demo/tutorial

WRF advantages

• Better numerics than MM5– Arakawa C grid, R-K scheme, odd order advection

w/ implicit diffusion– Much less diffusive, larger effective resolution,

permits longer time steps

• Better topography than Eta• GUI-driven domain configuration, initialization• Fortran 95 (MM5 was F77)• NetCDF output

Page 4: WRF demo/tutorial

Further advantages

• Allows real data and idealized simulations in same framework

• Plug-in architecture (different groups will supply WRF “cores”)

• What I’m calling WRF is really the “Advanced Research WRF” (ARW) core

Page 5: WRF demo/tutorial

WRF disadvantages

• Bleeding edge• Smaller range of physics choices

overall• No radiation upper bdry condition [yet]• Software design cumbersome, obtuse

[opinion may change with experience]• Nesting is very serious pain [that will

change]

Page 6: WRF demo/tutorial

Overview

• WRF Standard Initialization (WRFSI)– Set up domain– Prepare data for model run– MM5 equiv: terrain, pregrid, regridder

• WRF model– Initialize model (MM5’s interpf)– Run model

• WRF post-processing• WRF 3DVAR (not covered today)

Page 7: WRF demo/tutorial

Web stuff…

• http://www.mmm.ucar.edu/wrf/users/user_main.html (WRF model users’ site)

• http://www.mmm.ucar.edu/wrf/users/wrfv2/wrf-namelist.html (WRF namelist.input page)

• http://www.mmm.ucar.edu/wrf/users/docs/user_guide/contents.html (WRF users guide)

• http://www.mmm.ucar.edu/wrf/users/tutorial/tutorial-2004.htm (Slides from 2004 WRF tutorial at NCAR)

• http://www.atmos.ucla.edu/~fovell/WRF/WRF_ports.html (Darwin/Mac OS X port)

• http://www.wrf-model.org/si/ (WRFSI home page)• http://www.mmm.ucar.edu/wrf/WG4/tutorial/wrf3dvar_download

_data.htm (WRF 3DVAR tutorial)

Page 8: WRF demo/tutorial

WRF for real data run

Example:

24-26 October 2003 (Simi fire)

Page 9: WRF demo/tutorial

Directory structure

• …/WRFV2/– Parent directory

• …/WRFV2/wrfsi– WRFSI location

• …/WRFV2/wrfsi/domains/SoCal– Domain setup “SoCal” location

• …/WRFV2/test/em_real– Where real data run will be made

Page 10: WRF demo/tutorial

WRFSI

…/WRFV2/wrfsi/wrf_tools

Page 11: WRF demo/tutorial
Page 12: WRF demo/tutorial
Page 13: WRF demo/tutorial
Page 14: WRF demo/tutorial
Page 15: WRF demo/tutorial
Page 16: WRF demo/tutorial
Page 17: WRF demo/tutorial
Page 18: WRF demo/tutorial
Page 19: WRF demo/tutorial
Page 20: WRF demo/tutorial
Page 21: WRF demo/tutorial

Domain 1terrain

Page 22: WRF demo/tutorial
Page 23: WRF demo/tutorial
Page 24: WRF demo/tutorial
Page 25: WRF demo/tutorial
Page 26: WRF demo/tutorial
Page 27: WRF demo/tutorial
Page 28: WRF demo/tutorial

Output from WRFSI

• …/WRFV2/wrfsi/domains/SoCal/siprd

• IC, BC files for D1, IC file for D2• Move or link into …/WRFV2/test/em_real

Page 29: WRF demo/tutorial

WRF model

…/WRFV2/

Page 30: WRF demo/tutorial

Directory structure

• In ../WRFV2– main/ is where executables live– arch/ default config stuff– frame/ model framework stuff– phys/, dyn_em/ model physics, solver– external/ mainly I/O, MPI stuff– test/ test cases live here– run/ can run model from here, too

Page 31: WRF demo/tutorial

Preparing to run

• Configure– ./configure– Select platform, compiler, & whether single

threaded, OpenMP or MPI

• Compile– ./compile em_real– Creates real.exe and wrf.exe in ../WRFV2/main– Creates links to real.exe, wrf.exe in

../WRFV2/test/em_real

Page 32: WRF demo/tutorial

Configuring

• ./configure presents option list

• Example: chose option 3, MPI

Page 33: WRF demo/tutorial

Compiling

• ./compile presents options

• Example: chose compile em_real– Eulerian mass-coordinate real-data model

Page 34: WRF demo/tutorial

Final initialization step

• Move to .../WRFV2/test/em_real

• Edit namelist.input– Lots to do here…

• Execute ./real.exe– Creates wrfinput_d01, wrfbdy_d01 files– Run for each nest separately [ouch]

• Model executable is wrf.exe

Page 35: WRF demo/tutorial

Editing namelist.input

• Web resource– http://www.mmm.ucar.edu/wrf/users/

wrfv2/wrf-namelist.html

• Namelist sections [partial list]– &time_control– &domains– &physics– &dynamics

Page 36: WRF demo/tutorial

Setup for single domain run

Columns provided for 3 domains (parent & 2 nests)but if max_dom =1 extra columns ignored

Page 37: WRF demo/tutorial

Setup for single domain run

time_step ~ 6*DX (3*DX for MM5)… unless convective;Change max_dom when ready to activate nest

Page 38: WRF demo/tutorial

Setup for single domain run

Here I have my MOAD dimensions (80x67) andnest dimensions (61x37) entered. Third column ignored since

I only created 2 domains

Page 39: WRF demo/tutorial

Setup for single domain run

s_we = start index for west-east direction, always 1.e_we = end index west-east, that’s your dimension

Page 40: WRF demo/tutorial

Setup for single domain run

Make sure dx, dy set correctly-- the model does NOT check GUI-created inputs!

Page 41: WRF demo/tutorial

Setup for single domain run

Columns provided for 3 domains (parent & 2 nests)but if max_dom =1 extra columns ignored

Page 42: WRF demo/tutorial

Setup for single domain run

Here, subgrid mixing and computational diffusion is deactivated;model’s odd order advection is diffusive

Page 43: WRF demo/tutorial

Run real.exe & wrf.exe

• ./real.exe– Look for real_em: SUCCESS COMPLETE

REAL_EM INIT message

• mpirun -np 2 wrf.exe &– MPI version creates rsl.out.000* and

rsl.error.000* files– tail -f rsl.out.0000– Look for wrf: SUCCESS COMPLETE WRF

Page 44: WRF demo/tutorial

Files created by WRF run

• Named like:

wrfout_d01_2003-10-24_12:00:00

[d01 = domain 1;

file started 12Z 24 October 2003]

• Files can be HUGE (NetCDF inefficient)

- to split output files, namelist entry

frames_per_outfile in &time_control

Page 45: WRF demo/tutorial

WRF postprocessing

• RIP (just like MM5)

• WRF2GrADS converter

• WRF2VIS5D converter

• Software that can handle NetCDF

Page 46: WRF demo/tutorial

RIP

• RIP version 4 required• Real data runs only• ripdp_wrf expname all wrfout*

– Will unpack every wrfout* files in local directory and all variables and call extracted files “expname”

– Replace “all” with “basic” for less output

• RIP4 unpacker for MM5 is now ripdp_mm5 expname MMOUT*

Page 47: WRF demo/tutorial

Animation using RIP

• Part of Domain 1 shown for 24Oct2003 case

QuickTime™ and aVideo decompressor

are needed to see this picture.

Color: 2 m temperature; topo contours; 10 m wind vectors

Page 48: WRF demo/tutorial

Nesting

• Created domains 1, 2 for SoCal in WRFSI• WRFSI created wrf_real_input_em* files for

both domains• Need to run real.exe once for each domain• namelist.input needs to be edited for each

real.exe run• Files have to be renamed to “fool” real.exe• Web page explanation:

http://www.mmm.ucar.edu/wrf/users/wrfv2/runwrf.html

Page 49: WRF demo/tutorial

MM5 v. WRF on nesting

• MM5:– Need only initialize parent (outer) grid– MM5 interpolates to nests, using nest terrain files

created using terrain

• WRF– If let model interpolate to nests, higher res topo

files are NOT used, unlike MM5– So, you need to init each domain separately with

real.exe, and that takes fooling real.exe…

Page 50: WRF demo/tutorial

Fooling real.exe - 2 domain example

• Start with domain 2 first• Edit namelist.input, putting nest information in

first column– Previously, that info was for parent grid

• Rename wrf_real_input_em.d02* IC file as wrf_real_input_d01* [after saving “real” d01 file!!!!]– Here, it’s wrf_real_input_em.d02.2003-10-24_12:00:00 being

renamed as wrf_real_input_em.d01.2003-10-24_12:00:00

• Then…

Page 51: WRF demo/tutorial

Fooling real.exe - 2 domain example (cont.)

• This creates a wrfinput_d01 file (since real.exe thinks it’s domain #1)

• Rename that file as wrfinput_d02 (since it’s really for domain #2)

• Restore original domain #1 IC file– Here, it’s wrf_real_input_em.d01.2003-10-24_12:00:00

• Re-edit namelist.input, making sure domain #1 info in 1st column, domain #2 in 2nd…

• Run real.exe again– Creates wrfbdy_d01, wrfinput_d01

Page 52: WRF demo/tutorial

Nesting initialization, step by step

• This should be scripted somehow, to avoid mistakes

• Create your namelist.input, with parent and nest domain info, start and stop times, etc…– Set max_dom = 2– Set input_from_file = .true., .true.

• ICs for both domains will be read in from files• Those filenames will be wrfinput_d01, wrfinput_d02

Page 53: WRF demo/tutorial

Nesting initialization, step by step (cont.)

• Rename original d01 IC file as

• Copy d02 IC file with d01 IC file original name

• Copy namelist.input as namelist.input.real• Edit namelist.input

– This is your temporary namelist.input file– Set stop time = start time [only want IC]– Replace parent domain info in column #1 with nest info from

column #2

Page 54: WRF demo/tutorial

Nesting initialization, step by step (cont.)

• Temporary namelist.input’s &time_control

Page 55: WRF demo/tutorial

Nesting initialization, step by step (cont.)

• Temporary namelist.input’s &domains

• Run real.exe• Rename wrfinput_d01 as wrfinput_d02

Page 56: WRF demo/tutorial

Nesting initialization, step by step (cont.)

• Clean up:– Move namelist.input.real to namelist.input– Move wrf_real_input_em.d01.2003-10-24_12:00:00.real back to

wrf_real_input_em.d01.2003-10-24_12:00:00

• Run real.exe again, this time creating wrfinput_d01 and wrfbdy_d01

• Now you have– wrfinput files for d01 and d02– wrfbdy file for d01– namelist.input file controlling both domains

• Run the model!

Page 57: WRF demo/tutorial

Animation of nest

• Domain 2 shown for 24Oct2003 case

Color: 2 m temperature; topo contours; 10 m wind vectors

QuickTime™ and aVideo decompressor

are needed to see this picture.

Page 58: WRF demo/tutorial

Restarting WRF

• In namelist.input, set restart_interval to desired restart output file interval (minutes)

• To restart a simulation– Set restart = .true.– Set start_* time to reflect restart time

Page 59: WRF demo/tutorial

WRF performance on my machines

Page 60: WRF demo/tutorial

Compile flag notes

• On PCs, Intel beats PGF handily– But use -mp flag for accuracy, consistency as

number of CPUs varied• This flag does NOT refer to multiprocessing w/ Intel

compiler

– Don’t use -xW [vectorization] flag w/o checking (my results so far always wrong)

• On Macs, IBM xlf is a great compiler– But use -qfloat=nomaf flag for accuracy– My tests: virtually identical results between

optimized and non-optimized when nomaf used

Page 61: WRF demo/tutorial

WRF for idealized cases

• Ready-made examples include 2D squall lines and 3D supercells

• compile em_squall2d_x for the 2D x-z plane squall line example

• In …/WRFV2/test/em_squall2d_x, run ideal.exe and then wrf.exe

• To change IC for this case, modify …/WRFV2/dyn_em/module_initialize_squall2d_x.F and recompile

Page 62: WRF demo/tutorial

Ideal run output using WRF2GrADS

Page 63: WRF demo/tutorial

- End -