<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Did you read the documentation? <div class=""><br class=""></div><div class=""><a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/conform_dims.shtml" class="">https://www.ncl.ucar.edu/Document/Functions/Built-in/conform_dims.shtml</a> especially <b class=""><u class="">Example 4 </u></b></div><div class=""><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><em style="margin: 0px; padding: 0px; font-family: verdana, sans-serif; font-size: 13.3333px; font-variant-ligatures: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255);" class="">ndim</em></div><div class=""><p class="indent" style="margin: 10px 0px 20px; padding: 0px; color: rgb(51, 51, 51); font-family: verdana, sans-serif; font-size: 13.3333px; line-height: 12pt; font-variant-ligatures: normal; font-variant-east-asian: normal; font-variant-position: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255);">An array of dimension indexes to indicate <b class="">which dimension sizes indicated by <em style="margin: 0px; padding: 0px;" class="">dims</em> match the dimensions in <em style="margin: 0px; padding: 0px;" class="">r</em></b>. Dimension numbering starts at the left and must be increasing. The leftmost dimension index is 0, the next dimension index is 1, and so on. If <em style="margin: 0px; padding: 0px;" class="">r</em> is a scalar, then <em style="margin: 0px; padding: 0px;" class="">ndim</em> can have the special value of -1 (see below).</p></div></blockquote><div class=""><span style="font-family: verdana, sans-serif; font-size: 13.3333px; font-variant-ligatures: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255);" class=""></span><div>You indicated ndim =0, that is <b class="">lat</b> if the variables are dimensioned as you are saying (lat, lon, lev, time). Instead you are defining pressure as an height variable as far as I understand from your assignment </div><div><br class=""></div><div><blockquote type="cite" class=""> p = (/ 10.000000, 20.000000, 30.000000, 50.000000, 70.000000,<br class="">100.000000 \<br class=""> , 150.000000, 200.000000, 250.000000, 300.000000, 400.000000,<br class="">500.000000 \<br class=""> , 600.000000, 700.000000, 850.000000, 925.000000, 950.000000,<br class="">1000.000000 /)</blockquote><br class=""></div><div>So you should do p = conform_dims (dimsizes(q),p,2).</div><div><br class=""></div><div><br class=""></div><div><blockquote type="cite" class=""><div class="">On 14. Mar 2018, at 12:20, <a href="mailto:vivek@ncmrwf.gov.in" class="">vivek@ncmrwf.gov.in</a> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Hello Sir,<br class="">I have a model data(nc format). I am trying to calculate CAPE as below.<br class=""><br class="">;CAPE and CIN in ncl:<br class=""> f = addfile("./cape.nc" , "r")<br class=""> p = (/ 10.000000, 20.000000, 30.000000, 50.000000, 70.000000,<br class="">100.000000 \<br class=""> , 150.000000, 200.000000, 250.000000, 300.000000, 400.000000,<br class="">500.000000 \<br class=""> , 600.000000, 700.000000, 850.000000, 925.000000, 950.000000,<br class="">1000.000000 /)<br class=""> t = f->temp<br class=""> q = f->q<br class=""> z = f->ht_1<br class="">; p = conform_dims (dimsizes(q),p,0)<br class=""> zsfc = f->ht ; (lat,lon)<br class=""> psfc = f->p_1 ; (lat,lon) or (time,lat,lon)<br class=""> cinfo = wrf_cape_3d(p, t, q, z, zsfc, psfc, False) ; cinfo(2,...)<br class="">; cape3d = wrf_user_getvar(f,"cape_3d",-1)<br class=""><br class="">I am getting following error.<br class=""><br class="">fatal:conform_dims: the dimensions sizes of the second argument do not<br class="">match those indicated by the third argument<br class="">fatal:["Execute.c":8575]:Execute: Error occurred at or near line 9 in file<br class="">cape.ncl<br class=""><br class="">fatal:wrf_cape_3d: The p, t, q, and z arrays must all have the same number<br class="">of dimensions<br class="">fatal:["Execute.c":8575]:Execute: Error occurred at or near line 12 in<br class="">file cape.ncl<br class=""><br class=""><br class=""><br class="">What I could understand from the error is the dimension of 'p' is not<br class="">matching with dimension of q(or t; lat, lon, lev, time).<br class=""><br class="">Kindly suggest that How to match the dimension of p with that of q/t<br class=""><br class="">Thnking You,<br class=""><br class="">Vivek<br class=""><br class=""><br class=""><br class=""><br class=""><br class=""><br class="">-- <br class="">Yours Sincerely<br class="">----------------<br class="">Vivek Singh<br class="">(Scientist-'C')<br class="">NCMRWF,A-50, Sector-62,<br class="">Ministry of Earth Sciences<br class="">NOIDA.U.P. 201309<br class="">Mobile:09821123574,07042321724<br class="">Institute Website: <a href="http://www.ncmrwf.gov.in" class="">www.ncmrwf.gov.in</a><br class="">Alternate <a href="mailto:vivek.sgh1@gmail.com" class="">email: vivek.sgh1@gmail.com</a><br class=""><br class="">_______________________________________________<br class="">ncl-talk mailing list<br class=""><a href="mailto:ncl-talk@ucar.edu" class="">ncl-talk@ucar.edu</a><br class="">List instructions, subscriber options, unsubscribe:<br class="">http://mailman.ucar.edu/mailman/listinfo/ncl-talk<br class=""></div></div></blockquote></div><br class=""><div class="">
<div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class="Apple-interchange-newline">Guido Cioni</div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="http://guidocioni.altervista" class="">http://guidocioni.altervista</a>.org</div>
</div>
<br class=""></div></body></html>