Project

General

Profile

Problem with ml2pl interpolation to pressure levels, CAM output data

Added by Matthew Meko about 6 years ago

I'm hoping for help understanding what is missing from my data that may cause the following error when attempting to convert and interpolate CAM U fields from hybrid levels to pressure levels.

I use the following command:

cdo ml2pl,925,850,775,700 ifile ofile

with the attached .nc file (has been trimmed to 1 timestep)

and cdo gives the following error:

cdo ml2pl: This operator requires all variables on the same horizontal grid.
cdo ml2pl: Horizontal grids found:
cdo ml2pl: grid=1 type=lonlat points=13824
cdo ml2pl: grid=2 type=generic points=1
cdo ml2pl: grid=3 type=lonlat points=96
cdo ml2pl: grid=4 type=lonlat points=95

cdo ml2pl (Abort): The input stream contains variables on different horizontal grids!

I appreciate any help or insight; I have found a work-around using MATLAB, but it takes a very long time to complete the calculation.

time1.nc (1.32 MB) time1.nc

Replies (5)

RE: Problem with ml2pl interpolation to pressure levels, CAM output data - Added by Karin Meier-Fleischer about 6 years ago

Hi Matthew,

the error message tells you that your data file contains variables on different grids. Select the variable you want (U):

cdo ml2pl,925,850,775,700 -selname,U ifile ofile

cdo sinfon ofile

   File format : NetCDF4
    -1 : Institut Source   T Steptype Levels Num    Points Num Dtype : Parameter name
     1 : unknown  CAM      v instant       4   1     13824   1  F32  : U             
   Grid coordinates :
     1 : lonlat                   : points=13824 (144x96)
                              lon : 0 to 357.5 by 2.5 degrees_east  circular
                              lat : -90 to 90 by 1.894737 degrees_north
   Vertical coordinates :
     1 : pressure                 : levels=4
                             plev : 925 to 700 Pa
   Time coordinate :  1 step
     RefTime =  0651-01-01 00:00:00  Units = days  Calendar = 365_day  Bounds = true
  YYYY-MM-DD hh:mm:ss  YYYY-MM-DD hh:mm:ss  YYYY-MM-DD hh:mm:ss  YYYY-MM-DD hh:mm:ss
  0850-02-01 00:00:00
cdo sinfon: Processed 1 variable over 1 timestep ( 0.00s 22MB )

-Karin

RE: Problem with ml2pl interpolation to pressure levels, CAM output data - Added by Matthew Meko about 6 years ago

Thank you for your help, Karin, but when I try the solution you propose, I get the error message:

cdo ml2pl (Warning): No 3D variable with hybrid sigma pressure coordinate found!

Do you know why this solution may be working for you and not for me?

RE: Problem with ml2pl interpolation to pressure levels, CAM output data - Added by Matthew Meko about 6 years ago

To clarify my last reply, the solution Karin proposed appears to work with the 1-timestep data subset I posted, but fails for data with multiple time steps. Attached is a data subset with multiple timesteps. I receive the error message below, and the output file does not contain the desired data.

cdo ml2pl (Warning): No 3D variable with hybrid sigma pressure coordinate found!
time3.nc (4.96 MB) time3.nc

RE: Problem with ml2pl interpolation to pressure levels, CAM output data - Added by Uwe Schulzweida about 6 years ago

The connection between the variables lev and ilev is missing. You have to add the bounds attribute to the variable lev. Here is an example how to add the bounds attribute with the NCO tool ncatted:

ncatted -a bounds,lev,c,c,"ilev" time3.nc
Please note that the units of pressure level parameter for the operator ml2pl is Pa and not hPa:
cdo ml2pl,92500,85000,77500,70000 -selname,U ifile ofile

RE: Problem with ml2pl interpolation to pressure levels, CAM output data - Added by Matthew Meko about 6 years ago

Thank you, Uwe! I tried this with my full dataset and it worked as intended.

You have made my day,
Matt

    (1-5/5)