<div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Will,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Were there any other errors with this script?</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">The reason I ask is that it looks like your source grid is dimensioned 59 x 360 according to your printVarSummary statement, but the SrcGridLat says it is an array of 54 elements. I'm assuming that "var" is the variable you are regridding? If so, then you will need to make sure the lat/lon arrays are set to the same lat/lon arrays as "var". In fact, since "var" is a rectilinear grid and has lat/lon attached as coordinate arrays, you shouldn't need to set SrcGridLat or SrcGridLon at all.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I've attached a very simple example of regridding data that is on a rectilinear grid. You'll see that I'm not setting SrcGridLat/Lon at all. The data is attached too since it's small.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">--Mary</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Aug 19, 2018 at 6:53 PM, Will Hobbs <span dir="ltr"><<a href="mailto:will.hobbs@utas.edu.au" target="_blank">will.hobbs@utas.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 lang="EN-AU" link="#0563C1" vlink="#954F72">
<div class="m_2446855455457960263WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt">Hi all<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">I am using ESMF_regrid to regrid a number of different ocean models (some rectilinear, some not) onto a common lat/lon grid. To do this I explicitly set the SrcGridLat and SrcGridLon attributes, but sometimes
I get the following error message:<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><u></u> <u></u></span></p>
<p class="m_2446855455457960263p1"><span class="m_2446855455457960263s1">(0)</span><span class="m_2446855455457960263apple-tab-span"> </span><span class="m_2446855455457960263s1">get_src_grid_info: SrcGridType and/or SrcGridLat/SrcGridLon were not set.</span><u></u><u></u></p>
<p class="m_2446855455457960263p1"><span class="m_2446855455457960263s1">(0)</span><span class="m_2446855455457960263apple-tab-span"> </span><span class="m_2446855455457960263apple-converted-space">
</span><span class="m_2446855455457960263s1">Cannot determine the source grid type.</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">I’ve done a printVarSummary of both the variable to regrid and the ‘Opt’ (i.e. options variable – see below) and it’s clear that both attributes are there on the Opt file, just not being recognised by ESMF_regrid.
I can’t find any reason why they wouldn’t be. <u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Any ideas?<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Will<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><u></u> <u></u></span></p>
<p class="m_2446855455457960263p1"><span class="m_2446855455457960263s1">Variable: var</span><u></u><u></u></p>
<p class="m_2446855455457960263p1"><span class="m_2446855455457960263s1">Type: float</span><u></u><u></u></p>
<p class="m_2446855455457960263p1"><span class="m_2446855455457960263s1">Total Size: 4893696000 bytes</span><u></u><u></u></p>
<p class="m_2446855455457960263p1"><span class="m_2446855455457960263apple-converted-space"> </span><span class="m_2446855455457960263s1">1223424000 values</span><u></u><u></u></p>
<p class="m_2446855455457960263p1"><span class="m_2446855455457960263s1">Number of Dimensions: 4</span><u></u><u></u></p>
<p class="m_2446855455457960263p1"><span class="m_2446855455457960263s1">Dimensions and sizes:</span><span class="m_2446855455457960263apple-tab-span">
</span><span class="m_2446855455457960263s1">[time | 1920] x [lev | 30] x [lat | 59] x [lon | 360]</span><u></u><u></u></p>
<p class="m_2446855455457960263p1"><span class="m_2446855455457960263s1">Coordinates:</span><span class="m_2446855455457960263apple-converted-space"> </span><u></u><u></u></p>
<p class="m_2446855455457960263p1"><span class="m_2446855455457960263apple-converted-space"> </span><span class="m_2446855455457960263s1">time: [674900.5..733269.5]</span><u></u><u></u></p>
<p class="m_2446855455457960263p1"><span class="m_2446855455457960263apple-converted-space"> </span><span class="m_2446855455457960263s1">lev: [
</span><span class="m_2446855455457960263apple-converted-space"> </span><span class="m_2446855455457960263s1">5..5243.5966796875]</span><u></u><u></u></p>
<p class="m_2446855455457960263p1"><span class="m_2446855455457960263apple-converted-space"> </span><span class="m_2446855455457960263s1">lat: [-78.5..-20.5]</span><u></u><u></u></p>
<p class="m_2446855455457960263p1"><span class="m_2446855455457960263apple-converted-space"> </span><span class="m_2446855455457960263s1">lon: [ 0.5..359.5]</span><u></u><u></u></p>
<p class="m_2446855455457960263p1"><span class="m_2446855455457960263s1">Number Of Attributes: 9</span><u></u><u></u></p>
<p class="m_2446855455457960263p1"><span class="m_2446855455457960263apple-converted-space"> </span><span class="m_2446855455457960263s1">standard_name :</span><span class="m_2446855455457960263apple-tab-span">
</span><span class="m_2446855455457960263s1">sea_water_salinity</span><u></u><u></u></p>
<p class="m_2446855455457960263p1"><span class="m_2446855455457960263apple-converted-space"> </span><span class="m_2446855455457960263s1">long_name :</span><span class="m_2446855455457960263apple-tab-span">
</span><span class="m_2446855455457960263s1">Sea Water Salinity</span><u></u><u></u></p>
<p class="m_2446855455457960263p1"><span class="m_2446855455457960263apple-converted-space"> </span><span class="m_2446855455457960263s1">units :</span><span class="m_2446855455457960263apple-tab-span">
</span><span class="m_2446855455457960263s1">psu</span><u></u><u></u></p>
<p class="m_2446855455457960263p1"><span class="m_2446855455457960263apple-converted-space"> </span><span class="m_2446855455457960263s1">cell_methods :</span><span class="m_2446855455457960263apple-tab-span">
</span><span class="m_2446855455457960263s1">time: mean (interval: 60 seconds)</span><u></u><u></u></p>
<p class="m_2446855455457960263p1"><span class="m_2446855455457960263apple-converted-space"> </span><span class="m_2446855455457960263s1">cell_measures :</span><span class="m_2446855455457960263apple-tab-span">
</span><span class="m_2446855455457960263s1">area: areacello volume: volcello</span><u></u><u></u></p>
<p class="m_2446855455457960263p1"><span class="m_2446855455457960263apple-converted-space"> </span><span class="m_2446855455457960263s1">history :</span><span class="m_2446855455457960263apple-tab-span">
</span><span class="m_2446855455457960263s1">2011-12-26T07:02:13Z altered by CMOR: replaced missing value flag (1e+35) with standard missing value (1e+20). 2011-12-26T07:02:15Z altered by CMOR: Converted type from 'd' to 'f'. 2011-12-26T07:02:15Z altered by CMOR: Inverted axis:
lat.</span><u></u><u></u></p>
<p class="m_2446855455457960263p1"><span class="m_2446855455457960263apple-converted-space"> </span><span class="m_2446855455457960263s1">missing_value :</span><span class="m_2446855455457960263apple-tab-span">
</span><span class="m_2446855455457960263s1">1e+20</span><u></u><u></u></p>
<p class="m_2446855455457960263p1"><span class="m_2446855455457960263apple-converted-space"> </span><span class="m_2446855455457960263s1">_FillValue :</span><span class="m_2446855455457960263apple-tab-span">
</span><span class="m_2446855455457960263s1">1e+20</span><u></u><u></u></p>
<p class="m_2446855455457960263p1"><span class="m_2446855455457960263apple-converted-space"> </span><span class="m_2446855455457960263s1">associated_files :</span><span class="m_2446855455457960263apple-tab-span">
</span><span class="m_2446855455457960263s1">baseURL: <a href="http://cmip-pcmdi.llnl.gov/CMIP5/dataLocation" target="_blank">http://cmip-pcmdi.llnl.gov/<wbr>CMIP5/dataLocation</a> gridspecFile: gridspec_ocean_fx_FGOALS-g2_<wbr><a href="http://historical_r0i0p0.nc">historical_r0i0p0.nc</a> areacello: areacello_fx_FGOALS-g2_<wbr><a href="http://historical_r0i0p0.nc">historical_r0i0p0.nc</a> volcello: volcello_fx_FGOALS-g2_<wbr><a href="http://historical_r0i0p0.nc">historical_r0i0p0.nc</a></span><u></u><u></u></p>
<p class="m_2446855455457960263p2"><u></u> <u></u></p>
<p class="m_2446855455457960263p1"><span class="m_2446855455457960263s1">Variable: Opt</span><u></u><u></u></p>
<p class="m_2446855455457960263p1"><span class="m_2446855455457960263s1">Type: logical</span><u></u><u></u></p>
<p class="m_2446855455457960263p1"><span class="m_2446855455457960263s1">Total Size: 4 bytes</span><u></u><u></u></p>
<p class="m_2446855455457960263p1"><span class="m_2446855455457960263apple-converted-space"> </span><span class="m_2446855455457960263s1">1 values</span><u></u><u></u></p>
<p class="m_2446855455457960263p1"><span class="m_2446855455457960263s1">Number of Dimensions: 1</span><u></u><u></u></p>
<p class="m_2446855455457960263p1"><span class="m_2446855455457960263s1">Dimensions and sizes:</span><span class="m_2446855455457960263apple-tab-span">
</span><span class="m_2446855455457960263s1">[1]</span><u></u><u></u></p>
<p class="m_2446855455457960263p1"><span class="m_2446855455457960263s1">Coordinates:</span><span class="m_2446855455457960263apple-converted-space"> </span><u></u><u></u></p>
<p class="m_2446855455457960263p1"><span class="m_2446855455457960263s1">Number Of Attributes: 18</span><u></u><u></u></p>
<p class="m_2446855455457960263p1"><span class="m_2446855455457960263apple-converted-space"> </span><span class="m_2446855455457960263s1">WgtFileName :</span><span class="m_2446855455457960263apple-tab-span">
</span><span class="m_2446855455457960263s1">/g/data1/ua8/CMIP5_ocean_<wbr>processing/masks/FGOALS-g2/<wbr>FGOALS-g2_-80--25_1x1_level0_<wbr><a href="http://weights.nc">weights.nc</a></span><u></u><u></u></p>
<p class="m_2446855455457960263p1"><span class="m_2446855455457960263apple-converted-space"> </span><span class="m_2446855455457960263s1">SrcGridMask :</span><span class="m_2446855455457960263apple-tab-span">
</span><span class="m_2446855455457960263s1"><ARRAY of 21240 elements></span><u></u><u></u></p>
<p class="m_2446855455457960263p1"><span class="m_2446855455457960263apple-converted-space"> </span><span class="m_2446855455457960263s1">RemovePETLog :</span><span class="m_2446855455457960263apple-tab-span">
</span><span class="m_2446855455457960263s1">True</span><u></u><u></u></p>
<p class="m_2446855455457960263p1"><span class="m_2446855455457960263apple-converted-space"> </span><span class="m_2446855455457960263s1">RemoveWgtFile :</span><span class="m_2446855455457960263apple-tab-span">
</span><span class="m_2446855455457960263s1">False</span><span style="color:windowtext"><u></u><u></u></span></p>
<p class="m_2446855455457960263p1"><span class="m_2446855455457960263apple-converted-space"> </span><span class="m_2446855455457960263s1">RemoveDstFile :</span><span class="m_2446855455457960263apple-tab-span">
</span><span class="m_2446855455457960263s1">True</span><u></u><u></u></p>
<p class="m_2446855455457960263p1"><span class="m_2446855455457960263apple-converted-space"> </span><span class="m_2446855455457960263s1">RemoveSrcFile :</span><span class="m_2446855455457960263apple-tab-span">
</span><span class="m_2446855455457960263s1">True</span><u></u><u></u></p>
<p class="m_2446855455457960263p1"><span class="m_2446855455457960263apple-converted-space"> </span><span class="m_2446855455457960263s1">DstRegional :</span><span class="m_2446855455457960263apple-tab-span">
</span><span class="m_2446855455457960263s1">True</span><u></u><u></u></p>
<p class="m_2446855455457960263p1"><span class="m_2446855455457960263apple-converted-space"> </span><span class="m_2446855455457960263s1">DstURCorner :</span><span class="m_2446855455457960263apple-tab-span">
</span><span class="m_2446855455457960263s1">( -25, 359 )</span><u></u><u></u></p>
<p class="m_2446855455457960263p1"><span class="m_2446855455457960263apple-converted-space"> </span><span class="m_2446855455457960263s1">DstLLCorner :</span><span class="m_2446855455457960263apple-tab-span">
</span><span class="m_2446855455457960263s1">( -80,</span><span class="m_2446855455457960263apple-converted-space"> </span>
<span class="m_2446855455457960263s1">0 )</span><u></u><u></u></p>
<p class="m_2446855455457960263p1"><span class="m_2446855455457960263apple-converted-space"> </span><span class="m_2446855455457960263s1">DstGridLon :</span><span class="m_2446855455457960263apple-tab-span">
</span><span class="m_2446855455457960263s1"><ARRAY of 360 elements></span><u></u><u></u></p>
<p class="m_2446855455457960263p1"><span class="m_2446855455457960263apple-converted-space"> </span><span class="m_2446855455457960263s1">DstGridLat :</span><span class="m_2446855455457960263apple-tab-span">
</span><span class="m_2446855455457960263s1"><ARRAY of 56 elements></span><u></u><u></u></p>
<p class="m_2446855455457960263p1"><span class="m_2446855455457960263apple-converted-space"> </span><span class="m_2446855455457960263s1">SrcRegional :</span><span class="m_2446855455457960263apple-tab-span">
</span><span class="m_2446855455457960263s1">True</span><u></u><u></u></p>
<p class="m_2446855455457960263p1"><span class="m_2446855455457960263apple-converted-space"> </span><span class="m_2446855455457960263s1">SrcGridLon :</span><span class="m_2446855455457960263apple-tab-span">
</span><span class="m_2446855455457960263s1"><ARRAY of 360 elements></span><u></u><u></u></p>
<p class="m_2446855455457960263p1"><span class="m_2446855455457960263apple-converted-space"> </span><span class="m_2446855455457960263s1">SrcGridLat :</span><span class="m_2446855455457960263apple-tab-span">
</span><span class="m_2446855455457960263s1"><ARRAY of 54 elements></span><u></u><u></u></p>
<p class="m_2446855455457960263p1"><span class="m_2446855455457960263apple-converted-space"> </span><span class="m_2446855455457960263s1">ForceOverwrite :</span><span class="m_2446855455457960263apple-tab-span">
</span><span class="m_2446855455457960263s1">True</span><u></u><u></u></p>
<p class="m_2446855455457960263p1"><span class="m_2446855455457960263apple-converted-space"> </span><span class="m_2446855455457960263s1">InterpMethod :</span><span class="m_2446855455457960263apple-tab-span">
</span><span class="m_2446855455457960263s1">bilinear</span><u></u><u></u></p>
<p class="m_2446855455457960263p1"><span class="m_2446855455457960263apple-converted-space"> </span><span class="m_2446855455457960263s1">DstFileName :</span><span class="m_2446855455457960263apple-tab-span">
</span><span class="m_2446855455457960263s1"><a href="http://tmp2.nc" target="_blank">tmp2.nc</a></span><u></u><u></u></p>
<p class="m_2446855455457960263p1"><span class="m_2446855455457960263apple-converted-space"> </span><span class="m_2446855455457960263s1">SrcFileName :</span><span class="m_2446855455457960263apple-tab-span">
</span><span class="m_2446855455457960263s1"><a href="http://tmp1.nc" target="_blank">tmp1.nc</a></span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><u></u> <u></u></span></p>
</div>
<p style="font-size:10pt;line-height:10pt;font-family:Calibri,sans-serif"><br>
<br>
University of Tasmania Electronic Communications Policy (December, 2014). <br>
This email is confidential, and is for the intended recipient only. Access, disclosure, copying, distribution, or reliance on any of it by anyone outside the intended recipient organisation is prohibited and may be a criminal offence. Please delete if obtained
in error and email confirmation to the sender. The views expressed in this email are not necessarily the views of the University of Tasmania, unless clearly intended otherwise.
</p>
</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>