<div dir="ltr"><div><div>Thank you Dennis! My problem is solved.<br></div><br></div><div>Just for information, I want to add that although ESMF conservative method does a better job here, however, it also expands values over islands (probably because my output grid is very coarse). This can be seen in attached file (without_land_mask_exp.pdf). Of course we can easily mask those values using landsea_mask function (as shown in attached file "land_mask_exp.pdf").<br></div><div>The script is also attached where these can be reproduced by specifying "landmask = True/False" <br><br></div><div>Rashed<br></div><div><br><br></div><div><br><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 28, 2017 at 9:37 PM, Dennis Shea <span dir="ltr"><<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div>No.<br><br>[1]<br></div><div>Look at your source variable. The 'cod' variable contains the cyclic points<br></div><br>Variable: cod<span class=""><br>Dimensions and sizes: [lat | 45] x [lon | 361]<br>Coordinates: <br> lat: [ 45.. 89]<br></span> lon: [-180.. 180] <==== Cyclic point<br><br>====<br></div>The cyclic point should be avoided.<br><br> cod = ifil->cod(:,{-180:179})<br> printVarSummary(cod)<br> printMinMax(cod,0)<br><br>Variable: cod<br>Dimensions and sizes: [lat | 45] x [lon | 360]<br>Coordinates: <br> lat: [ 45.. 89]<br> lon: [-180.. 179] <==== No Cyclic point<br><br>++++++++++++++++++++++++++++++<wbr>++++++++++<br><br>[2]<br></div>Again, look at your data ... the 'cod' variable contains missing values.<br></div>These must be flagged.<br><br> nmsg = num(ismissing(cod))<br> print("nmsg="+nmsg)<br> print("---------------")<br>...<br> if (nmsg.gt.0) then<br> opt@SrcMask2D = where(.not.ismissing(cod),1,0)<br> end if<br><br>++++++++++++++++++++++++++++++<wbr>++++++++<br><br></div>See attached<br><br>Variable: cod_conserve<br>Type: float<br>Total Size: 8192 bytes<br> 2048 values<br>Number of Dimensions: 2<br>Dimensions and sizes: [lat | 16] x [lon | 128]<br>Coordinates: <br> lat: [46.04472732543945..87.<wbr>86380004882812]<br> lon: [-180..177.1875]<span class=""><br>Number Of Attributes: 3<br> _FillValue : -999<br> remap : remapped via ESMF_regrid_with_weights: Bilinear<br> missing_value : -999<br></span>(0) min=0.274607 max=1.91372<br><br><div><div><div><br><br><div><br> <br></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Tue, Feb 28, 2017 at 6:45 PM, Rashed Mahmood <span dir="ltr"><<a href="mailto:rashidcomsis@gmail.com" target="_blank">rashidcomsis@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr">Sorry please ignore previous message; I think It can be done using ESMF regrid by using:<br> Opt@DstGridLon = LONT<br> Opt@DstGridLat = TLAT ;(Gaussian lats)<br> Opt@DstRegional = True<br></div><div class="m_1539455032074554130HOEnZb"><div class="m_1539455032074554130h5"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 28, 2017 at 5:26 PM, Rashed Mahmood <span dir="ltr"><<a href="mailto:rashidcomsis@gmail.com" target="_blank">rashidcomsis@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>Hi everyone,<br></div><br>My data is 1*1 degree resolution which is Not global (latitute span: 45N-89N) and I want to convert it into a Gaussian grid as below. I thought ESMF_regrid would be easy But I am not sure what to specify for attribute "Opt@DstGridType = "??????" for a Gaussian destination grid?<br></div><br></div>So I tried using area_conserve_remap as in following simple code:<br><br>begin<br> ifil = addfile("<a href="http://test_file.nc" target="_blank">test_file.nc</a>","r")<br> cod = ifil->cod<br> printVarSummary(cod)<br><br> NLATT = 64<br> MLONT = 2*NLATT<br> LATT = latGau(NLATT, "lat", "latitude" , "degrees_north")<br> LONT = fspan(-180,180,128)<br> TLAT = LATT({45:90})<br><br> opt = True<br> opt@NLATi = 178<br> opt@NALTo = NLATT<br> gcod = area_conserve_remap_Wrap (cod&lon, cod&lat, cod ,LONT, TLAT, opt)<br><br>end<br><br><div><br></div><div>However, I am getting error as below, which I understand is due not global lats but not sure how to fix it? The sample data file attached.<br><br>Copyright (C) 1995-2015 - All Rights Reserved<br> University Corporation for Atmospheric Research<br> NCAR Command Language Version 6.3.0<br> The use of this software is governed by a License Agreement.<br> See <a href="http://www.ncl.ucar.edu/" target="_blank">http://www.ncl.ucar.edu/</a> for more details.<br><br>Variable: cod<br>Type: float<br>Total Size: 64980 bytes<br> 16245 values<br>Number of Dimensions: 2<br>Dimensions and sizes: [lat | 45] x [lon | 361]<br>Coordinates: <br> lat: [ 45.. 89]<br> lon: [-180.. 180]<br>Number Of Attributes: 3<br> _FillValue : -999<br> remap : remapped via ESMF_regrid_with_weights: Bilinear<br> missing_value : -999<br><span style="background-color:rgb(255,255,255)"><span style="color:rgb(255,0,0)"> </span><span style="color:rgb(255,0,0)">Error in "cremapbin":<br> Could not map global lat array into grid array<br>Abort (core dumped)</span><br></span><br></div><div>any thoughts?<br><br><br><br></div><div>Thank you,<br></div><div>Rashed<br></div><div><br><br></div><div><br><br><br></div></div>
</blockquote></div><br></div>
</div></div><br></div></div>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<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/mailma<wbr>n/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>