<div dir="ltr"><div>I work at BSC in Barcelona, so no I do not have access to NCAR machines.</div><div><br></div><div>I think the problem is that the longitudes of the MOPIT data and model data are not exactly the same. From your print summaries:</div><div><br></div><div><pre class="gmail-aLF-aPX-K0-aPE">MOPIT: XDim_MOP03: <b>[ 0.5..359.5] <br></b></pre><pre class="gmail-aLF-aPX-K0-aPE">Model: lon: <b>[ 0..358.75] <br><br></b></pre><pre class="gmail-aLF-aPX-K0-aPE"><span style="font-family:arial,sans-serif">You are using longitudes of MOPIT to subset model values. <br>So when your loop reaches: <b>lon=359.5</b>, this value is beyond the maximum value of model longitude (which is <b>358.75</b>),and hence the error message.<br>It's up to you to decide what you want to do about this, e.g. regrid option etc. You can easily test this by adding print(""+n) statement inside the loop that is being used to subscript model values.</span><br></pre><pre class="gmail-aLF-aPX-K0-aPE"><b></b></pre><pre class="gmail-aLF-aPX-K0-aPE"><b></b></pre><pre class="gmail-aLF-aPX-K0-aPE"><b></b></pre><pre class="gmail-aLF-aPX-K0-aPE"><br><br><br><br></pre></div><div><br></div><div><br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jun 4, 2021 at 12:17 PM Najib Yusuf <<a href="mailto:najibgal@yahoo.com">najibgal@yahoo.com</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"><div><div style="font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:16px"><div></div>
<div dir="ltr">Dear Rasheed,</div><div dir="ltr"><br></div><div dir="ltr">Thank you for this explanation. I have effected the lonFlip and it works giving similar longitude with model output. However, am still missing something as similar error comes again. As you have suggested I attached the VarSummary file and the script Najib_script for your further assistance please. I really appreciate you and Dennis for your help. I dont know if you are working at NCAR and you have access to cheyenne so you can access the files in my directory (VarSummary file) for the files are large to attached. I know Dennis can access them.</div><div dir="ltr"><br></div><div dir="ltr">Thank you</div><div dir="ltr"><br></div><div dir="ltr">Najib</div>
</div><div id="gmail-m_-8429674840683761420yahoo_quoted_3035364640">
<div style="font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;color:rgb(38,40,42)">
<div>
On Thursday, June 3, 2021, 10:11:08 PM GMT+1, Rashed Mahmood <<a href="mailto:rashidcomsis@gmail.com" target="_blank">rashidcomsis@gmail.com</a>> wrote:
</div>
<div><br></div>
<div><br></div>
<div><div id="gmail-m_-8429674840683761420yiv1651076893"><div><div dir="ltr"><div><br clear="none"></div><div>As the documentation for lonFlip says "The rightmost dimension must be the longitude dimension...". So now you can use lonFlip for the reordered variable "cocol_retr_reorder":</div><div>lonFlip(cocol_retr_reorder)</div><div><br clear="none"></div><div>Since your original variable "cocol_retr" and the reordered variable "cocol_retr_reorder" have latitudes that are already south to north <b>(note: - to +) </b>according to the variable summary, so you do not need south to north conversion. If this does not work then please share the latest (minimum script) and if possible a data file that you are reading.<br clear="none"></div><div><br clear="none"></div><div><br clear="none"></div></div><br clear="none"><div id="gmail-m_-8429674840683761420yiv1651076893yqt83641"><div><div dir="ltr">On Thu, Jun 3, 2021 at 10:27 PM Najib Yusuf <<a rel="nofollow noopener noreferrer" shape="rect" href="mailto:najibgal@yahoo.com" target="_blank">najibgal@yahoo.com</a>> wrote:<br clear="none"></div><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div style="font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:16px"><div></div>
<div dir="ltr">Hello Dennis,</div><div dir="ltr"><br clear="none"></div><div dir="ltr">Thank you. I have effected the corrections, I think the interchanged was as a result of "lonFlip" when I undo the "lonFlip" function and use the "reorder" and reorder S to N" functions/command you have suggested, the Lat and Lon became okay like this;</div><div dir="ltr"><br clear="none"></div><div dir="ltr"><div><div>Variable: cocol_retr</div><div>Type: float</div><div>Total Size: 3110400 bytes</div><div> 777600 values</div><div>Number of Dimensions: 3</div><div>Dimensions and sizes: [ncl_join | 12] x [XDim_MOP03 | 360] x [YDim_MOP03 | 180]</div><div>Coordinates:</div><div> XDim_MOP03: [-179.5..179.5]</div><div> YDim_MOP03: [-89.5..89.5]</div><div>Number Of Attributes: 4</div><div> long_name : Retrieved CO Total Column Day</div><div> units : mol/cm^2</div><div> _FillValue : -9999</div><div> projection : Geographic</div><div><br clear="none"></div><div>Variable: cocol_retr_reorder</div><div>Type: float</div><div>Total Size: 3110400 bytes</div><div> 777600 values</div><div>Number of Dimensions: 3</div><div>Dimensions and sizes: [time | 12] x [YDim_MOP03 | 180] x [XDim_MOP03 | 360]</div><div>Coordinates:</div><div> YDim_MOP03: [-89.5..89.5]</div><div> XDim_MOP03: [-179.5..179.5]</div><div>Number Of Attributes: 4</div><div> projection : Geographic</div><div> _FillValue : -9999</div><div> units : mol/cm^2</div><div> long_name : Retrieved CO Total Column Day</div><div><br clear="none"></div><div>Variable: cocol_retr_SN</div><div>Type: float</div><div>Total Size: 3110400 bytes</div><div> 777600 values</div><div>Number of Dimensions: 3</div><div>Dimensions and sizes: [time | 12] x [YDim_MOP03 | 180] x [XDim_MOP03 | 360]</div><div>Coordinates:</div><div> YDim_MOP03: [89.5..-89.5]</div><div> XDim_MOP03: [-179.5..179.5]</div><div>Number Of Attributes: 4</div><div> long_name : Retrieved CO Total Column Day</div><div> units : mol/cm^2</div><div> _FillValue : -9999</div><div> projection : Geographic</div></div><div><br clear="none"></div><div dir="ltr">but running gave similar error:</div><div dir="ltr"><br clear="none"></div><div><div>fatal:NclOneDValGetClosestIndex: finish coordinate index out of range, can't continue</div><div>fatal:Could not obtain coordinate indexes, unable to perform subscript</div><div>fatal:["Execute.c":8637]:Execute: Error occurred at or near line 191 in file Annualaverage_MOPITTCO_nyg_modified.ncl</div></div><div><br clear="none"></div><div dir="ltr">Thank you</div><div dir="ltr"><br clear="none"></div><div dir="ltr">Najib</div><br clear="none"></div>
</div><div id="gmail-m_-8429674840683761420yiv1651076893gmail-m_3704361106871692057yahoo_quoted_3308247321">
<div style="font-family:Helvetica,Arial,sans-serif;font-size:13px;color:rgb(38,40,42)">
<div>
On Thursday, June 3, 2021, 04:31:56 AM GMT+1, Dennis Shea <<a rel="nofollow noopener noreferrer" shape="rect" href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>> wrote:
</div>
<div><br clear="none"></div>
<div><br clear="none"></div>
<div><div id="gmail-m_-8429674840683761420yiv1651076893gmail-m_3704361106871692057yiv0371527968"><div><div dir="ltr"><div>Rashad is correct. <br clear="none"></div><div><br clear="none"></div><div><div>Variable: cocol_retr_flip</div><span></span><div>Dimensions and sizes: [ncl_join | 12] x [XDim_MOP03 | 360] x [YDim_MOP03 | 180]</div><div>Coordinates:</div><div> XDim_MOP03: [-179.5..179.5] <=== these are longitudes<br clear="none"></div><div> YDim_MOP03: [ 0.5..359.5] <=== these are longitudes also <br clear="none"></div><div><br clear="none"></div><div>Both coordinate variables have ranges for longitudes. These values are not suitable for latitudes.</div><div><br clear="none"></div><div>Further, you have:</div><div> <br clear="none"></div><div><div>Variable: cocol_retr_flip</div><span></span><div>Dimensions and sizes: [ncl_join | 12] x [XDim_MOP03 | 360] x [YDim_MOP03 | 180]</div><div><br clear="none"></div><div>For comparison the model output, it should be [lat,lon]<br clear="none"></div><div> [ncl_join | 12] x [YDim_MOP03 | 180] x [XDim_MOP03 | 360]</div><div><br clear="none"></div>-----<div><br clear="none"></div></div><div><br clear="none"></div><div>I have one [old] MOP03 file the latitudes range from:<br clear="none"></div><div><br clear="none"></div><div>YDim_MOP03:: 89.5 ..-89.5 [North to south ordering]</div><div><br clear="none"></div><div>The variables do have ( XDim_MOP03, YDim_MOP03 ) ordering.</div><div><br clear="none"></div><div>This can be rectified by using NCL's named dimension reordering.</div><div><br clear="none"></div><div>After <b>addfiles</b>:</div><div> cocol_retr_flip := cocol_retr_flip(:,YDim_MOP03|:,XDim_MOP03|:) ; reorder to (12,lat,lon)</div><div> printVarSummary( cocol_retr_flip ) ; ***LOOK at this*** especially the ordering<br clear="none"></div><div>Now reorder from N->S to S->N<br clear="none"></div><div> cocol_retr_flip := cocol_retr_flip(:,::-1,:)</div><div> printVarSummary( cocol_retr_flip ) ; ***LOOK at this*** especially the latitude coordinates<br clear="none"></div><div>=========</div><div><br clear="none"></div><div>I suggest that you only work on the one MOP03 variable to workk out the ordering.</div><div><br clear="none"></div><div><br clear="none"></div><div><br clear="none"></div><div><br clear="none"></div><div><br clear="none"></div></div></div><br clear="none"><div id="gmail-m_-8429674840683761420yiv1651076893gmail-m_3704361106871692057yiv0371527968yqt11365"><div><div dir="ltr">On Wed, Jun 2, 2021 at 10:03 AM Rashed Mahmood <<a rel="nofollow noopener noreferrer" shape="rect" href="mailto:rashidcomsis@gmail.com" target="_blank">rashidcomsis@gmail.com</a>> wrote:<br clear="none"></div><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">But even if it is the case, then still the range in your: <span><span>XDim_MOP03: [-179.5..179.5], does not make sense for a latitude range. latitude range should be within -90 to 90. You need to look into your data to make sure it is read correctly. Also a suggestion, please reduce your script for debugging and test it with one input file.<br clear="none"></span></span></div><br clear="none"><div><div dir="ltr">On Wed, Jun 2, 2021 at 5:52 PM Najib Yusuf <<a rel="nofollow noopener noreferrer" shape="rect" href="mailto:najibgal@yahoo.com" target="_blank">najibgal@yahoo.com</a>> wrote:<br clear="none"></div><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div id="gmail-m_-8429674840683761420yiv1651076893gmail-m_3704361106871692057yiv0371527968gmail-m_120638456374024172gmail-m_-7708099357822680761yiv9140072311"><div id="gmail-m_-8429674840683761420yiv1651076893gmail-m_3704361106871692057yiv0371527968gmail-m_120638456374024172gmail-m_-7708099357822680761yMail_cursorElementTracker_1622649007222">No Rashed, could it be interchanged with longitude?<br clear="none"><br clear="none"><div id="gmail-m_-8429674840683761420yiv1651076893gmail-m_3704361106871692057yiv0371527968gmail-m_120638456374024172gmail-m_-7708099357822680761yiv9140072311ymail_android_signature"><a rel="nofollow noopener noreferrer" shape="rect" id="gmail-m_-8429674840683761420yiv1651076893gmail-m_3704361106871692057yiv0371527968gmail-m_120638456374024172gmail-m_-7708099357822680761yiv9140072311ymail_android_signature_link" href="https://go.onelink.me/107872968?pid=InProduct&c=Global_Internal_YGrowth_AndroidEmailSig__AndroidUsers&af_wl=ym&af_sub1=Internal&af_sub2=Global_YGrowth&af_sub3=EmailSignature" target="_blank">Sent from Yahoo Mail on Android</a></div> <br clear="none"> <div id="gmail-m_-8429674840683761420yiv1651076893gmail-m_3704361106871692057yiv0371527968gmail-m_120638456374024172gmail-m_-7708099357822680761yiv9140072311yqt05141"><blockquote style="margin:0px 0px 20px"> <div style="font-family:Roboto,sans-serif;color:rgb(109,0,246)"> <div>On Wed, 2 Jun 2021 at 16:32, Rashed Mahmood</div><div><<a rel="nofollow noopener noreferrer" shape="rect" href="mailto:rashidcomsis@gmail.com" target="_blank">rashidcomsis@gmail.com</a>> wrote:</div> </div> <div style="padding:10px 0px 0px 20px;margin:10px 0px 0px;border-left:1px solid rgb(109,0,246)"> <div id="gmail-m_-8429674840683761420yiv1651076893gmail-m_3704361106871692057yiv0371527968gmail-m_120638456374024172gmail-m_-7708099357822680761yiv9140072311"><div><div dir="ltr"><div>The latitude range from the variable summary looks strange:</div><div><span></span><div>Coordinates:</div><div> XDim_MOP03: [-179.5..179.5]</div><div> <span style="color:rgb(255,0,0)"><b>YDim_MOP03: [ 0.5..359.5]</b></span></div></div><div><div><span style="color:rgb(255,0,0)"><span style="color:rgb(0,0,0)">Do you know why latitudes are expanding from 0.5 to 359.5?</span><br clear="none"></span></div><div><span style="color:rgb(255,0,0)"><b></b></span></div></div></div><br clear="none"><div><div id="gmail-m_-8429674840683761420yiv1651076893gmail-m_3704361106871692057yiv0371527968gmail-m_120638456374024172gmail-m_-7708099357822680761yiv9140072311yqt47003"><div dir="ltr">On Wed, Jun 2, 2021 at 4:39 PM Najib Yusuf via ncl-talk <<a rel="nofollow noopener noreferrer" shape="rect" href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a>> wrote:<br clear="none"></div><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div style="font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:16px"><div></div>
<div dir="ltr">Dear Dennis,</div><div dir="ltr"><br clear="none"></div><div dir="ltr">Thank you for this quick response. I have effected the suggestion, the printVarSummary is:</div><div dir="ltr"><br clear="none"></div><div dir="ltr"><div><div>Variable: co_model</div><div>Type: float</div><div>Total Size: 148635648 bytes</div><div> 37158912 values</div><div>Number of Dimensions: 4</div><div>Dimensions and sizes: [time | 12] x [lev | 56] x [lat | 192] x [lon | 288]</div><div>Coordinates:</div><div> time: [ 31.. 365]</div><div> lev: [1.867879997007549..992.5000106104562]</div><div> lat: [ -90.. 90]</div><div> lon: [ 0..358.75]</div><div>Number Of Attributes: 4</div><div> mdims : 1</div><div> units : mol/mol</div><div> long_name : CO concentration</div><div> cell_methods : time: mean</div><div><br clear="none"></div><div>Variable: cocol_retr_flip</div><div>Type: float</div><div>Total Size: 3110400 bytes</div><div> 777600 values</div><div>Number of Dimensions: 3</div><div>Dimensions and sizes: [ncl_join | 12] x [XDim_MOP03 | 360] x [YDim_MOP03 | 180]</div><div>Coordinates:</div><div> XDim_MOP03: [-179.5..179.5]</div><div> YDim_MOP03: [ 0.5..359.5]</div><div id="gmail-m_-8429674840683761420yiv1651076893gmail-m_3704361106871692057yiv0371527968gmail-m_120638456374024172gmail-m_-7708099357822680761yiv9140072311yMail_cursorElementTracker_1622648969746">Number Of Attributes: 5</div><div id="gmail-m_-8429674840683761420yiv1651076893gmail-m_3704361106871692057yiv0371527968gmail-m_120638456374024172gmail-m_-7708099357822680761yiv9140072311yMail_cursorElementTracker_1622648879690"> long_name : Retrieved CO Total Column Day</div><div> units : mol/cm^2</div><div> _FillValue : -9999</div><div> projection : Geographic</div><div> lonFlip : longitude coordinate variable has been reordered via lonFlip</div><div><br clear="none"></div><div dir="ltr">However, when I run I get similar error:</div><div>fatal:NclOneDValGetClosestIndex: finish coordinate index out of range, can't continue</div><div>fatal:Could not obtain coordinate indexes, unable to perform subscript</div><div>fatal:["Execute.c":8637]:Execute: Error occurred at or near line 172 in file Annualaverage_MOPITTCO_nyg_modified.ncl</div><div><br clear="none"></div><div dir="ltr">I know you are busy, kindly spare some time to assist me look at the script as you use to.</div><div dir="ltr"><br clear="none"></div><div dir="ltr">Thank you sir.</div><div dir="ltr"><br clear="none"></div><div dir="ltr">Najib</div><div><br clear="none"></div></div><br clear="none"></div><div><br clear="none"></div>
</div><div id="gmail-m_-8429674840683761420yiv1651076893gmail-m_3704361106871692057yiv0371527968gmail-m_120638456374024172gmail-m_-7708099357822680761yiv9140072311gmail-m_8483689665148356502yahoo_quoted_2979222831">
<div style="font-family:Helvetica,Arial,sans-serif;font-size:13px;color:rgb(38,40,42)">
<div>
On Tuesday, June 1, 2021, 09:29:32 PM GMT+1, Dennis Shea <<a rel="nofollow noopener noreferrer" shape="rect" href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>> wrote:
</div>
<div><br clear="none"></div>
<div><br clear="none"></div>
<div><div id="gmail-m_-8429674840683761420yiv1651076893gmail-m_3704361106871692057yiv0371527968gmail-m_120638456374024172gmail-m_-7708099357822680761yiv9140072311gmail-m_8483689665148356502yiv5656186867"><div><div dir="ltr"><div>I don't have the time to look at your script right now.</div><div><br clear="none"></div><div>However, The lat/lon ranges are different.</div><div><br clear="none"></div><div>In particular the longitudes. Likely, you will have to make the longitudes both be (nominally) 0-to-360 or -180-to180</div><div>You can use <a rel="nofollow noopener noreferrer" shape="rect" href="http://www.ncl.ucar.edu/Document/Functions/Contributed/lonFlip.shtml" target="_blank"><b>lonFlip</b></a> to accomplish this.</div><div><br clear="none"></div><div>Variable: co_model</div>Dimensions and sizes: [time | 12] x [lev | 56] x [lat | 192] x [lon | 288]<br clear="none">Coordinates:<br clear="none"> time: [ 31.. 365]<br clear="none"> lev: [1.867879997007549..992.5000106104562]<br clear="none"><b> lat: [ -90.. 90]<br clear="none"> lon: [ 0..358.75</b>]<br clear="none"><br clear="none">Variable: cocol_retr<br clear="none">Dimensions and sizes: [ncl_join | 12] x [XDim_MOP03 | 360] x [YDim_MOP03 | 180]<br clear="none">Coordinates:<br clear="none"> <b> XDim_MOP03: [-179.5..179.5]<br clear="none"> YDim_MOP03: [-89.5..89.5]</b><br clear="none">~ <br clear="none"></div><br clear="none"><div><div id="gmail-m_-8429674840683761420yiv1651076893gmail-m_3704361106871692057yiv0371527968gmail-m_120638456374024172gmail-m_-7708099357822680761yiv9140072311gmail-m_8483689665148356502yiv5656186867yqt28029"><div dir="ltr">On Tue, Jun 1, 2021 at 5:17 AM Najib Yusuf via ncl-talk <<a rel="nofollow noopener noreferrer" shape="rect" href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a>> wrote:<br clear="none"></div><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div style="font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:16px"><div dir="ltr">Dear NCL users,</div><div dir="ltr"><br clear="none"></div><div dir="ltr">I am comparing CO from MOPITT satellite retrieval and model CAM output with averaging kernel been considered. I am having trouble synchronising the coordinates amd the error is: <div><div>fatal:NclOneDValGetClosestIndex: finish coordinate index out of range, can't continue</div><div>fatal:Could not obtain coordinate indexes, unable to perform subscript</div><div dir="ltr">fatal:["Execute.c":8637]:Execute: Error occurred at or near line 165 in file Annualaverage_MOPITTCO_nyg_modified.ncl ( under: <span> Collect equivalent profile)</span></div><div><br clear="none"></div></div><div dir="ltr">I look around NCL examples but couldn't figure out how to resolve the issue and get the plot.</div> Kindly assist to figure out the solution to this. The script <span>Annualaverage_MOPITTCO_nyg_modified.ncl and the run <span>CO_MOPITT_MODEL_Comparison_run are attached. </span></span></div><div dir="ltr"><span><span><br clear="none"></span></span></div><div dir="ltr"><span><span>Thank you for your support.</span></span></div></div></div>_______________________________________________<br clear="none">
ncl-talk mailing list<br clear="none">
<a rel="nofollow noopener noreferrer" shape="rect" href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a><br clear="none">
List instructions, subscriber options, unsubscribe:<br clear="none">
<a rel="nofollow noopener noreferrer" shape="rect" href="https://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">https://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></blockquote></div></div>
</div></div></div>
</div>
</div></div>_______________________________________________<br clear="none">
ncl-talk mailing list<br clear="none">
<a rel="nofollow noopener noreferrer" shape="rect" href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a><br clear="none">
List instructions, subscriber options, unsubscribe:<br clear="none">
<a rel="nofollow noopener noreferrer" shape="rect" href="https://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">https://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></blockquote></div></div>
</div></div> </div> </blockquote></div></div></div></blockquote></div>
</blockquote></div></div>
</div></div></div>
</div>
</div></div></blockquote></div></div>
</div></div></div>
</div>
</div></div></blockquote></div>