
Steps for running a HRLDAS simulation using NARR for forcing. Confirm that your domain lies entirely inside the NARR domain. If this is not the case, you may need to use something like GLDAS for forcing.


1. Create your geo_em and wrfinput files through WPS and real.exe. These are not needed until the end of Step 2, but there is no point in creating the forcing if you don't have the domain.

--------------------------------------------------

2. Compile HRLDAS

Place the HRLDAS tar file where you will be running the model. 

tar xvf HRLDAS-v3.x.tar

I will refer to this location as /root_path/HRLDAS-v3.x

In /root_path/HRLDAS-v3.x, modify user_build_options to link to the proper compilers and paths. (Barlage: As of 20140530, I have only tested this on pgf90 on both my linux workstation and Yellowstone.)

type 'make'

If successful, there should be two executables created

HRLDAS_COLLECT_DATA/consolidate_grib.exe

and 

Run/Noah_hrldas_beta

--------------------------------------------------

3. Prepare NARR forcing data.

This step can be quite involved for a first-time user. It involves converting GRIB NARR output to NetCDF forcing files in HRLDAS format. This will be done in the /root_path/HRLDAS-v3.x/HRLDAS_COLLECT_DATA/ directory. In that directory you will find another directory named examples/ that contains some useful scripts for doing the NARR steps below.

Required programs and libraries:

- wgrib
- Perl
- Fortran with w3 grib library (only needed if SW interpolation is done)
    can be downloaded from NCEP: http://www.nco.ncep.noaa.gov/pmb/codes/GRIB2/w3lib-2.0.2.tar

When using the NARR output, I suggest using the 30m forcing for PRES, TMP, SPFH, UGRD, and VGRD. This is similar to using model first-level output. You will need both the "sfc" and "flx" NARR output. The procedure below also uses an optional temporal interpolation of downward shortwave that uses a cosine zenith interpolation. If this is not done, the HRLDAS pre-processor will do a linear interpolation between the three-hour output (which is an average).

--------------------------------------------------

3.1 Get the NARR raw files (e.g., ds608.0 from Yellowstone).

On Yellowstone, they can be accessed here:

/glade/p/rda/data/ds608.0/3HRLY/

This may help with efficiency:

find /glade/p/rda/data/ds608.0/3HRLY/2012/ -name 'NARRsfc_201209*' | xargs -L 1 tar xvf

If you don't have access to Yellowstone, you will have to find another way.

I stick all of these "raw" NARR files in one directory (e.g., /raw_NARR_data_path)

The NARR .sfc and .flx files require about 50Gb per year.

--------------------------------------------------

3.2 extract_narr_30m.perl: extract the individual 30m variables from the NARR flx GRIB files

The current script uses wgrib to extract individual fields from the NARR output. It will process entire years or sections of one year. You can change this by changing the Perl script.

Change these two paths for where raw NARR files are located and where separated(extracted) files will go. 

$data_dir = "/raw_NARR_data_path";
$results_dir = "/extracted_NARR_data_path";

For convenience, you may want to create directories in the results_dir for each variable and a few more for processed fields.

`cd /extracted_NARR_data_path`
`mkdir TMP/ SPFH/ PRES/ UGRD/  VGRD/  APCP/ DSWRF/ DLWRF/ DSWRF24/ INIT/ FIXED/`

--------------------------------------------------

3.3 extract_narr_sfc.perl: extract the sfc fields (APCP,DSWRF,DLWRF) from the NARR GRIB files

Follow the same procedure as in #2 with this script.

--------------------------------------------------

3.4 extract_narr_init.perl: extract the initial-only fields (TSOIL,SOILW,TMP,CNWAT,WEASD) from the NARR GRIB files

Change the date of initialization and run the script one time. The files should appear in the /extracted_NARR_data_path/INIT/ directory.

--------------------------------------------------

3.5 intermediate clean-up

If you are space-limited, at this point you can remove the raw NARR files. You have extracted all you need and they are no longer needed.

--------------------------------------------------

3.6 fill_DSWRF.perl: do hourly interpolation of solar radiation via zenith angle

  - note original data are average for 3 hours from file time to file time + 3hrs

Again, you will need to change the paths in the Perl script along with the year/day ranges that are appropriate for your application. For this step, you will need to compile the w3lib reference above. This library will allow you to read and write GRIB in Fortran.

There is an NCL script (check_SW.ncl) if you want to see what the interpolation is doing.

--------------------------------------------------

3.7 Download the NARR elevation file for height adjustment of forcing.

  - you can put this wherever, but I put it here: /extracted_NARR_data_path/FIXED/
  
  You can find this file around the internet, but if you have access to Yellowstone, you can do this (one long command):
  
  wgrib -s /glade/p/rda/data/ds608.0/FIXED/rr-fixed.grb | grep ':HGT:sfc' | wgrib -i -grib 
      /glade/p/rda/data/ds608.0/FIXED/rr-fixed.grb -o NARR_SFC_ELEVATION.GRIB

--------------------------------------------------

3.8 Download the NARR land-sea mask file for height adjustment of forcing.

  - you can put this wherever, but I put it here: /extracted_NARR_data_path/FIXED/

  You can find this file around the internet, but if you have access to Yellowstone, you can do this (one long command):
  
wgrib -s /glade/p/rda/data/ds608.0/FIXED/rr-fixed.grb | grep ':LAND:sfc' | wgrib -i -grib /glade/p/rda/data/ds608.0/FIXED/rr-fixed.grb -o NARR.fixed.LANDSEA.2000010100

--------------------------------------------------

3.9 Run the HRLDAS pre-processor code.

At this point, you should have all the NARR output extracted into different directories at /extracted_NARR_data_path/. Now it's finally time to run the first step of the HRLDAS.

cd /root_path/HRLDAS-v3.x/HRLDAS_COLLECT_DATA/run

In the examples/NARR/ directory there is a namelist.input file that is consistent with the NARR procedure described above. You can modify this file for your case and place it in the pre-processor run directory:

cp examples/NARR/namelist.input.NARR .

--------------------------------------------------

3.9.1 Modify the namelist

Modifying the namelist.input.NARR to your case. The following is a short description of each line in the file. A longer description is available in README.namelist

 STARTDATE        : start date of your simulation
 ENDDATE          : end date of your simulation
 DATADIR          : base directory for your NARR GRIB files (will be substituted in the paths below)
 OUTPUTDIR        : where you want the forcing files to be placed
 FULL_IC_FRQ      : set to 0 if you want initial conditions in the first file, -1 otherwise
 RAINFALL_INTERP  : rainfall interpolation procedure
 RESCALE_SHORTWAVE : set to .FALSE. for NARR
 UPDATE_SNOW : do you want to read in snow during the simulation?
 FORCING_HEIGHT_2D : set to .FALSE. for NARR
 TRUNCATE_SW : set to .FALSE. for NARR
 EXPAND_LOOP : the number of loops to fill missing NARR data (e.g., soil over ocean). Set to at least 1 for NARR, may need to set higher if, for example, you have islands in your WRF grid that are not resolved by NARR.

 geo_em_flnm      = path and name of your geo_em file
 wrfinput_flnm    = path and name of your wrfinput file

 Zfile_template     = template for your NARR terrain height file
 LANDSfile_template = template for your NARR land-sea file
 Tfile_template     = template for your NARR temperature file
 Ufile_template     = template for your NARR u-wind file
 Vfile_template     = template for your NARR v-wind file
 Pfile_template     = template for your NARR pressure file
 Qfile_template     = template for your NARR q file
 LWfile_template    = template for your NARR longwave file
 SWfile_primary     = template for your NARR primary shortwave file
 SWfile_secondary   = template for your NARR secondary shortwave file
 PCPfile_primary    = template for your NARR primary precipitation file
 PCPfile_secondary  = template for your NARR secondary precipitation file
 WEASDfile_template = template for your NARR SWE file
 CANWTfile_template = template for your NARR canopy water file
 SKINTfile_template = template for your NARR skin temperature file
 STfile_template    = template for your NARR soil temperature file
 SMfile_template    = template for your NARR soil moisture file

Note: for NARR there will be no need to include a secondary SW and precipitation file, so just set them to be the same

3.9.2 Run the pre-processor

First, set the path to the grib tables:

setenv GRIB_ROOT ../GRIB_TABLES/

Now, run the pre-processor with the NARR namelist

../consolidate_grib.exe namelist.input.NARR

In your OUTPUTDIR, you should now have all your LDASIN files.

4. Run HRLDAS

The hard part is over. Go to the HRLDAS Run directory:

cd /root_path/HRLDAS-v3.x/Run

4.1 Modify the namelist

There is an example namelist.hrldas in the examples/NARR/ directory. Copy this to the Run directory

cp examples/NARR/namelist.hrldas.NARR namelist.hrldas

See the full documentation for a complete description of items, but these are the important modifications:

 HRLDAS_CONSTANTS_FILE = path and name of your wrfinput file
 INDIR                 = where the LDASIN files are located
 MMF_RUNOFF_FILE       = special for OPT_RUN=5, which is unsupported, for now

 START_YEAR  = start year of your simulation
 START_MONTH = start month of your simulation
 START_DAY   = start day of your simulation
 START_HOUR  = start hour of your simulation
 START_MIN   = start minute of your simulation

 RESTART_FILENAME_REQUESTED = uncomment for a restart

 KDAY = length of simulation in days

 DYNAMIC_VEG_OPTION                = Noah-MP options
 CANOPY_STOMATAL_RESISTANCE_OPTION = 
 BTR_OPTION                        = 
 RUNOFF_OPTION                     = 
 SURFACE_DRAG_OPTION               = 
 FROZEN_SOIL_OPTION                = 
 SUPERCOOLED_WATER_OPTION          = 
 RADIATIVE_TRANSFER_OPTION         = 
 SNOW_ALBEDO_OPTION                = 
 PCP_PARTITION_OPTION              = 
 TBOT_OPTION                       = 
 TEMP_TIME_SCHEME_OPTION           = 


 FORCING_TIMESTEP = time increment of available forcing (3600 for NARR)
 NOAH_TIMESTEP    = time increment for model (<= FORCING_TIMESTEP)
 OUTPUT_TIMESTEP  = time increment for output (>= NOAH_TIMESTEP)

 SPLIT_OUTPUT_COUNT = split output after this many writes
 RESTART_FREQUENCY_HOURS = write restart files after this many hours

 XSTART = uncomment and set if you want to run a subset of your domain 
 XEND   = 
 YSTART = 
 YEND   = 

 ZLVL = forcing height (set to 30.0 for NARR)

4.2 Run the HRLDAS

./Noah_hrldas_beta

The output will show up in the Run/ directory.
