Project

General

Profile

ml2pl gives wrong interpolated values

Added by Hans Chen over 9 years ago

Question

I want to use the ml2pl (or ml2pl_lp) operator to interpolate CAM output on hybrid sigma-pressure levels to pressure levels.
After searching through the forums, I've managed to come up with the following:

#!/bin/bash

pressures="364.346569404,759.481964633,1435.66322513,2461.22200042,3826.82997733,5459.54797417,7201.2450546,8782.12302923,10331.7126632,12154.7240764,14299.4038761,16822.5079775,19790.8086702,23282.8618959,27391.0816759,32224.1902351,37910.0903869,44599.2574096,52468.7174708,60977.8694808,69138.9430314,76340.4481113,82085.836865,85953.4766525,88702.024892,91264.4546945,93619.8398471,95748.5479536,97632.5407391,99255.6095123" 

cdo -delname,sp,geosp \
    -ml2pl,"$pressures" \
    -selname,sp,geosp,T,Z3 \
    -chname,PS,sp \
    -chname,PHIS,geosp \
    sample.nc \
    out.nc

The script runs without any issues or warnings, but the interpolated values are not what I expected.
My question is: how do I correctly interpolate the attached sample.nc to some specified pressure levels?

Reproduce problem

Here is a quick way to reproduce the problem:
1. Download the file and script and run the script. The interpolated pressure levels are the same as the hybrid levels at layer midpoints ("lev" variable in sample.nc file converted to Pa).
2. Pick a grid point where the surface pressure ("PS" variable) is approximately 100000 Pa. The hybrid levels above this grid point should be approximately the same as the pressure levels. I chose the grid point at i=91, j=17.
3. Plot e.g. the geopotential height ("Z3" variable) for sample.nc (Reference) and out.nc (Interpolated) for this grid point. You'll see that the values are close in the lower model levels, but diverge considerably at upper levels.

More information

More information about the vertical coordinate system in CAM: http://www.cesm.ucar.edu/models/atm-cam/docs/usersguide/node25.html
I've tried to calculate the actual pressures using the formula and confirmed that the values are close to the "lev" values over my selected grid point.

I get the same result using CDO 1.6.2 and 1.6.5rc3.

sample.nc (3.28 MB) sample.nc

Replies (2)

RE: ml2pl gives wrong interpolated values - Added by Uwe Schulzweida over 9 years ago

The pressure component of the vertical model coordinates seems to have the unit bar and not the required unit Pa. The following NCO example converts the unit from bar to Pa:

ncap2 -s "hyai=hyai*100000;hyam=hyam*100000;" sample.nc sample2.nc

RE: ml2pl gives wrong interpolated values - Added by Hans Chen over 9 years ago

That seems to have fixed it. Many thanks Uwe for the fast answer and the NCO example!

At first it didn't make much sense to me, but now I think I understand why this conversion is needed.

In ECHAM (whose convention CDO is following) the pressure is given by:

P = A + B*PS.

While in CAM, the corresponding equation is:

P = A*P0 + B*PS,

where P0 is a surface reference pressure = 100000 Pa.

Therefore, in order to follow the ECHAM convention, we have to multiply A (i.e., hyai and hyam) by 100000 before using ml2pl.

    (1-2/2)