Vertical interpolation to different pressure levels
Added by Wei Chow almost 6 years ago
Hello,
I have a set of 17 pressure levels model data and want to do vertical interpolation to a different 35 pressure levels coordinates.
First I saw the ap2pl / Air pressure to pressure level interpolation from the Reference Card.
But failed with error: cdo ap2pl (Abort): air_pressure not found!
Then I read the user guide more carefully and did some searches,
it seems that ap2pl actually does not mean model air pressure levels to pressure levels but sigma-z levels to pressure levels, right?
So, could still I do a pressure levels to pressure levels interpolation with CDO,
OR do you have some other tool suggestions?
Thanks.
Replies (9)
RE: Vertical interpolation to different pressure levels - Added by Ralf Mueller almost 6 years ago
ap2pl
is designed for ICON. you might upload some sample data for clarification
cheers
ralf
RE: Vertical interpolation to different pressure levels - Added by Wei Chow almost 6 years ago
Thank you Ralf
I uploaded a sample data from 17 levels CCSM4
if I do
cdo ap2pl,100000,97500,95000,...,2000,1000 17plevs.nc test.nc
I will get a cdo ap2pl (Abort): air_pressure not found!
Then I read the user guide again, ap2pl is not to do vertical interpolation between different pressure levels, right?
Is there a CDO method to do such type of vertical interpolation?
Best regards,
Wei
17plevs.nc (3.6 MB) 17plevs.nc | CCSM4 17 levels sample |
RE: Vertical interpolation to different pressure levels - Added by Uwe Schulzweida almost 6 years ago
The CDO operator *intlevel* can be used for a linear vertical interpolation.
RE: Vertical interpolation to different pressure levels - Added by Hilawe S about 2 years ago
To continue on to what Mr. Wei Chow was trying to do, I need to take the existing 37 pressure levels for the uploaded file with CFSR variables 'Temperature_isobaric' and 'Relative_humidity_isobaric' and interpolate a lot of the pressure levels from the current,
isobaric3 - 37 levels in Pascals
{100.0, 200.0, 300.0, 500.0, 700.0, 1000.0, 2000.0, 3000.0, 5000.0, 7000.0, 10000.0, 12500.0, 15000.0, 17500.0, 20000.0, 22500.0, 25000.0, 30000.0, 35000.0, 40000.0, 45000.0, 50000.0, 55000.0, 60000.0, 65000.0, 70000.0, 75000.0, 77500.0, 80000.0, 82500.0, 85000.0, 87500.0, 90000.0, 92500.0, 95000.0, 97500.0, 100000.0}
to be
{1000.0, 5000.0, 10000.0, 15000.0, 20000.0, 26000.0, 32000.0, 38000.0, 44000.0, 50000.0, 56000.0, 62000.0, 68000.0, 74000.0, 80000.0, 90000.0}
As you can see from the bolded pressure levels, some do not match in pressure levels and need to be interpolated for temperature and RH. How would I go about doing that? Doing a simple, cdo intlevel,1000.0,5000.0,10000.0,...90000.0 infile.grib2 outfile would not work.
Any suggestions on the steps needed, please? Thank you.
RE: Vertical interpolation to different pressure levels - Added by Ralf Mueller about 2 years ago
hi Hilawe!
the interpolation you need depends on the vertical coordinated. sigma hybrid pressure coordinate can be interpolated with the ml2pl
operator.
cheers
ralf
RE: Vertical interpolation to different pressure levels - Added by Hilawe S about 2 years ago
Hi Ralf,
The current vertical coordinate is 37 pressure levels (isobaric3), which I believe are not sigma hydrid pressure coordinates. For example,
float Specific_humidity_isobaric(time2=1, isobaric3=37, lat=361, lon=720);
:long_name = "Specific humidity @ Isobaric surface";
:units = "kg/kg";
Also could the issue be that it's a 4D variable instead of 3D for using intlevel or another operator? Thanks again!
RE: Vertical interpolation to different pressure levels - Added by Ralf Mueller about 2 years ago
I have problems reading your upload with CDO:
cdo sinfov `lf` [Tue 2022-09-13|15:48:43] Warning (gribapiScanTimestep1): Record 335 (name=csnow id=195.1.0 lev1=0 lev2=0) timestep 1: Inconsistent verification time! File format : GRIB2 jpeg -1 : Institut Source T Steptype Levels Num Points Num Dtype : Parameter name 1 : NCEP unknown c instant 1 1 259920 1 P16j : msl 2 : NCEP unknown c instant 37 2 259920 1 P16j : gh 3 : NCEP unknown c instant 37 2 259920 1 P10j : t 4 : NCEP unknown c instant 37 2 259920 1 P7 j : r 5 : NCEP unknown c instant 37 2 259920 1 P14j : q 6 : NCEP unknown c instant 37 2 259920 1 P16j : w 7 : NCEP unknown c instant 37 2 259920 1 P14j : u 8 : NCEP unknown c instant 37 2 259920 1 P14j : absv 9 : NCEP unknown c instant 37 2 259920 1 P16j : o3mr 10 : NCEP unknown c instant 32 3 259920 1 P14j : clwmr 11 : NCEP unknown c instant 1 4 259920 1 P11j : 2d 12 : NCEP unknown c instant 1 4 259920 1 P10j : 2r 13 : NCEP unknown c accum 1 5 259920 1 P12j : tp 14 : NCEP unknown c accum 1 5 259920 1 P0 j : acpcp 15 : NCEP unknown c accum 1 5 259920 1 P0 j : ncpcp 16 : NCEP unknown c avg 1 5 259920 1 P1 j : csnow 17 : NCEP unknown c avg 1 5 259920 1 P1 j : cicep 18 : NCEP unknown c avg 1 5 259920 1 P1 j : cfrzr 19 : NCEP unknown c avg 1 5 259920 1 P1 j : crain 20 : NCEP unknown c instant 1 5 259920 1 P10j : lftx 21 : NCEP unknown c instant 1 5 259920 1 P13j : cape 22 : NCEP unknown c instant 1 5 259920 1 P11j : cin 23 : NCEP unknown c instant 1 6 259920 1 P10j : cwat 24 : NCEP unknown c instant 1 6 259920 1 P7 j : r 25 : NCEP unknown c instant 1 6 259920 1 P12j : tozne 26 : NCEP unknown c instant 2 7 259920 1 P13j : hlcy 27 : NCEP unknown c instant 1 8 259920 1 P13j : ustm 28 : NCEP unknown c instant 1 8 259920 1 P13j : vstm 29 : NCEP unknown c instant 1 9 259920 1 P16j : trpp 30 : NCEP unknown c instant 1 9 259920 1 P16j : gh 31 : NCEP unknown c instant 1 9 259920 1 P10j : t 32 : NCEP unknown c instant 1 9 259920 1 P11j : u 33 : NCEP unknown c instant 1 9 259920 1 P10j : vwsh 34 : NCEP unknown c instant 1 10 259920 1 P16j : pres 35 : NCEP unknown c instant 1 10 259920 1 P16j : gh 36 : NCEP unknown c instant 1 10 259920 1 P11j : u 37 : NCEP unknown c instant 1 10 259920 1 P10j : t 38 : NCEP unknown c instant 4 11 259920 1 P10j : t 39 : NCEP unknown c instant 4 11 259920 1 P14j : u 40 : NCEP unknown c instant 1 12 259920 1 P16j : gh 41 : NCEP unknown c instant 1 12 259920 1 P7 j : r 42 : NCEP unknown c instant 1 13 259920 1 P16j : gh 43 : NCEP unknown c instant 1 13 259920 1 P7 j : r 44 : NCEP unknown c instant 1 14 259920 1 P10j : t 45 : NCEP unknown c instant 1 14 259920 1 P7 j : r 46 : NCEP unknown c instant 1 14 259920 1 P14j : dpt 47 : NCEP unknown c instant 1 14 259920 1 P15j : q 48 : NCEP unknown c instant 1 14 259920 1 P13j : u 49 : NCEP unknown c instant 1 14 259920 1 P10j : pwat 50 : NCEP unknown c instant 1 14 259920 1 P10j : pli 51 : NCEP unknown c instant 1 5 259920 1 P9 j : 4lftx 52 : NCEP unknown c instant 1 15 259920 1 P13j : cape 53 : NCEP unknown c instant 1 15 259920 1 P11j : cin 54 : NCEP unknown c instant 5 16 259920 1 P10j : r 55 : NCEP unknown c instant 1 17 259920 1 P10j : t 56 : NCEP unknown c instant 1 17 259920 1 P14j : pt 57 : NCEP unknown c instant 1 17 259920 1 P13j : u 58 : NCEP unknown c instant 1 17 259920 1 P16j : w 59 : NCEP unknown v instant 2 18 259920 1 P11j : u 60 : NCEP unknown v instant 2 18 259920 1 P14j : t 61 : NCEP unknown v instant 2 18 259920 1 P16j : gh 62 : NCEP unknown v instant 2 18 259920 1 P16j : pres 63 : NCEP unknown v instant 2 18 259920 1 P10j : vwsh Grid coordinates : 1 : lonlat : points=259920 (720x361) lon : 0 to 359.5 by 0.5 degrees_east circular lat : 90 to -90 by -0.5 degrees_north Vertical coordinates : 1 : meansea : levels=1 2 : pressure : levels=37 plev : 100 to 100000 Pa 3 : pressure : levels=32 plev : 1000 to 100000 Pa 4 : height : levels=1 height : 2 m 5 : surface : levels=1 6 : generic (ltype=200) : levels=1 lev : 0 7 : height : levels=2 height : 3000 to 1000 m bounds : 3000-0 to 1000-0 m 8 : height : levels=1 height : 6000 m bounds : 6000-0 m 9 : tropopause : levels=1 10 : generic (ltype= 6) : levels=1 lev : 0 11 : altitude : levels=4 alt : 1829 to 4572 by 914.3333 m 12 : isotherm_zero : levels=1 13 : generic (ltype=204) : levels=1 lev : 0 14 : generic (ltype=108) : levels=1 lev : 3000 bounds : 3000-0 15 : generic (ltype=108) : levels=1 lev : 18000 bounds : 18000-0 16 : sigma : levels=5 lev : 0.33 to 0.995 level bounds : 0.33-1 to 0.995-0 level 17 : sigma : levels=1 lev : 0.995 level 18 : generic (ltype=109) : levels=2 lev : 0 to 2 Time coordinate : time : unlimited steps RefTime = 2022-07-23 00:00:00 Units = hours Calendar = proleptic_gregorian YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss Warning (gribapiScanTimestep): Record 429 (name=prmsl id=1.3.0 lev1=0 lev2=0) timestep 5: Parameter not defined at timestep 1! 2022-07-23 00:00:00 2022-07-23 00:00:00 2022-07-23 00:00:00 2022-07-23 00:00:00 cdo sinfon: Processed 63 variables over 4 timesteps [0.53s 38MB].
So I cannot comment your post regarding
float Specific_humidity_isobaric(time2=1, isobaric3=37, lat=361, lon=720); :long_name = "Specific humidity @ Isobaric surface"; :units = "kg/kg";
RE: Vertical interpolation to different pressure levels - Added by Hilawe S about 2 years ago
Hi Ralf,
I have a netCDF file that should be readable now. Can you please advise on the interpolation based on pressure levels (not sigma dimensions)?
Specifically that I need interpolation to these pressure levels (Pa) from the attached netCDF file for temperature (TMP_L100) and rel. humidity (R_H_L100): {26000.0, 32000.0, 38000.0, 44000.0, 56000.0, 62000.0, 68000.0, 74000.0}.
For the attached file, it'll need to be "gunzipped" first.
Thank you again!
Hilawe
RE: Vertical interpolation to different pressure levels - Added by Hilawe S about 2 years ago
I finally figured it out. Here's what I ran:
Vertically interpolated pressure levels from CFSR's 37 pressure levels to these 16 specific pressure levels:
cdo intlevel,900,800,740,680,620,560,500,440,380,320,260,200,150,100,50,10 cdas1.20190201.pgrbanl.ucar-rda.grb2.nc cdas1.20190201.pgrbanl.ucar-rda.interpolated.grb2.nc
The above cdo operation created a ‘positive’ variable attribute with the value of “down” (which was wrong) from the 'level0' variable. So I deleted the positive variable attribute using the following nco command:
ncatted -O -a positive,level0,d,, cdas1.20190201.pgrbanl.ucar-rda.interpolated.grb2.nc (attached)