# Presentation: 502986

## WRF SI(The WRF Standard Initialization)HWRF specific !!!

- Dusan Jovic  -- NOAA/NCEP/EMC

## Main WRF SI tasks

- Creates (localize) domains
- Define location, projection, resolution
- “static fields” preprocessor: interpolates terrain, landuse, ...
- Decode input grib files (used for IC / BC)input grib files for IC can be different from those used for BC, or LSM
- Horizontal interpolation from input grid to model grid (rot. lat-lon in NMM case)
- Vertical interpolation (usually from P to hybrid-P coordinate)

## Required software

- Fortran 90 compiler
- C compiler
- netCDF (libraries, include files and ncdump)
- make
- perl

- Required Input Files

- Static data ( topography, landuse ...) _[ftp://aftp.fsl.noaa.gov/divisions/frd-laps/WRFSI/Geog_Data](ftp://aftp.fsl.noaa.gov/divisions/frd-laps/WRFSI/Geog_Data)_
- Grib Data (GFS, Eta, ...)

## How to install and run WRF SI

- untar the distribution file (will create HWRFV1 directory, SI is in NMMSI)
- configure and compile SI
-  edit install.scr
- /usr/bin/perl ./srcroot/install_wrfsi.pl \              --source_root="/emc2/wx20du/WRFEMC/HWRF/NMMSI/srcroot" \              --installroot="/emc2/wx20du/WRFEMC/HWRF/NMMSI/setup" \              --path_to_netcdf="/usrx/local/netcdf3.5" \              --geog_dataroot="/emc2/wx20py/wrfsigeog" \              --machine="ibm"

## Slide 5

| Environment variable | Description
 | Default location |
| --- | --- | --- |
| SOURCE_ROOT | the-source-root-directory | ./wrfsi |
| INSTALLROOT | the-installroot-directory | ./wrfsi |
| GEOG_DATAROOT | where-terrestrial-data-are | $INSTALLROOT/extdata |
| EXT_DATAROOT | where-degribbed-data-are | $INSTALLROOT/extdata |
| DATAROOT | where-all-case-directory-is | $INSTALLROOT/domains |
| MOAD_DATAROOT | where-one-case-directory-is | - |
| TEMPLATES | where-the-template-directory-is | $INSTALLROOT/templates |

- set compiler options in srcroot/src/lib/w3lib.source_ei/Makefile andsrcroot/src/lib/w3lib.source_ei/clib.h

- edit paths in $EXT_DATAROOT/static/grib_prep.nl

**&gpinput_defs**
-  SRCNAME = 'GFDL','ETA','GFS','AVN','AVNLSM','RUCH','NNRP',   'NNRPSFC','SST',
-  SRCVTAB = 'GFDL','ETA','GFS','AVN','AVNLSM','RUCH','NNRPSFC','NNRPSFC','SST',
-  SRCPATH = '/export/lnx280/wd20dj/HWRF/NMMSI/gribdata/GFDL',
-            '/export/lnx280/wd20dj/HWRF/NMMSI/gribdata/ETA',
-            '/export/lnx280/wd20dj/HWRF/NMMSI/gribdata/AVN',
-            '/export/lnx280/wd20dj/HWRF/NMMSI/gribdata/AVN',
-            '/export/lnx280/wd20dj/HWRF/NMMSI/gribdata/AVNLSM',
-            '/rt0/rucdev/nrelwind/run/maps_fcst',
-            '/path/to/nnrp/grib',
-            '/path/to/nnrp/sfc/grib',
-            '/public/data/grids/ncep/sst/grib',
-  SRCCYCLE =  6,6,6,6,12,12,24,
-  SRCDELAY =  3,4,4,3, 0, 0,36,
**/**

## WRF SI main programs (overview)

- gridgen_model

- hinterp

- vinterp

## Grib pre-processing (decoding)

- decodes only desired grib messages(using Vtable)
- reformats and writes 2d files in binary intermediate format suitable for hinterp
- domain independent

## grib_prep.exe

- $INSTALLROT/etc/grib_prep.pl \
-                           -d ${INSTALLROT}/extdata \
-                           -i ${INSTALLROT} \
-                           -s ${YEAR}${MONTH}${DATE}${CYCLE} \
-                           -l ${FLENGTH} \
-                           -t ${FREQBC} \
-                              ${MOD}

- $EXT_DATAROOT/static/grib_prep.nl
- $EXT_DATAROOT/static/Vtable.$MOD
- $EXT_DATAROOT/work/$MOD/GRIBFILE.AA ...

- $EXT_DATAROOT/extprd/$MOD:2004-08-31_00
- $EXT_DATAROOT/extprd/$MOD:2004-08-31_06
-     . . . .
- $EXT_DATAROOT/extprd/$MOD:2004-09-01_00

## $EXT_DATAROOT/static/grib_prep.nl

-  START_YEAR = 0000
-  START_MONTH = 00
-  START_DAY = 00
-  START_HOUR = 00
-  START_MINUTE = 00
-  START_SECOND = 00
-  END_YEAR = 0000
-  END_MONTH = 00
-  END_DAY = 00
-  END_HOUR = 00
-  END_MINUTE = 00
-  END_SECOND = 00
-  INTERVAL = 21600
**/**
**&gpinput_defs**
-  SRCNAME = 'GFDL','ETA','GFS','AVN','AVNLSM','RUCH', 'NNRP',    'NNRPSFC', 'SST',
-  SRCVTAB = 'GFDL','ETA','GFS','AVN','AVNLSM','RUCH', 'NNRPSFC', 'NNRPSFC', 'SST',
-  SRCPATH = '/emc2/wx20du/WRFEMC/HWRF/NMMSI/gribdata/GFDL',
-            '/emc2/wx20du/WRFEMC/HWRF/NMMSI/gribdata/ETA',
-            '/emc2/wx20du/WRFEMC/HWRF/NMMSI/gribdata/AVN',
-            '/emc2/wx20du/WRFEMC/HWRF/NMMSI/gribdata/AVN',
-            '/emc2/wx20du/WRFEMC/HWRF/NMMSI/gribdata/AVNLSM',
-            '/rt0/rucdev/nrelwind/run/maps_fcst',
-            '/path/to/nnrp/grib',
-            '/path/to/nnrp/sfc/grib',
-            '/public/data/grids/ncep/sst/grib',
-  SRCCYCLE =  6,6,6,6,12,12,24,
-  SRCDELAY =  3,4,4,3, 0, 0,36,
**/**

## $EXT_DATAROOT/static/Vtable.GFDL

- Code | Code |   1  |   2  | Name     |  Units   | Description                              |
- -----+------+------+------+----------+----------+------------------------------------------+
-   11 | 100  |   *  |      | T        | K        | Temperature                              |
-   33 | 100  |   *  |      | U        | m s{-1}  | U                                        |
-   34 | 100  |   *  |      | V        | m s{-1}  | V                                        |
-   52 | 100  |   *  |      | RH       | %        | Relative Humidity                        |
-   7  | 100  |   *  |      | HGT      | m        | Height                                   |
-    1 |  1   |   0  |      | PSFC     | Pa       | Surface Pressure                         |
-    2 | 102  |   0  |      | PMSL     | Pa       | Sea-level Pressure                       |
-   11 |  1   |   0  |      | SKINTEMP | K        | Skin temperature (can use for SST also)  |
- -----+------+------+------+----------+----------+------------------------------------------+

- $EXT_DATAROOT/static/Vtable.AVNLSM

- GRIB | Level| Level| Level| REGRID   |  REGRID  | REGRID                                   |
- Code | Code |   1  |   2  | Name     |  Units   | Description                              |
- -----+------+------+------+----------+----------+------------------------------------------+
-  144 | 112  |   0  |  10  | SM000010 | fraction | Soil Moisture of 0-10 cm ground layer    |
-  144 | 112  |  10  | 200  | SM010200 | fraction | Soil Moisture of 10-200 cm ground layer  |
-  11  | 112  |   0  |  10  | ST000010 | K        | T of 0-10 cm ground layer                |
-  11  | 112  |  10  | 200  | ST010200 | K        | T of 10-200 cm ground layer              |
- -----+------+------+------+----------+----------+------------------------------------------+

## Domain Localization

- localize domain, information in wrfsi.nl (hgridspec section)
- Run ones for each domain
- Terrestrial data interpolator
- New MAP_PROJ_NAME entry 'rotlat'
- Creates one netCDF file static.wrfsi.rotlat

## gridgen_model.exe

- $MOAD_DATAROOT/static/wrfsi.nl
- $MOAD_DATAROOT/cdl/wrfsi.rotlat.cdl

- static/static.wrfsi.rotlat
- static/....

- $INSTALLROT/etc/window_domain_rt.pl \
-                           -w $TYPE \
-                           -t $TEMPLATE_ROOT \
-                           -s $SOURCE_ROOT \
-                           -i $INSTALLROT \
-                           -d $MOAD_DATAROOT \
-                           -c

## $MOAD_DATAROOT/static/wrfsi.nl

-  NUM_DOMAINS = 1
-  XDIM = 204,100,200
-  YDIM = 419,100,200
-  PARENT_ID = 1,1,2
-  RATIO_TO_PARENT = 1,4,4
-  DOMAIN_ORIGIN_PARENT_X = 1,36,36
-  DOMAIN_ORIGIN_PARENT_Y = 1,36,36
-  MAP_PROJ_NAME = 'rotlat',
-  MOAD_KNOWN_LAT = HURLAT,
-  MOAD_KNOWN_LON = HURLON,
-  MOAD_KNOWN_LOC = 'center'
-  MOAD_STAND_LATS = SLAT, 0.0,
-  MOAD_STAND_LONS = SLON,
-  MOAD_DELTA_X = 0.132867
-  MOAD_DELTA_Y = 0.119497
-  SILAVWT_PARM_WRF = 0.
-  TOPTWVL_PARM_WRF = 2.
- /
- &sfcfiles
-  TOPO_30S = '/emc2/wx20py/wrfsigeog/topo_30s',
-  LANDUSE_30S = '/emc2/wx20py/wrfsigeog/landuse_30s',
-  SOILTYPE_TOP_30S = '/emc2/wx20py/wrfsigeog/soiltype_top_30s',
-  SOILTYPE_BOT_30S = '/emc2/wx20py/wrfsigeog/soiltype_bot_30s',
-  GREENFRAC = '/emc2/wx20py/wrfsigeog/greenfrac',
-  SOILTEMP_1DEG = '/emc2/wx20py/wrfsigeog/soiltemp_1deg',
-  ALBEDO_NCEP = '/emc2/wx20py/wrfsigeog/albedo_ncep',
-  MAXSNOWALB = '/emc2/wx20py/wrfsigeog/maxsnowalb',
-  ISLOPE = '/emc2/wx20py/wrfsigeog/islope',
- /

## 75o

- 75o

- 75o

** ****MOAD_KNOWN_LAT**
** ****MOAD_STAND_LATS **

** ****MOAD_KNOWN_LON  **
** ****MOAD_STAND_LONS **

## i=1

- i=2

- i=3

- i=4

- i=5

- i=6

- i=7

- i=8

- j=1

- j=2

- j=3

- j=4

- j=5

- j=6

- j=7

- j=8

- j=9

- j=10

- j=11

## i=1

- i=2

- i=3

- i=4

- i=5

- i=6

- i=7

- i=204

- j=1

- j=2

- j=3

- j=4

- j=5

- j=6

- j=7

- j=8

- j=9

- j=10

- j=419

## 

**i=1**

**i=2**

**i=3**

**i=IM**

**i=IM-1**

**j=1**

**j=2**

**j=3**

**j=JM-1**

**j=JM**

- 

## Horizontal interpolation (hinterp.exe)

- uses wrfsi.nl for domain information
- reads output files (binary “intermediate” format) from grib_prep
- reads netCDF file from gridgen_model(static.wrfsi.rotlat)
- horizontally interpolates 2d fields(interpolation method for “soil” (LSM) fields can be different from other fields)

## hinterp.exe

- $INSTALLROT/etc/wrfprep.pl \
-                           -d ${MOAD_DATAROOT} \
-                           -i ${INSTALLROT} \
-                           -s ${YEAR}${MONTH}${DATE}${CYCLE} \
-                           -f ${FLENGTH} \
-                           -t ${FREQBC}

- $MOAD_DATAROOT/static/wrfsi.nl (project_id,filetimespec,interp_control)
- $MOAD_DATAROOT/static/static.wrfsi.rotlat
- $MOAD_DATAROOT/siprd/$MOD:2004-08-31_00
-        link to
- $EXT_DATAROOT/extprd/$MOD:2004-08-31_00

- $MOAD_DATAROOT/siprd/hinterp.global.metadata
- $MOAD_DATAROOT/siprd/hinterp.d01.2004-08-31_00:00:00
- $MOAD_DATAROOT/siprd/hinterp.d01.2004-08-31_00:00:06
-     . . . .
- $MOAD_DATAROOT/siprd/hinterp.d01.2004-09-01_00:00:00

## Vertical interpolation (vinterp.exe)

- uses wrfsi.nl to determine number of vertical levels andvalues of sigma
- reads output files from hinterp.exe
- performs vertical interpolation
- outputs netCDF files (one for each BC time step) to be read by real.exe

## vinterp.exe

- $INSTALLROT/etc/wrfprep.pl \
-                           -d ${MOAD_DATAROOT} \
-                           -i ${INSTALLROT} \
-                           -s ${YEAR}${MONTH}${DATE}${CYCLE} \
-                           -f ${FLENGTH} \
-                           -t ${FREQBC}

- $MOAD_DATAROOT/static/wrfsi.nl (interp_control)
- $MOAD_DATAROOT/siprd/hinterp.global.metadata
- $MOAD_DATAROOT/siprd/hinterp.d01.2004-08-31_00:00:00

- $MOAD_DATAROOT/siprd/wrf_real_input_nm.d01.2004-08-31_00:00:00
- $MOAD_DATAROOT/siprd/wrf_real_input_nm.d01.2004-08-31_00:00:06
-     . . . .
- $MOAD_DATAROOT/siprd/wrf_real_input_nm.d01.2004-09-01_00:00:00

- netCDF files

## $MOAD_DATAROOT/static/wrfsi.nl

-  NUM_DOMAINS = 1,
-  DOMAIN_ID_LIST = 1,
-  PTOP_PA = 5000,
-  HINTERP_METHOD = 1,
-  LSM_HINTERP_METHOD = 0,
-  NUM_INIT_TIMES = 1,
-  INIT_ROOT = 'GFDL',
-  LBC_ROOT = 'GFDL',
-  LSM_ROOT = 'AVNLSM',
-  CONSTANTS_FULL_NAME = '',
-  VERBOSE_LOG = .true.,
-  OUTPUT_COORD = 'NMMH',
-  LEVELS = **1.0**, .9919699, .9827400, .9721600, .9600599, .9462600,
-  .9306099,     .9129300, .8930600, .8708600, .8462000, .8190300,
-  .7893100,     .7570800, .7224600, .6856500, .6469100, .6066099,
-  .5651600,     .5230500, .4807700, .4388600, .3978000, .3580500,
-  .3200099,     .2840100, .2502900, .2190100, .1902600, .1640600,
-  .1403600,     .1190600, .1000500, .0831600, .0682400, .0551200,
-  .0436200,     .0335700, .0248200, .0172200, .0106300, .0049200,
-  **.0000000**,
-  OUTPUT_VARS = 2,
-  OUTPUT_FILE_TYPE = 'WRF',
**/**

## $INSTALLROOT/bin/siscan hinterp.d01.2004-08-31_00:00:00
 Scanning hinterp.d01.2004-08-31_00:00:00
 Domain Metadata Information
 -----------------------------------------------------
Domain Number .........  1
Parent ID .............  0
Dynamic Init. Source .. SI
Static Init. Source ... SI
Valid Date (YYYDDD) ... 2004244
Valid Time (sec UTC) ..     0.0
Origin X in Parent ....     1
Origin Y in Parent ....     1
Nest Ratio to Parent ..     1
Delta X ............... 19871.3
Delta Y ............... 19871.3
Top Level .............   5000.0
Origin Z in Parent ....     1
X dimension ...........   204
Y dimension ...........   419
Z dimension ...........    20
  ---------------------------------------------------

 Variables found:
   NAME    STAG DIM   NX    NY    NZ        UNITS        DESCRIPTION
 -------- ----- --- ----- ----- ----- ---------------- --------------------------------
PRESSURE     0   1    20     0     0 Pa               Pressure levels used for vertica
T            4   3   204   419    20 K                Temperature
U            4   3   204   419    20 m s{-1}          U
V            4   3   204   419    20 m s{-1}          V
RH           4   3   204   419    20 %                Relative Humidity
HGT          4   3   204   419    20 m                Height
SM000010     1   2   204   419     0 fraction         Soil Moisture of 0-10 cm ground
SM010200     1   2   204   419     0 fraction         Soil Moisture of 10-200 cm groun
ST000010     1   2   204   419     0 K                T of 0-10 cm ground layer
ST010200     1   2   204   419     0 K                T of 10-200 cm ground layer
PMSL         4   2   204   419     0 Pa               Sea-level Pressure
PSFC         4   2   204   419     0 Pa               Surface Pressure
SKINTEMP     1   2   204   419     0 K                Skin temperature (can use for SS
 End of file reached.

-  Scanning hinterp.d01.2004-08-31_00:00:00
-  Domain Metadata Information
-  -----------------------------------------------------
- Domain Number .........  1
- Parent ID .............  0
- Dynamic Init. Source .. SI
- Static Init. Source ... SI
- Valid Date (YYYDDD) ... 2004244
- Valid Time (sec UTC) ..     0.0
- Origin X in Parent ....     1
- Origin Y in Parent ....     1
- Nest Ratio to Parent ..     1
- Delta X ............... 19871.3
- Delta Y ............... 19871.3
- Top Level .............   5000.0
- Origin Z in Parent ....     1
- X dimension ...........   204
- Y dimension ...........   419
- Z dimension ...........    20
-   ---------------------------------------------------
-  Variables found:
-    NAME    STAG DIM   NX    NY    NZ        UNITS        DESCRIPTION
-  -------- ----- --- ----- ----- ----- ---------------- --------------------------------
- PRESSURE     0   1    20     0     0 Pa               Pressure levels used for vertica
- T            4   3   204   419    20 K                Temperature
- U            4   3   204   419    20 m s{-1}          U
- V            4   3   204   419    20 m s{-1}          V
- RH           4   3   204   419    20 %                Relative Humidity
- HGT          4   3   204   419    20 m                Height
- SM000010     1   2   204   419     0 fraction         Soil Moisture of 0-10 cm ground
- SM010200     1   2   204   419     0 fraction         Soil Moisture of 10-200 cm groun
- ST000010     1   2   204   419     0 K                T of 0-10 cm ground layer
- ST010200     1   2   204   419     0 K                T of 10-200 cm ground layer
- PMSL         4   2   204   419     0 Pa               Sea-level Pressure
- PSFC         4   2   204   419     0 Pa               Surface Pressure
- SKINTEMP     1   2   204   419     0 K                Skin temperature (can use for SS
-  End of file reached.

- siscan and ncdump utilties

## Slide 26

## Slide 27

## Slide 28