Changeset 282
- Timestamp:
- 09/12/07 17:43:11 (17 years ago)
- Location:
- trunk/SRC/Interpolation
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/Interpolation/compute_fromirr_bilinear_weigaddr.pro
r271 r282 216 216 , newcoord[0, 2], newcoord[1, 2] $ 217 217 , newcoord[0, 1], newcoord[1, 1] $ 218 , newcoord[0, 4], newcoord[1, 4] )218 , newcoord[0, 4], newcoord[1, 4], /double) 219 219 ENDIF ELSE BEGIN 220 220 xy = quadrilateral2square(xcell[0, ind], ycell[0, ind] $ 221 221 , xcell[1, ind], ycell[1, ind] $ 222 222 , xcell[2, ind], ycell[2, ind] $ 223 , xcell[3, ind], ycell[3, ind], xx, yy )223 , xcell[3, ind], ycell[3, ind], xx, yy, /double) 224 224 ENDELSE 225 225 ; take care of rounding errors... 226 zero = where(abs(xy) LT 1e- 4)227 IF zero[0] NE -1 THEN xy[zero] = 0 228 one = where(abs(1 -xy) LT 1e-4)229 IF one[0] NE -1 THEN xy[one] = 1 226 zero = where(abs(xy) LT 1e-6) 227 IF zero[0] NE -1 THEN xy[zero] = 0.d 228 one = where(abs(1.d - xy) LT 1e-6) 229 IF one[0] NE -1 THEN xy[one] = 1.d 230 230 ; some checks... 231 231 tmpmsk = omsk[celladdr[*, ind]] … … 249 249 END 250 250 ENDCASE 251 252 253 254 251 ENDIF ELSE foraddr[n] = -1 255 252 ENDIF ELSE foraddr[n] = -1 … … 289 286 ; mask the weight to suppress the corner located on land 290 287 newaweig = newaweig*((omsk)[newaaddr]) 291 totalweig = total(newaweig, 1)292 288 ; for cell with some land corner, 293 ; we have to redistribute the weight on the re aining water corners289 ; we have to redistribute the weight on the remaining water corners 294 290 ; weights normalization 295 totalweig = total(newaweig, 1) 296 IF min(totalweig, max = ma) EQ 0 then stop 297 IF ma GT 1 then stop 298 newaweig = newaweig/(replicate(1., 4)#totalweig) 299 totalweig = total(newaweig, 1) 300 291 totalweig = total(newaweig, 1, /double) 292 IF abs(min(totalweig, max = ma)) LT 1.e-6 then stop 293 IF abs(1.d - ma) GT 1.e-6 then stop 294 newaweig = newaweig/(replicate(1.d, 4)#totalweig) 301 295 ; weights 302 296 weig = dblarr(4, jpia*jpja) -
trunk/SRC/Interpolation/compute_fromreg_bilinear_weigaddr.pro
r238 r282 217 217 ENDIF 218 218 ; check totalweight = 1 219 totalweig = abs(1 -total(weig, 1))219 totalweig = abs(1.d - total(weig, 1, /double)) 220 220 IF (where(temporary(totalweig) GE 1.e-5))[0] NE -1 THEN stop 221 221 ; -
trunk/SRC/Interpolation/compute_fromreg_imoms3_weigaddr.pro
r262 r282 284 284 weig[15, short] = wx3 * wy3 285 285 ; 286 mi = min(total(weig[*, short], 1 ), max = ma)286 mi = min(total(weig[*, short], 1, /double), max = ma) 287 287 IF abs(mi-1) GE 1.e-6 THEN stop 288 288 IF abs(ma-1) GE 1.e-6 THEN stop … … 385 385 weig[7, short] = wx3 * wy2 386 386 ; 387 mi = min(total(weig[*, short], 1 ), max = ma)387 mi = min(total(weig[*, short], 1, /double), max = ma) 388 388 IF abs(mi-1) GE 1.e-6 THEN stop 389 389 IF abs(ma-1) GE 1.e-6 THEN stop … … 451 451 weig[3, short] = wx3 452 452 ; 453 mi = min(total(weig[*, short], 1 ), max = ma)453 mi = min(total(weig[*, short], 1, /double), max = ma) 454 454 IF abs(mi-1) GE 1.e-6 THEN stop 455 455 IF abs(ma-1) GE 1.e-6 THEN stop … … 517 517 weig[3, short] = wx3 518 518 ; 519 mi = min(total(weig[*, short], 1 ), max = ma)519 mi = min(total(weig[*, short], 1, /double), max = ma) 520 520 IF abs(mi-1) GE 1.e-6 THEN stop 521 521 IF abs(ma-1) GE 1.e-6 THEN stop -
trunk/SRC/Interpolation/quadrilateral2square.pro
r242 r282 38 38 ; Can be scalar or array. 39 39 ; 40 ; @keyword PERF 40 ; @keyword PERF {type=salar 0 or 1}{default=0} 41 ; activate to print the elapsed time spent within quadrilateral2square 42 ; 43 ; @keyword DOUBLE {type=salar 0 or 1}{default=0} 44 ; activate to perform double precision computation 41 45 ; 42 46 ; @returns … … 75 79 ;- 76 80 ; 77 FUNCTION quadrilateral2square, x0in, y0in, x1in, y1in, x2in, y2in, x3in, y3in, xxin, yyin, PERF = perf 81 FUNCTION quadrilateral2square, x0in, y0in, x1in, y1in, x2in, y2in, x3in, y3in, xxin, yyin, PERF = perf, DOUBLE = double 78 82 ; 79 83 compile_opt idl2, strictarrsubs … … 111 115 ; get the matrix A 112 116 ; 113 a = square2quadrilateral(x0in, y0in, x1in, y1in, x2in, y2in, x3in, y3in )117 a = square2quadrilateral(x0in, y0in, x1in, y1in, x2in, y2in, x3in, y3in, DOUBLE = double) 114 118 ; 115 119 ; compute the adjoint matrix -
trunk/SRC/Interpolation/square2quadrilateral.pro
r242 r282 29 29 ; 30 30 ; @param xxin {in}{optional} 31 ; first coordinates of the point(s) for which we want to do the mapping. 31 32 ; @param yyin {in}{optional} 32 ; the coordinates of the point(s) for which we want to do the mapping. 33 ; second coordinates of the point(s) for which we want to do the mapping. 34 ; 35 ; @keyword DOUBLE {type=salar 0 or 1}{default=0} 36 ; activate to perform double precision computation 33 37 ; 34 38 ; @returns … … 67 71 ;- 68 72 ; 69 FUNCTION square2quadrilateral, x0in, y0in, x1in, y1in, x2in, y2in, x3in, y3in, xxin, yyin 73 FUNCTION square2quadrilateral, x0in, y0in, x1in, y1in, x2in, y2in, x3in, y3in, xxin, yyin, DOUBLE = double 70 74 ; 71 75 ; Warning, wrong definition of (x2,y2) and (x3,y3) at the bottom of
Note: See TracChangeset
for help on using the changeset viewer.