<div dir="ltr"><div><div>Dear,<br><br></div>I am following the steps given in thread (<a target="_blank" href="https://www.ncl.ucar.edu/Support/talk_archives/2006/0001.html">https://www.ncl.ucar.edu/<wbr>Support/talk_archives/2006/<wbr>0001.html</a>)
 to convert a file from hybrid level to sigma levels. I paste below my 
script and the outputs. I am not able to understand where I am going 
wrong. Please advice. Also, let me know if I need to send my netcdf 
files as well.</div><div>Thanks in advance,</div><div>Jayant<br></div><div><br><span style="font-family:monospace,monospace">  f=addfile("ham_oxi_aps_T63L31.<wbr>nc","r")<br>  hyai = f->hyam         ; input A(k)<br>  hybi = f->hybm         ; input B(k) <br>  xi   = f->OX_VMR_avrg        ; (0,:,:,:)     ; variable to be interpolated<br>  dims = getvardims(xi)<br>  xin  = dim_rmvmean_Wrap(xi($dims(0)$|<wbr>:,$dims(1)$|:,$dims(3)$|:,$<wbr>dims(2)$|:))<br>  printVarSummary(xin)<br>  p0   = 101325            ; reference pressure (Pa)<br><br>  fP   = addfile("<a target="_blank" href="http://surf_pres_new_exp_echam_exp.nc">surf_pres_new_exp_<wbr>echam_exp.nc</a>","r")<br>  psfc = fP->aps            ; surface pressure (Pa)<br>  printVarSummary(psfc)<br>  ; dims = getvardims(psfc)<br>  ; psfcr = dim_rmvmean_Wrap(psfc($dims(0)<wbr>$|:,$dims(2)$|:,$dims(1)$|:))<br>  ; psfc2d = psfcr(0,:,:)<br><br>  sigma = (/0.00657, 0.01386, 0.02309, 0.03469, 0.04920, 0.06723, 0.08945, 0.11654, 0.14916, \<br>         0.18783, 0.23286, 0.28421, 0.34137, 0.40334, 0.46860, 0.53529, 0.60135, 0.66482,    \<br>         0.72401, 0.77773, 0.82527, 0.86642, 0.90135, 0.93054, 0.95459, 0.97418, 0.99000,    \<br>         1.00000/)<br><br>  hybo = sigma            ; *your* B(k) [ sigma levels ] <br>  nsig = dimsizes(hybo)<br>  hyao = new(nsig,typeof(hybo))<br>  hyao = 0.0             ; set output A(k) to 0.0 <br><br>  ; xo = hyi2hyo_Wrap(p0,hyai,hybi,<wbr>psfcr,xi,hyao,hybo,0) ; contributed.ncl <br>  xo = hyi2hyo_Wrap(p0,hyai,hybi,<wbr>psfc,xin,hyao,hybo,0) ; contributed.ncl <br>  printVarSummary(xo)</span><br><br></div>On running, I am getting the following error:<br><br><span style="font-family:monospace,monospace">Variable: xin<br>Type: float<br>Total Size: 27426816 bytes<br>            6856704 values<br>Number of Dimensions: 4<br>Dimensions and sizes:    [time | 12] x [lev | 31] x [lat | 96] x [lon | 192]<br>Coordinates: <br>            time: [   0..  11]<br>            lev: [ 1..31]<br>            lat: [88.5721685140073..-88.<wbr>5721685140073]<br>            lon: [   0..358.125]<br>Number Of Attributes: 5<br>  rmvmean_op_NCL :    dim_rmvmean over dimension(s): lon<br>  long_name :    Deviation from mean<br>  grid_type :    gaussian<br>  units :    VMR<br>  _FillValue :    9.96921e+36<br><br>Variable: psfc<br>Type: float<br>Total Size: 73728 bytes<br>            18432 values<br>Number of Dimensions: 3<br>Dimensions and sizes:    [time | 1] x [lat | 96] x [lon | 192]<br>Coordinates: <br>            time: [30.99166666666667..30.<wbr>99166666666667]<br>            lat: [88.57216851400727..-88.<wbr>57216851400727]<br>            lon: [   0..358.125]<br>Number Of Attributes: 5<br>  grid_type :    gaussian<br>  table :    128<br>  code :    134<br>  units :    Pa<br>  long_name :    surface pressure<br>fatal:hyi2hyo: The rightmost dimensions of 'ps' and 'xi' must be the same<br>fatal:["Execute.c":8575]:<wbr>Execute: Error occurred at or near line 9139 in file $NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/contributed.ncl<br></span></div>