Sunday, August 19, 2007

Avoiding GEMPAK Interpolation when Processing Upper-Air Soundings

The following information on how to avoid interpolation within the GEMPAK code has been provided by David O. Blanchard - many thanks!

The fix for the interpolation of winds and temperatures in GEMPAK is not difficult.

GEMPAK can store upper-air data in two formats: merged and unmerged.

Unmerged data sets will store the TTAA, TTBB, and PPBB data as separate parts. There is no interpolation of the data.

Merged data sets combine the TTAA, TTBB, and PPBB parts and contain values for each parameter (P, T, Td, Dir, Spd, and Z) at each level and interpolates the data.

To avoid interpolation, the data must be saved unmerged. This is specified with the "MRGDAT" variable in GEMPAK when originally creating the upper air file.

Most sounding programs that use GEMPAK upper-air data will call SN_RDAT to read the data; SN_RDAT calls SN_MERG to merge the TTAA/TTBB/PPBB data if they are not already merged; SN_MERG calls MR_UADT which calls MR_MISS to interpolate the data.

Only MR_UADT needs to be modified. Copy the MR_UADT source code and the required INCLUDE files to your sounding software directory. Edit MR_UADT and comment out the line that calls MR_MISS. Compile your sounding source code and the modified MR_UADT source code.

The necessary code is found in the following locations:

./gempak/source/gemlib/mr/mruadt.f
./gempak/include/GEMPRM.PRM
./gempak/include/MCHPRM.PRM (rename MCHPRM.machineType to MCHPRM.PRM)

This patch prevents interpolation of the upper-air data in your sounding program but makes no changes to GEMPAK and its programs and libraries. Your sounding program must handle the uninterpolated data arrays
(i.e., it must be able to handle missing data flags of -9999.)

Example of merged TTAA/TTBB/PPBB data with interpolation:
603.0 3.8 -45.2 298.7 4.4 4375.2
589.0 2.8 -46.2 295.5 4.7 4565.5
558.0 -1.1 -36.1 288.1 5.4 4999.7
546.0 -0.3 -49.3 285.2 5.6 5173.3
545.4 -0.4 -49.4 285.0 5.7 5182.0
505.0 -5.1 -54.1 280.6 5.2 5791.9
500.0 -5.5 -53.5 280.0 5.2 5870.0
485.7 -6.2 -54.2 260.0 4.1 6096.0
477.0 -6.7 -54.7 261.5 4.6 6237.0
431.2 -12.6 -58.4 270.0 7.2 7010.0
416.0 -14.7 -59.7 252.0 6.3 7284.9
414.3 -14.8 -59.4 250.0 6.2 7315.0
400.0 -15.9 -56.9 255.0 7.7 7580.0

Example of merged data TTAA/TTBB/PPBB without interpolation:
603.0 3.8 -45.2 -9999.0 -9999.0 4375.2
589.0 2.8 -46.2 -9999.0 -9999.0 4565.5
558.0 -1.1 -36.1 -9999.0 -9999.0 4999.7
546.0 -0.3 -49.3 -9999.0 -9999.0 5173.3
545.4 -9999.0 -9999.0 285.0 5.7 5182.0
505.0 -5.1 -54.1 -9999.0 -9999.0 5791.9
500.0 -5.5 -53.5 280.0 5.2 5870.0
485.7 -9999.0 -9999 .0 260.0 4.1 6096.0
477.0 -6.7 -54.7 -9999.0 -9999.0 6237.0
431.2 -9999.0 -9999.0 270.0 7.2 7010.0
416.0 -14.7 -59.7 -9999.0 -9999.0 7284.9
414.3 -9999.0 -9999.0 250.0 6.2 7315.0
400.0 -15.9 -56.9 255.0 7.7 7580.0

No comments:

Post a Comment