<div dir="ltr"><div><div><div>I only skimmed your complicated script. <br>This is a longish response dealing with hybrid levels..<br><br>There are several different forms of 'hybrid' coordinates.<br><br></div>[1] <br>The initial hybrid coefficients I encountered were from the Climate Atmosphere Model (CAM) within the Community Climate Model (CCM). FYI: The CCM is the predecessor of the CESM. <br><br></div>The CCM [CAM] formula is: hybrid_plevel(p) = hya(p)*p0 + hyb(p)*ps<br><br></div><div>The hy{a/b} coefficients are associated with (1) 'mid-levels' and are often denoted as 'hyam' and 'hybm' or (2) 'interface levels' often denoted as 'hyai' and 'hybi'. The dimension sizes for the interface are one larger than the hy{a/b}m coefficients.<br></div><div><br></div><div>The 'pres_hybrid_ccm' uses the mid-level coefficients: 'hyam' and 'hybm'.<br></div><div>The 'dpres_hybrid_ccm' uses the interface-level coefficients: 'hyai' and 'hybi'.<br><br></div><div>The _ccm suffix indicates that the CCM formulation is used.<br><br></div><div> pres = pres_hybrid_ccm(ps, p0, hyam, hybm)<br></div><div> dpres = dpres_hybrid_ccm(ps, p0, hyai, hybi)<br><br></div><div> p0 should be 100000 (Pa) or 1000 (hPa). The units of p0 should match the units of 'ps'<br><br></div><div>The hy{a/b} order is top-to-bottom.<br></div><div><br>[2]<br></div><div>Subsequently, it was called to my attention that ECMWF used a slight variant of the _ccm formulation: <br> hybrid_plevel(p) = HYA(p) + hyb(p)*ps ; HYA(p)=hya(p)*p0<br></div><div>Rather than create a new function (also new documentation and testing), I noted this variation in the _ccm function documentation. The '{d}pres_hybrid_ccm' functions can be used with a simple change. <br><br>Let HYA{M/I}(p)=hya{m/i}(p)*p0, then <br><br></div><div> hyam = HYAM/p0<br> pres = pres_hybrid_ccm(ps, p0, hyam, hybm)<br></div><div> hyai = HYAI/p0<br></div><div> dpres = dpres_hybrid_ccm(ps, p0, hyai, hybi<br><br>[3] <br></div><div>Within the last year or two, NCAR's Data Support Section asked me to look at the Japanese Meteorological Agency hybrid level formulation. This was quite different. The formulation is based on Simmons & Burridge (1981):<br><br> <b><a href="http://journals.ametsoc.org/doi/pdf/10.1175/1520-0493%281981%29109%3C0758%3AAEAAMC%3E2.0.CO%3B2" target="_blank">http://journals.ametsoc.org/<wbr>doi/pdf/10.1175/1520-0493%<wbr>281981%29109%3C0758%3AAEAAMC%<wbr>3E2.0.CO%3B2</a><br></b></div><div><b> </b>see equations 3.17 and 3.18<br></div><div><b><br></b></div><div>The JMA has a document that has additional information (see page 17):<br> <a href="https://rda.ucar.edu/datasets/ds628.0/docs/JRA-55.handbook_TL319_en.pdf" target="_blank">https://rda.ucar.edu/datasets/<wbr>ds628.0/docs/JRA-55.handbook_<wbr>TL319_en.pdf</a><br><br></div><div>Punch line: the pressure levels for the 'mid-levels' are determined via a much more complicated expression. This is done for conservation reasons. The difference between the 'conservative' pressure levels and those obtained using [2] are small but important.<br></div><div><br></div><div>The JAM data were from the 55-year Japanese ReAnalysis project. Hence the name:<br> <a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/pres_hybrid_jra55.shtml" target="_blank">http://www.ncl.ucar.edu/<wbr>Document/Functions/Built-in/<wbr>pres_hybrid_jra55.shtml</a><br><br></div><div>Note:this function requires bottom-to-top ordering because that is the way the JRA55 files were ordered.<br> <br>[4]<br></div><div>You sent me a file: ERA-Interim_coordvars.nc<br><br></div><div>It is always important to look at your data.<br></div><div><br>(a) Your hybrid coefficients are of the ECMWF type [2].<br>(b) Your data are ordered top-to-bottom.<br><br></div><div>I have attached my own hybrid-function library (hybrid_lib.ncl). These are not supported or documented. There is some internal documentation. I have also modified a test script of mine to use your data file(s). <br><br></div><div>%> ncl test.ncl | less<br><br>Carefully look at the script and the output.<br><br></div><div>I added something at the end to help you with the correct use of 'cz2ccm' You will have to provide the correct arguments.<br><br></div><div>Good Luck<br></div><div><br> <br></div><div><br></div><div><br></div><div><br><br></div><div><br></div><div><br><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 22, 2017 at 4:41 PM, Ghyslaine Boschat <span dir="ltr"><<a href="mailto:ghyslaine.boschat@unimelb.edu.au" target="_blank">ghyslaine.boschat@unimelb.edu.au</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word;color:rgb(0,0,0);font-size:14px;font-family:Calibri,sans-serif">
<div>
<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Cambria;text-align:justify">
<span style="font-family:Times" lang="EN-US">Dear NCL users,<u></u><u></u></span></p>
<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Cambria;text-align:justify">
<span style="font-family:Times" lang="EN-US"> </span></p>
<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Cambria;text-align:justify">
<span style="font-family:Times" lang="EN-US">I am using NCL version 6.4.0 to calculate vertically integrated meridional energy transports in the atmosphere using ERA-Interim. I am specifically using the NCL functions <b>cz2ccm</b> to calculate the geopotential
height in hybrid coordinates and then <b>dpres_hybrid_ccm</b> to perform vertical integration of my data on model levels.<u></u><u></u></span></p>
<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Cambria;text-align:justify">
<span lang="EN-US"> </span></p>
<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Cambria;text-align:justify">
<span style="font-family:Times" lang="EN-US">Both these NCL functions require as input the hybrid base pressure <b>p0 </b>and hybrid coefficients a and b. p0 is usually equal to 100000Pa but is not available for ERA-Interim and I am not sure what to use…<u></u><u></u></span></p>
<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Cambria;text-align:justify">
<span lang="EN-US"> </span></p>
<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 48pt;font-size:12pt;font-family:Cambria;text-align:justify">
<span style="font-family:Times" lang="EN-US">To my understanding, NCL assumes the coefficients are of the form: </span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Cambria">
<span style="font-family:Times" lang="EN-US"> <wbr> p = a(k)*p0 + b(k)*ps </span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 48pt;font-size:12pt;font-family:Cambria;text-align:justify">
<span style="font-family:Times" lang="EN-US">whereas the equivalent ERA-Interim pressure equation is </span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Cambria">
<span style="font-family:Times" lang="EN-US"> <wbr> p = A(k) + B(k)*ps</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Cambria">
<span style="font-family:Times" lang="EN-US"> </span></p>
<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Cambria">
<span style="font-family:Times" lang="EN-US">Therefore, for ERA-Interim data do I need to just use <b><i>p0=1</i></b> or else keep <b><i>p0 = 100000</i></b> with the provided hybrid coefficients becoming hyam= hyam/p0 and hyai= hyai/p0 (i.e. A(k)=a(k)/p0)?<u></u><u></u></span></p>
<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Cambria">
<span lang="EN-US"> </span></p>
<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:Cambria">
<span style="font-family:Times" lang="EN-US">My results are slightly different depending on these 2 options.</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 48pt;font-size:12pt;font-family:Cambria;text-align:justify">
<span style="font-family:Times" lang="EN-US"> </span></p>
<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 48pt;font-size:12pt;font-family:Cambria;text-align:justify">
<span style="font-family:Times" lang="EN-US">Thank you for your help with this.</span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 48pt;font-size:12pt;font-family:Cambria;text-align:justify">
<span lang="EN-US"> </span></p>
<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 48pt;font-size:12pt;font-family:Cambria">
<span style="font-family:Times" lang="EN-US">Regards, </span><span class="HOEnZb"><font color="#888888"><span lang="EN-US"><u></u><u></u></span></font></span></p><span class="HOEnZb"><font color="#888888">
<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt 48pt;font-size:12pt;font-family:Cambria">
<span style="font-family:Times" lang="EN-US"><br>
</span></p>
<p class="MsoNormal" style="margin:0cm 0cm 10pt;font-size:12pt;font-family:Cambria">
<span style="font-family:Times" lang="EN-US">Ghyslaine</span></p>
</font></span></div>
</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>