[ncl-talk] Problem with wgt_vertical_n routine

Dennis Shea shea at ucar.edu
Tue May 7 14:22:31 MDT 2019


The documentation needs to be improved.

The 'dp' should have the same shape and size as 'x'. This should have been
done within the function.It wasn't. Hence, the user must perform this
'trivial' task.

  *DP*    =* conform*
<http://www.ncl.ucar.edu/Document/Functions/Built-in/conform.shtml>(qu, dp,
1)                      ; propagate to all dimensions.
  quint =* wgt_vertical_n*(qu,*DP*,vopt,1)
  delete(DP)                                                ; no longer
needed

On Mon, May 6, 2019 at 9:19 PM Lyndz <olagueralyndonmark429 at gmail.com>
wrote:

> Dear NCL-experts,
>
> I am encountering the following errors when using *wgt_vertical_n*
> routine in NCL.
>
> *(0) wgt_vertical_n: dimension sizes are not equal*
> *(0) wgt_vertical_n:  dimX=124*
> *(1) wgt_vertical_n:  dimX=8*
> *(2) wgt_vertical_n:  dimX=73*
> *(3) wgt_vertical_n:  dimX=144*
> *(0) wgt_vertical_n: dimDP=8*
>
> I am not sure why this is occurring.
> Below is part of the script.
>
>   f  = addfile("ncep_6h_jan.nc","r")       ; open netcdf file
>   a  = addfile("moisture/shum_jan_6hr.nc","r"); moisutre file
>
>   u   = f->U_GRD_2_ISBL(:,{1000:300},:,:)       ; pull u off file
>   v   = f->V_GRD_2_ISBL(:,{1000:300},:,:)       ; pull v off file
>   q   = a->shum(:,{1000:300},:,:)               ; pull q off file
>
>   lat = f->lat
>   lon = f->lon
>   lev = (/1000.,925.,850.,700.,600.,500.,400.,300./)
>
>   u   = u(:,:,::-1,:)
>   printVarSummary(u)         ; [time | 124] x [level | 8] x [lat | 73] x
> [lon | 144]
>   v   = v(:,:,::-1,:)
>   printVarSummary(v)          ;[time | 124] x [level | 8] x [lat | 73] x
> [lon | 144]
>   q   = q(:,:,::-1,:)
>   printVarSummary(q)          ;[time | 124] x [level | 8] x [lat | 73] x
> [lon | 144]
>
> ;**********************************************************
> ;integration
> ;***********************************************************
>   qu = q*u                             ;[124] x [8] x [73] x [144]
>   qv = q*v                             ;[124] x [8] x [73] x [144]
>
>   ptop = 300.0
>   psfc = 1000.0
>   dp = dpres_plevel_Wrap(lev,psfc,ptop,0)
>   vopt = 0
> *  quint = wgt_vertical_n(qu,dp,vopt,1)*
>
> Problems:
> [1] NCL exits after the last line (quint) and gives the error above. Both
> qu and dp have the same number of levels.
>
> Any suggestion on how to do this correctly in NCL?
>
> I'll appreciate any help.
>
> Sincerely,
>
> *Lyndz*
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190507/66b3b6eb/attachment.html>


More information about the ncl-talk mailing list