<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Thank you very much, Dennis.</div><div class=""><br class=""></div><div class="">I modified the script following your suggestion and it worked except for IPSL-CM5A-LR output.</div><div class=""><br class=""></div><div class="">The error message is the same:</div><div class="">“Assignment type mismatch, right hand side can't be coerced to type of left hand side” occurring at</div><div class="">var_regrid = ESMF_regrid(var,Opt)</div><div class=""><br class=""></div><div class="">Could you tell me what I miss?</div><div class=""><br class=""></div><div class="">Tomoko</div><div class=""><br class=""></div><div class="">+++++++++++++++++</div><div class="">+ Error message +</div><div class="">+++++++++++++++++</div><div class=""><br class=""></div><div class=""> Copyright (C) 1995-2015 - All Rights Reserved</div><div class=""> University Corporation for Atmospheric Research</div><div class=""> NCAR Command Language Version 6.3.0</div><div class=""> The use of this software is governed by a License Agreement.</div><div class=""> See <a href="http://www.ncl.ucar.edu/" class="">http://www.ncl.ucar.edu/</a> for more details.</div><div class=""><br class=""></div><div class="">Variable: var</div><div class="">Type: float</div><div class="">Total Size: 6176395680 bytes</div><div class=""> 1544098920 values</div><div class="">Number of Dimensions: 3</div><div class="">Dimensions and sizes:<span class="Apple-tab-span" style="white-space:pre"> </span>[time | 56940] x [j | 149] x [i | 182]</div><div class="">Coordinates: </div><div class=""> time: [ 0.5..56939.5]</div><div class=""> j: [1..149]</div><div class=""> i: [1..182]</div><div class="">Number Of Attributes: 13</div><div class=""> standard_name :<span class="Apple-tab-span" style="white-space:pre"> </span>sea_ice_area_fraction</div><div class=""> long_name :<span class="Apple-tab-span" style="white-space:pre"> </span>Sea Ice Area Fraction</div><div class=""> comment :<span class="Apple-tab-span" style="white-space:pre"> </span>fraction of grid cell covered by sea ice.</div><div class=""> units :<span class="Apple-tab-span" style="white-space:pre"> </span>%</div><div class=""> original_name :<span class="Apple-tab-span" style="white-space:pre"> </span>ileadfra</div><div class=""> original_units :<span class="Apple-tab-span" style="white-space:pre"> </span>1</div><div class=""> history :<span class="Apple-tab-span" style="white-space:pre"> </span>2011-07-03T20:18:11Z altered by CMOR: Converted units from '1' to '%'. 2011-07-03T20:18:11Z altered by CMOR: replaced missing value flag (9.96921e+36) with standard missing value (1e+20).</div><div class=""> cell_methods :<span class="Apple-tab-span" style="white-space:pre"> </span>time: mean (interval: 30 minutes)</div><div class=""> cell_measures :<span class="Apple-tab-span" style="white-space:pre"> </span>area: areacello</div><div class=""> missing_value :<span class="Apple-tab-span" style="white-space:pre"> </span>1e+20</div><div class=""> _FillValue :<span class="Apple-tab-span" style="white-space:pre"> </span>1e+20</div><div class=""> associated_files :<span class="Apple-tab-span" style="white-space:pre"> </span>baseURL: <a href="http://cmip-pcmdi.llnl.gov/CMIP5/dataLocation" class="">http://cmip-pcmdi.llnl.gov/CMIP5/dataLocation</a> gridspecFile: gridspec_seaIce_fx_IPSL-CM5A-LR_historical_r0i0p0.nc areacello: areacello_fx_IPSL-CM5A-LR_historical_r0i0p0.nc</div><div class=""> coordinates :<span class="Apple-tab-span" style="white-space:pre"> </span>lat lon</div><div class="">(0)<span class="Apple-tab-span" style="white-space:pre"> </span>get_src_grid_info: source lat dims = (149)</div><div class="">(0)<span class="Apple-tab-span" style="white-space:pre"> </span>get_src_grid_info: source lon dims = (182)</div><div class="">(0)<span class="Apple-tab-span" style="white-space:pre"> </span>get_src_grid_info: source grid type is 'rectilinear'</div><div class="">(0)<span class="Apple-tab-span" style="white-space:pre"> </span>curvilinear_to_SCRIP: calculating grid corners...</div><div class="">(0)<span class="Apple-tab-span" style="white-space:pre"> </span>curvilinear_to_SCRIP: one or more lat values are at the</div><div class="">(0)<span class="Apple-tab-span" style="white-space:pre"> </span> poles, so calculating grid corners using</div><div class="">(0)<span class="Apple-tab-span" style="white-space:pre"> </span> calc_SCRIP_corners_boundaries...</div><div class="">(0)<span class="Apple-tab-span" style="white-space:pre"> </span>calc_SCRIP_corners_boundaries</div><div class="">(0)<span class="Apple-tab-span" style="white-space:pre"> </span> min/max original lat: 1/149</div><div class="">(0)<span class="Apple-tab-span" style="white-space:pre"> </span> min/max original lon: 1/182</div><div class="">fatal:Assignment type mismatch, right hand side can't be coerced to type of left hand side</div><div class=""><br class=""></div><div class="">fatal:["Execute.c":8575]:Execute: Error occurred at or near line 770 in file $NCARG_ROOT/lib/ncarg/nclscripts/esmf/ESMF_regridding.ncl</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">fatal:["Execute.c":8575]:Execute: Error occurred at or near line 1744 in file $NCARG_ROOT/lib/ncarg/nclscripts/esmf/ESMF_regridding.ncl</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">fatal:["Execute.c":8575]:Execute: Error occurred at or near line 1822 in file $NCARG_ROOT/lib/ncarg/nclscripts/esmf/ESMF_regridding.ncl</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">fatal:["Execute.c":8575]:Execute: Error occurred at or near line 3851 in file $NCARG_ROOT/lib/ncarg/nclscripts/esmf/ESMF_regridding.ncl</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">fatal:["Execute.c":8575]:Execute: Error occurred at or near line 3983 in file $NCARG_ROOT/lib/ncarg/nclscripts/esmf/ESMF_regridding.ncl</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">fatal:["Execute.c":8573]:Execute: Error occurred at or near line 88</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">++++++++++</div><div class="">+ Script +</div><div class="">++++++++++</div><div class=""><br class=""></div><div class="">load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"</div><div class="">load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"</div><div class="">load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"</div><div class="">load "$NCARG_ROOT/lib/ncarg/nclscripts/esmf/ESMF_regridding.ncl"</div><div class=""><br class=""></div><div class="">method = "bilinear"</div><div class="">model = "IPSL-CM5A-LR"</div><div class=""><br class=""></div><div class="">rdiri = "/work/koyama_sice"</div><div class="">in_diri = "/home/koyama/CMIP5/data/input"</div><div class="">esmf_diri = in_diri + "/" + model</div><div class=""><br class=""></div><div class="">begin</div><div class=""> ; Source grid</div><div class=""> srcGridDiri = rdiri + "/" + model</div><div class=""> fili = systemfunc("cd " + srcGridDiri + " ; ls sic*.nc")</div><div class=""> nfil = dimsizes(fili)</div><div class=""><br class=""></div><div class=""> ; Destination grid</div><div class=""> dstGridDiri ="/home/koyama/CMIP5/data/grid_coord"</div><div class=""> dstFileName = "NRims180x180.nc"</div><div class=""> dstGridFili = dstGridDiri + "/" + dstFileName</div><div class=""> dfile = addfile(dstGridDiri + "/" + dstFileName, "r")</div><div class=""> lat2d = dfile->latitude</div><div class=""> lon2d = dfile->longitude</div><div class=""><br class=""></div><div class=""> do ifil = 0, nfil-1</div><div class=""> srcGridFili = fili(ifil) </div><div class=""> sfile = addfile(srcGridDiri + "/" + srcGridFili, "r")</div><div class=""> dSizes = getfiledimsizes(sfile)</div><div class=""> </div><div class=""> var = sfile->sic</div><div class=""> if (model.eq."CCSM4" .or. model.eq."NorESM1-M") then<span class="Apple-tab-span" style="white-space:pre"> </span>; See "get_src_grid_info"</div><div class=""> var@lat2d<span class="Apple-tab-span" style="white-space:pre"> </span>= sfile->lat<span class="Apple-tab-span" style="white-space:pre"> </span>; when lat dims is 2D,</div><div class=""> var@lon2d<span class="Apple-tab-span" style="white-space:pre"> </span>= sfile->lon<span class="Apple-tab-span" style="white-space:pre"> </span>; this if close is necessary</div><div class=""> end if<span class="Apple-tab-span" style="white-space:pre"> </span>; ref. ESFM regrid - example 24</div><div class=""><br class=""></div><div class=""> printVarSummary( var )</div><div class=""><br class=""></div><div class=""> lat1d = ndtooned(lat2d)</div><div class=""> lon1d = ndtooned(lon2d)</div><div class=""> lon1d = where(lon1d.lt.0,360.0+lon1d,lon1d)</div><div class=""> latlon_dims = dimsizes(lat2d) ; 180x180</div><div class=""> </div><div class=""> Opt = True</div><div class=""><br class=""></div><div class=""> Opt@ForceOverwrite = True</div><div class=""><br class=""></div><div class=""> Opt@SrcFileName = esmf_diri + "/" + model +"_SCRIP.nc" ; output file names</div><div class=""> Opt@DstFileName = esmf_diri + "/" + "EASE_ESMF.nc"</div><div class=""> Opt@WgtFileName = esmf_diri + "/" + model +"_2_EASE_"+method+".nc"</div><div class=""><br class=""></div><div class=""> Opt@SrcInputFileName = srcGridFili ; optional, but good idea</div><div class=""> Opt@DstInputFileName = dstGridFili</div><div class=""><br class=""></div><div class=""> Opt@SkipSrcGrid = False</div><div class=""> Opt@SkipDstGrid = False</div><div class=""> Opt@SkipWgtGen = False</div><div class=""> Opt@DstESMF = True</div><div class=""><br class=""></div><div class=""> Indexes = ind(.not.ismissing(lon1d)) </div><div class=""> Opt@DstGridType = "unstructured" ; Destination grid</div><div class=""> Opt@DstGridLat = lat1d(Indexes) ; Strip off missing data</div><div class=""> Opt@DstGridLon = lon1d(Indexes)</div><div class=""><br class=""></div><div class=""> Opt@RemapIndexes = True ; This is necessary to remap</div><div class=""> Opt@Indexes = Indexes ; regridded values back to </div><div class=""> Opt@IndexesDims = latlon_dims ; locations on destination grid</div><div class=""><br class=""></div><div class=""> Opt@InterpMethod = method</div><div class=""><br class=""></div><div class=""> Opt@Debug = True</div><div class=""> Opt@PrintTimings = True</div><div class=""><br class=""></div><div class=""> Opt@CopyVarCoords = False ; we can't copy the coords because</div><div class=""> ; the weights on the file are only</div><div class=""> ; for the non-missing lat/lon values.</div><div class=""><br class=""></div><div class=""> Opt@SrcGridMask = where(ismissing(var(0,:,:)),0,1)</div><div class=""><br class=""></div><div class=""> var_regrid = ESMF_regrid(var,Opt) ; Regrid var</div><div class=""><br class=""></div><div class=""> copy_VarAtts(var,var_regrid)</div><div class=""> var_regrid@_FillValue = 1.e+20</div><div class=""> var_regrid@missing_value = 1.e+20</div><div class=""> var_regrid@_FillValue = var@_FillValue</div><div class=""><br class=""></div><div class=""> var_regrid!0 = "time"</div><div class=""> var_regrid!1 = "i"</div><div class=""> var_regrid!2 = "j"</div><div class=""><br class=""></div><div class=""> if (model.eq."CCSM4") then</div><div class=""> time = ispan(1,dSizes(3),1)</div><div class=""> else</div><div class=""> time = ispan(1,dSizes(0),1)</div><div class=""> end if</div><div class=""> time!0 = "time"</div><div class=""> time@long_name = "time"</div><div class=""> time@units = "month"</div><div class=""> time&time = time</div><div class=""><br class=""></div><div class=""> var_regrid&time = time</div><div class=""> var_regrid&i = lat2d&i</div><div class=""> var_regrid&j = lat2d&j</div><div class=""><br class=""></div><div class=""> ;delete( var_regrid@lat1d )</div><div class=""> ;delete( var_regrid@lon1d )</div><div class=""> if ( isatt( var_regrid, "lat2d" ) ) then</div><div class=""> delete( var_regrid@lat2d )</div><div class=""> end if</div><div class=""> if ( isatt( var_regrid, "lon2d" ) ) then</div><div class=""> delete( var_regrid@lon2d )</div><div class=""> end if</div><div class=""><br class=""></div><div class="">;;----------------------------------------------------------------------</div><div class="">;; Write regridded data to file</div><div class="">;;----------------------------------------------------------------------</div><div class=""> str = str_split(srcGridFili, ".")</div><div class=""> filo = str(0) + ".rgrd.nc"</div><div class=""><br class=""></div><div class=""> if ( isfilepresent(srcGridDiri+"/"+filo) .eq. True ) then</div><div class=""> system( "rm " + filo )</div><div class=""> end if</div><div class=""><br class=""></div><div class=""> setfileoption("nc","Format","LargeFile")</div><div class=""> fo = addfile( srcGridDiri + "/" + filo,"c")</div><div class=""> fo->sic = var_regrid</div><div class=""> fo->lat = lat2d</div><div class=""> fo->lon = lon2d</div><div class=""><br class=""></div><div class=""> ;; Clean up</div><div class=""> delete( var )</div><div class=""> delete( time )</div><div class=""> delete( sfile )</div><div class=""> delete( Opt )</div><div class=""> delete( filo )</div><div class=""> delete( fo )</div><div class=""> delete( var_regrid )</div><div class=""><br class=""></div><div class=""> end do</div><div class=""><br class=""></div><div class=""> delete( dfile )</div><div class=""> delete( lat2d )</div><div class=""> delete( lon2d )</div><div class=""><br class=""></div><div class="">end</div><div class=""><br class=""></div><div class=""><br class=""></div><div><blockquote type="cite" class=""><div class="">On Nov 13, 2017, at 8:26 AM, Dennis Shea <<a href="mailto:shea@ucar.edu" class="">shea@ucar.edu</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class=""><div class="">See: <br class=""><a href="https://www.ncl.ucar.edu/Applications/ESMF.shtml" class="">https://www.ncl.ucar.edu/Applications/ESMF.shtml</a><br class=""></div>Example 24<br class=""><br class=""></div>Make appropriate changes: use 'bilinear' only<br class=""><div class=""><div class=""><br class="">Your source file has<br class=""><b class=""> coordinates : lat lon<br class=""><br class=""></b></div><div class="">replace<b class=""><br class=""></b><pre class=""> x@lat2d = sfile->TLAT
x@lon2d = sfile->TLONG<br class=""><br class=""></pre><pre class="">with <br class=""><br class=""> x@lat2d = sfile->lat
x@lon2d = sfile->lon</pre>Good luck<br class=""></div></div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Sun, Nov 12, 2017 at 2:13 PM, Tomoko Koyama <span dir="ltr" class=""><<a href="mailto:Tomoko.Koyama@colorado.edu" target="_blank" class="">Tomoko.Koyama@colorado.edu</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><div class="">Here’s what I can get with printVarSummary(var);</div><div class=""><br class=""></div><div class="">Variable: var</div><div class="">Type: float</div><div class="">Total Size: 3588096000 bytes</div><div class=""> 897024000 values</div><div class="">Number of Dimensions: 3</div><div class="">Dimensions and sizes: [time | 7300] x [j | 384] x [i | 320]</div><div class="">Coordinates:</div><div class=""> time: [719050.5..726349.5]</div><div class=""> j: [1..384]</div><div class=""> i: [1..320]</div><div class="">Number Of Attributes: 12</div><div class=""> standard_name : sea_ice_area_fraction</div><div class=""> long_name : Sea Ice Area Fraction</div><div class=""> comment : aice_d no change, CMIP5_table_comment: fraction of grid cell covered by sea ice.</div><div class=""> units : %</div><div class=""> original_name : aice_d</div><div class=""> cell_methods : time: mean (interval: 30 days)</div><div class=""> cell_measures : area: areacello</div><div class=""> history : 2014-09-29T18:12:07Z altered by CMOR: replaced missing value flag (1e+30) with standard missing value (1e+20).</div><div class=""> missing_value : 1e+20</div><div class=""> _FillValue : 1e+20</div><div class=""> associated_files : baseURL: <a href="http://cmip-pcmdi.llnl.gov/CMIP5/dataLocation" target="_blank" class="">http://cmip-pcmdi.llnl.gov/<wbr class="">CMIP5/dataLocation</a> gridspecFile: gridspec_seaIce_fx_CCSM4_<wbr class=""><a href="http://secure-web.cisco.com/1yCwSrw2YG46U8ckJsCmEFAmOAIgvR9BcggFxjdaRI5vRMFbCqGU2zNh0Xia-YOHgWeEUBwnsdMPrDBBYdSVo3nzBfkl4QIQmyK0niwjRIg3zpnluAI5PK4lIbhMVFHrj7zUA_xSp1SSDuiJTdQYhH6Fgc8TsdfnjWNQ8fpLfa-AU8Avh6nXboPIO7m_0XYJj1aV15QK_o5JAVI5LoDWvqbNiJersJuWFOxpCYQMjeLRLxcwrGmGWTB47dOYhdcJxkgNjKzL3Wqkk9XK2FnklJX0nxPXQf8Trv0HJu0hktwWUK8JKqpHROboONkDKzFv0MmFfIwzCT8_xGXglOlgrx8BeOZ7D-nwKjF10lh7Semd1XWsARasZ3xai1BIKDl-lFl1KV0tM5LHBgqYeihAze7TvWCrujoV5-bYWq5EehnMRFZ-9L3piibDzcBzeYafR/http%3A%2F%2Fhistorical_r0i0p0.nc" class="">historical_r0i0p0.nc</a> areacello: areacello_fx_CCSM4_historical_<wbr class=""><a href="http://secure-web.cisco.com/14ZCWlRncW_i1YOy3Yp1Q9P7Hqe9PfKa2yT6_03GLOp4VsLue11kVzLwOsYRyxQR0g0VHuI8Zf9RaQgt5_34knBeHVIZYD_P2M8NjAp8Z_TbE8kF0vDeSE7NNN6AyNJvMgs1YXEBfaugiKrdLbqZA6gjcl4UM3NWR19H98dOvUnG0QMJIXabYQTGEMEZ4rHBGzSje0oCZ719lTBnDY7yhEb9fDLtlMSOQgnNPdFHYGpaw6JyPlo7t-u7eJ-hR7cloVlGsMka_8ZIkegX7vF_VHBL55HtiX-IA5QxV2e2gjqcg57LY6j4J5104TsrzmFwFp7R7BcZqVDrAndaF5sUKPaF6LpR3bYIAlpWGkgOhsIfKfYmrrYhwBsgdXF2jMgrAjTq3ZPti8Y_9dq8LYPdve1yOOiTPDEY_c3qj8bUnI0FqZqptTU9te9RF4NZAY48m/http%3A%2F%2Fr0i0p0.nc" class="">r0i0p0.nc</a></div><div class=""> coordinates : lat lon</div><div class=""><br class=""></div><div class="">Thank you,</div><div class="">Tomoko</div><div class=""><div class="h5"><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><blockquote type="cite" class=""><div class="">On Nov 12, 2017, at 9:02 AM, music piano <<a href="mailto:musicpianoljy@gmail.com" target="_blank" class="">musicpianoljy@gmail.com</a>> wrote:</div><br class="m_3545818192545176747Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hi, Tomoko<div class=""><br class=""></div><div class="">Would you try to use printVarSummary(var) to see what type of the data is ? </div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Sat, Nov 11, 2017 at 10:50 PM, Tomoko Koyama <span dir="ltr" class=""><<a href="mailto:Tomoko.Koyama@colorado.edu" target="_blank" class="">Tomoko.Koyama@colorado.edu</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br class="">
<br class="">
I am trying to regrid Sea Ice Area Fraction and Sea Ice Thickness data from some CMIP5 daily data to EASE 100km grid.<br class="">
The following script works for Sea Level Pressure, Near-Surface Temperature, Geopotential Height etc. but not for those ice parameters.<br class="">
<br class="">
The error message is “Assignment type mismatch, right hand side can't be coerced to type of left hand side” occurring at regridding;<br class="">
var_regrid = ESMF_regrid(var,Opt)<br class="">
<br class="">
Does anyone see why this might be???<br class="">
<br class="">
Thank you in advance,<br class="">
Tomoko<br class="">
<br class="">
<br class="">
+++++++++++++++++<br class="">
+ Error message +<br class="">
+++++++++++++++++<br class="">
<br class="">
Copyright (C) 1995-2015 - All Rights Reserved<br class="">
University Corporation for Atmospheric Research<br class="">
NCAR Command Language Version 6.3.0<br class="">
The use of this software is governed by a License Agreement.<br class="">
See <a href="http://www.ncl.ucar.edu/" rel="noreferrer" target="_blank" class="">http://www.ncl.ucar.edu/</a> for more details.<br class="">
(0) get_src_grid_info: source lat dims = (384)<br class="">
(0) get_src_grid_info: source lon dims = (320)<br class="">
(0) get_src_grid_info: source grid type is 'rectilinear'<br class="">
(0) curvilinear_to_SCRIP: calculating grid corners...<br class="">
(0) curvilinear_to_SCRIP: one or more lat values are at the<br class="">
(0) poles, so calculating grid corners using<br class="">
(0) calc_SCRIP_corners_boundaries.<wbr class="">..<br class="">
(0) calc_SCRIP_corners_boundaries<br class="">
(0) min/max original lat: 1/384<br class="">
(0) min/max original lon: 1/320<br class="">
fatal:Assignment type mismatch, right hand side can't be coerced to type of left hand side<br class="">
^Mfatal:["Execute.c":8575]:Exe<wbr class="">cute: Error occurred at or near line 770 in file $NCARG_ROOT/lib/ncarg/nclscrip<wbr class="">ts/esmf/ESMF_regridding.ncl<br class="">
<br class="">
^Mfatal:["Execute.c":8575]:Exe<wbr class="">cute: Error occurred at or near line 1744 in file $NCARG_ROOT/lib/ncarg/nclscrip<wbr class="">ts/esmf/ESMF_regridding.ncl<br class="">
<br class="">
^Mfatal:["Execute.c":8575]:Exe<wbr class="">cute: Error occurred at or near line 1822 in file $NCARG_ROOT/lib/ncarg/nclscrip<wbr class="">ts/esmf/ESMF_regridding.ncl<br class="">
<br class="">
^Mfatal:["Execute.c":8575]:Exe<wbr class="">cute: Error occurred at or near line 3851 in file $NCARG_ROOT/lib/ncarg/nclscrip<wbr class="">ts/esmf/ESMF_regridding.ncl<br class="">
<br class="">
^Mfatal:["Execute.c":8575]:Exe<wbr class="">cute: Error occurred at or near line 3983 in file $NCARG_ROOT/lib/ncarg/nclscrip<wbr class="">ts/esmf/ESMF_regridding.ncl<br class="">
<br class="">
^Mfatal:["Execute.c":8573]:Exe<wbr class="">cute: Error occurred at or near line 86<br class="">
<br class="">
++++++++++<br class="">
+ Script +<br class="">
++++++++++<br class="">
<br class="">
load "$NCARG_ROOT/lib/ncarg/nclscri<wbr class="">pts/csm/gsn_code.ncl"<br class="">
load "$NCARG_ROOT/lib/ncarg/nclscri<wbr class="">pts/csm/gsn_csm.ncl"<br class="">
load "$NCARG_ROOT/lib/ncarg/nclscri<wbr class="">pts/csm/contributed.ncl"<br class="">
load "$NCARG_ROOT/lib/ncarg/nclscri<wbr class="">pts/esmf/ESMF_regridding.ncl"<br class="">
<br class="">
method = "bilinear"<br class="">
model = "CCSM4"<br class="">
gridtype = "latlon"<br class="">
<br class="">
rdiri = "/work/koyama_sice"<br class="">
in_diri = "/home/koyama/CMIP5/data/input<wbr class="">"<br class="">
esmf_diri = in_diri + "/" + model<br class="">
<br class="">
begin<br class="">
; Source grid<br class="">
srcGridDiri = rdiri + "/" + model<br class="">
fili = systemfunc("cd " + srcGridDiri + " ; ls sic*.nc")<br class="">
nfil = dimsizes(fili)<br class="">
<br class="">
; Destination grid<br class="">
dstGridDiri ="/home/koyama/CMIP5/data/grid<wbr class="">_coord"<br class="">
dstFileName = "NRims180x180.nc"<br class="">
dstGridFili = dstGridDiri + "/" + dstFileName<br class="">
dfile = addfile(dstGridDiri + "/" + dstFileName, "r")<br class="">
lat2d = dfile->latitude<br class="">
lon2d = dfile->longitude<br class="">
<br class="">
do ifil = 0, nfil-1<br class="">
srcGridFili = fili(ifil)<br class="">
sfile = addfile(srcGridDiri + "/" + srcGridFili, "r")<br class="">
dSizes = getfiledimsizes(sfile)<br class="">
var = sfile->sic<br class="">
<br class="">
lat1d = ndtooned(lat2d)<br class="">
lon1d = ndtooned(lon2d)<br class="">
lon1d = where(lon1d.lt.0,360.0+lon1d,l<wbr class="">on1d)<br class="">
latlon_dims = dimsizes(lat2d) ; 180x180<br class="">
<br class="">
Opt = True<br class="">
<br class="">
Opt@ForceOverwrite = True<br class="">
<br class="">
Opt@SrcFileName = esmf_diri + "/" + model +"_SCRIP.nc" ; output file names<br class="">
Opt@DstFileName = esmf_diri + "/" + "EASE_ESMF.nc"<br class="">
Opt@WgtFileName = esmf_diri + "/" + model +"_2_EASE_"+method+".nc"<br class="">
<br class="">
Opt@SrcInputFileName = srcGridFili ; optional, but good idea<br class="">
Opt@DstInputFileName = dstGridFili<br class="">
<br class="">
Opt@SkipSrcGrid = False<br class="">
Opt@SkipDstGrid = False<br class="">
Opt@SkipWgtGen = False<br class="">
Opt@DstESMF = True<br class="">
<br class="">
Indexes = ind(.not.ismissing(lon1d))<br class="">
Opt@DstGridType = "unstructured" ; Destination grid<br class="">
Opt@DstGridLat = lat1d(Indexes) ; Strip off missing data<br class="">
Opt@DstGridLon = lon1d(Indexes)<br class="">
<br class="">
Opt@RemapIndexes = True ; This is necessary to remap<br class="">
Opt@Indexes = Indexes ; regridded values back to<br class="">
Opt@IndexesDims = latlon_dims ; locations on destination grid<br class="">
<br class="">
Opt@InterpMethod = method<br class="">
<br class="">
Opt@Debug = True<br class="">
Opt@PrintTimings = True<br class="">
<br class="">
Opt@CopyVarCoords = False ; we can't copy the coords because<br class="">
; the weights on the file are only<br class="">
; for the non-missing lat/lon values.<br class="">
<br class="">
Opt@SrcGridMask = where(ismissing(var(0,:,:)),0,<wbr class="">1)<br class="">
<br class="">
var_regrid = ESMF_regrid(var,Opt) ; Regrid var<br class="">
<br class="">
copy_VarAtts(var,var_regrid)<br class="">
var_regrid@_FillValue = 1.e+20<br class="">
var_regrid@missing_value = 1.e+20<br class="">
var_regrid@_FillValue = var@_FillValue<br class="">
<br class="">
var_regrid!0 = "time"<br class="">
var_regrid!1 = "i"<br class="">
var_regrid!2 = "j"<br class="">
<br class="">
time = ispan(1,dSizes(3),1) ; CCSM4<br class="">
time!0 = "time"<br class="">
time@long_name = "time"<br class="">
time@units = "month"<br class="">
time&time = time<br class="">
<br class="">
var_regrid&time = time<br class="">
var_regrid&i = lat2d&i<br class="">
var_regrid&j = lat2d&j<br class="">
<br class="">
delete( var_regrid@lat1d )<br class="">
delete( var_regrid@lon1d )<br class="">
if ( isatt( var_regrid, "lat2d" ) ) then<br class="">
delete( var_regrid@lat2d )<br class="">
end if<br class="">
if ( isatt( var_regrid, "lon2d" ) ) then<br class="">
delete( var_regrid@lon2d )<br class="">
end if<br class="">
<br class="">
;;----------------------------<wbr class="">------------------------------<wbr class="">------------<br class="">
;; Write regridded data to file<br class="">
;;----------------------------<wbr class="">------------------------------<wbr class="">------------<br class="">
str = str_split(srcGridFili, ".")<br class="">
filo = str(0) + ".<a href="http://secure-web.cisco.com/1qp3lTKKuGOiRenNSV2mBVPtaoJvr4FX79fNvr1SHNiH45LiiRgo791rBK5WvVJ328_9O9negnRBCXH87H-TT4hFZFC1Jx2Gv7S--nVCvs6J0xREDrJzfEWPXiFW0ZsKtPsAQY3KT5kCR2tSWv9ApyU_7pLbFlMoQoVPcHXKt28S2KbzbcZLHQW2uwsMY_9X1pYYswOB1CkCT8ykYCmwxrzjA3upf-XiQssRxyO-Hcq3GROvwl6HS6cRm8ADD85jf4dqfHXti59WTN27GCubmYXCahfUApc1vwD37weD2iAORkRo21fwXdt2L5agRiKwr_942CeBi4j5MClyorMHhE3J-G1fR5XRcSN3wOaf09LYw2mDSo2Lv64Q-tgRyuNz5JQkuXP8nMW1nYnEeI56nyx4oAO94r5Pl1Wt9GdAME62yUUhdRJKL9xMorz0xxBS1/http%3A%2F%2Frgrd.nc" rel="noreferrer" target="_blank" class="">rgrd.nc</a>"<br class="">
<br class="">
if ( isfilepresent(srcGridDiri+"/"+<wbr class="">filo) .eq. True ) then<br class="">
system( "rm " + filo )<br class="">
end if<br class="">
<br class="">
setfileoption("nc","Format","L<wbr class="">argeFile")<br class="">
fo = addfile( srcGridDiri + "/" + filo,"c")<br class="">
fo->var = var_regrid<br class="">
fo->lat = lat2d<br class="">
fo->lon = lon2d<br class="">
<br class="">
;; Clean up<br class="">
delete( var )<br class="">
delete( sfile )<br class="">
delete( Opt )<br class="">
delete( filo )<br class="">
delete( fo )<br class="">
delete( var_regrid )<br class="">
<br class="">
end do<br class="">
<br class="">
delete( dfile )<br class="">
delete( lat2d )<br class="">
delete( lon2d )<br class="">
<br class="">
end<br class="">
<br class="">
<br class="">
______________________________<wbr class="">_________________<br class="">
ncl-talk mailing list<br class="">
<a href="mailto:ncl-talk@ucar.edu" target="_blank" class="">ncl-talk@ucar.edu</a><br class="">
List instructions, subscriber options, unsubscribe:<br class="">
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank" class="">http://mailman.ucar.edu/mailma<wbr class="">n/listinfo/ncl-talk</a><br class="">
</blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></div></div></div><br class="">______________________________<wbr class="">_________________<br class="">
ncl-talk mailing list<br class="">
<a href="mailto:ncl-talk@ucar.edu" class="">ncl-talk@ucar.edu</a><br class="">
List instructions, subscriber options, unsubscribe:<br class="">
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank" class="">http://mailman.ucar.edu/<wbr class="">mailman/listinfo/ncl-talk</a><br class="">
<br class=""></blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></body></html>