[ncl-talk] dpres_hybrid_ccm

Dennis Shea shea at ucar.edu
Tue Jan 21 09:38:02 MST 2020


Hi Jonathan,

Is this being used on CAM data?  EG:

        lat = 96 ;
        lon = 144 ;
        lev = *26* ;              mid levels
        ilev = *27* ;             interface levels
        time= 1

        double lev(lev) ;
        double ilev(ilev) ;
        float PS(time, lat, lon) ;
        float T(time, lev, lat, lon) ;

  f = addfile ("....", "r")
  hyai = f->hyai                  ; [27]
  hybi = f->hybi                  ; [27]
  p0   = f->P0                     ; [1]
  ps   = f->PS                     ; [1] x [96] x [144]

  dp   =  dpres_hybrid_ccm (ps,p0,*hyai,hybi*)  ; Pa [kg/(m s2)]
  printVarSummary(dp)      ; [1] x [*26*] x [96] x [144]

  T = f->T
  printVarSummary(T)        ; [1] x [*26*] x [96] x [144]

   Tdp = T*dp                      ; [1] x [26] x [96] x [144]








On Tue, Jan 21, 2020 at 6:34 AM Buzan, Jonathan via ncl-talk <
ncl-talk at ucar.edu> wrote:

> Hello NCL-Talk,
>
> I am attempting to use the following function:
> dpres_hybrid_ccm
> https://www.ncl.ucar.edu/Document/Functions/Built-in/dpres_hybrid_ccm.shtml
>
> Example 3 says to:
>
> f = addfile
> ("....", "r")
>   hyai = f->hyai
>   hybi = f->hybi
>   p0   = f->P0
>   ps   = f->PS
>
>   dp   =  dpres_hybrid_ccm
>  (ps,p0,hyai,hybi)  ; Pa [kg/(m s2)]
>
>   T    = f->T                                ; K  (time,lev,lat,lon)
>   cp   = 1004.                               ; J/(K kg)     [ m2/(K s2) ]
>   g    = 9.81                                ; m/s
>
>   Tdp  = T*dp                                ; [K kg/(m s2)]   (temporary
> variable)
>
>
> fatal:Mul: Dimension size, for dimension number 1, of operands does not
> match, can't continue
>
> fatal:["Execute.c":8638]:Execute: Error occurred at or near line 105
>
> However, T and dp have different sized dimensions for the levels (dp is
> one less than T). I am not sure if this is correct for the example.
>
> Thanks,
> -Jonathan
>
>
> _______________________________________________
> 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/20200121/6e1c516f/attachment.html>


More information about the ncl-talk mailing list