begin ; Read in the data as an nlat*nlon x 3 array (not nlat x nlon x 3) nlat = 121 nlon = 320 data = asciiread("tst.csv",(/nlat*nlon,3/),"float") lat1d = data(::nlon,1) print(lat1d) ;lon1d = data(0:nlon-1,2) ;print(lon1d) ;temp1D = data(:,2) ; 1st create a 1d array ;temp2D = onedtond(temp1D,(/nlat,nlon/)) ; convert 1D array to a 2D array ;temp2D!0 = "lat" ;temp2D!1 = "lon" ; Assign coordinate variables ;temp2D&lat = lat1d ;temp2D&lon = lon1d ;temp2D&lat@units="degrees_north" ;temp2D&lon@units="degrees_east" ;range_only = temp2D ; trick to keep cv's and atts ;range_only = mask(temp2D,(temp2D.ge.0),True) end