Difference between revisions of "How to run WRF-SFIRE with real data"

From openwfm
Jump to navigation Jump to search
Line 62: Line 62:
 
  subgrid_ratio_y = 10,
 
  subgrid_ratio_y = 10,
 
/</pre></code>
 
/</pre></code>
 +
The full namelist used can be found [http://pastebin.com/2u3YXkHS here].
  
 
=Obtaining data for geogrid=
 
=Obtaining data for geogrid=
Line 255: Line 256:
 
</pre></code>
 
</pre></code>
 
For <tt>NFUEL_CAT</tt>, we will use simple nearest neighbor interpolation, while for <tt>ZSF</tt>, we will
 
For <tt>NFUEL_CAT</tt>, we will use simple nearest neighbor interpolation, while for <tt>ZSF</tt>, we will
use bilinear interpolation with smoothing.  Other configurations are possible.  See the [http://www.mmm.ucar.edu/wrf/users/docs/user_guide_V3.1/users_guide_chap3.htm#_Description_of_GEOGRID.TBL WPS users guide] for further information.
+
use bilinear interpolation with smoothing.  Other configurations are possible.  See the [http://www.mmm.ucar.edu/wrf/users/docs/user_guide_V3.1/users_guide_chap3.htm#_Description_of_GEOGRID.TBL WPS users guide] for further information.  The full table used can be found [http://pastebin.com/kdymq5ff here].
  
 
=Obtaining atmospheric data=
 
=Obtaining atmospheric data=

Revision as of 07:34, 31 March 2010

Running WRF-Fire with real data is a process very similar to running WRF with real data for weather simulations. The WRF users page has many documents and tutorials outlining this process. The purpose of this page is to provide a tutorial for using real data with WRF-Fire starting from scratch. We begin with a quick outline of the steps involved including links to the output of each step. The user can use these linked files to start from any step or to verify their own results. Due to platform and compiler differences your output might differ slightly from those provided.

Outline

  1. Obtain WRF-Fire source code.
  2. Compile target em_real.
  3. Compile WPS.
  4. Configure your domain.
  5. Download geogrid datasets.
  6. Convert fire data to geogrid format.
  7. Run the geogrid executable.
  8. Download atmospheric data.
  9. Run the ungrib executable.
  10. Run the metrid executable.
  11. Run real.exe and wrf.exe.

Configuring the domain

The physical domain is configured in the geogrid section of namelist.wps in the WPS directory. In this section, you should define the geographic projection with map_proj, truelat1, truelat2, and stand_lon. Available projections include 'lambert', 'polar', 'mercator', and 'lat-lon'. The lower left corner of the domain is located at ref_lon longitude and ref_lat latitude. The computational grid is defined by e_we/e_sn, the number of (staggered) grid points in the west-east/south-north direction, and the grid resolution is defined by dx and dy in meters. We also specify a path to where we will put the static dataset that geogrid will read from, and we specify the highest resolution (30 arc minutes) that this data is released in.

&geogrid
 e_we              =  43,
 e_sn              =  43,
 geog_data_res     = '30s',
 dx = 60,
 dy = 60,
 map_proj  = 'lambert',
 ref_lat   =  39.70537,
 ref_lon   = -107.2907,
 truelat1  =  39.338,
 truelat2  =  39.338,
 stand_lon = -106.807,
 geog_data_path = '../../wrfdata/geog'
/

The share section of the WPS namelist defines the fire subgrid refinement in subgrid_ratio_x and subgrid_ratio_y. This means that the fire grid will be a 10 time refined grid at a resolution of 6 meters by 6 meters. The start_date and end_data parameters specify the time window that the simulation will be run in. Atmospheric data must be available at both temporal boundaries. The interval_seconds parameter tells WPS the number of seconds between each atmospheric dataset. For our example, we will be using the NARR dataset which is released daily every three hours or 10,800 seconds.

&share
 wrf_core = 'ARW',
 max_dom = 1,
 start_date = '2005-08-28_12:00:00',
 end_date   = '2005-08-28_15:00:00',
 interval_seconds = 10800,
 io_form_geogrid = 2,
 subgrid_ratio_x = 10,
 subgrid_ratio_y = 10,
/

The full namelist used can be found here.

Obtaining data for geogrid

First you must download and uncompress the standard geogrid input data. This is a 429 MB compressed tarball that uncompresses to around 11 GB. It contains all of the static data that geogrid needs for a standard weather simulation; however, for a WRF-Fire simulation we need to fill in two additional fields that are too big to release in a single download for the whole globe. We first need to determine the approximate latitude and longitude bounds for our domain.

We know the coordinates in the lower left corner from the ref_lon and ref_lat parameters of the namelist. We can estimate the coordinates of the upper right corner by the approximate ratio 9e-6 degrees per meter. So, the upper right corner of our domain is at approximately -107.2675 longitude and 39.7286 latitude. For the purposes of downloading data, we will expand this region to the range -107.35 through -107.2 longitude and 39.6 through 39.75 latitude.

Downloading fuel category data

For the United States, Anderson 13 fuel category data is available at the landfire website. Upon opening the national map, you will see a menu on the right side of the screen. Select the icon circled in blue.

The landfire menu.


This will open a window that lets you key in the the longitude and latitude range of your selection. In this window, we will input the coordinates computed earlier.

Domain selection.


In the next window, click on "modify data request". This window lists all of the available data products for the selected region. You want to check the box next to "LANDFIRE 13 Anderson Fire Behavior Fuel Models" and change the data format to "GeoTIFF". Then go to the bottom of the page and click "Save Changes".

Data product selection.


Finally, click "Download". The file will be a compressed archive containing, among others, a GeoTIFF file. The name of the file will be different for each request, but in this example we have lf02588871.zip containing the GeoTIFF file lf02588871.tif, which can be found here, File:Lf02588871.tif.

Downloading high resolution elevation data

Another USGS website serves topographical data of sufficient resolution for our 6 meter resolution fire grid. This dataset is called the National Elevation Dataset (NED) and can be accessed at http://seamless.usgs.gov/. The interface is similar to that of the Landfire national map. Click on the icon circled in blue.

The NED menu.


Again, we key in the coordinates determined before and click the modify data request button. In the data product selection page, we select "National Elevation Dataset (NED) 1/3 Arc Second" and change to GeoTIFF format. Then download the data set, which can be found here, File:09159064.tif.

The NED data product selection page


Converting fire data

In order for geogrid to be able to read this data, we need to convert it into an intermediate format. We will be using a utility program released with autoWPS to accomplish this. For information on how to obtain and compile this tool, see How_to_convert_data_for_Geogrid. We will place the convert_geotiff.x binary and the GeoTIFF data files in the main WPS directory. To convert the fuel category data, we will create new directories inside the WPS directory called landfire_data and ned_data. Inside the landfire_data directory, we issue the following command to convert the fuel category data.

../convert_geotiff.x -c 13 -w 1 -u "fuel category" -d "Anderson 13 fire behavior categories" ../lf02588871.tif

The resulting index file created as follows.

projection = albers_nad83
truelat1 = 29.500000
truelat2 = 45.500000
stdlon = -96.000000
known_x = 1
known_y = 606
known_lat = 39.747818
known_lon = -107.373398
dx = 3.000000e+01
dy = 3.000000e+01
type = categorical
signed = yes
units = "fuel category"
description = "Anderson 13 fire behavior categories"
wordsize = 1
tile_x = 100
tile_y = 100
tile_z = 1
category_min = 1
category_max = 14
tile_bdr = 3
missing_value = 0.000000
scale_factor = 1.000000
row_order = bottom_top
endian = little

We have chosen to set the word size to 1 byte because it can represent 256 categories, plenty for this purpose. Notice that the program has changed the number of categories to 14 and uses the last category to indicate that the source data was out of the range 1-13. For the fuel category data, this represents that there is no fuel present, due to a lake, river, road, etc.

We can check that the projection information entered into the index file is correct, by running the listgeo binary that is installed with libGeoTIFF. In this case, listgeo tells us that the source file contains the following projection parameters.

Projection Method: CT_AlbersEqualArea
   ProjStdParallel1GeoKey: 29.500000 ( 29d30' 0.00"N)
   ProjStdParallel2GeoKey: 45.500000 ( 45d30' 0.00"N)
   ProjNatOriginLatGeoKey: 23.000000 ( 23d 0' 0.00"N)
   ProjNatOriginLongGeoKey: -96.000000 ( 96d 0' 0.00"W)
   ProjFalseEastingGeoKey: 0.000000 m
   ProjFalseNorthingGeoKey: 0.000000 m
GCS: 4269/NAD83
Datum: 6269/North American Datum 1983
Ellipsoid: 7019/GRS 1980 (6378137.00,6356752.31)
Prime Meridian: 8901/Greenwich (0.000000/  0d 0' 0.00"E)
Projection Linear Units: 9001/metre (1.000000m)

Corner Coordinates:
Upper Left    ( -963525.000, 1916445.000)  (-107.3734004,39.7478163)
Lower Left    ( -963525.000, 1898265.000)  (-107.3478974,39.5867431)
Upper Right   ( -948885.000, 1916445.000)  (-107.2021990,39.7632976)
Lower Right   ( -948885.000, 1898265.000)  (-107.1770727,39.6021889)
Center        ( -956205.000, 1907355.000)  (-107.2751374,39.6750401)

We can see that the conversion detected the projection correctly. The small difference in the coordinates of the upper left corner reported by listgeo and that in the index file is due to floating point error and is much less than the resolution of the data.

Finally, we go to the ned_data directory to convert the ZSF variable. In this case, we issue the following command.

../convert_geotiff.x -u meters -d 'National Elevation Dataset 1/3 arcsecond resolution' ../09159064.tif

This produces the following index file.

projection = regular_ll
known_x = 1
known_y = 1621
known_lat = 39.750092
known_lon = -107.350090
dx = 9.259259e-05
dy = 9.259259e-05
type = continuous
signed = yes
units = "meters"
description = "National Elevation Dataset 1/3 arcsecond resolution"
wordsize = 2
tile_x = 100
tile_y = 100
tile_z = 1
tile_bdr = 3
missing_value = 0.000000
scale_factor = 1.000000
row_order = bottom_top
endian = little

Here we have used the default word size of 2 bytes and a scale factor of 1.0, which can represent any elevation in the world with 1 meter accuracy, which is approximately the accuracy of the source data.

Again, we compare the projection parameters in the index file with that reported by listgeo and find that the conversion was correct.

      Keyed_Information:
      GTModelTypeGeoKey (Short,1): ModelTypeGeographic
      GTRasterTypeGeoKey (Short,1): RasterPixelIsArea
      GeographicTypeGeoKey (Short,1): GCS_NAD83
      GeogCitationGeoKey (Ascii,6): "NAD83"
      GeogAngularUnitsGeoKey (Short,1): Angular_Degree
      End_Of_Keys.
   End_Of_Geotiff.

GCS: 4269/NAD83
Datum: 6269/North American Datum 1983
Ellipsoid: 7019/GRS 1980 (6378137.00,6356752.31)
Prime Meridian: 8901/Greenwich (0.000000/  0d 0' 0.00"E)

Corner Coordinates:
Upper Left    (-107.3500926,39.7500926)
Lower Left    (-107.3500926,39.6000000)
Upper Right   (-107.2000000,39.7500926)
Lower Right   (-107.2000000,39.6000000)
Center        (-107.2750463,39.6750463)

Finally, the converted data can be found here, File:Landfire data.tgz, and here, File:Ned data.tgz.

Running geogrid

The geogrid binary will create a netcdf file called geo_em_d01.nc. This file will contain all of the static data necessary to run your simulation. Before we can run the binary, however, we must tell geogrid what data needs to be in these files, where it can find them, and what kind of preprocessing we wnat done. This information is contained in a run-time configuration file called GEOGRID.TBL, which is located in the geogrid subdirectory. The file that is released with WPS contains reasonable defaults for the variables defined on the atmospheric grid, but we need to add two additional sections for the two fire grid data sets that we have just created. We will append the following sections to the file geogrid/GEOGRID.TBL.

===============================
name=NFUEL_CAT
        priority=1
	dest_type=categorical
	dominant_only=NFUEL_CAT
	z_dim_name=fuel_cat
	halt_on_missing=yes
	interp_option=default:nearest_neighbor
	abs_path=./landfire_data
	subgrid=yes
==============================
name=ZSF
        priority = 1
        dest_type = continuous
        smooth_option = smth-desmth_special; smooth_passes=1
	halt_on_missing=yes
        interp_option = default:four_pt
	abs_path=./ned_data
==============================

For NFUEL_CAT, we will use simple nearest neighbor interpolation, while for ZSF, we will use bilinear interpolation with smoothing. Other configurations are possible. See the WPS users guide for further information. The full table used can be found here.

Obtaining atmospheric data

Running ungrib

Running metgrid

Running wrf