WRF with MERRA2

WRF required fields: http://www2.mmm.ucar.edu/wrf/OnLineTutorial/Basics/UNGRIB/ungrib_req_fields.htm

  • 3D, pressure levels: Temperature=T, Winds=U, V, Relative Humidity=RH, Geopotential Height=PHIS
  • 2D: Surface Pressure=PS, Sea Level Pressure=SLP, Skin Temperature=TS, 2-meter Temperature=T2M, 2-meter specific humidity=QV2M, 10-meter U,V=U10M,V10M
  • Constant: LANDSEA mask=FRLAND, Soil Height, PHIS
  • Optional: Soil Temperature and Soil Moisture, needed for Noah LSM. Water equivalent snow depth=PRECSNOLAND.

Area I download for GFS forecasts: leftlon=-55, rightlon=20, toplat=70, bottomlat=30

MERRA2 Data info from File Specification by Bosilovich et al. here: https://gmao.gsfc.nasa.gov/reanalysis/MERRA-2/docs/

  • inst3_3d_asm_Np (M2I3NPASM): Assimilated Meteorological Fields
    • RH : relative humidity after moist, 1
    • T : air temperature, K
    • U : eastward wind, m/s
    • V : northward wind m/s
    • PHIS : surface geopotential height,  m2/s2
  • inst1_2d_asm_Nx (M2I1NXASM): Single-Level Diagnostics
    • PS : surface pressure, Pa
    • SLP : sea level pressure, Pa
    • TS : surface skin temperature, K
    • T2M : 2-meter air temperature, K
    • QV2M : 2-meter specific humidity, kg/kg
    • U10M : 10-meter eastward wind, m/s
    • V10M : 10-meter northward wind, m/s
  • const_2d_asm_Nx (M2C0NXASM): Constant Model Parameters
    • FRLAND : fraction of land, 1
    • PHIS : surface geopotential height, m2/s2

To download data, start here: https://disc.gsfc.nasa.gov/uui/datasets?keywords=”MERRA-2″

Then type in the dataset name in the search box. Select the dataset. Click on Subset > Subsetter. Enter lat/lon values. Download list of files. Issue wget command:

wget --load-cookies ~/.urs_cookies --save-cookies ~/.urs_cookies --auth-no-challenge=on --keep-session-cookies --content-disposition -i myfile.dat

The constants files are different, download those directly from the online archive. Downloading requires earthdata login.

Dealing with GRIB2 data

We use python for our data analysis and plotting.

The wonderful xarray package (http://xarray.pydata.org/en/stable/) has no problem with NetCDF, but doesn’t like GRIB2. GFS data are in GRIB2, however, so it would be nicve if we could convert them easily to NetCDF.

We can do this by using the great wgrib2 tool (http://www.cpc.noaa.gov/products/wesley/wgrib2/).

To install wgrib2 (on ORR2 or SONIC, for example), do the following:

  1. Make a directory for wgrib2 and move there:
    cd
    mkdir wgrib2
    cd wgrib2
  2. Get wgrib2 and unpack it:
    wget ftp://ftp.cpc.ncep.noaa.gov/wd51we/wgrib2/wgrib2.tgz
    tar -xzf wgrib2.tgz
  3. Move into the directory, set environment variables and make wgrib2:
    cd grib2/
    export CC=gcc
    export FC=gfortran
    make
  4. Now you can convert a GFS GRIB2 file to NetCDF!
    wgrib2/grib2/wgrib2/wgrib2 gec00.t12z.pgrb2f00 -netcdf GFS.nc

    It’d be a good idea to add the wgrib2 executable directory to your PATH, so you can call it from any directory.