# Invalid Assignment Left-Hand Side

Cause: Using "toint" to convert a float or double value that is larger than (2^31-1) to an integer.Fix: Try using tolong, or use where to do something with these large values before converting them: x = (/2^19,2^20,2^30,2^31/) i = toint(x) ; triggers the warning ;---Solution 1: live with it; the last value will be set to the default int missing value print(i) ; last value is -2147483647 (integer missing) ;---Solution 2: use "tolong" l = tolong(x) print(l) ; last value is 2147483648, the correct value ;---Solution 3: convert large values to a smaller value, and perhaps set to missing [email protected]_Fill Value = -999 x = where((2^31-1),[email protected]_Fill Value,x) j = toint(x) print(j) ; This is effectively the same as solution #1, but ; no warnings are produced. Cause: Calling a function or procedure with the wrong argument type.It is important to note that variables do a string value, the fact that it previously had a numeric value is forgotten.

Fix: The value of the _Fill Value attribute must be the same (or lower) type as the variable you are attaching it to.

You can use one of the conversion functions, like toint, to force a lower type.

;---Using bad index subscripting x = random_uniform(-100,100,(/10,20,30/)) print(x(5,20,5)) ; index '20' is invalid ;---Using bad coordinate variable subscripting ntim = 5 nlat = 10 nlon = 20 y = random_uniform(0,.100,(/ntim,nlat,nlon/)) time = ispan(1,ntim,1) lat = fspan(-5,5,nlat) lon = fspan(10,30,nlon) y! Index subscript numbers start at 0 and go from left to right, so subscript "#1" refers to the second dimension from the left.

2 = "lon" y&time = time y&lat = lat y&lon = lon ys = y(:,,) ; range is invalid for "lat" coord var Cause: There are two possible causes: 1) subscripting an array using an index that is out-of-range of the size of your array, or 2) subscripting an array using coordinate values that are out-of-range of the coordinate variables.

Can someone help me figure out what is wrong with this code?