<div dir="ltr"><div>You may have to change the following but it gives you the necessary algorithm<br><br><br>("depth_unesco83")<br>function depth_unesco83(p[*]:numeric, lat[1]:numeric, Del[1]:numeric)<span><br>;<br>; Saunders P.M., Fofonoff N.P. (1976): <br>; Conversion of pressure to depth in the ocean. Deep Sea Research 23:109-111.</span><span><br>; UNESCO (1983): Algorithms for computation
of fundamental properties of seawater.<br>; UNESCO technical papers in marine
science 44:1-55.</span><span></span><br>;<br>local w, gr, DepthTerm, depth<br>begin<br> w = sin(lat*0.01745329)^2<br> gr = 9.780318 * (1.0 + (5.2788e-3 + 2.36e-5*w)*w) + 1.092e-6*p<br> DepthTerm = (((-1.82e-15*p + 2.279e-10)*p - 2.2512e-5)*p + 9.72659)*p<br> depth = DepthTerm/gr + Del/9.8<br> copy_VarCoords(p,depth)<br> depth@long_name = "depth"<br> depth@units = "m"<br> return(depth)<br>end<br>;--------------MAIN-----------<wbr>--<br>p = 10000.0<br>lat = 30.<br>del = 0<br><br>d = depth_unesco83(p, lat, del)<br>print(d)<br>==============================<wbr>=<br><br>Variable: d<br>Type: float<br>Total Size: 4 bytes<br> 1 values<br>Number of Dimensions: 1<br>Dimensions and sizes: [1]<br>Coordinates: <br>Number Of Attributes: 2<br> long_name : depth<br> units : m<br></div>(0) 9712.653 <=== Correct<br><div><br>========<br><br></div><div>See attached. you may have to alter the function.<br><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 2, 2017 at 6:47 PM, saurabh rathore <span dir="ltr"><<a href="mailto:rohitsrb2020@gmail.com" target="_blank">rohitsrb2020@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="color:rgb(0,0,0)">hi all<br><br></div><div class="gmail_default" style="color:rgb(0,0,0)">i am having ocean temperature data having depth in decibars instead of meters along the depth axis (z axis). i want to convert this pressure axis to the depth in meter axis. So i was wondering does NCL is having such a function to do that conversion for the depth axis.<br><br></div><div class="gmail_default" style="color:rgb(0,0,0)">regards, saurabh <br></div><span class="HOEnZb"><font color="#888888"><div class="gmail_default" style="color:#000000"><br><br clear="all"></div><br>-- <br><div class="m_-5492894830706731968gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><font color="#0000ff" size="4"><b><br></b></font></div><div><font color="#0000ff" size="4"><b><br></b></font></div><font color="#0000ff" face="times new roman, serif" size="4"><b>REGARDS</b></font><div><font color="#0000ff" face="times new roman, serif" size="4"><b><br></b></font><div><font color="#0000ff" face="times new roman, serif" size="4"><b>Saurabh Rathore</b></font></div><div><font color="#0000ff" face="times new roman, serif" size="4"><b>Research Scholar (PhD.)</b></font></div><div><font color="#0000ff" face="times new roman, serif" size="4"><b>Centre For Oceans, Rivers, Atmosphere & Land Science Technology</b></font></div><div><font color="#0000ff" face="times new roman, serif" size="4"><b>Indian Institute Of Technology, Kharagpur</b></font></div><div><font color="#0000ff" face="times new roman, serif" size="4"><b>contact :- 91- 8345984434</b></font></div></div></div></div></div></div>
</font></span></div>
<br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>