1 / 69

WRF-Var System Overview

WRF-Var System Overview. Xin Zhang, Yong-Run Guo, Syed R-H Rizvi, and Michael Duda. Outline. WRF-Var in the WRF Modeling System Observation Preprocessing Using OBSPROC WRF-Var Software WRF-Var Setup WRF-Var Implementation. WRF-Var in the WRF Modeling System.

rose-salas
Télécharger la présentation

WRF-Var System Overview

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. WRF-Var System Overview Xin Zhang, Yong-Run Guo, Syed R-H Rizvi, and Michael Duda The 3rd East Asia WRF Tutorial, 15-18 April 2009

  2. Outline • WRF-Var in the WRF Modeling System • Observation Preprocessing Using OBSPROC • WRF-Var Software • WRF-Var Setup • WRF-Var Implementation The 3rd East Asia WRF Tutorial, 15-18 April 2009

  3. WRF-Var in the WRF Modeling System The 3rd East Asia WRF Tutorial, 15-18 April 2009

  4. WRF-Var in the WRF Modeling System WRF-Var Blue --> Supported by WRF-Var Team The 3rd East Asia WRF Tutorial, 15-18 April 2009

  5. WRF-Var in the WRF Modeling System 1. Prepare BE data WRF-Var Background Error (gen_be) B0 Blue --> Supported by WRF-Var Team The 3rd East Asia WRF Tutorial, 15-18 April 2009

  6. Prepare BE statistics J(x) = (x - xb)TB-1(x - xb) + (yo- Hx)TR-1(yo- Hx) • For initial testing , default background error statistics may be used • be.dat file (CV option 5) from test case tar file can only be used with the domain from online tutorial • be.dat.cv3 (CV option 3) from source code tar file can be used for general test domains • Ultimately, these should be specific to the particular model domain (and season) • See the next talk “Background Error Calculation” (Xin Zhang) The 3rd East Asia WRF Tutorial, 15-18 April 2009

  7. WRF-Var in the WRF Modeling System 2. Prepare background (WPS and real) xlbc Background Preprocessing (WPS , real) xb Cold-Start Background WRF-Var Background Error (gen_be) B0 The 3rd East Asia WRF Tutorial, 15-18 April 2009

  8. Prepare background J(x) = (x - xb)TB-1(x -xb) + (yo- Hx)TR-1(yo- Hx) • In “cold-start” mode: accomplished by running the WPS and real programs • The background is essentially the wrfinput_d01 file • In “cycling” mode: the output of the WRF model • WRF can output wrfinput-formatted files used for cycling The 3rd East Asia WRF Tutorial, 15-18 April 2009

  9. WRF-Var in the WRF Modeling System 3. Prepare observations (run OBSPROC) xlbc Background Preprocessing (WPS , real) xb Cold-Start Background WRF-Var Observation Preprocessing (OBSPROC) yo , R Radar in ASCII Radiance in BUFR Note: Radar and radiance data do not pass through the OBSPROC program! Background Error (gen_be) B0 Blue --> Supported by WRF-Var Team The 3rd East Asia WRF Tutorial, 15-18 April 2009

  10. Prepare observations (y0) J(x) = (x - xb)TB-1(x - xb) + (yo- Hx)TR-1(yo- Hx) • Observation input for WRF-Var is supplied through observation preprocessor, OBSPROC • Except radar and satellite radiances • Observation error covariance also provided by OBSPROC (R is a diagonal matrix) • Separate input file (ASCII) for radar, both reflectivity and radial velocity. • Separate input file for satellite radiances The 3rd East Asia WRF Tutorial, 15-18 April 2009

  11. WRF-Var in the WRF Modeling System 4. Run WRF-Var xlbc Background Preprocessing (WPS , real) xb Cold-Start Background WRF-Var Observation Preprocessing (OBSPROC) yo , R xa Radar in ASCII Radiance in BUFR Background Error (gen_be) B0 Blue --> Supported by WRF-Var Team The 3rd East Asia WRF Tutorial, 15-18 April 2009

  12. WRF-Var in the WRF Modeling System 5. Update boundary conditions (UPDATE_BC) xlbc Background Preprocessing (WPS , real) xb Cold-Start Background WRF-Var Observation Preprocessing (OBSPROC) yo , R xa Update Lateral & Lower BCs (UPDATE_BC) Radar in ASCII Radiance in BUFR Background Error (gen_be) B0 Blue --> Supported by WRF-Var Team The 3rd East Asia WRF Tutorial, 15-18 April 2009

  13. Update boundary conditions • After creating an analysis, xa, we have changed the initial conditions for the model • However, tendencies in wrfbdy_d01 (and possibly wrflbdy) file are valid for background, xb • The update_bc program adjusts these tendencies based on the difference xa - xb • Of course, if xa was produced for reasons other than running WRF, there is probably not a need to update boundary conditions The 3rd East Asia WRF Tutorial, 15-18 April 2009

  14. WRF-Var in the WRF Modeling System 6a. Run forecast (cold-start mode) xlbc Background Preprocessing (WPS , real) xb Cold-Start Background WRF-Var Observation Preprocessing (OBSPROC) yo , R xa Update Lateral & Lower BCs (UPDATE_BC) Forecast (WRF) Radar in ASCII Radiance in BUFR Background Error (gen_be) B0 Blue --> Supported by WRF-Var Team The 3rd East Asia WRF Tutorial, 15-18 April 2009

  15. WRF-Var in the WRF Modeling System Note the arrow from ARW MODEL to WRF-Var! The 3rd East Asia WRF Tutorial, 15-18 April 2009

  16. WRF-Var in the WRF Modeling System 6b. Run forecast (cycling mode) xlbc Background Preprocessing (WPS , real) xb xf Cycled Background WRF-Var Observation Preprocessing (OBSPROC) yo , R xa Update Lateral & Lower BCs (UPDATE_BC) Forecast (WRF) Radar in ASCII Radiance in BUFR Background Error (gen_be) B0 Blue --> Supported by WRF-Var Team The 3rd East Asia WRF Tutorial, 15-18 April 2009

  17. Background Error (BE) for WRF-Var One important question from WRF-Var users is “What background errors are best for my application?” • Create your own once you have run your system for a few weeks to a month • Implement, tune, and iterate The utility gen_be has been developed at NCAR for use in calculating these BEs The 3rd East Asia WRF Tutorial, 15-18 April 2009

  18. WRF-Var in the WRF Modeling System 7. WRF-Var/WRF Ultimate Configuration xlbc Background Preprocessing (WPS , real) xb xf Cycled Background Cold-Start Background WRF-Var Observation Preprocessing (OBSPROC) yo , R xa Update Lateral & Lower BCs (UPDATE_BC) Forecast (WRF) Radar in ASCII Radiance in BUFR Background Error (gen_be) B0 Blue --> Supported by WRF-Var Team The 3rd East Asia WRF Tutorial, 15-18 April 2009

  19. Observation Preprocessing Using OBSPROC The 3rd East Asia WRF Tutorial, 15-18 April 2009

  20. OBSPROC • OBSPROC is the observation pre-processing program for “conventional obs” for WRF-Var • The purposes of OBSPROC are to • Remove observations that are outside the assimilation time range or model domain (horizontal and top) • Re-order and merge duplicate (in time and location) data reports • Retrieve pressure or height based on observed information using the hydrostatic assumption • Check vertical consistency and super adiabatic for multi-level observations • Assign observational errors based on a pre-specified error file • Write out the observation file to be used by WRF-Var in ASCII format The 3rd East Asia WRF Tutorial, 15-18 April 2009

  21. OBSPROC • OBSPROC processes conventional observations given in an intermediate, ASCII file format (LITTLE_R) • Radar (after running through separate pre-processing) and satellite radiances bypass OBSPROC and go directly into WRF-Var • Pre-processed obs are written to the ASCII 3DVAR obs format • Typically, observations are kept within some window around the analysis time The 3rd East Asia WRF Tutorial, 15-18 April 2009

  22. WRFVar Prepbufr_obs_gts.3dvar (NCEP prebufr format) Output_ob_format=1 Namelist.3dvar_obs Obs_gts_yyyy-mm-dd_hh:00:00.3DVAR (obs_ssmi_retrieval.3dvar) Output_ob_format=2 OBSPROC OBS data file (LITTLE_R format) Log file: 3dvar_obs.out Obserr.txt prepbufr_table_filename (provided) A set of the diagnostic files OBSPROC NCEP prepbufr Input/output from OBSPROC The 3rd East Asia WRF Tutorial, 15-18 April 2009

  23. Read in data and discard the data outside domain and time Get namelist Assign the OBS errors Sort, and merge the duplicated data Check the data completeness QC index reduction Setup mapparameters Check vertical consistency And adiabatic Write out obs_gst_yyyy-mm-dd_hh:00:00.3DVAR (obs_ssmi_retrieval.3dvar) SATOB, QSCAT and SSMI data Thinning END OBSPROC Program Flow The 3rd East Asia WRF Tutorial, 15-18 April 2009

  24. Input to OBSPROC The OBSPROC program takes as input • A namelist specifying time window, domain boundaries, and options related to quality control and satellite observation thinning • An observation file in LITTLE_R format • An observation error file (provided) The LITTLE_R format is a report-based ASCII format • Multiple observation files can be simply concatenated together • Each report consists of • Header record • Data record • Ending record The 3rd East Asia WRF Tutorial, 15-18 April 2009

  25. Input to OBSPROC • For observations not in LITTLE_R or PREPBUFR format, users must convert observations into one of these formats • Sample program for writing to the LITTLE_R format is available from ftp://ftp.ucar.edu/mesouser/MM5V3/V3-7-0/LITTLE_R.TAR.gz(see LITTLE_R/util/upa.f) • For a description of the LITTLE_R format, check the MM5 tutorial notes: http://www.mmm.ucar.edu/mm5/documents/MM5_tut_Web_notes/OA/OA.htm In general, a more detailed introduction to OBSPROC can be found in the Winter 2009 WRF-Var tutorial slides for OBSPROC http://www.mmm.ucar.edu/wrf/users/wrfda/Tutorials/2009_Jan/wrfvar_obs_Feb09.pdf The 3rd East Asia WRF Tutorial, 15-18 April 2009

  26. Output from OBSPROC File: obs_gts_yyyy-mm-dd_hh:00:00.3DVAR TOTAL = 8169, MISS. =-888888.,SYNOP = 1432, METAR = 164, SHIP = 86, BUOY = 0, TEMP = 179, AMDAR = 0, AIREP = 265, PILOT = 0, SATEM = 0, SATOB = 6043, GPSPW = 0, SSMT1 = 0, SSMT2 = 0, TOVS = 0, QSCAT = 0, PROFL = 0, OTHER = 0, PHIC = 28.50, XLONC = 116.00, TRUE1 = 10.00, TRUE2 = 45.00, XIM11 = 1.00, XJM11 = 1.00,TS0 = 275.00, TLP = 50.00, PTOP = 7000., PS0 =100000.,IXC = 67, JXC = 81, IPROJ = 1, IDD = 1, MAXNES= 10,NESTIX= 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, NESTJX= 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, NUMC = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, DIS = 135.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, NESTI = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, NESTJ = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, INFO = PLATFORM, DATE, NAME, LEVELS, LATITUDE, LONGITUDE, ELEVATION, ID.SRFC = SLP, PW (DATA,QC,ERROR).EACH = PRES, SPEED, DIR, HEIGHT, TEMP, DEW PT, HUMID (DATA,QC,ERROR)*LEVELS.INFO_FMT = (A12,1X,A19,1X,A40,1X,I6,3(F12.3,11X),6X,A5)SRFC_FMT = (F12.3,I4,F7.2,F12.3,I4,F7.2)EACH_FMT = (3(F12.3,I4,F7.2),11X,3(F12.3,I4,F7.2),11X,1(F12.3,I4,F7.2)))#------------------------------------------------------------------------------#FM-35 TEMP 1999-08-19_11:00:00 AHMADABAD / INDIA 17 23.070 72.630 55.000 42647 -888888.000 -88 200.00 -888888.000 -88 0.20 100000.000 0 100.00 3.000 0 1.10 225.000 0 5.00 53.000 0 7.00 305.550 0 1.00 298.550 0 1.00 65.984 0 15.00 92500.000 0 100.00 3.000 0 1.10 220.000 0 5.00 745.000 0 7.48 300.550 0 1.00 295.550 0 1.00 73.714 0 12.60 91600.000 0 100.00 -888888.000 -88 1.10 -888888.000 -88 5.00 830.000 0 7.54 300.150 0 1.00 295.150 0 1.00 73.653 0 12.30 87300.000 0 100.00 -888888.000 -88 1.10 -888888.000 -88 5.00 1251.000 0 7.84 297.350 0 1.00 291.350 0 1.00 68.712 0 10.82 85000.000 0 100.00 6.000 0 1.10 250.000 0 5.00 1498.000 0 8.00 295.350 0 1.00 290.750 0 1.00 74.809 0 10.00 79200.000 0 100.00 -888888.000 -88 1.13 -888888.000 -88 5.00 2104.000 0 8.22 290.750 0 1.00 288.550 0 1.00 86.755 0 10.00 78000.000 0 100.00 -888888.000 -88 1.18 -888888.000 -88 5.00 2238.000 0 8.27 292.950 0 1.00 281.950 0 1.00 48.599 0 10.00 70700.000 0 100.00 -888888.000 -88 1.39 -888888.000 -88 5.00 3076.000 0 8.57 289.950 0 1.00 268.950 0 1.00 23.245 0 10.00 70000.000 0 100.00 2.000 0 1.40 30.000 0 5.00 3168.000 0 8.60 -888888.000 -11 1.00 -888888.000 -11 1.00 -888888.000 -11 10.00 61100.000 0 100.00 -888888.000 -88 1.76 -888888.000 -88 5.00 4312.000 3 10.01 282.350 0 1.00 271.350 0 1.00 45.937 0 10.00 60000.000 0 100.00 -888888.000 -88 1.80 -888888.000 -88 5.00 4463.000 3 10.20 281.350 0 1.00 272.350 0 1.00 52.920 0 10.00 57400.000 0 100.00 -888888.000 -88 1.90 -888888.000 -88 5.00 4828.000 3 10.66 279.150 0 1.00 274.150 0 1.00 70.188 0 10.00 52700.000 0 100.00 -888888.000 -88 2.14 -888888.000 -88 5.00 5526.000 3 11.55 275.550 0 1.00 272.650 0 1.00 81.128 0 10.00 50300.000 0 100.00 -888888.000 -88 2.28 -888888.000 -88 5.00 5902.000 3 12.04 273.350 0 1.00 269.650 0 1.00 76.187 0 10.00 50200.000 0 100.00 -888888.000 -88 2.29 -888888.000 -88 5.00 5918.000 3 12.06 273.150 0 1.00 269.450 0 1.00 76.157 0 10.00 50000.000 0 100.00 3.000 0 2.30 95.000 0 5.00 5950.000 0 12.10 272.850 0 1.00 269.250 0 1.00 76.682 0 10.00 46900.000 0 100.00 2.000 0 2.42 100.000 0 5.00 6461.000 3 12.90 270.450 0 1.00 266.250 0 1.00 72.904 0 10.00FM-35 TEMP 1999-08-19_11:00:00 BOMBAY / SANTACRUZ / INDIA 25 19.120 72.850 14.000 430 ………………………………………………………… # of observations Model domain information Data format The 3rd East Asia WRF Tutorial, 15-18 April 2009

  27. OBSPROC Also included in the OBSPROC package is a utility, Map_plot, to plot observation locations for each observation type SOUND observation locations SATOB observation locations The 3rd East Asia WRF Tutorial, 15-18 April 2009

  28. WRF-Var Software The 3rd East Asia WRF Tutorial, 15-18 April 2009

  29. Use of the WRF Software Framework • WRF-Var relies on the WRF Software framework for • Distributed memory parallelism (halo exchanges, etc.) • Input/Output of first guess and analysis files • Parallel transposes • WRF-Var also uses • The WRF Registry mechanism to handle definitions of fields, halos, and transposes • The WRF build system (clean, configure, compile) The 3rd East Asia WRF Tutorial, 15-18 April 2009

  30. WRF-Var Code Organization Besides the directories for WRF, the WRFDA tar file contains a “var” directory, which holds all of the WRF-Var code The 3rd East Asia WRF Tutorial, 15-18 April 2009

  31. WRF-Var Code Organization Generally, each subdirectory of “da” contains a Fortran module with the same name The 3rd East Asia WRF Tutorial, 15-18 April 2009

  32. WRF-Var Code Organization • da_metar.f90 contains a Fortran module • Each .inc file corresponds to a subroutine within the module The 3rd East Asia WRF Tutorial, 15-18 April 2009

  33. WRF-Var Setup (Installation) The 3rd East Asia WRF Tutorial, 15-18 April 2009

  34. Download and Unpack • WRFDA source code can be downloaded from • http://www.mmm.ucar.edu/wrf/users/wrfda/download/get_source.html • Unpacking the downloaded tar file should give a directory WRFDA • Before installing, the following are also needed • C and Fortran compilers • MPI (e.g., MPICH) (only if running WRF-Var in parallel) • Several external libraries (described in the next two slides) The 3rd East Asia WRF Tutorial, 15-18 April 2009

  35. Required Libraries • NetCDF • http://www.unidata.ucar.edu/software/netcdf/ • BLAS (Basic Linear Algebra Subprograms): • http://netlib.org/blas/ • LAPACK (Linear Algebra PACKage): • http://netlib.org/lapack/ Make sure the required libraries are all compiled using the same compiler that will be used to build WRF-Var, and that the default size for real variables is set to 8-bytes when building the libraries. The 3rd East Asia WRF Tutorial, 15-18 April 2009

  36. Optional Libraries • If observations in PREPBUFR format will be used, the BUFR library is required: • http://www.nco.ncep.noaa.gov/sib/decoders/BUFRLIB/ • If assimilating satellite radiance data, in addition to the BUFR library, either the CRTM (v1.2) or RTTOV (v8.7) libraries are required: • ftp://ftp.emc.ncep.noaa.gov/jcsda/CRTM • http://www.metoffice.gov.uk/science/creating/working_together/nwpsaf_public.html The 3rd East Asia WRF Tutorial, 15-18 April 2009

  37. Required Libraries • Set environment variables pointing to libraries: >setenv NETCDF $your_installation_dir/netcdf >setenv BLAS $your_installation_dir/blas >setenv LAPACK $your_installation_dir/lapack >setenv BUFR $your_installation_dir/bufr >setenv CRTM $your_installation_dir/crtm >setenv RTTOV $your_installation_dir/rttov87 The 3rd East Asia WRF Tutorial, 15-18 April 2009

  38. Compile WRF-Var • Change to the WRFDA directory and configure the code > ./configure wrfda • When prompted, choose an option that matches your compiler • Only serial and dmpar options are available, since OpenMP is not currently used in WRF-Var (WRF has smpar and sm+dm) • serial - single-processor executable • dmpar - distributed memory parallel executable; requires MPI! • Compile the code > ./compile all_wrfvar • If successful, the var/build directory should contain da_wrfvar.exe, da_update_bc.exe, and other executables; the var/obsproc/src directory should contain obsproc.exe The 3rd East Asia WRF Tutorial, 15-18 April 2009

  39. Compiling for 4DVAR • When using 4DVAR, besides WRF-Var, three additional components are needed: • WRFNL : The non-linear model • WRFPLUS : The tangent linear and adjoint models • These componets may be downloaded through the WRFDA download page • For instructions on how to install these components, see the section “Installing WRFNL and WRFPLUS” in the WRFDA Users’ Guide The 3rd East Asia WRF Tutorial, 15-18 April 2009

  40. WRF-Var Implementation The 3rd East Asia WRF Tutorial, 15-18 April 2009

  41. WRF-Var Formulation • WRF-Var actually uses an incremental formulation of the 3DVAR problem • Define the increment x’ = x - xb • Also, if x’ is small, H(x) = H(xb + x’) ≈H(xb) + Hx’ where H is the linearization of H • Then, the problem becomes with yo’ = yo- H(xb) J(x) = (x - xb)TB-1(x - xb) + (yo- H(x))TR-1(yo- H(x)) J(x’) = (x’)TB-1(x’) + (yo’ - Hx’)TR-1(yo’ - Hx’) The 3rd East Asia WRF Tutorial, 15-18 April 2009

  42. WRF-Var Formulation • Next, define the control variable transformU such that x’ = Uv. • v is the analysis increment in control variable space • B is approximated by UUT • WRF-Var actually minimizes • After minimization, the analysis, xa, is given by J(v) = vTv + (yo’ - HUv)TR-1(yo’ - HUv) xa= xb + Uv The 3rd East Asia WRF Tutorial, 15-18 April 2009

  43. WRF-Var B0 Namelist File xb yo WRF-Var START Setup Frame Read Namelist Setup Background Setup Background Errors Setup Observations Compute Analysis Minimize Cost Function Calculate O-B “Outer Loop” Calculate Diagnostics Output Analysis Tidy Up Diagnostics File xa WRF-Var END The 3rd East Asia WRF Tutorial, 15-18 April 2009

  44. Setup Frame • Reads grid dimensions from “namelist.input” file. • Use WRF framework’s distributed memory capability to initialize tile, memory, patch dimensions, etc. The 3rd East Asia WRF Tutorial, 15-18 April 2009

  45. WRF-Var B0 Namelist File xb yo WRF-Var START Setup Frame Read Namelist Setup Background Setup Background Errors Setup Observations Compute Analysis Minimize Cost Function Calculate O-B “Outer Loop” Calculate Diagnostics Output Analysis Tidy Up Diagnostics File xa WRF-Var END The 3rd East Asia WRF Tutorial, 15-18 April 2009

  46. Read Namelist • Reads WRF-Var data assimilation options from “namelist.input” file. • Performs consistency checks between namelist options. The 3rd East Asia WRF Tutorial, 15-18 April 2009

  47. WRF-Var B0 Namelist File xb yo WRF-Var START Setup Frame Read Namelist Setup Background Setup Background Errors Setup Observations Compute Analysis Minimize Cost Function Calculate O-B “Outer Loop” Calculate Diagnostics Output Analysis Tidy Up Diagnostics File xa WRF-Var END The 3rd East Asia WRF Tutorial, 15-18 April 2009

  48. Setup Background (First-guess) • Reads in the first-guess field. • Format depends on namelist option : “fg_format” ; 1= WRF, etc. • Extracts necessary fields. • Creates background FORTRAN 90 derived data type “xb” e.g. xb % mix, xb % u(:,:,:), …. The 3rd East Asia WRF Tutorial, 15-18 April 2009

  49. WRF-Var B0 Namelist File xb yo WRF-Var START Setup Frame Read Namelist Setup Background Setup Background Errors Setup Observations Compute Analysis Minimize Cost Function Calculate O-B “Outer Loop” Calculate Diagnostics Output Analysis Tidy Up Diagnostics File xa WRF-Var END The 3rd East Asia WRF Tutorial, 15-18 April 2009

  50. Setup Background Errors (BE) • Reads in background error statistics. • Extracts necessary quantities – eigenvectors, eigenvalues, lengthscales, regression coefficients, etc (see “WRF-Var Background Error Estimation”). • Creates background error FORTRAN 90 derived data type “be” • e.g. be % v1 % evec(:,:), be % v2 % eval(:), etc, …. The 3rd East Asia WRF Tutorial, 15-18 April 2009

More Related