;+ ; ; NAME: correc_angle.pro ; ; PURPOSE: Corrects angles for interpolated vectorial data. ; Applies a rotation of field from original geographic ; mesh to target curvilinear grid ; ; CATEGORY: Subroutine ; ; CALLING SEQUENCE: correc_angle, zresul_uu, zresul_uv, $ ; zresul_vv, zresul_vu, zresul_u, zresul_v ; ; INPUTS: ; zresul_uu : x-component of interpolated field at ; u-point ; zresul_uv : x-component of interpolated field at ; v-point ; zresul_vv : y-component of interpolated field at ; v-point ; zresul_vu : y-component of interpolated field at ; u-point ; ; KEYWORD PARAMETERS: None ; ; OUTPUTS: ; zresul_u : corrected x-component of interpolated ; field at u-point ; zresul_v : corrected y-component of interpolated ; field at v-point ; ; COMMON BLOCKS: ; common_interp.pro ; ; SIDE EFFECTS: ; ; RESTRICTIONS: ; ; EXAMPLE: ; ; MODIFICATION HISTORY: 11/99 A. Jouzeau ; ;- ;------------------------------------------------------------ ;------------------------------------------------------------ ;------------------------------------------------------------ PRO correc_angle, zresul_uu, zresul_uv, zresul_vv, zresul_vu, zresul_u, zresul_v @common_interp ; ; 1. Compute angles between grid lines and direction of the North ; =============================================================== ; printf, 40, '' printf, 40, 'calculating angles between geographic mesh and target grid' angle, lon_u, lat_u, lon_v, lat_v, lon_f, lat_f, gsinu, gsinv, gcosu, gcosv ; ; 2. Correct the two components of the field ; ========================================== ; printf, 40, '' printf, 40, 'rotating fields' ; gcosu = reform(reform(temporary(gcosu), jpioce*jpjoce)#replicate(1, nstep), jpioce, jpjoce, nstep) ; gcosv = reform(reform(temporary(gcosv), jpioce*jpjoce)#replicate(1, nstep), jpioce, jpjoce, nstep) ; gsinu = reform(reform(temporary(gsinu), jpioce*jpjoce)#replicate(1, nstep), jpioce, jpjoce, nstep) ; gsinv = reform(reform(temporary(gsinv), jpioce*jpjoce)#replicate(1, nstep), jpioce, jpjoce, nstep) zresul_u = zresul_uu*gcosu + zresul_vu*gsinu zresul_v = zresul_vv*gcosv - zresul_uv*gsinv ; return END