[ncl-talk] dpres_hybrid_ccm

Buzan, Jonathan jbuzan at purdue.edu
Tue Jan 21 10:55:11 MST 2020


Hi Dennis,

I am using it with CAM5. Hmmmmmm… This makes more sense that I should be using ilev and the hyai and hybi.  I was using hyam hybm and lev. I’ll try those. Thanks!

Variable: UQ
Type: float
Total Size: 597196800 bytes
            149299200 values
Number of Dimensions: 4
Dimensions and sizes: [time | 360] x [lev | 30] x [lat | 96] x [lon | 144]

Variable: lev
Type: double
Total Size: 240 bytes
            30 values
Number of Dimensions: 1
Dimensions and sizes: [lev | 30]

Variable: hyam
Type: double
Total Size: 240 bytes
            30 values
Number of Dimensions: 1
Dimensions and sizes: [lev | 30]
Coordinates:
            lev: [3.64346569404006..992.556095123291]
Number Of Attributes: 1
  long_name : hybrid A coefficient at layer midpoints

Variable: hybm
Type: double
Total Size: 240 bytes
            30 values
Number of Dimensions: 1
Dimensions and sizes: [lev | 30]
Coordinates:
            lev: [3.64346569404006..992.556095123291]
Number Of Attributes: 1
  long_name : hybrid B coefficient at layer midpoints

-Jonathan




On Jan 21, 2020, at 5:38 PM, Dennis Shea <shea at ucar.edu<mailto:shea at ucar.edu>> wrote:

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]






[https://mail.google.com/mail/u/1/images/cleardot.gif]


On Tue, Jan 21, 2020 at 6:34 AM Buzan, Jonathan via ncl-talk <ncl-talk at ucar.edu<mailto: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<mailto: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/aa307c0f/attachment.html>


More information about the ncl-talk mailing list