<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body>
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p>Dear NCL Team / Dear Dennis,</p>
<p><br>
</p>
<p>If still possible, I would like to follow up on a previous correspondence. Previously, I encountered a problem, the so-called Gibbs effect or ringing, in potential vorticity (PV) fields computed with the NCL function "pot_vort_hybrid" using CERA-20C data
 on a regular grid (u, v, and temp on hybrid levels and surface pressure). This issue does not appear when using data on a Gaussian grid. Since this issue re-appeared in the same computation using the ERA5 data on a 0.5 degree regular grid (see attached plot,
 left panel), I looked again into this issue, and wanted to ask your brief advice / opinion.</p>
<p><br>
</p>
<p>In your previous writing, you suggested that the ECMWF transformation from spherical harmonics to the regular grid may introduce this Gibbs effect. Currently, I am in touch with ECMWF about this issue, and they suspected exactly the same reason for the Gibbs
 effect appearing. They suggested an alternative setting in the retrieval script for ERA5 data will <span style="font-size: 12pt;">avoid spectral truncation of the data that can give rise to the Gibbs effect.</span></p>
<p><span style="font-size: 12pt;"><br>
</span></p>
<p><span style="font-size: 12pt;">A long story short: this suggestion plus a few other trails in different data formats didnt help, and the Gibbs effect remains in the PV fields.</span></p>
<p><span style="font-size: 12pt;"><br>
</span></p>
<p><font size="3">However, I did find two different ways when the Gibbs effect didn't appear and the PV fields looked perfectly fine: (i) if I </font>download<font size="3"> ERA5 data at a Gaussian grid and then interpolate it to a regular grid using the cdo
 command "remapbil" and (ii) if I compute PV reading in source data at a regular grid but only from latitudes -89.5 to + 89.5, i.e., excluding the latitude arrays at -90 and +90 degrees (see attached plot, right panel). Note that the interpolated data by cdo
 under (i) also has a latitude array from -89.75 to +89.75, ie. has no latitude array at -90 and +90. So it seems that the ringing effect appears when PV is computed from source data on a regular grid with having latitude arrays at -90 and +90. Does this make
 sense? </font><font size="3">Is there an obvious reason for the Gibbs ringing disappearing when omitting data at the lat -90 & +90 degrees?</font></p>
<p><font size="3"><br>
</font></p>
<p><span style="font-size: medium;">By finding out the above, an easy work-around is at hand: computing PV from -89.5 to +89.5 and adding longitudinally averaged PV from -89.5 (+89.5) </span><font size="3">to the -90 (+90) latitude array. Still I thought it
 could be helpful to understand this issue as to why it arise, and to make sure it doesn't affect the data I use</font><font size="3">.</font></p>
<p><font size="3"></font></p>
<p><font size="3"><br>
</font></p>
<p><font size="3">Any help is appreciated! Many thanks!</font></p>
<p><font size="3"><br>
</font></p>
<p><font size="3">Best,</font></p>
<p><font size="3">Andries <br>
</font></p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Dennis Shea <shea@ucar.edu><br>
<b>Sent:</b> 08 March 2019 04:45:07<br>
<b>To:</b> De Vries Andries<br>
<b>Cc:</b> ncl-talk@ucar.edu<br>
<b>Subject:</b> Re: [ncl-talk] compute PV on hybrid levels on a regular global grid with function pot_vort_hybrid; weird, fluctuating values toward the poles</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div dir="ltr">
<div>Hello Andries</div>
<div><br>
</div>
<div>I only skimmed the scripts. I did not see anything 'wrong'.</div>
<div>Perhaps some form of filtering of the source 1x1 grid. <br>
</div>
<div><br>
</div>
<div>The following filters work on the spherical harmonic coefficients.<br>
</div>
<div><br>
</div>
<div><a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/tri_trunC-1.shtml"><b>tri_trunC  
</b></a>: Triangular truncation of spherical harmonic coefficients</div>
<div><br>
</div>
<div><a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/exp_tapershC.shtml"><b>exp_tapershC</b></a>: : Performs tapering (filtering) of the spherical harmonic coefficients</div>
<div><br>
</div>
<div>I have a 1x1 grid so I used that. See attached script. Substitute your file.</div>
<div><br>
</div>
<div>Play with the various parameters.</div>
<div><br>
</div>
<div>Of course, the contour intervals will have to be adjusted.</div>
<div><br>
</div>
<div>Hope this helps..</div>
<div><br>
</div>
<div>D<br>
</div>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Thu, Mar 7, 2019 at 6:03 AM De Vries Andries <<a href="mailto:andries.devries@env.ethz.ch">andries.devries@env.ethz.ch</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Hi Dennis,<br>
<br>
Thank you very much for your helpful response. I looked a bit into this ringing/Gibbs phenomenon and it seems indeed the issue looks very much like that.
<br>
<br>
At the moment I see the following options/solutions: <br>
1) accepting the ringing effect in the PV data on a regular grid. Large differences only occur very close to the Pole and might not be a big problem<br>
2) switching to working with data on a gaussian grid. <br>
<br>
Any comments on this? Or perhaps any other solutions that I miss? By the way, please, find attached the scripts how I compute the PV for the regular and Gaussian grids, and another one to assess the differences in the PV files. I forgot to attach those in the
 previous email. If there is anything in the scripts that looks suspicious or might explain the the issue, please, let me know.<br>
<br>
Cheers,<br>
Andries<br>
________________________________________<br>
From: Dennis Shea [<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>]<br>
Sent: 06 March 2019 19:57<br>
To: De Vries  Andries<br>
Cc: <a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
Subject: Re: [ncl-talk] compute PV on hybrid levels on a regular global grid with function pot_vort_hybrid; weird, fluctuating values toward the poles<br>
<br>
<a href="http://www.ncl.ucar.edu/Applications/pot_vort.shtml" rel="noreferrer" target="_blank">http://www.ncl.ucar.edu/Applications/pot_vort.shtml</a><br>
<br>
[1]<br>
"Previously, I computed PV using data from ERA-Interim on a gaussian grid without any troubles."<br>
<br>
[2]<br>
"Now I try the same, but with ERA-Interim data on a regular 1x1 grid.<br>
<br>
---<br>
pot_vort_hybrid<<a href="http://www.ncl.ucar.edu/Document/Functions/Contributed/pot_vort_hybrid.shtml" rel="noreferrer" target="_blank">http://www.ncl.ucar.edu/Document/Functions/Contributed/pot_vort_hybrid.shtml</a>>: This function works with both gaussian
 and regular grids. Same code, just a switch for the grid type<br>
<br>
---<br>
I speculate that the ECMWFspectral  interpolation from the source gaussian grid to 1x1 is the issue. Spectral interpolation can result in "ringing" due to Gibbs phenomenon.<br>
<br>
D<br>
<br>
<br>
<br>
<br>
<br>
On Wed, Mar 6, 2019 at 10:31 AM De Vries Andries <<a href="mailto:andries.devries@env.ethz.ch" target="_blank">andries.devries@env.ethz.ch</a><mailto:<a href="mailto:andries.devries@env.ethz.ch" target="_blank">andries.devries@env.ethz.ch</a>>> wrote:<br>
Dear NCL team & NCL users,<br>
<br>
I have an issue with the computation of potential vorticity (PV) on hybrid levels using the function "pot_vort_hybrid". Previously, I computed PV using data from ERA-Interim on a gaussian grid without any troubles. Now I try the same, but with ERA-Interim data
 on a regular 1x1 grid. I found that values toward the pole are fluctuating with respect to PV that has been provided directly by the ECMWF. (The reason for computing PV myself is to obtain PV isentropic surfaces with higher intervals than provided by ECMWF).
 In other words, the PV that I compute show increasing, positive & negative alternating values as compared to the PV that is provided by the ECMWF.<br>
<br>
Any idea if I do something wrong, and/or how to fix this issue?<br>
<br>
Please, find attached the two scripts for the computation of PV on a Gaussian grid and on a regular grid, as well as a short script that prints the numerical differences between the two output files. The needed data files to compute PV on a guassian and regular
 grid, as well as files with PV from ECMWF are uploaded.<br>
<br>
Looking forward for any feedback!<br>
Many thanks!<br>
<br>
Cheers,<br>
Andries<br>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><mailto:<a href="mailto:ncl-talk@ucar.edu" target="_blank">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/mailman/listinfo/ncl-talk</a><br>
</blockquote>
</div>
</div>
</body>
</html>