<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Dear NCL,<div class=""><br class=""></div><div class="">I would like to learn if there has been any progress on this reported bug when one uses certain pressure levels (e.g., 700hPa to 300hPa).</div><div class=""><br class=""></div><div class="">Regards,</div><div class=""><br class=""></div><div class="">Deniz</div><div class=""><br class=""></div><div class=""><div class=""><span class="" style="color: rgb(132, 132, 132); font-size: 11px; border-collapse: separate;"><div class="" style="word-wrap: break-word;"><span class="" style="border-collapse: separate;"><div class="" style="word-wrap: break-word;"><span class="" style="border-collapse: separate;"><div class="" style="word-wrap: break-word;"><span class="" style="border-collapse: separate;"><div class="" style="word-wrap: break-word;"><div class="" style="word-wrap: break-word;"><span class="" style="border-collapse: collapse; font-family: Arial;">--</span><div class="" style="border-collapse: separate;"><font face="Arial" class=""><div class="" style="word-wrap: break-word;"><div class="" style="border-collapse: separate; word-wrap: break-word;"><span class="" style="border-collapse: separate;"><div class="" style="word-wrap: break-word;"><div class="" style="word-wrap: break-word;"><div class="" style="word-wrap: break-word;"><div class="" style="border-collapse: separate;"><span class="" style="border-collapse: collapse;">Deniz Bozkurt, PhD<br class=""></span></div><div class="" style="border-collapse: separate;"><span class="" style="border-collapse: collapse;">Post-doctoral Fellow</span></div></div></div></div></span></div></div><span class="" style="border-collapse: collapse;">Center&nbsp;for&nbsp;Climate&nbsp;and Resilience Research</span></font></div></div><span class="" style="border-collapse: collapse; font-family: Arial;">Department of Geophysics</span>, University of Chile<span class="" style="border-collapse: collapse; font-family: Arial;"></span><div class=""><span class="" style="border-collapse: collapse; font-family: Arial;"></span><div class="" style="word-wrap: break-word;"><div class="" style="border-collapse: separate;"><span class="" style="border-collapse: collapse;"><font face="Arial" class="">Blanco Encalada 2002, Santiago, Chile</font></span></div><div class="" style="border-collapse: separate;"><font face="Arial" class=""><span class="" style="border-collapse: collapse;">E-mail:&nbsp;<a href="mailto:dbozkurt@dgf.uchile.cl" target="_blank" class="">dbozkurt@dgf.uchile.cl</a>,&nbsp;<a href="mailto:deniboz@gmail.com" target="_blank" class="">deniboz@gmail.com</a></span></font></div></div></div></div></span></div></span></div></span></div></span><span style="color: rgb(132, 132, 132); font-size: 11px;" class="">Web:&nbsp;</span><a href="http://dgf.uchile.cl/%7Edbozkurt/" target="_blank" class="" style="font-size: 11px;">http://dgf.uchile.cl/~dbozkurt/</a></div></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""><div class=""><div class=""><div><blockquote type="cite" class=""><div class="">On Oct 19, 2015, at 8:11 PM, Dennis Shea &lt;<a href="mailto:shea@ucar.edu" class="">shea@ucar.edu</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class="">Thank you for sending the file. There is a bug.<br class=""><br class="">If you use ptop=0 or ptop=min(levels)=200, there is no bug. The [<br class="">psfc-ptop ] differences match the sum of the layer thickness.<br class=""><br class="">However, if you use a ptop &gt; min(levels) [for example, ptop=500] a<br class="">small subset [0.7%] of the grid points &nbsp;do not sum correctly.<br class=""><br class="">I am out tomorrow. I will look on Wednesday.<br class=""><br class="">Regards<br class="">Dennis Shea<br class=""><br class=""><br class=""><br class=""><br class="">On Tue, Oct 13, 2015 at 11:56 PM, Bilbo Qiu &lt;<a href="mailto:biloisbrave@gmail.com" class="">biloisbrave@gmail.com</a>&gt; wrote:<br class=""><blockquote type="cite" class="">Dear everyone,<br class=""><br class="">It's my first time to send the email. I am trying to describe the problem<br class="">briefly as possible.<br class=""><br class="">Version: &nbsp;NCL 6.3.0<br class=""><br class="">System: Ubuntu<br class=""><br class="">No errors.<br class=""><br class="">Warning: dpres_plevel: At one or more grid points the sum of the layer<br class="">thicknesses is not equal to (psfc-ptop). Are units of plev, psfc and ptop<br class="">matching?<br class=""><br class="">Problems: I tried to calculate the pressure layer thickness "dp", using the<br class="">function "dpres_plevel". The input file is "ps_qv.nc", which includes two<br class="">variables, ps (surface pressure) and qv(specific humidity). I exported the<br class="">result to a file named "dp.nc". A warning displayed as the above. I checked<br class="">all of the units. It is "Pa". I visualized "dp.nc", using ncview and found<br class="">dp is about 3000 Pa on Tibet Plateau on the level of 1000 hPa where the<br class="">surface pressure is about 550 hPa. There should be no value on Tibet Plateau<br class="">where the surface pressure is much below 1000 hPa. In addition, there exists<br class="">extreme value about 30000 pa on the top level of 700 hPa on the boundary of<br class="">Tibet Plateau. The value is too big for dp. Below is my script:<br class="">--------------------------------<br class="">begin<br class=""> &nbsp;&nbsp;diri = "./"<br class=""> &nbsp;&nbsp;fili = "ps_qv.nc"<br class=""> &nbsp;&nbsp;fi &nbsp;&nbsp;= addfile(diri+fili, "r")<br class=""><br class=""> &nbsp;&nbsp;q &nbsp;= fi-&gt;qv(0,0:12,:,:) ; (levels, latitude, longitude), it will provide<br class="">coordinate information for dp<br class=""><br class=""> &nbsp;&nbsp;psfc &nbsp;= fi-&gt;ps(0,:,:) &nbsp;&nbsp;; (lat,lon), the unit of the variable "ps" in the<br class="">input file is Pa<br class=""> &nbsp;&nbsp;psfc@units = "Pa"<br class=""> &nbsp;&nbsp;printVarSummary(psfc)<br class=""> &nbsp;&nbsp;printMinMax(psfc, 0)<br class=""><br class=""> &nbsp;&nbsp;;isobaric levels<br class=""> &nbsp;&nbsp;&nbsp;plev = fi-&gt;levels(0:12) ;from 1000 to 700 hPa<br class=""> &nbsp;plev = plev*100. ;the unit of plev is hPa, convert it to Pa by *100<br class=""> &nbsp;&nbsp;&nbsp;plev@units = "Pa"<br class=""> &nbsp;&nbsp;&nbsp;printVarSummary(plev)<br class=""> &nbsp;&nbsp;&nbsp;printMinMax(plev, 0)<br class=""><br class=""> &nbsp;&nbsp;&nbsp;ptop= 70000<br class=""> &nbsp;ptop@units = "Pa"<br class=""><br class=""> &nbsp;&nbsp;&nbsp;dp &nbsp;= dpres_plevel(plev, psfc, ptop, 0) ; the key function<br class=""> &nbsp;copy_VarCoords(q, dp)<br class=""> &nbsp;&nbsp;&nbsp;printVarSummary(dp)<br class=""> &nbsp;&nbsp;&nbsp;printMinMax(dp, 0)<br class="">;output dp to a netCDF file<br class="">system("/bin/rm -f dp.nc") &nbsp;&nbsp;; remove any pre-existing file<br class="">ncdf = addfile("dp.nc" ,"c") &nbsp;; open output netCDF file<br class="">fAtt &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= True &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;; assign file attributes<br class="">fAtt@title &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= "NCL Simple Approach to netCDF Creation"<br class="">fAtt@source_file &nbsp;&nbsp;= &nbsp;"original-file.nc"<br class="">fAtt@Conventions &nbsp;&nbsp;= "None"<br class="">fAtt@creation_date = systemfunc ("date")<br class="">fileattdef( ncdf, fAtt ) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;; copy file attributes<br class="">filedimdef(ncdf,"time",-1,True)<br class="">ncdf-&gt;dp &nbsp;= dp<br class="">end<br class="">-----------------------------------<br class=""><br class="">I couldn't find the source code of the function "dpres_pleve" and had no<br class="">idea where the errors are.<br class=""><br class="">I am looking forwards to your help.<br class=""><br class="">Additions: I set the surface pressure to a constant, 101800 Pa. The result<br class="">makes sense. I am wondering if the function is wrong when the surface<br class="">pressure is a 2-D or 3-D array.<br class=""><br class="">Bilbo Qiu<br class=""><br class=""><br class=""><br class=""><br class=""><br class=""><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=""><br class=""></blockquote>_______________________________________________<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></blockquote></div><br class=""></div></div></div></body></html>