<p><span style="font-family:Arial;font-size:12pt;">Thanks Dave,</span></p><p> </p><p>The Fortran code looks straightforward. The last bit is for converting the pdf into frequency ("if flag is set", according to the comment), but the same code is also present in the contributed.ncl code. I'm assuming the flag isn't set, otherwise the conversion would be done twice. </p><p> </p><p>Unfortunately I'm not getting any closer to solve this problem. Simply dividing the NCL pdfs by 100 make them much smaller than Python or IDL pdfs. I don't know if anyone ever encountered this issue before.</p><p> </p><p>Cheers,</p><p>Giorgio<br><br> </p><blockquote><p>------ Messaggio Originale ------<br>Da: dave.allured@noaa.gov<br>A: g.graffino@tim.it Cc: ncl-talk@ucar.edu<br>Inviato: mercoledì, settembre 11º 2024, 04:58 PM<br>Oggetto: Re: [ncl-talk] Query about probability density functions<br> </p><div dir="ltr"><div>Giorgio, the fortran routine is at <strong>ni/src/lib/nfpfort/xy1pdf77.f</strong> in the NCL v6.6.2 source code.</div><div><br> </div><p><br> </p><div class="gmail_quote"><div class="gmail_attr" dir="ltr">On Wed, Sep 11, 2024 at 8:01 AM Giorgio Graffino via ncl-talk <<a href="mailto:ncl-talk@mailman.ucar.edu"><span class="wt_Email">ncl-talk@mailman.ucar.edu</span></a>> wrote:<br> </div><blockquote class="gmail_quote" style="border-left-color:rgb(204,204,204);border-left-style:solid;border-left-width:1.0px;margin:0.0px 0.0px 0.0px 0.8ex;padding-left:1.0ex;"><p><span style="font-family:Arial;font-size:12.0pt;">Hi Dennis,</span></p><p><span style="font-family:Arial;font-size:12.0pt;">Thank you for pointing out that detail.</span></p><p><span style="font-family:Arial;font-size:12.0pt;">I've found the code of the pdfx function in here (</span><a target="_blank" rel="noopener noreferrer" href="https://github.com/NCAR/ncl/blob/develop/ni/src/examples/gsun/contributed.ncl"><span style="font-family:Arial;font-size:12.0pt;">https://github.com/NCAR/ncl/blob/develop/ni/src/examples/gsun/contributed.ncl</span></a><span style="font-family:Arial;font-size:12.0pt;">) and the frequency is computed as pdf = 100d0*pdf/nMax. I tried to normalize the pdf by multiplying the frequency pdf by the number of data and divide by 100, but the results is very different depending on the number of data to compute the pdf. Also, the results are different from similar computations using Python, especially with large number of data. Without knowing what the Fortran routine does (and I can't find it), I don't know how to normalize NCL to match Python.</span></p><p><span style="font-family:Arial;font-size:12.0pt;">Any suggestions?</span></p><p><span style="font-family:Arial;font-size:12.0pt;">Cheers,</span></p><p><span style="font-family:Arial;font-size:12.0pt;">Giorgio</span><br><br> </p><blockquote><p>------ Messaggio Originale ------<br>Da: <a href="mailto:shea@ucar.edu" target="_blank"><span class="wt_Email">shea@ucar.edu</span></a><br>A: <a href="mailto:g.graffino@tim.it" target="_blank"><span class="wt_Email">g.graffino@tim.it</span></a> Cc: <a href="mailto:ncl-talk@ucar.edu" target="_blank"><span class="wt_Email">ncl-talk@ucar.edu</span></a><br>Inviato: lunedì, settembre 9º 2024, 08:15 PM<br>Oggetto: Re: [ncl-talk] Query about probability density functions<br> </p><div dir="ltr"><div>From the <a target="_blank" rel="noopener noreferrer" href="https://www.ncl.ucar.edu/Document/Functions/Contributed/pdfx.shtml"><strong>pdfx</strong></a> documentation:  "The PDF units are percent [%]."</div><div> </div><div>Divide by 100.<br> </div></div><p> </p><div class="gmail_quote"><div class="gmail_attr" dir="ltr">On Mon, Sep 9, 2024 at 10:26 AM Giorgio Graffino via ncl-talk <<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank"><span class="wt_Email">ncl-talk@mailman.ucar.edu</span></a>> wrote:<br> </div><blockquote class="gmail_quote" style="border-left-color:rgb(204,204,204);border-left-style:solid;border-left-width:1.0px;margin:0.0px 0.0px 0.0px 0.8ex;padding-left:1.0ex;"><p><span style="font-family:Arial;font-size:12.0pt;">Hello NCL experts,</span></p><p><span style="font-family:Arial;font-size:12.0pt;">I'm using pdfx to compute probability density functions (</span><a target="_blank" rel="noopener noreferrer" href="https://www.ncl.ucar.edu/Document/Functions/Contributed/pdfx.shtml"><span style="font-family:Arial;font-size:12.0pt;">https://www.ncl.ucar.edu/Document/Functions/Contributed/pdfx.shtml</span></a><span style="font-family:Arial;font-size:12.0pt;">). I noticed that the cumulative density functions sum up to 100 in NCL, instead of 1 as per definition. Why is that? How can I normalize them back to 1?</span><br> </p><p><span style="font-family:Arial;font-size:12.0pt;">Thanks for your help.</span></p><p><span style="font-family:Arial;font-size:12.0pt;">Cheers,</span></p><p><span style="font-family:Arial;font-size:12.0pt;">Giorgio</span></p></blockquote></div></blockquote></blockquote></div></div></blockquote>