Presentation is loading. Please wait.

Presentation is loading. Please wait.

For Version / Synoptic Lab

Similar presentations


Presentation on theme: "For Version / Synoptic Lab"— Presentation transcript:

1 For Version 3.0.1.1 / Synoptic Lab
WRF Tutorial For Version / Synoptic Lab January, 2009 Robert Fovell

2 Background on WRF model
“Weather Research and Forecasting” Co-developed by research and operational communities ARW core “Advanced Research WRF” NMM core “Nonhydrostatic Mesoscale Model” Supercedes MM5 and Eta models Current version Platforms include Linux and Mac OS X

3 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 handling of topography than Eta (original NAM) NAM model is now WRF-NMM Fortran 95 and C (MM5 was F77) NetCDF, GRIB1 and GRIB2

4 Further advantages MPI from the ground up
Allows real data and idealized simulations in same framework Plug-in architecture (different groups will supply WRF “cores”) Recently added: moving nests and nudging NetCDF output - many great tools such as NetCDF operators: GRIB2 output now possible as well Examples here ??

5 WRF disadvantages Bleeding edge
Smaller range of physics choices (changing quickly…) Software design is unintuitive for physical scientists Can take hours to compile But does not need frequent recompiling Comparatively slower than MM5 NetCDF files can be huge

6 WRF and related software
WRF Preprocessing System (WPS) Replaces/supercedes WRF SI WRF-ARW model Single node, OpenMP and MPI WRF postprocessing software RIP (read/interpolate/plot) GrADS NCL Specific to “hurricane” Synoptic Lab environment Neglecting for now: ARWpost, WRF Chem, WRF Var, MET (Verification software), VAPOR, Vis5D

7 Web resources WRF model users site ARW users’ guide
ARW users’ guide WRF-ARW/WPS online tutorial WRF namelist description Tutorial presentations

8 My resources This presentation (PPT format) WRF on Mac OS X

9 Setup on “hurricane” machines
Presumed: • tcsh environment • Intel Fortran compiler (64-bit) • my environment setup employed • precompiled versions of WRF, WPS, RIP and wrf_to_grads

10 Environment setup > …is the command line prompt
If you don’t have a .cshrc file (worth saving) - recommended > cp /home/fovell/.cshrc . > source .cshrc If you want to keep your present .cshrc > cp /home/fovell/cshrc_fovell.csh . > ./cshrc_fovell.csh [you would need to do this every time, in every window]

11 This environment uses my versions of
# RGF additions [abridged] setenv RIP_ROOT /home/fovell/RIP4 setenv GADDIR /home/fovell/lib/grads setenv GASCRP /home/fovell/gradslib # alias lsm 'ls -alt | more' alias rm 'rm -i' alias cp 'cp -i' alias mv 'mv -i' alias trsl ' tail -f rsl.out.0000' alias mpirun 'nohup time /home/fovell/mpich-1.2.7p1/bin/mpirun' alias w2g '/home/fovell/WRF2GrADS/wrf_to_grads' setenv P4_GLOBMEMSIZE setenv P4_SOCKBUFSIZE 65536 unlimit limit coredumpsize 0 This environment uses my versions of netcdf, mpich, grads, RIP

12 Set up a run directory > cd > mkdir SQUALL > cd SQUALL
> cp /home/fovell/WRFtutorial/make_all_links.csh . > make_all_links.csh > cp /home/fovell/WRFtutorial/namelist.* . [copies namelist.input, namelist.wps]

13 [This example uses data that
WRF for real-data run A 2006 squall-line [This example uses data that may not remain online]

14 Surface map 00Z April 3, 2006

15 Radar 00Z April 3, 2006

16 WPS overview Tasks Controlled by namelist.wps
(1) set up a domain (can be reused) geogrid.exe (2) unpack parent model data (e.g., from GFS, NAM, etc.) ungrib.exe (3) prepare unpacked data for WRF metgrid.exe Controlled by namelist.wps Input data source: FNL analysis

17 namelist.wps Setup for 3 telescoping domains
&share wrf_core = 'ARW', max_dom = 3, start_date = ' _18:00:00', ' _18:00:00',' _18:00:00', end_date = ' _00:00:00', ' _00:00:00',' _00:00:00', interval_seconds = 21600 io_form_geogrid = 2, / Setup for 3 telescoping domains For start_date, end_date need one column for each domain interval_seconds is parent model data frequency (here, 6 h f or FNL data)

18 namelist.wps (cont.) there is more… &geogrid parent_id = 1, 1, 2,
parent_grid_ratio = 1, 3, 3, i_parent_start = 1, 15, 30, j_parent_start = 1, 15, 37, e_we = 70, 133, 190, e_sn = 70, 133, 190, geog_data_res = '10m','2m','30s', dx = 36000, dy = 36000, map_proj = 'lambert', ref_lat = 39., ref_lon = , truelat1 = 30.0, truelat2 = 60.0, stand_lon = , geog_data_path = '/home/fovell/WPS_GEOG/geog' / there is more…

19 geogrid - create domain
> geogrid.exe * creates geo_em.d0*.nc (a NetCDF file) * look for “Successful completion of geogrid.” > plotgrids.exe * creates gmeta > idt gmeta * uses NCAR graphics tool to view domain

20

21 > ncdump geo_em.d01.nc | more
netcdf geo_em.d01 { dimensions: Time = UNLIMITED ; // (1 currently) DateStrLen = 19 ; west_east = 69 ; south_north = 69 ; south_north_stag = 70 ; west_east_stag = 70 ; land_cat = 24 ; soil_cat = 16 ; month = 12 ; variables: char Times(Time, DateStrLen) ; float XLAT_M(Time, south_north, west_east) ; XLAT_M:FieldType = 104 ; XLAT_M:MemoryOrder = "XY " ; XLAT_M:units = "degrees latitude" ; XLAT_M:description = "Latitude on mass grid" ; XLAT_M:stagger = "M" ;

22 Parent model data issues
Sources include GFS, FNL, NAM, RUC, NARR and NNRP reanalysis data, etc. Need a different Vtable (variable table) for each source e.g., Vtable.GFS, Vtable.NAM, Vtable.NARR, etc. Look in /home/fovell/WRFtutorial

23 Accessing parent model data
> link_grib.csh /home/fovell/FNL2006/fnl * links to where parent model for case resides ** data files start with ‘fnl*’ > ln -sf /home/fovell/WRFtutorial/Vtable.GFS Vtable * specifies appropriate Vtable > ungrib.exe * extracts parent model data * look for “Successful completion of ungrib.”

24 Next step: metgrid > metgrid.exe ...hopefully you see ...
“Successful completion of metgrid.” ...Output looks like... met_em.d _18:00:00.nc met_em.d _12:00:00.nc met_em.d _00:00:00.nc met_em.d _18:00:00.nc met_em.d _06:00:00.nc met_em.d _00:00:00.nc met_em.d _12:00:00.nc met_em.d _18:00:00.nc met_em.d _18:00:00.nc met_em.d _00:00:00.nc met_em.d _00:00:00.nc met_em.d _06:00:00.nc met_em.d _18:00:00.nc met_em.d _12:00:00.nc met_em.d _00:00:00.nc met_em.d _18:00:00.nc met_em.d _06:00:00.nc met_em.d _00:00:00.nc

25 ncdump on a metgrid file
netcdf met_em.d _18:00:00 { dimensions: Time = UNLIMITED ; // (1 currently) DateStrLen = 19 ; west_east = 69 ; south_north = 69 ; num_metgrid_levels = 27 ; This data source has 27 vertical levels. This will vary with source - so check an met_em* file.

26 WRF model steps Tasks Both use namelist.input
Run real.exe (to finish creation of WRF model input data) Run wrf.exe Both use namelist.input Configured separately from namelist.wps but includes overlapping information Examples set up to use OpenMP on a single node (i.e., WRF will use 1 or more cores)

27 For start_*, end_*, one column per domain
namelist.input &time_control run_days = 0, run_hours = 12, run_minutes = 0, run_seconds = 0, start_year = 2006, 2006, 2006, start_month = 04, 04, 04, start_day = 02, 02, 02, start_hour = 18, 18, 18, start_minute = 00, 00, 00, start_second = 00, 00, 00, end_year = 2006, 2006, 2006, end_month = 04, 04, 04, end_day = 03, 03, 03, end_hour = 06, 06, 06, end_minute = 00, 00, 00, end_second = 00, 00, 00, For start_*, end_*, one column per domain

28 namelist.input (cont.) interval_seconds matches namelist.wps
input_from_file = .true.,.true.,.true., history_interval = 60, 60, 60, frames_per_outfile = 1, 1, 1, restart = .false., restart_interval = 5000, interval_seconds matches namelist.wps input_from_file should normally be ‘true’ for each domain history_interval - how frequently (in min) output created frames_per_outfile - number of writes in each history file If wish to restart mode, restart = .true. (and set model start_* data to restart time) restart_interval = frequency (min) for writing restart files

29 namelist.input (cont.) time_step = 60, time_step_fract_num = 0,
&domains time_step = 60, time_step_fract_num = 0, time_step_fract_den = 1, max_dom = 1, s_we = 1, 1, 1, e_we = 70, , 190, s_sn = 1, 1, 1, e_sn = 70, , 190, s_vert = 1, 1, 1, e_vert = 51, 51, 51, num_metgrid_levels = 27 dx = 36000, 12000, 4000, dy = 36000, 12000, 4000, grid_id = 1, 2, 3, parent_id = 0, 1, 2, i_parent_start = 0, , 30, j_parent_start = 0, , 37, parent_grid_ratio = 1, 3, 3, parent_time_step_ratio = 1, 3, 3,

30 namelist.input (cont.) there is more… &physics mp_physics = 3, 3, 3,
ra_lw_physics = 1, 1, 1, ra_sw_physics = 1, 1, 1, radt = 10, 10, 10, cam_abs_freq_s = 21600, cam_abs_dim = 4, cam_abs_dim = 51, levsiz = 59, paerlev = 29, sf_sfclay_physics = 1, 1, 1, sf_surface_physics = 2, 2, 2, bl_pbl_physics = 1, 1, 1, bldt = 0, 0, 0, cu_physics = 1, 1, 0, cudt = 5, 5, 5, there is more…

31 Notes on physics Need to use SAME microphysics (mp) scheme in each domain, but can use different cumulus (cu) schemes Some physics combinations work better than others, some don’t work at all -- this is only lightly documented bldt = 0 means boundary layer (bl) scheme is called every time step Standard practice: call bl every time step, cu every 5 min, ra (radiation) every 10 min

32 namelist.input (cont.) &dynamics w_damping = 0, diff_opt [subgrid turbulence] = 1, km_opt [ “ ] = 4, diff_6th_opt [numerical smoothing] = 0, diff_6th_factor [ “ ] = 0.12, base_temp = 290. damp_opt = 0, zdamp = 5000., , , dampcoef = 0.01, , khdif = 0, , , kvdif = 0, , , Only some diff_opt/km_opt combinations make sense, and choices are resolution-dependent. More info:

33

34 real.exe Has changed a lot since version 2.1.2
Number of vertical model levels is specified in this step The num_metgrid_levels comes from parent model; you set e_vert (number of WRF levels) here Can reset WRF levels by rerunning real.exe Can also specify which levels you want e_vert = 51, 51, 51, num_metgrid_levels = 27

35 Setting levels in namelist.input (optional)
WRF uses “sigma” or “eta” coordinates (1.0 is model bottom, 0.0 is top) Added lines to &domains in namelist.input, presuming e_vert = 51, requests a model top pressure of 50 mb (5000 Pa) and concentrates vertical resolution in lower trop p_top_requested = 5000 eta_levels = 1.00,0.9969,0.9935,0.9899,0.9861,0.9821, 0.9777,0.9731,0.9682,0.9629,0.9573,0.9513, 0.9450,0.9382,0.9312,0.9240,0.9165,0.9088, 0.9008,0.8925,0.8840,0.8752,0.8661,0.8567, 0.8471,0.8371,0.8261,0.8141,0.8008,0.7863,0.7704, 0.7531,0.7341,0.7135,0.6911,0.6668,0.6406, 0.6123,0.5806,0.5452,0.5060,0.4630,0.4161, 0.3656,0.3119,0.2558,0.1982,0.1339,0.0804,0.0362,0.0000,

36 Run real.exe and wrf.exe > setenv | grep OMP OMP_NUM_THREADS=4 > real.exe [look for…] d _06:00:00 real_em: SUCCESS COMPLETE REAL_EM INIT • max_dom in namelist.input is set to 1… although we created three domains, only one will be used in the run

37 Run wrf.exe Output of real.exe is wrfbdy_d01 and wrfinput_d01 (NetCDF files) - Input files created for each domain, up to max_dom Run the model > nohup time wrf.exe > wrf.out & • Creates wrfout_d0* files keyed by simulation date for each domain > tail -f wrf.out [to watch the model run]

38 WRF model output Namelist set up to do 12 h run
Look for at end of wrf.out file: d _06:00:00 wrf: SUCCESS COMPLETE WRF Output files created: This is because history_interval was 60 min and frames_per_outfile was 1 wrfout_d01_ _18:00:00 wrfout_d01_ _01:00:00 wrfout_d01_ _19:00:00 wrfout_d01_ _02:00:00 wrfout_d01_ _20:00:00 wrfout_d01_ _03:00:00 wrfout_d01_ _21:00:00 wrfout_d01_ _04:00:00 wrfout_d01_ _22:00:00 wrfout_d01_ _05:00:00 wrfout_d01_ _23:00:00 wrfout_d01_ _06:00:00 wrfout_d01_ _00:00:00

39 Postprocessing WRF output: RIP and GrADS (Vis5D, ARWpost and VAPOR also exist)

40 RIP RIP operates in batch mode, using input scripts
RIP can overlay fields, do arbitrary cross-sections, calculate trajectories, and create Vis5D output files RIP tasks include Unpack model output data (ripdp_wrf) Create RIP plotting scripts (rip.in files) Execute scripts (rip) RIP can create a LOT of output files

41 RIP procedure You can view the cgm file using idt or ictrans
> cp /home/fovell/WRFtutorial/rip.T2.in . > ripdp_wrf run1 all wrfout_d01* [this creates a new dataset called ‘run1’ and uses all wrfout_d01 files created] > rip run1 rip.T2.in [the rip.T2.in file is a script containing RIP plotting commands] [the output file, rip.T2.cgm, is a graphics metafile] You can view the cgm file using idt or ictrans

42 Domain 1 terrain

43 12 h forecast (2m T - color; 1h precip totals; 10 m vector winds)

44 12 h forecast (2m T - color; 1h precip totals; 10 m vector winds)

45 RIP script http://www.mmm.ucar.edu/wrf/users/docs/ripug.htm
=========================================================================== feld=T2; ptyp=hc; vcor=s; levs=1fb; cint=1; cmth=fill;> arng; cbeg=273; cend=303; cosq=0,violet,12.5,blue,25,green,37.5,> light.green,50,white,62.5,yellow,75,orange,87.5,red,100,brown feld=U10,V10; ptyp=hv; vcmx=20.0; colr=black; linw=1; intv=2; feld=slp; ptyp=hc; vcor=s; levs=1fb; cint=4; nohl;colr=blue;linw=2;nolb feld=map; ptyp=hb; colr=dark.blue; linw=2; feld=tic; ptyp=hb

46 GrADS and wrf_to_grads
GrADS produces beautiful graphics Batch scriptable AND interactive Interactive: good for overlaying different datasets, computing difference fields [can also be done in RIP] Doesn’t create huge numbers of intermediate files like RIP Arbitrary cross-sections are difficult to construct

47 GrADS procedure Copy control_file from /home/fovell/WRFtutorial and edit Select variables desired and define wrfout files to be accessed (next slide) w2g control_file run1g Creates run1g.ctl, run1g.dat

48 List of available 2D fields follows
control_file ! times to put in GrADS file, negative ignores this _00:00:00 _00:05:00 _00:10:00 end_of_time_list ! 3D variable list for GrADS file ! indent one space to skip U ! U Compoment of wind V ! V Component of wind UMET ! U Compoment of wind - rotated (diagnostic) VMET ! V Component of wind - rotated (diagnostic) W ! W Component of wind THETA ! Theta TK ! Temperature in K TC ! Temperature in C List of available 2D fields follows

49 control_file (cont.) ! Now we check to see what to do with the data
! All list of files to read here ! Indent not to read ! Full path OK wrfout_d01_ _18:00:00 wrfout_d01_ _19:00:00 wrfout_d01_ _20:00:00 [more…] end_of_file_list ! Now we check to see what to do with the data real ! real (input/output) / ideal / static ! 0=no map background in grads, 1=map background in grads ! specify grads vertical grid ! 0=cartesian, ! -1=interp to z from lowest h ! 1 list levels (either height in km, or pressure in mb) 1000.0 950.0 900.0 850.0 800.0 750.0

50 Running GrADS > gradsnc -l [GrADS graphics output window opens]
ga-> open run1g [ga-> is GrADS environment prompt] ga-> /home/fovell/WRFtutorial/T2_movie.gs [executes this GrADS script; hit return to advance a frame] ga-> quit [to exit]

51 12 h forecast (2 m T, 1 h precip totals, 10 m winds)

52 GrADS ctl file Sometimes, wrf_to_grads fails to detect proper
dset ^run1g.dat undef 1.e35 pdef lcc xdef 228 linear ydef 148 linear zdef 50 levels [more…] tdef linear 18:00z02apr2006 1hr vars 24 U U Compoment of wind V V Component of wind W W Component of wind THETA Theta TC Temperature in C Sometimes, wrf_to_grads fails to detect proper time increment. In this case, I manually changed “19hr” to “1hr”. A bug.

53 WRF for idealized cases

54 Idealized cases WRF comes with “pre-packaged” idealized case examples (2D squall line, 2D sea-breeze, 3D supercell, mountain wave, etc.) Type compile to see list of cases 2D examples cannot use MPI or OpenMP Can be modified Next example: modified 3D supercell to do 3D squall line initialized with a line thermal w/ random perturbations

55 6 h forecast - surface T’ and column max W

56 = end =


Download ppt "For Version / Synoptic Lab"

Similar presentations


Ads by Google