<blockquote class="ReferenceQuote" style="padding-left: 5px; margin-right: 0px; margin-left: 5px; border-left-color: rgb(182, 182, 182); border-left-width: 2px; border-left-style: solid;"><p><br></p>
<p>Hello,</p>
<p>I'm regridding AMSR-E L3 daily snow following the examples on NCL website <a href="http://www.ncl.ucar.edu/Applications/Scripts/ESMF_regrid_13.ncl" target="_blank">http://www.ncl.ucar.edu/Applications/Scripts/ESMF_regrid_13.ncl</a> and hdf website <a href="http://hdfeos.org/zoo/index_openNSIDC_Examples.php#AMSR_E" target="_blank">http://hdfeos.org/zoo/index_openNSIDC_Examples.php#AMSR_E</a>. </p>
<p>All is fine,but there are missing values along 90°E and 90°W after regridding while there are no missing values in original data along and near 90°E and 90°W 。</p>
<p>Followed is my script.</p>
<p>----------------------</p>
<p>----------------------</p>
<p>load "$NCARG_ROOT/lib/ncarg/nclscripts/esmf/ESMF_regridding.ncl"</p>
<p>begin<br>;-----read data<br>    srcFileName = "AMSR_E_L3_DailySnow_V09_20100311.hdf"                   ; Source file<br>    eos_file   = addfile(srcFileName + ".he2","r")<br>    lon2d       = eos_file->GridLon_Northern_Hemisphere<br>    lat2d       = eos_file->GridLat_Northern_Hemisphere<br>  ; Process NAN (1e51) fillValue for LAMAZ geolocation.<br>    lon2d=where(lon2d .gt. 1000, -999.0, lon2d)<br>    lat2d=where(lat2d .gt. 1000, -999.0, lat2d)<br>    <a href="mailto:lon2d@_FillValue" target="_blank">lon2d@_FillValue</a> = -999.0<br>    <a href="mailto:lat2d@_FillValue" target="_blank">lat2d@_FillValue</a> = -999.0</p>
<p><br>    hdf_file = addfile(srcFileName, "r")<br>  ; Read the dataset.<br>    hdf_data = hdf_file->SWE_NorthernDaily</p>
<p>  ; Filter out invalid range values.<br>  ; See "Table 2. Pixel Values ofr the SWE Feids" from [2].<br>    hdf_data = where(hdf_data .gt. 240, <a href="mailto:hdf_data@_FillValue" target="_blank">hdf_data@_FillValue</a>, hdf_data)</p>
<p>  ; Prepare data for plotting by converting type.<br>    swe2d = tofloat(hdf_data)<br>    <a href="mailto:swe2d@_FillValue" target="_blank">swe2d@_FillValue</a> = tofloat(<a href="mailto:hdf_data@_FillValue" target="_blank">hdf_data@_FillValue</a>)</p>
<p>  ; Multiply by two according to data spec [2].<br>    swe2d = 2 * swe2d</p>
<p>  ; You can get the description of data set from the data spec [2].<br>    <a href="mailto:swe2d@long_name" target="_blank">swe2d@long_name</a> = "Northern Hemisphere 5-day Snow Water Equivalent ~C~ (" + <a href="mailto:hdf_data@hdf_name" target="_blank">hdf_data@hdf_name</a> + ")"<br>    <a href="mailto:swe2d@units" target="_blank">swe2d@units</a> = "mm"<br>  ; Associate data with lat/lon.<br>    <a href="mailto:swe2d@lon2d" target="_blank">swe2d@lon2d</a> = lon2d<br>    <a href="mailto:swe2d@lat2d" target="_blank">swe2d@lat2d</a> = lat2d</p>
<p>;-----ESMF regridding<br>    Opt                   = True            ; Options for regridding</p>
<p>    <a href="mailto:Opt@SrcFileName" target="_blank">Opt@SrcFileName</a>       = "EASE_SCRIP.nc"  ; Output files<br>    <a href="mailto:Opt@DstFileName" target="_blank">Opt@DstFileName</a>       = "NH_SCRIP.nc"<br>    <a href="mailto:Opt@WgtFileName" target="_blank">Opt@WgtFileName</a>       = "EASE_2_NH_patch.nc"<br>    <a href="mailto:Opt@ForceOverwrite" target="_blank">Opt@ForceOverwrite</a>    = True<br>    <a href="mailto:Opt@SrcMask2D" target="_blank">Opt@SrcMask2D</a>         = where(ismissing(lat2d),0,1)<br>    <a href="mailto:Opt@SrcGridLat" target="_blank">Opt@SrcGridLat</a>        = lat2d<br>    <a href="mailto:Opt@SrcGridLon" target="_blank">Opt@SrcGridLon</a>        = lon2d</p>
<p>    <a href="mailto:Opt@DstGridType" target="_blank">Opt@DstGridType</a>       = "0.25deg"       ; Destination grid<br>    <a href="mailto:Opt@DstTitle" target="_blank">Opt@DstTitle</a>          = "Northern Hemisphere 0.25 resolution"<br>    <a href="mailto:Opt@DstLLCorner" target="_blank">Opt@DstLLCorner</a>       = (/ 0.25d,   0.25d/)<br>    <a href="mailto:Opt@DstURCorner" target="_blank">Opt@DstURCorner</a>       = (/89.75d, 179.75d/)</p>
<p>    <a href="mailto:Opt@InterpMethod" target="_blank">Opt@InterpMethod</a>      = "bilinear"   ; Careful! Patch method takes a long time</p>
<p>    <a href="mailto:Opt@Debug" target="_blank">Opt@Debug</a>           = True</p>
<p>    swe_regrid = ESMF_regrid(swe2d,Opt)    ; Regrid swe<br>    printVarSummary(swe_regrid)</p>
<p>;----------------------------------------------------------------------<br>; Plotting section<br>;----------------------------------------------------------------------<br>    wks = gsn_open_wks("x11","ESMF_regrid")     ; send graphics to PNG file</p>
<p>    res                     = True              ; Plot mods desired.<br>    <a href="mailto:res@gsnMaximize" target="_blank">res@gsnMaximize</a>         = True              ; Maximize plot</p>
<p>    <a href="mailto:res@gsnDraw" target="_blank">res@gsnDraw</a>             = False<br>    <a href="mailto:res@gsnFrame" target="_blank">res@gsnFrame</a>            = False</p>
<p>    <a href="mailto:res@cnFillOn" target="_blank">res@cnFillOn</a>            = True              ; color plot desired<br>    <a href="mailto:res@cnFillPalette" target="_blank">res@cnFillPalette</a>       = "amwg"            ; set color map<br>    <a href="mailto:res@cnLinesOn" target="_blank">res@cnLinesOn</a>           = False             ; turn off contour lines<br>    <a href="mailto:res@cnLineLabelsOn" target="_blank">res@cnLineLabelsOn</a>      = False             ; turn off contour labels<br>    <a href="mailto:res@cnFillMode" target="_blank">res@cnFillMode</a>          = "RasterFill"      ; turn raster on</p>
<p>    <a href="mailto:res@cnLevelSelectionMode" target="_blank">res@cnLevelSelectionMode</a>= "ExplicitLevels" ; set explicit contour levels<br>    <a href="mailto:res@cnLevels" target="_blank">res@cnLevels</a>            = (/-300,-250,-200,-150,-100,   \<br>                                0,1,5,10,25,100,200,300,400/)</p>
<p>    <a href="mailto:res@lbLabelBarOn" target="_blank">res@lbLabelBarOn</a>        = False              ; turn on in panel</p>
<p>    <a href="mailto:res@trGridType" target="_blank">res@trGridType</a>          = "TriangularMesh"   ; allow missing coordinates</p>
<p><br>    <a href="mailto:res@gsnPolar" target="_blank">res@gsnPolar</a>            = "NH"               ; specify the hemisphere<br>    <a href="mailto:res@mpMinLatF" target="_blank">res@mpMinLatF</a>           = 35</p>
<p>;---Plot original data.<br>    <a href="mailto:res@gsnAddCyclic" target="_blank">res@gsnAddCyclic</a> = False<br>    <a href="mailto:res@sfXArray" target="_blank">res@sfXArray</a>     = lon2d<br>    <a href="mailto:res@sfYArray" target="_blank">res@sfYArray</a>     = lat2d<br>    <a href="mailto:res@tiMainString" target="_blank">res@tiMainString</a> = "Original EASE grid (" + str_join(dimsizes(lat2d),",") + ")"<br>    <a href="mailto:res@trGridType" target="_blank">res@trGridType</a> = "TriangularMesh"<br>    <a href="mailto:res@cnFillMode" target="_blank">res@cnFillMode</a> = "RasterFill"</p>
<p>    plot_orig   = gsn_csm_contour_map_polar(wks,swe2d,res)</p>
<p>    delete(<a href="mailto:res@sfXArray" target="_blank">res@sfXArray</a>)<br>    delete(<a href="mailto:res@sfYArray" target="_blank">res@sfYArray</a>)</p>
<p>;---Plot regridded data.<br>    <a href="mailto:res@gsnAddCyclic" target="_blank">res@gsnAddCyclic</a> = True</p>
<p>    dims = tostring(dimsizes(swe_regrid))<br>    <a href="mailto:res@tiMainString" target="_blank">res@tiMainString</a> = "Regridded to 0.25 degree grid (" + \<br>                       str_join(dims," x ") + ")"</p>
<p>    plot_regrid = gsn_csm_contour_map_polar(wks,swe_regrid,res)</p>
<p>;---Compare the plots in a panel<br>    pres                    = True<br>    <a href="mailto:pres@gsnMaximize" target="_blank">pres@gsnMaximize</a>        = True<br>    <a href="mailto:pres@gsnPanelLabelBar" target="_blank">pres@gsnPanelLabelBar</a>   = True<br>    <a href="mailto:pres@lbLabelFontHeightF" target="_blank">pres@lbLabelFontHeightF</a> = 0.01<br>    <a href="mailto:pres@pmLabelBarWidthF" target="_blank">pres@pmLabelBarWidthF</a>   = 0.8</p>
<p>    gsn_panel(wks,(/plot_orig,plot_regrid/),(/1,2/),pres)<br>end</p>
<p>---------------------------</p>
<p>---------------------------</p>
<p>Any suggestions are appreciated! Thank you!</p>
<p>Best,</p>
<p>Qingyun</p><p><br></p></blockquote>