source: trunk/correc_angle.pro @ 48

Last change on this file since 48 was 48, checked in by pinsard, 10 years ago

fix thanks to coding rules

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