Tools: p_interp

This utility interpolates WRF-ARW netCDF output files to user-specified pressure levels.


Obtain the utility from the WRF Download page (you must be a registered user to download any code - it is free)
 

Compile


The code can be run on any machine with a netCDF library.

The code can be compiled serially or in parallel. Below are examples for both options using pgf90 for serial compilation and IBM xlf compiler for MPI compilaiton. You need to compile the code using the available compiler on your machine.
e.g., serial, using pgf90:

pgf90 p_interp.F90  -L/usr/local/netcdf/lib -lnetcdf  -lm 
    -I/usr/local/netcdf/include -Mfree  -o p_interp


e.g., MPI, using IBM xlf compiler:

mpxlf_r -qfree=f90 -L/usr/local/netcdf/lib -lnetcdf -lm 
    -I/usr/local/netcdf/include -o p_interp p_interp.F90 -WF,-D_MPI

If successful, this will create the executable: p_interp
 

Run

Edit the associated namelist.pinterp file (see namelist options below), and run

./p_interp (for serial job)
mpirun -n x p_interp
(typical for mpi jobs on a LINUX computer - may be different for different systems; x is the number of processors)

 

&io

path_to_input Location of input data
input_name File name(s) of wrfout files.
Use wild character if more than one file is processed.

Output will be written to input_name_PLEV, unless overwritten by output_name.
path_to_output Location of output data. Thsi directory must exist - it will not be created by the code.

output_name

File output name. If not supplied, data will be written to input_name_PLEV

process

Indicate which fields to process.
‘all’ fields in wrfout file (diagnostics PRES, TT, GEOPT & RH will automatically be calculated);
‘list’ of fields as indicated in ‘fields’

fields

List of fields to process.

met_em_output

Set to .TRUE. if you would like to generate met_em* output files - these files can in turn be used as input to real.exe
If met_em_output is set to .TRUE., make sure to also set:
     split_output = .TRUE.
     unstagger_grid = .FALSE.
     extrapolate = 1
     process = 'all'

split_output Set to .TRUE. to output each time in the input file to a separate file.
debug Switch debug more on/off.

mpi_debug

Switch special MPI debug more on/off.

64bit

Allow large files (> 2GB) to be read / write.

 

&interp_in

interp_levels

List of pressure levels to interpolate data to

extrapolate

0 - set values below ground and above model top to missing values (default)
1 - extrapolate below ground, and set above model top to model top values

interp_method

1 - linear in p interpolation (default)
2 - linear in log p interpolation

unstagger_grid

Set to .True. to unstagger the data on output