<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
<div class="">Hi Dennis,</div>
<div class=""><br class="">
</div>
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!
<div class="">
<div class=""><br class="">
</div>
<div class="">Variable: UQ<br class="">
Type: float<br class="">
Total Size: 597196800 bytes<br class="">
149299200 values<br class="">
Number of Dimensions: 4<br class="">
Dimensions and sizes:<span class="Apple-tab-span" style="white-space:pre"> </span>
[time | 360] x [lev | 30] x [lat | 96] x [lon | 144]<br class="">
<br class="">
Variable: lev<br class="">
Type: double<br class="">
Total Size: 240 bytes<br class="">
30 values<br class="">
Number of Dimensions: 1<br class="">
Dimensions and sizes:<span class="Apple-tab-span" style="white-space:pre"> </span>
[lev | 30]<br class="">
<br class="">
Variable: hyam<br class="">
Type: double<br class="">
Total Size: 240 bytes<br class="">
30 values<br class="">
Number of Dimensions: 1<br class="">
Dimensions and sizes:<span class="Apple-tab-span" style="white-space:pre"> </span>
[lev | 30]<br class="">
Coordinates: <br class="">
lev: [3.64346569404006..992.556095123291]<br class="">
Number Of Attributes: 1<br class="">
long_name :<span class="Apple-tab-span" style="white-space:pre"> </span>hybrid A coefficient at layer midpoints<br class="">
<br class="">
Variable: hybm<br class="">
Type: double<br class="">
Total Size: 240 bytes<br class="">
30 values<br class="">
Number of Dimensions: 1<br class="">
Dimensions and sizes:<span class="Apple-tab-span" style="white-space:pre"> </span>
[lev | 30]<br class="">
Coordinates: <br class="">
lev: [3.64346569404006..992.556095123291]<br class="">
Number Of Attributes: 1<br class="">
long_name :<span class="Apple-tab-span" style="white-space:pre"> </span>hybrid B coefficient at layer midpoints<br class="">
<br class="">
<div>-Jonathan</div>
<div><br class="">
</div>
<div><br class="">
</div>
<div><br class="">
</div>
<div><br class="">
<blockquote type="cite" class="">
<div class="">On Jan 21, 2020, at 5:38 PM, Dennis Shea <<a href="mailto:shea@ucar.edu" class="">shea@ucar.edu</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" class="">
<div class="">Hi Jonathan,</div>
<div class=""><br class="">
</div>
<div class="">Is this being used on CAM data? EG:<br class="">
</div>
<div class=""><br class="">
</div>
<div class="">
<div class=""> lat = 96 ;<br class="">
lon = 144 ;<br class="">
lev = <b class="">26</b> ; mid levels<br class="">
ilev = <b class="">27</b> ; interface levels<br class="">
</div>
<div class=""> time= 1</div>
<div class=""><br class="">
</div>
<div class=""> double lev(lev) ;<br class="">
double ilev(ilev) ;</div>
<div class=""> float PS(time, lat, lon) ;</div>
<div class=""> float T(time, lev, lat, lon) ;</div>
<div class=""><br class="">
</div>
<div class=""> f = addfile ("....", "r")</div>
<div class=""> hyai = f->hyai ; [27]<br class="">
hybi = f->hybi ; [27]<br class="">
p0 = f->P0 ; [1] <br class="">
ps = f->PS ; [1] x [96] x [144]<br class="">
<br class="">
dp = dpres_hybrid_ccm (ps,p0,<b class="">hyai,hybi</b>) ; Pa [kg/(m s2)]<br class="">
</div>
<div class=""> printVarSummary(dp) ; [1] x [<b class="">26</b>] x [96] x [144]</div>
<div class=""><br class="">
</div>
<div class=""> T = f->T</div>
<div class=""> printVarSummary(T) ; [1] x [<b class="">26</b>] x [96] x [144]</div>
<div class=""><br class="">
</div>
<div class=""> Tdp = T*dp ; [1] x [26] x [96] x [144]</div>
<div class=""> <br class="">
<div class="gmail-aju">
<div class="gmail-aCi"><br class="">
</div>
</div>
<div class="gmail-gs">
<div class="gmail-iv gmail-gt gmail-gE">
<table class="gmail-gJ gmail-cf" cellpadding="0">
<tbody class="">
<tr class="gmail-acZ">
<td class="gmail-gF gmail-gK">
<table class="gmail-cf gmail-ix" cellpadding="0">
<tbody class="">
<tr class="">
<td class="gmail-c2"><br class="">
</td>
</tr>
</tbody>
</table>
</td>
<td class="gmail-bAk gmail-gH"><br class="">
</td>
</tr>
</tbody>
</table>
</div>
</div>
<table class="gmail-gJ gmail-cf" cellpadding="0">
<tbody class="">
<tr class="gmail-acZ">
<td class="gmail-gH"><br class="">
</td>
<td class="gmail-acX gmail-bAm gmail-gH" rowspan="2"><br class="">
</td>
</tr>
</tbody>
</table>
<table class="gmail-gJ gmail-cf" cellpadding="0">
<tbody class="">
<tr class="gmail-acZ gmail-xD">
</tr>
</tbody>
</table>
<table class="gmail-gJ gmail-cf" cellpadding="0">
<tbody class="">
<tr class="gmail-acZ gmail-xD">
<td colspan="3" class="">
<table class="gmail-adz gmail-cf" cellpadding="0">
<tbody class="">
<tr class="">
<td class="gmail-ady">
<div id="gmail-:1ws" class="gmail-ajy" tabindex="0"><img class="gmail-ajz" src="https://mail.google.com/mail/u/1/images/cleardot.gif" alt=""></div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
<div class=""> <br class="">
</div>
</div>
</div>
<br class="">
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Tue, Jan 21, 2020 at 6:34 AM Buzan, Jonathan via ncl-talk <<a href="mailto:ncl-talk@ucar.edu" class="">ncl-talk@ucar.edu</a>> wrote:<br class="">
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Hello NCL-Talk,<br class="">
<br class="">
I am attempting to use the following function:<br class="">
dpres_hybrid_ccm<br class="">
<a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/dpres_hybrid_ccm.shtml" rel="noreferrer" target="_blank" class="">https://www.ncl.ucar.edu/Document/Functions/Built-in/dpres_hybrid_ccm.shtml</a><br class="">
<br class="">
Example 3 says to:<br class="">
<br class="">
f = addfile<br class="">
("....", "r")<br class="">
hyai = f->hyai<br class="">
hybi = f->hybi<br class="">
p0 = f->P0<br class="">
ps = f->PS<br class="">
<br class="">
dp = dpres_hybrid_ccm<br class="">
(ps,p0,hyai,hybi) ; Pa [kg/(m s2)] <br class="">
<br class="">
T = f->T ; K (time,lev,lat,lon)<br class="">
cp = 1004. ; J/(K kg) [ m2/(K s2) ]<br class="">
g = 9.81 ; m/s<br class="">
<br class="">
Tdp = T*dp ; [K kg/(m s2)] (temporary variable)<br class="">
<br class="">
<br class="">
fatal:Mul: Dimension size, for dimension number 1, of operands does not match, can't continue<br class="">
<br class="">
fatal:["Execute.c":8638]:Execute: Error occurred at or near line 105<br class="">
<br class="">
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.<br class="">
<br class="">
Thanks,<br class="">
-Jonathan<br class="">
<br class="">
<br class="">
_______________________________________________<br class="">
ncl-talk mailing list<br class="">
<a href="mailto:ncl-talk@ucar.edu" target="_blank" class="">ncl-talk@ucar.edu</a><br class="">
List instructions, subscriber options, unsubscribe:<br class="">
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank" class="">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br class="">
</blockquote>
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
</body>
</html>