Forecasting Lab Guide to using the WRF Model at NC State - Part 3
From WolfWikis
THIS DOCUMENT CONTAINS THE THIRD INSTALLMENT OF THE ORIGINAL WRF WIKI GUIDE ("THE EXTRAS") THAT BECAME TOO LONG AND HAD TO BE DIVIDED UP...WE HOPE TO STREAMLINE THIS DOCUMENT A LITTLE BETTER AT SOME POINT, BUT FOR NOW AT LEAST IT IS HOPEFULLY FUNCTIONAL. -KMM, FEB 2008
Guide for Generating SST Overlays for use as WRF Input
Written as a guide for using high-resolution CoastWatch SST data and 0.5º daily SST analyses from NCEP. Originally written by Matt Borkowski.
Table of Contents: I. Setup II. Downloading high-resolution CoastWatch data III. Generating a SST Composite using CoastWatch data IV. Converting CoastWatch Composite to GEMPAK V. Downloading NCEP SST analysis and converting to GEMPAK (v. 5.8.3a or better) VI. Creating an SST overlay VII. Converting SST WRF Intermediate File Format VIII. Special Instructions for Ingesting SSTs into WRF
I. Setup
1.Set the path to CoastWatch Library and Utilities in your aliases file by adding the following to your ‘setenv PATH’ line: ‘/lockers/PAMS/Volume1/mpborkow/cwatch/cwf/bin’
2.make sure Java and PGI compilers are mounted by typing ‘add java’ and ‘add pgi’
3.copy all scripts from ‘/lockers/PAMS/Volume1/mpborkow/sstscripts/’ to your personal directory.
II. Downloading high-resolution CoastWatch data
1. Go to http://www.class.noaa.gov, and register
2. Once you’ve created an account and login, go to the ‘User Preferences’ link in the left-hand column. Under ‘My filename preference is’, be sure to select ‘DS’.
3.Determine the area over which you need high-resolution data (better than 0.5 º). Keep in mind, the larger the area, the longer it will take to create a useable composite, and the more dates your composite will cover.
4.Search for data over the regions for which you need. This may vary depending on the dates for which you need the data.
a. For recent data (November 10, 2003-present)
i. The data format will be HDF. There will be one HDF file for each time.
ii. In the pull-down menu on the top of the page, select ‘CoastWatch Regions in HDF format (CW_REGION)’. Click ‘Go’.
iii. Under ‘Regions’, select the areas for which you need data. If unsure of the area the region covers, download a single. You can use the CoastWatch program ‘cwinfo’ to see the area the dataset covers (or use ‘cdat’ to view the region visually).
iv. If you only want data from a specific satellite, select it under ‘Satellites’.
v. Enter the dates for which you want to search for data. This should be equivalent to the time period you want your composite to cover. (Usually a 7-10 day composite will be enough to generate a relatively cloud-free image, although it ultimately depends on the size of the composite and the synoptic conditions during the time period. You probably won’t need a completely cloud-free composite, as when the overlay is performed, any areas that were obscured by clouds will be filled in with the low resolution data.)
vi. When you search, the results will pop up in a new window. Select the files you wish to download. Click ‘Update’, then ‘Go to Cart.’ A summary of the files you’ve selected will appear in the original search window. Make sure your e-mail address is correct and ‘Place Order.’ If you need more than 500 files, you will need to place multiple orders.
vii. You will receive a e-mail when your order is complete. Follow the instructions to obtain your data via ftp. To download all files without prompts, type ‘prompt’ in the ftp window then ‘mget *’ in the directory with your files.
b. For older data (prior to November 10, 2003)
viii. The data format is CWF. There will be multiple CWF files for each time.
ix. Downloading older data is a bit more complicated. You will only be able to search one region at a time. There are also multiple subregions for each region, each with varying resolution. In the pull down menu, select ‘CoastWatch ******’ where ****** is the specific region you want to search. Click ‘Go’.
x. There is no need to select anything under ‘Datatype.’ We will download all data for each time.
xi. Select the Subregion you want to search. It is important to realize that not all subregions have the same resolution. Extended and Synoptic regions typically have lower resolutions. The Full Regional Panel (as well as various subregions) have highest resolution (up to 1.27 km). The individual search page typically lists the resolution, but if uncertain, download a data for one time and run the CoastWatch utility cwinfo -t filename to see the actual resolution.
xii. Enter the dates for which you want to search for data. This should be equivalent to the time period you want your composite to cover. (Usually a 7-10 day composite will be enough to generate a relatively cloud-free image, although it ultimately depends on the size of the composite and the synoptic conditions during the time period. You probably won’t need a completely cloud-free composite, as when the overlay is performed, any areas that were obscured by clouds will be filled in with the low resolution data.)
xiii. When you search, the results will pop up in a new window. Select the files you wish to download. Click ‘Update’, then ‘Go to Cart.’ A summary of the files you’ve selected will appear in the original search window. Make sure your e-mail address is correct and ‘Place Order.’ If you need more than 500 files, you will need to place multiple orders.
xiv. You will receive a e-mail when your order is complete. Follow the instructions to obtain your data via ftp. To download all files without prompts, type ‘prompt’ in the ftp window then ‘mget *’ in the directory with your files.
xv. CWF data must be converted to HDF before continuing. Run the script cwftohdf.csh once to accomplish this. You want 1 file per time. Make sure to use the cloud mask files.
1. The original script uses a file similar to: 2002_061_0713_n16_sr_cm.cwf
2. For older data (such as in 2000), the files are in the form of: s0033921.rcm
III. Generating an SST Composite using CoastWatch data 1. In this section, a file called ‘latlon.dat’ will be used to define the latitude/longitude points for which we want to pull SST values out of the HDF files. A template, ‘latlon.dat’, already exists. However, this covers a large area (20-52N, 60-100W) at high resolution (~3km) and will take a phenomenal amount of time to create a composite. I recommend generating your own ‘latlon.dat’ file with the grid spacing and area of your model domain. You can determine the spacing between grid points (in degrees) you will need to specify in your ‘latlon.dat’ file by dividing the grid spacing of your model domain (i.e. 12 km) by 111km. 2. You will now need to generate two new data files for your composite.
a. In the namelist.composite file, edit the variables ‘R’ and ‘C’ to match the number of rows (latitude) and columns (longitude) in the grid defined by your ‘latlon.dat’ file
b. In the sst.master.ctl file, edit the first number after XDEF and YDEF to reflect the rows and columns of your grid. You will also need to change the values 20 and -100 to the southern and western bounds defined in your ‘latlon.dat’ file.
c. Link the following files to the fortran units:
i. ln –s namelist.composite fort.1 ii. ln –s master_composite.init fort.2000 iii. ln –s mm5_composite.init fort.2200
d. copy composite_init.x to the new directory and run ‘./composite_init.x’
e. If this was successful, two new files (‘master_composite.init’ and ‘mm5_composite.init) will be created
3. copy ‘mm5_composite.init’ and ‘master_composite.init’ (initial templates) to ‘mm5_composite.flt’ and ‘master_composite.flt’ (final products) respectively. (rm fort.2000 and fort.2200 before continuing) 4. Run the script cwsample.csh. This will create one text file for every hdf file with SST values corresponding to you latitude/longitude values from latlon.dat. This step may take several hours depending on the area you are sampling and the total number of files you have. 5. If you initially downloaded HDF files from CLASS, skip to Step 8. If you began with CWF files, you need to edit filterzero.csh and run the perl script filterzero.pl to correct the way in which cloud-free skies are denoted in your files. 6. Edit the file namelist.input (in RECORD2 section) to reflect desired output file name and initialization date 7. In the file namelist.composite, set NUNITS to one less than the total number of hdf files (i.e. if there are a total of 200 HDF files, NUNITS=199). You can count the number of files by using the command ‘ls –l *.hdf | wc –l’. 8. In the namelist.composite file, make sure ‘R’ and ‘C’ are reflect the rows and columns of your grid as defined by ‘latlon.dat’ 9. Run the script, link.csh, to link all files to their respective fortran units. 10. Type ‘composite.x’ to run the executable. This may take several hour depending on the size of your area and the total number of files. If this does not work properly on a compute node, you may need to run it on a login node.
NOTE: If you began with CWF files of varying resolution, you may want to run this program more than once if you have overlapping files of differing resolutions. It is recommended that you run composite.x on your lowest resolution files first, then run it as many times as needed until you’ve reached your highest resolution files. When doing this, you will need to keep only the HDF/text files you are processing for that particular run in your current directory, and move all others to a temporary directory. Then, for each time you run composite.x, you will need to run link.csh and adjust your NUNITS variable in namelist.composite. When completed with a run, delete all fortran units and repeat for the next batch of files. In this way, you can be sure that the final composite will have the highest resolution where possible…as opposed to just having the most recent available data.
11. To verify the composite was created successfully, you can view it in GrADS. 1. type ‘add grads’ 2. open grads with the command ‘gradsc’ 3. Type ‘open sst.master.ctl’ 4. Type ‘set gxout shaded’ 5. Type ‘set cint 2’ (will contour at 2 degree intervals. If this won’t work, use the command ‘set clevs’ to define the actual contours you want drawn.) 6. If you want to view an area other than the default, use the commands ‘set lat min max’ and ‘set lon min max’ to set your area 7. ‘d sst’ 8. This should plot SSTs, if something looks wrong, you’ll have to trouble shoot. Otherwise, continue to the next section. 12. If you began with the older CWF files, you may need to exclude data from GOES-15 satellite from your composite. I found that frequently, when using this data, the data from the GOES-15 was stored differently, resulting in bogus values for SSTs. The problem can be fixed by excluding all files with ‘_n15_’ in the filename from the composite.
IV. Converting CoastWatch Composite to GEMPAK 1. Edit the GrADS script ‘txtout.gs’ o reflect the area of the grid you have defined. Also edit the name of the desired output ASCII file. 2. Run the script by typing ‘txtout’in GrADS. 3. If completed properly, you will have an ASCII output file containing SST values. 4. Edit ascii2gem.f to reflect the proper input file name, desired output filename (i.e. highres.gem), grid dimensions, and model initialization date/time (‘gdat(1)’). The grid dimensions will need to be changed in several places beginning with ‘paremeter(krecl=ix*iy)’ and continuing everywhere you see those dimensions repeated throughout the file. Grid dimensions should be the same as what you specified in section III. 5. You will need to first created the output GEMPAK file using the GEMPAK program gdcfil. 1. Open ‘gdcfil’ 2. GDOUTF: name of gempak file specified in fortran program (i.e. highres.gem) 3. PROJ: set this to ‘ced’ 4. GRDAREA: should match the values specified in your ‘latlon.dat’ file (lower left corner coords; upper right corner coords) 5. KXKY: should match the dimensions for the output grid specified in the fortran program (ix;iy) 6. Run gdcfil by typing ‘r’. The new grid should be created. If you get “grid too large for GEMPAK programs”, you will need to point your aliases.csh file to /share/mpborkow/gempak/GEMPAK5.9.1/Gemenviron 6. Once the new gempak file has been created, compile and run the fortran program 1. ‘f77 –fno-second-underscore –o ascii2gem.exe ascii2gem.f $GEMLIB/gemlib.a’ (later versions of gempak may require you to also add $GEMLIB/cgemlib.a to the end of the command line) 2. ‘./ascii2gem.exe’ 7. To ensure the program ran successfully, use gdcntr to plot the new grid 1. Copy the file ‘plotsst.nts’ to the directory in which the GEMPAK file is located 2. Open gdcntr 3. ‘restore plotsst.nts’ 4. Edit GDATTIM, GFUNC, GDFILE, and any other variables you’d like 5. 'r'
V. Downloading NCEP SST analysis and converting to GEMPAK 1. For SST data from February 11, 2001 onward, ‘ftp polar.ncep.noaa.gov’ 2. logon on with the username ‘anonymous’ and use your e-mail address for the password 3. ‘prompt’ 4. ‘binary’ 5. ‘cd /pub/history/sst’ 6. ‘mget filename’ where filename is the name of the file that corresponds to the initialization day of your model run. Files are in the format ‘rtg_sst_grb_0.5.YYYYMMDD. 7. ‘bye’ 8. convert the file to GEMPAK with the command ‘dcgrib2 lowres.gem < rtg_sst_grb_0.5.YYYYMMDD’ 9. if you need data prior to February 11, 2001, follow the below procedure: ‘ftp ftpprd.ncep.noaa.gov’ 1. You can get the 1 degree SST files already in GRIB format in a weekly format from: http://nomad3.ncep.noaa.gov/pub/sst/weekly/ 2. Just in case the above link changes: Another way to get to this data is through the NOMADS site—the same place where you can get NARR data. http://nomads.ncdc.noaa.gov/data.php?name=access 3. Scroll down from the NARR section and click on the “http” link in the “Reynolds SST O/I v2.0” dataset row. From there, click on the “weekly” directory. In the “weekly” directory, you can find weekly SST data from 1981 to the present. Right click to save the files to your computer.
VI. Creating an SST Overlay
1. Step 1 is a seemingly pointless step, as all you will be doing is moving your high resolution and low resolution SST analyses to new grid files that are identical to the originals. For some reason, at the time these directions were written, GEMPAK would not perform the overlay properly without this step. If you find you are able to complete the overlay without this step, then feel free to do so.
a. Open gddiag
b. Edit settings to the following
i. GDFILE = highres.gem (name of your high res. SST GEMPAK file)
ii. GDOUTF = highres.final.gem
iii. GFUNC = TMPK
iv. GDATTIM = (the gdat you specified in ascii2gem, run gdinfo on highres.gem if unsure)
v. GLEVEL = 0
vi. GVCORD = none
vii. GRDNAM = TMPK
viii. CPYFIL = highres.gem
ix. ANLYSS = 4/2;2;2;2
c. Type ‘r’ to run gddiag. A new grid (highres.final.gem) should be created, identical to ‘highres.gem’, and filled with the SST data (TMPK).
d. Edit the following settings in gddiag, keeping the others the same as they were set to in step ‘b’.
i. GDFILE = lowres.gem (name of your low res. SST GEMPAK file)
ii. GDOUTF = lowres.final.gem
iii. GDATTIM = (the gdattim from lowres.gem, run gdinfo on lowres.gem if unsure)
iv. CPYFIL = lowres.gem
e. Type ‘r’ to run gddiag. A new grid (lowres.final.gem) should be created, identical to ‘lowres.gem’, and filled with the SST data (TMPK).
2. Now, we must interpolate the two grids to the same grid file
a. Determine the size of the grid file you want to create. This should be at least the size of your model domain, although I would recommend going a bit larger than your model domain so you have some lee-way. So, if your model domain is 25-45N/60-100W, plan a grid domain of 20-50N/55-105W.
b. Open gddiag
c. Edit the settings to the following:
i. GDFILE = lowres.final.gem
ii. GDOUTF = overlay.gem
iii. GFUNC = TMPK
iv. GDATTIM = (should match step 1.d.iii above)
v. GLEVEL = 0
vi. GVCORD = none
vii. GRDNAM = TMPKL (include the L here to denote the lowres analysis)
viii. PROJ = CED
ix. GRDAREA = lat1;lon1;lat2;lon2 (the area you determined in step ‘a’)
x. KXKY = the spacing (in degrees) between points in your latlon.dat file, be sure it is preceded by a # symbol (i.e. #0.027;0.027)
xi. MAXGRD = set this to 10. You most likely won’t need 10 grids, but if you leave this at 200, you will most likely have issues with gempak memory.
xii. CPYFIL = (make sure this is blank!!!!)
xiii. ANLYSS = 4/2;2;2;2
d. Type ‘r’ to run gddiag. This will place the low resolution SST data in a new grid file.
e. Edit the following entries in gddiag, keep the other set to what they were before
i. GDFILE = highres.final.gem
ii. GDATTIM = (should match step 1.b.iv above)
iii. GRDNAM = TMPKH (include the H here to denote the highres analysis)
f. Type ‘r’ to run gddiag. This will place the high resolution SST data in the new grid file.
3. Now we perform the overlay
a. Open gddiag
b. Set the following parameters as follows
i. GDFILE = overlay.gem
ii. GDOUTF = overlay.gem
iii. GFUNC = MISS(TMPKH,TMPKL)
note, if gdattim of TMPKL does not match that of TMPKH, use the following: GFUNC = MISS(TMPKH,TMPKL^gdattim), where gdattim matches gdattim for TMPKL.
iv. GDATTIM = should be gdattim of TMPKH (model initialization time)
v. GLEVEL = 0
vi. GVCORD = none
vii. GRDNAM = TMPK
4. It is suggested you plot TMPK from overlay.gem to verify the overlay is acceptable. Keep in mind there will likely be some bad data over land which will create some artificial gradients. These will not come into play in WRF as it is using this data only as SSTs, and will not use the values over land. 5. It is also a good idea to run a smoother on the overlay to help smooth out artificial gradients at the boundaries of the two images. In order to do this you’ll want to run gddiag again with the following parameters set.
a. GDFILE = overlay.gem
b. GDOUTF = overlay.gem
c. GFUNC = sm9s(tmpk) (sm5s is also a valid option here)
d. GDATTIM = the gdattim of the tmpk grid. Note that if gdattim was different for TMPKL and TMPKH, you’ll probably need to specify two times here using the format gdattim=YYMMDD/HHHH:YYMMDD/HHHH.
e. GLEVEL = 0
f. GVCORD = none
g. GRDNAM = SSTK (or some other new grid name)
VII. Converting SST WRF Intermediate File Format
Note: This section converts GEMPAK SST data to the WRF Intermediate File Format, which is the file format of data files after running grib_prep. Converting to the Intermediate File Format is only necessary if working with a custom WRF grid. If planning on using a NCEP grid (i.e. #218), you may find it easier to convert your SST data to grib using gdgrib, then use wrfsi to convert the data to the intermediate file format as you would your other input data.
1. Copy the Fortran programs readgem.f and writewrf.f to your directory. 2. Edit readgem.f as needed. The most essential variables are:
a. ix,iy: the dimensions of your GEMPAK grid
b. ifile: gempak file name
c. gdat(1), gdat(2): gdattim identifiers for your grid
3. to compile type: ‘f77 –fno-second-underscore –o readgem.exe readgem.f $GEMLIB/gemlib.a’.
a. later versions of gempak may require you to also add $GEMLIB/cgemlib.a to the end of the command line
b. if the program runs properly, you should get an output file called sst.txt
4. Edit writewrf.f as needed. The most essential variables are:
a. Real, dimension(nx,ny) :: sst – adjust nx,ny to your grid dimensions
b. hdate: run initialization time
c. nx, ny: grid dimensions
d. startlat: latitude coordinate of SW corner of grid
e. startlon: longitude coordinate of SW corner of grid
f. deltalat/deltalon: grid spacing (in degrees)
5. to compile type: ‘pgf90 –o writewrf.exe writewrf.f’
a. If the program runs properly, you should get an output file called sst.grd
VII. Special Instructions for Ingesting SSTs into WRF
1. Go through the grib_prep steps (Initial Data) in wrfsi with rest of data
2. Prior to running wrf_prep (Interpolate Data), copy your sst.grd file to your WRFV2/wrfsi/extdata/extprd/ directory
a. Rename sst.grd in this format – SST:YY-MM-DD_HH, where the time/date information is the initialization time/date
3. create a symbolic link to the file in the same directory by typing ‘ln –s SST:YY-MM-DD_HH SSTDATA’ 4. In the Interpolate Data section,
a. In the Controls tab, enter the following:
i. INIT_ROOT – root of model data (i.e. ‘NARR’, ‘ETA’)
ii. LBC_ROOT – root of model data (i.e. ‘NARR’, ‘ETA’)
iii. CONSTANTS_FULL_NAME – ‘SSTDATA’
5. Proceed running WRF as you normally would
Namelist.input Hints
(hints highlighted, important fields in bold)
(Updated for WRF 2.1)
Note: variables followed by (max_dom) indicate that this variable needs to
be defined for the nests when max_dom > 1.
&time_control
run_days = 1, ; run time in days
run_hours = 0, ; run time in hours
Note: if it is more than 1 day, one may use both run_days and run_hours
or just run_hours. e.g. if the total run length is 36 hrs, you may
set run_days = 1, and run_hours = 12, or run_days = 0, and run_hours = 36
However, remember that the time is the *total* of each of these time units. For example, if you only want a 24h run, set run_days = 1, *OR* run_hours = 24, *OR* run_minutes = 1440, etc., but do not set all of them! Doing so will result in a 3+ day run!
run_minutes = 0, ; run time in minutes
run_seconds = 0, ; run time in seconds
start_year (max_dom) = 2001, ; four digit year of starting time
start_month (max_dom) = 06, ; two digit month of starting time
start_day (max_dom) = 11, ; two digit day of starting time
start_hour (max_dom) = 12, ; two digit hour of starting time
start_minute (max_dom) = 00, ; two digit minute of starting time
start_second (max_dom) = 00, ; two digit second of starting time
Note: the start time is used to name the first wrfout file.
It also controls the start time for nest domains, and the time to restart
end_year (max_dom) = 2001, ; four digit year of ending time
end_month (max_dom) = 06, ; two digit month of ending time
end_day (max_dom) = 12, ; two digit day of ending time
end_hour (max_dom) = 12, ; two digit hour of ending time
end_minute (max_dom) = 00, ; two digit minute of ending time
end_second (max_dom) = 00, ; two digit second of ending time
It also controls when the nest domain integrations end
All start and end times are used by real.exe.
Note that one may use either run_days/run_hours etc. or
end_year/month/day/hour etc. to control the length of
model integration. But run_days/run_hours
takes precedence over the end times.
Program real.exe uses start and end times only.
interval_seconds = 10800, ; time interval between incoming real data, which will be the interval
between the lateral boundary condition file (real only)
input_from_file (max_dom) = T, ; whether nested run will have input files for domains other than 1
fine_input_stream (max_dom) = 0, ; field selection from nest input for its initialization
0: all fields are used; 1: only static, and time-varying, masked
surface fields are used
history_interval (max_dom) = 60, ; history output file interval in minutes (this is where you set your output
frequency. e.g., if you want hourly output this would be set to 60)
Alternative way to specify output intervals (integers only):
history_interval_mo (max_dom) = 1, ; history output file interval in months history_interval_d (max_dom) = 1, ; history output file interval in days history_interval_h (max_dom) = 1, ; history output file interval in hours history_interval_m (max_dom) = 1, ; history output file interval in minutes (equivalent to history_interval) history_interval_s (max_dom) = 1, ; history output file interval in seconds
frames_per_outfile (max_dom) = 1, ; output times per history output file, used to split output files
into smaller pieces (e.g., if you want hourly output in separate files, this would be set to 1)
restart = F, ; whether this run is a restart run
restart_interval = 1440, ; restart output file interval in minutes
io_form_history = 2, ; 2 = netCDF
io_form_restart = 2, ; 2 = netCDF
(= 102, ; this causes restart files for MPI runs to be written one per processor.
; May be used when restart file is larger than 2 Gb.
; Must restart with the same number of processors)
io_form_input = 2, ; 2 = netCDF
io_form_boundary = 2, ; netCDF format
= 4, ; PHDF5 format
= 5, ; GRIB1
= 1, ; binary
debug_level = 0, ; 50,100,200,300 values give increasing prints
Other output options:
auxhist2_outname = "rainfall" ; file name for extra output; if not specified,
auxhist2_d_ will be used
also note that to write variables in output other
than the history file requires Registry.EM file change
auxhist2_interval = 10, ; interval in minutes
io_form_auxhist2 = 2, ; output in netCDF
Additional ones when running 3DVAR:
write_input = t, ; write input-formatted data as output
inputout_interval = 180, ; interval in minutes when writing input-formatted data
input_outname = wrf_3dvar_input_d_ ; you may change the output file name
inputout_begin_y = 0
inputout_begin_mo = 0
inputout_begin_d = 0
inputout_begin_h = 3
inputout_begin_s = 0
inputout_end_y = 0
inputout_end_mo = 0
inputout_end_d = 0
inputout_end_h = 12
inputout_end_s = 0 ; the above shows that the input-formatted data are output
starting from hour 3 to hour 12 in 180 min interval.
&domains time_step = 60, ; time step for integration in integer seconds (this should be about 6 x your
horizontal gridspacing (in km) – e.g., if you have 4km grid spacing, the time step will be ~24s)
time_step_fract_num = 0, ; numerator for fractional time step
time_step_fract_den = 1, ; denominator for fractional time step
Example, if you want to use 60.3 sec as your time step,
set time_step = 60, time_step_fract_num = 3, and
time_step_fract_den = 10
max_dom = 1, ; number of domains - set it to > 1 if it is a nested run
s_we (max_dom) = 1, ; start index in x (west-east) direction (leave as is)
e_we (max_dom) = 91, ; end index in x (west-east) direction (if you have forgotten these dimensions,
they can be found in /WRFV2/wrfsi/domains/yourdomainname/static/wrfsi.nl…this is the horizontal grid dimension in the x-direction)
s_sn (max_dom) = 1, ; start index in y (south-north) direction (leave as is) e_sn (max_dom) = 82, ; end index in y (sth-north) direction(if you have forgotten these dimensions,
they can be found in /WRFV2/wrfsi/domains/yourdomainname/static/wrfsi.nl…this is the horizontal grid dimension in the x-direction)
s_vert (max_dom) = 1, ; start index in z (vertical) direction (leave as is) e_vert (max_dom) = 28, ; end index in z (vertical) direction (number of vertical levels, also in
wrfsi.nl)
vertical dimensions need to be the same for all nests
dx (max_dom) = 10000, ; grid length in x direction, unit in meters
dy (max_dom) = 10000, ; grid length in y direction, unit in meters
ztop (max_dom) = 19000. ; used in mass model for idealized cases
grid_id (max_dom) = 1, ; domain identifier
parent_id (max_dom) = 0, ; id of the parent domain
i_parent_start (max_dom) = 0, ; starting LLC I-indices from the parent domain
j_parent_start (max_dom) = 0, ; starting LLC J-indices from the parent domain
parent_grid_ratio (max_dom) = 1, ; parent-to-nest domain grid size ratio: for real-data cases
the ratio has to be odd; for idealized cases,
the ratio can be even if feedback is set to 0.
parent_time_step_ratio (max_dom) = 1, ; parent-to-nest time step ratio; it can be different
from the parent_grid_ratio
feedback = 1, ; feedback from nest to its parent domain; 0 = no feedback
smooth_option = 0 ; smoothing option for parent domain, used only with feedback
option on. 0: no smoothing; 1: 1-2-1 smoothing; 2: smoothing-desmoothing
Namelist variables for controling the prototype moving nest:
Note moving nest needs to be activated at the compile time by adding -DMOVE_NEST
to the ARCHFLAGS. The maximum number of moves, max_moves, is set to 50
but can be modified in source code file frame/module_driver_constants.F.
num_moves = 4 ; total number of moves
move_id = 2,2,2,2, ; a list of nest domain id's, one per move
move_interval = 60,120,150,180, ; time in minutes since the start of this domain
move_cd_x = 1,1,0,-1,; the number of parent domain grid cells to move in i direction
move_cd_y = 1,0,-1,1,; the number of parent domain grid cells to move in j direction
positive is to move in increasing i and j direction, and
negative is to move in decreasing i and j direction.
0 means no move. The limitation now is to move only 1 grid cell
at each move.
&physics
Note: even the physics options can be different in different nest domains,
caution must be used as what options are sensible to use
chem_opt = 0, ; chemistry option - not yet available
mp_physics (max_dom) microphysics option
= 0, no microphysics
= 1, Kessler scheme
= 2, Lin et al. scheme
= 3, WSM 3-class simple ice scheme
= 4, WSM 5-class scheme
= 5, Ferrier (new Eta) microphysics
= 6, WSM 6-class graupel scheme
= 8, Thompson 7-class scheme (also predict ice number concentraion)
= 98, NCEP 3-class simple ice scheme (to be removed)
= 99, NCEP 5-class scheme (to be removed)
For non-zero mp_physics options, to keep Qv .GE. 0, and to set the other moisture fields .LT. a critcal value to zero
mp_zero_out = 0, ; no action taken, no adjustment to any moist field
= 1, ; except for Qv, all other moist arrays are set to zero
; if they fall below a critical value
= 2, ; Qv is .GE. 0, all other moist arrays are set to zero
; if they fall below a critical value
mp_zero_out_thresh = 1.e-8 ; critical value for moist array threshold, below which
; moist arrays (except for Qv) are set to zero (kg/kg)
ra_lw_physics (max_dom) longwave radiation option
= 0, no longwave radiation
= 1, rrtm scheme
= 99, GFDL (Eta) longwave (semi-supported)
ra_sw_physics (max_dom) shortwave radiation option
= 0, no shortwave radiation
= 1, Dudhia scheme
= 2, Goddard short wave
= 99, GFDL (Eta) longwave (semi-supported)
radt (max_dom) = 30, ; minutes between radiation physics calls
reduce it if grid distance is finer
sf_sfclay_physics (max_dom) surface-layer option (old bl_sfclay_physics option)
= 0, no surface-layer
= 1, Monin-Obukhov scheme
= 2, Monin-Obukhov (Janjic Eta) scheme (if you use MYJ PBL, you need to use this sfc scheme)
sf_surface_physics (max_dom) land-surface option (old bl_surface_physics option)
= 0, no surface temp prediction
= 1, thermal diffusion scheme
= 2, Noah land-surface model
= 3, RUC land-surface model
bl_pbl_physics (max_dom) boundary-layer option
= 0, no boundary-layer
= 1, YSU scheme
= 2, Mellor-Yamada-Janjic (Eta) TKE scheme
= 99, MRF scheme (to be removed)
bldt (max_dom) = 0, ; minutes between boundary-layer physics calls
cu_physics (max_dom) cumulus option
= 0, no cumulus
= 1, Kain-Fritsch (new Eta) scheme
= 2, Betts-Miller-Janjic scheme
= 3, Grell-Devenyi ensemble scheme
= 4, simplified arakawa schubert scheme
= 99, previous Kain-Fritsch scheme
cudt = 0, ; minutes between cumulus physics calls
isfflx = 1, ; heat and moisture fluxes from the surface
(only works for sf_sfclay_physics = 1)
1 = with fluxes from the surface
0 = no flux from the surface
ifsnow = 0, ; snow-cover effects
(only works for sf_surface_physics = 1)
1 = with snow-cover effect
0 = without snow-cover effect
icloud = 1, ; cloud effect to the optical depth in radiation
(only works for ra_sw_physics = 1 and ra_lw_physics = 1)
1 = with cloud effect
0 = without cloud effect
surface_input_source = 1, ; where landuse and soil category data come from:
1 = SI/gridgen
2 = GRIB data from another model (only possible
(VEGCAT/SOILCAT are in wrf_real_input_em files from SI)
num_soil_layers = 5, ; number of soil layers in land surface model
= 5: thermal diffusion scheme
= 4: Noah landsurface model
= 6: RUC landsurface model
maxiens = 1, ; Grell-Devenyi only
maxens = 3, ; G-D only
maxens2 = 3, ; G-D only
maxens3 = 16 ; G-D only
ensdim = 144 ; G-D only
These are recommended numbers. If you would like to use
any other number, consult the code, know what you are doing.
seaice_threshold = 271 ; tsk < seaice_threshold, if water point and 5-layer slab
; scheme, set to land point and permanent ice; if water point
; and Noah scheme, set to land point, permanent ice, set temps
; from 3 m to surface, and set smois and sh2o
&dynamics
dyn_opt = 2, ; dynamical core option: advanced research WRF core (Eulerian mass)
rk_ord = 3, ; time-integration scheme option:
2 = Runge-Kutta 2nd order
3 = Runge-Kutta 3rd order
diff_opt = 0, ; turbulence and mixing option:
0 = no turbulence or explicit
spatial numerical filters (km_opt IS IGNORED).
1 = evaluates 2nd order
diffusion term on coordinate surfaces.
uses kvdif for vertical diff unless PBL option
is used. may be used with km_opt = 1 and 4.
(= 1, recommended for real-data case when grid distance < 10 km)
2 = evaluates mixing terms in
physical space (stress form) (x,y,z).
turbulence parameterization is chosen
by specifying km_opt.
km_opt = 1, ; eddy coefficient option
1 = constant (use khdif kvdif)
2 = 1.5 order TKE closure (3D)
3 = Smagorinsky first order closure (3D)
Note: option 2 and 3 are not recommended for DX > 2 km
4 = horizontal Smagorinsky first order closure
(recommended for real-data case when grid distance < 10 km)
damp_opt = 0, ; upper level damping flag (do not use it for real-data case
until further notice); also set to 0 if mix_full_fields = .true.
0 = without damping
1 = with diffusive damping (dampcoef non-dimensional ~0.01-0.1)
2 = with Rayleigh damping (dampcoef inverse time scale [1/s] e.g. .003)
w_damping = 0, ; vertical velocity damping flag (for operational use)
0 = without damping
1 = with damping
base_temp = 290., ; real-data, em ONLY, base sea-level temp (K)
base_pres = 10^5 ; real-data, em ONLY, base sea-level pres (Pa), DO NOT CHANGE
base_lapse = 50., ; real-data, em ONLY, lapse rate (K), DO NOT CHANGE
zdamp (max_dom) = 5000., ; damping depth (m) from model top
dampcoef (max_dom) = 0., ; damping coefficient (dampcoef <= 0.2, <=0.1 for 3D cases)
khdif (max_dom) = 0, ; horizontal diffusion constant (m^2/s)
kvdif (max_dom) = 0, ; vertical diffusion constant (m^2/s)
smdiv (max_dom) = 0.1, ; divergence damping (0.1 is typical)
emdiv (max_dom) = 0.01, ; external-mode filter coef for mass coordinate model
(0.01 is typical for real-data cases)
epssm (max_dom) = .1, ; time off-centering for vertical sound waves
non_hydrostatic (max_dom) = .true., ; whether running the model in hydrostatic or non-hydro mode
pert_coriolis (max_dom) = .false., ; Coriolis only acts on wind perturbation (idealized)
mix_full_fields(max_dom) = .true., ; used with diff_opt = 2; value of ".true." is recommended, except for
highly idealized numerical tests; damp_opt must be set to 0 if ".true."
is choosen
h_mom_adv_order (max_dom) = 5, ; horizontal momentum advection order (5=5th, etc.)
v_mom_adv_order (max_dom) = 3, ; vertical momentum advection order
h_sca_adv_order (max_dom) = 5, ; horizontal scalar advection order
v_sca_adv_order (max_dom) = 3, ; vertical scalar advection order
time_step_sound (max_dom) = 4 / ; number of sound steps per time-step
(if using a time_step much larger than 6*dx (in km),
increase number of sound steps)
&bc_control
spec_bdy_width = 5, ; total number of rows for specified boundary value nudging
spec_zone = 1, ; number of points in specified zone (spec b.c. option)
relax_zone = 4, ; number of points in relaxation zone (spec b.c. option)
specified (max_dom) = .false., ; specified boundary conditions (only for domain 1)
the above 4 are used for real-data runs
periodic_x (max_dom) = .false., ; periodic boundary conditions in x direction symmetric_xs (max_dom) = .false., ; symmetric boundary conditions at x start (west) symmetric_xe (max_dom) = .false., ; symmetric boundary conditions at x end (east) open_xs (max_dom) = .false., ; open boundary conditions at x start (west) open_xe (max_dom) = .false., ; open boundary conditions at x end (east) periodic_y (max_dom) = .false., ; periodic boundary conditions in y direction symmetric_ys (max_dom) = .false., ; symmetric boundary conditions at y start (south) symmetric_ye (max_dom) = .false., ; symmetric boundary conditions at y end (north) open_ys (max_dom) = .false., ; open boundary conditions at y start (south) open_ye (max_dom) = .false., ; open boundary conditions at y end (north) nested (max_dom) = .false., ; nested boundary conditions (inactive)
&namelist_quilt This namelist record controls asynchronized I/O for MPI applications.
nio_tasks_per_group = 0, default value is 0: no quilting; > 0 quilting I/O (this is the number of
processors you are running on (if running in MPI mode))
nio_groups = 1, default 1, don't change
miscelleneous in &domains: tile_sz_x = 0, ; number of points in tile x direction tile_sz_y = 0, ; number of points in tile y direction
can be determined automatically
numtiles = 1, ; number of tiles per patch (alternative to above two items)
nproc_x = -1, ; number of processors in x for decomposition
nproc_y = -1, ; number of processors in y for decomposition
-1: code will do automatic decomposition
>1: for both: will be used for decomposition
Acknowledgments
Created by the NCSU Forecasting Lab:
- Dr. Mike Brennan
- Megan Gentry
- Nicole Haglund
- Kevin Hill
- Dr. Gary Lackmann
- Kelly Mahoney
With additional contributions from:
- Matt Borkowski
- Zach Brown
- Dr. Matt Parker