Wednesday, November 28, 2018

Research Note #17 - WRF-Chem Simulation with ECMWF ERA-Interim Data

Running WRF-Chem with ERA-Interim data is basically similar with GFS data. The main difference is the pre-processing steps. While GFS (FNL or forecast) dataset contains everything the user needs for the pre-processing, ECMWF (ERA-Interim, Era5 etc) dataset requires more efforts from user to determine parameters included in the data before downloading and processing it. It may seems bothersome and complicated, but determination of parameters is really important to understand how WRF model works.

The key point here is WRF's Vtable file, which contains all parameter needed for simulation. Once you understand the contents of the file (in accordance with the type of input data), you can basically use WRF with many kinds of input dataset.

To make long story short, here are steps for running WRF-Chem with ERA-Interim dataset:

1. Downloading Data
  • Go to ECMWF website, and log-in to it. An account is required for downloading data, thus if you don't have one, just register a new account. It's free.
  • Once you logged in, browse into Forecast > Datasets > Archived Datasets > Reanalysis Datasets, and finally, select Download on ERA-Interim section. You will be directed to ERA-Interim, Daily data page.
  • Now, the most important thing, WRF needs two kinds of level type for the data: surface and levels. Aside from surface level, there are at least two kinds of level type could be used for WRF: pressure levels and model levels. Which level type you use will depend on Vtable you use for WRF (wrf directory/ungrib/Variable_Tables). For this example, I use Vtable.ERA-interim.ml, which means I will use model levels type dataset. Another important thing, aside from daily data, you will need Invariant data for the data field. This data is static and not time-varied as daily data, hence you only need to download it once.
  • For the surface level data, on Type of Level section, select Surface, and put a tick on the month and year section. Regardless the data period of your interest, you have to download the data for at least one whole month. Next, select the time of the data. If you want to use 6-hourly boundary condition data, put check to all time box. For the step (model cycle), choose 0. Finally, you should choose 18 parameters of the surface level data (which are listed in WRF Vtable file): 2m temperature, 10m U wind component, 10m V wind component, mean sea level pressure, sea surface temperature, sea ice area fraction, skin temperature, snow density, snow depth, surface pressure, soil temperature levels (1,2,3 and 4) and finally, volumetric soil water layers (1,2,3 and 4). Click Retrieve GRIB. The website will summarize your request and if you think it's correct, click Retrieve now, and wait until the download link appears. Depending on the size of the data you requested, this process may take up to 1 minute to hours to complete. All those parameters will be downloaded as single file. Give it suitable name e.g. era-int-201711-sfc.grib.
  • For the model levels data, on Type of Level section, select Model levels. The steps are almost similar with surface level data download. This time you only need to select the month, year, time and 5 parameters on all levels: specific humidity, temperature, U component of wind, V component of wind and geopotential. Click Retrieve GRIB, and the rest will be same as surface level data download procedure. Anyway, since geopotential data is only available for one level, you could download it separately from the others. For example, the downloaded data will be named era-int-201711-geo.grib (for geopotential) and era-int-201711-mod.grib (for the other parameters). Therefore, there will be two model levels data files.  
  • Finally, don't forget to download the Invariant data. On ERA Interim Fields section, select Invariant, and put check on Land-Sea Mask, then click Retrieve GRIB and so on. Name it into era-int-invariant.grib.
  • In the end, based on this example, there are four files you should have from the website: era-int-201711-sfc.grib (surface levels), era-int-201711-geo.grib (model levels geopotential), era-int-201711-mod.grib (model levels other than geopotential) and era-int-invariant.grib (land-sea mask invariant).

2. WRF Pre-processing

  • Make sure you have already set the model domain (by geogrid.exe) and set the dynamic link of Vtable to Vtable.ERA-interim.ml file.
  • Link all ERA-Interim data downloaded by link_grib.csh script, and execute ungrib.exe. Wait until the process finished.
  • The next step after ungrib is very important. ECMWF model levels data uses sigma levels, while WRF requires pressure levels, thus you need to calculate the pressure level of the corresponding sigma level using utility calc_ecmwf_p.exe (WPS/util/calc_ecmwf_p.exe). You have to do this before executing metgrid.exe. Failing to do so may result on model crashes or unrealistic simulation results (as I previously experienced). Assuming this is the first time you use ERA-Interim data, open namelist.wps and add 'PRES' to the list of prefixes in the fg_name namelist variable.
          &metgrid
          fg_name = 'FILE', 'PRES',
  • Make a dynamic link of the calc_ecmwf_p.exe to the current working WPS directory and make a text file with this following template, then save and name it: 'ecmwf_coeffs':

    0         0.000000    0.00000000
    1        20.000000    0.00000000
    2        38.425343    0.00000000
    3        63.647804    0.00000000
    4        95.636963    0.00000000
    5       134.483307    0.00000000
    6       180.584351    0.00000000
    7       234.779053    0.00000000
    8       298.495789    0.00000000
    9       373.971924    0.00000000
   10       464.618134    0.00000000
   11       575.651001    0.00000000
   12       713.218079    0.00000000
   13       883.660522    0.00000000
   14      1094.834717    0.00000000
   15      1356.474609    0.00000000
   16      1680.640259    0.00000000
   17      2082.273926    0.00000000
   18      2579.888672    0.00000000
   19      3196.421631    0.00000000
   20      3960.291504    0.00000000
   21      4906.708496    0.00000000
   22      6018.019531    0.00000000
   23      7306.631348    0.00000000
   24      8765.053711    0.00007582
   25     10376.126953    0.00046139
   26     12077.446289    0.00181516
   27     13775.325195    0.00508112
   28     15379.805664    0.01114291
   29     16819.474609    0.02067788
   30     18045.183594    0.03412116
   31     19027.695313    0.05169041
   32     19755.109375    0.07353383
   33     20222.205078    0.09967469
   34     20429.863281    0.13002251
   35     20384.480469    0.16438432
   36     20097.402344    0.20247594
   37     19584.330078    0.24393314
   38     18864.750000    0.28832296
   39     17961.357422    0.33515489
   40     16899.468750    0.38389215
   41     15706.447266    0.43396294
   42     14411.124023    0.48477158
   43     13043.218750    0.53570992
   44     11632.758789    0.58616841
   45     10209.500977    0.63554746
   46      8802.356445    0.68326861
   47      7438.803223    0.72878581
   48      6144.314941    0.77159661
   49      4941.778320    0.81125343
   50      3850.913330    0.84737492
   51      2887.696533    0.87965691
   52      2063.779785    0.90788388
   53      1385.912598    0.93194032
   54       855.361755    0.95182151
   55       467.333588    0.96764523
   56       210.393890    0.97966272
   57        65.889244    0.98827010
   58         7.367743    0.99401945
   59         0.000000    0.99763012
   60         0.000000    1.00000000
  • Execute the utility and wait until it completes calculating the pressure levels. This results new files with prefix 'PRES' in current directory. Once finished, you can execute metgrid.exe. This will complete the pre-processing steps.
3. Running WRF
  • Open namelist.input in WRF's run directory, and pay attention to these following variables, since they are closely related to ECMWF data, e.g. number of metgrid pressure levels. Modify the values as follows:
&domains  
num_metgrid_levels = 61 [default 32]

&physics
surface_input_sources= 1 [default 3]
  • Execute real.exe and finally, wrf.exe to run the model.  
That's it. This post will be updated once something new occurred in the future.

No comments:

Post a Comment