<div dir="ltr"><div><div><div><div><div>NCL is a strongly typed language. It will not allow<br><br></div><div> i = f _d ; i= variable of type integer, f_d= variable of type float or double<br></div><div> <br></div><div>You would have to use a function (toint, totype, etc)<br>===== <br></div><div>Further, you did not indicate twhat line 195 is. Please use print statements and look at the 'type' on the left and right sides of the assignment statement.<br><br></div> x = ...<br></div> y = ...<br></div> printVarSummary(x)<br></div> printVarSummary(y)<br><br></div> y = ... x ... <line 195<br><br>=====================================================<br><div><div><div><div><div><br>hp1 = "/home/pknu/pknuicon/util/KOR_<wbr>adm/KOR_adm1.shp"<div><br></div><div> o = addfile("/home/pknu/pknuicon/<wbr>util/GLOBAL_FRLAND.nc","r")</div><div> oro = o->fr</div><div><br></div><div> a1 = addfile("./ensmean/icon_T2M_<wbr>2016SON_compare.grb","r")</div><div> i_data = a1->TMP_P1_L103_GLL0<br><br> i_temp = where(oro.gt.0.5, i_temp-273.16, i_temp@_FillValue)<br><br></div><div>; look at variable 'evolution'<br><br></div><div> printVarSummary(i_temp)</div><div> copy_VarCoords(i_data, i_temp)<br></div><div> printVarSummary(i_temp)<br></div><div> i_temp@long_name = i_data@long_name<br></div><div> i_temp@units = "degC"<br> printVarSummary(i_temp) </div><div><br></div><div> <br></div><div> do the same for g_temp ... *look* at variable types.<br><br></div><div>==An excellent tutorial=><br><br><a href="http://www.ncl.ucar.edu/Document/Manuals/">http://www.ncl.ucar.edu/Document/Manuals/</a><br><br></div><div>See the DKRZ tutorials<br></div><div><br></div></div></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Aug 31, 2016 at 5:07 AM, 김가은 <span dir="ltr"><<a href="mailto:gaeun.kim0921@gmail.com" target="_blank">gaeun.kim0921@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">Hi<div><br></div><div>I have been tried 'copy_VarCoords' several times and in this way it normally works. but this time I cannot!</div><div><br></div><div>below is ncl script I wrote:</div><div><div>begin</div><div> shp1 = "/home/pknu/pknuicon/util/KOR_<wbr>adm/KOR_adm1.shp"</div><div><br></div><div> o = addfile("/home/pknu/pknuicon/<wbr>util/GLOBAL_FRLAND.nc","r")</div><div> oro = o->fr(0,:,:)</div><div><br></div><div> a1 = addfile("./ensmean/icon_T2M_<wbr>2016SON_compare.grb","r")</div><div> i_data = a1->TMP_P1_L103_GLL0</div><div> time=a1->initial_time0_hours</div><div> lon=a1->lon_0</div><div> lat=a1->lat_0</div><div> nlon=dimsizes(lon)</div><div> nlat=dimsizes(lat)</div><div><br></div><div> lon@units="degrees_east"<br></div><div> lat@units="degrees_north"</div><div> i_data&lon_0=lon</div><div> i_data&lat_0=lat</div><div> i_data&initial_time0_hours=<wbr>time</div><div><br></div><div> i_temp = i_data</div><div><br></div><div> do n = 1, 3</div><div> i_temp(n-1,:,:) = i_data(n-1,:,:)</div><div> i_temp(n-1,:,:) = i_temp(n-1,:,:) - 273.16</div><div> i_temp(n-1,:,:) = where(oro.gt.0.5,i_temp(n-1,:,<wbr>:),i_temp@_FillValue)</div><div> end do</div><div><br></div><div> printVarSummary(i_temp)</div><div><br></div><div> b1 = addfile("./gme_out/gme_T2M_<wbr>2016SON_compare.grb","r")</div><div> g_data = b1->T_GDS0_HTGL</div><div><br></div><div> printVarSummary(g_data)</div><div> copy_VarCoords(i_temp, g_data)</div><div><br></div><div> g_temp = g_data</div><div><br></div><div> do n = 1, 3</div><div> g_temp(n-1,:,:) = g_data(n-1,:,:)</div><div> g_temp(n-1,:,:) = g_temp(n-1,:,:) - 273.16</div><div> g_temp(n-1,:,:) = where(oro.gt.0.5,g_temp(n-1,:,<wbr>:),g_temp@_FillValue)</div><div> end do</div><div><br></div><div> temp_diff = i_temp - g_temp</div><div> temp_diff@units = "degree C"</div></div><div><br></div><div><br></div><div>and I keep getting this error message:</div><div><br></div><div><div>Variable: i_data</div><div>Type: float</div><div>Total Size: 4870800 bytes</div><div> 1217700 values</div><div>Number of Dimensions: 3</div><div>Dimensions and sizes:<span style="white-space:pre-wrap">        </span>[initial_time0_hours | 3] x [lat_0 | 451] x [lon_0 | 900]</div><div>Coordinates: </div><div> initial_time0_hours: [1899264..1900728]</div><div> lat_0: [-90..90]</div><div> lon_0: [ 0..359.6]</div><div>Number Of Attributes: 12</div><div> center :<span style="white-space:pre-wrap">        </span>Offenbach (RSMC)</div><div> production_status :<span style="white-space:pre-wrap">        </span>Operational products</div><div> long_name :<span style="white-space:pre-wrap">        </span>Temperature</div><div> units :<span style="white-space:pre-wrap">        </span>K</div><div> _FillValue :<span style="white-space:pre-wrap">        </span>1e+20</div><div> grid_type :<span style="white-space:pre-wrap">        </span>Latitude/longitude</div><div> parameter_discipline_and_<wbr>category :<span style="white-space:pre-wrap">        </span>Meteorological products, Temperature</div><div> parameter_template_discipline_<wbr>category_number :<span style="white-space:pre-wrap">        </span>( 1, 0, 0, 0 )</div><div> level_type :<span style="white-space:pre-wrap">        </span>Specified height level above ground (m)</div><div> level :<span style="white-space:pre-wrap">        </span> 2</div><div> forecast_time :<span style="white-space:pre-wrap">        </span>0</div><div> forecast_time_units :<span style="white-space:pre-wrap">        </span>hours</div><div><br></div><div>Variable: g_data</div><div>Type: float</div><div>Total Size: 4870800 bytes</div><div> 1217700 values</div><div>Number of Dimensions: 3</div><div>Dimensions and sizes:<span style="white-space:pre-wrap">        </span>[forecast_time0 | 3] x [g0_lat_1 | 451] x [g0_lon_2 | 900]</div><div>Coordinates: </div><div> forecast_time0: [1008..2472]</div><div> g0_lat_1: [-90..90]</div><div> g0_lon_2: [ 0..359.6]</div><div>Number Of Attributes: 10</div><div> center :<span style="white-space:pre-wrap">        </span>Offenbach (RSMC)</div><div> long_name :<span style="white-space:pre-wrap">        </span>temperature</div><div> units :<span style="white-space:pre-wrap">        </span>K</div><div> _FillValue :<span style="white-space:pre-wrap">        </span>1e+20</div><div> level_indicator :<span style="white-space:pre-wrap">        </span>105</div><div> gds_grid_type :<span style="white-space:pre-wrap">        </span>0</div><div> parameter_table_version :<span style="white-space:pre-wrap">        </span>2</div><div> parameter_number :<span style="white-space:pre-wrap">        </span>11</div><div> level :<span style="white-space:pre-wrap">        </span>2</div><div> initial_time :<span style="white-space:pre-wrap">        </span>07/21/2016 (00:00)</div><div>fatal:["NclVar.c":1382]:<wbr>Assignment type mismatch, right hand side can't be coerced to type of left hand side</div><div>fatal:["Execute.c":8128]:<wbr>Execute: Error occurred at or near line 195 in file $NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/contributed.ncl</div><div><br></div><div>fatal:["Execute.c":8128]:<wbr>Execute: Error occurred at or near line 40 in file 6.compare_monthly.ncl</div></div><div><br></div><div>thanks for your help! </div><div><br></div><div>Gaeun</div></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>