source: trunk/correc_angle.pro @ 6

Last change on this file since 6 was 2, checked in by pinsard, 18 years ago

initial import from /usr/work/fvi/OPA/geomag/

File size: 2.5 KB
Line 
1;------------------------------------------------------------
2;------------------------------------------------------------
3;------------------------------------------------------------
4;+
5; NAME: correc_angle.pro
6;
7; PURPOSE: Corrects angles for interpolated vectorial data.
8;          Applies a rotation of field from original geographic
9;          mesh to target curvilinear grid
10;
11; CATEGORY: Subroutine
12;
13; CALLING SEQUENCE: correc_angle, zresul_uu, zresul_uv, $
14;                    zresul_vv, zresul_vu, zresul_u, zresul_v
15;
16; INPUTS:
17;          zresul_uu : x-component of interpolated field at
18;                      u-point   
19;          zresul_uv : x-component of interpolated field at
20;                      v-point   
21;          zresul_vv : y-component of interpolated field at
22;                      v-point   
23;          zresul_vu : y-component of interpolated field at
24;                      u-point   
25;
26; KEYWORD PARAMETERS: None
27;
28; OUTPUTS:
29;          zresul_u : corrected x-component of interpolated
30;                     field at u-point
31;          zresul_v : corrected y-component of interpolated
32;                     field at v-point
33;
34; COMMON BLOCKS:
35;       common_interp.pro
36;
37; SIDE EFFECTS:
38;
39; RESTRICTIONS:
40;
41; EXAMPLE:
42;
43; MODIFICATION HISTORY: 11/99 A. Jouzeau
44;
45;-
46;------------------------------------------------------------
47;------------------------------------------------------------
48;------------------------------------------------------------
49PRO correc_angle, zresul_uu, zresul_uv, zresul_vv, zresul_vu, zresul_u, zresul_v
50@common_interp
51;
52; 1. Compute angles between grid lines and direction of the North
53; ===============================================================
54;
55printf, 40, ''
56printf, 40, 'calculating angles between geographic mesh and target grid'
57angle, lon_u, lat_u, lon_v, lat_v, lon_f, lat_f, gsinu, gsinv, gcosu, gcosv
58;
59; 2. Correct the two components of the field
60; ==========================================
61;
62printf, 40, ''
63printf, 40, 'rotating fields'
64; gcosu = reform(reform(temporary(gcosu), jpioce*jpjoce)#replicate(1, nstep), jpioce, jpjoce, nstep)
65; gcosv = reform(reform(temporary(gcosv), jpioce*jpjoce)#replicate(1, nstep), jpioce, jpjoce, nstep)
66; gsinu = reform(reform(temporary(gsinu), jpioce*jpjoce)#replicate(1, nstep), jpioce, jpjoce, nstep)
67; gsinv = reform(reform(temporary(gsinv), jpioce*jpjoce)#replicate(1, nstep), jpioce, jpjoce, nstep)
68zresul_u = zresul_uu*gcosu + zresul_vu*gsinu
69zresul_v = zresul_vv*gcosv - zresul_uv*gsinv
70;
71return
72END
Note: See TracBrowser for help on using the repository browser.