source: trunk/naminterp.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: 6.6 KB
Line 
1;---------------------------------------------------
2; INTERPOLATION INITIALISATIONS                    *
3;---------------------------------------------------
4@common_interp
5;
6; 1. General information concerning the interpolation
7; ===================================================
8;
9;  1.1. Dimension of the field being interpolated (2D or 3D)
10;  ---------------------------------------------------------
11;   2D field --> ndim = 0
12;   3D field --> ndim = 1
13ndim = 0
14;   Case ndim = 0
15;   -if the field and mask are really 2D (x,y(,t)) then
16;      key_2d = 1
17;   -else if they are (x,y,z_a(,t)) where z_a=1 then
18;      key_2d = 0
19key_2d = 1
20;
21;  1.2. Nature of the field being interpolated (scalar ou vector)
22;  --------------------------------------------------------------
23;   scalar --> nscal = 0
24;   vector --> nscal = 1
25nscal = 0
26;nscal = 1
27;
28;  1.3. Type of interpolation needed (bilinear ou bicubic)
29;  -------------------------------------------------------
30;   bilinear --> ninterp = 0
31;   bicubic  --> ninterp = 1
32ninterp = 0
33;ninterp = 1
34;
35;  1.4. Mask on points
36;  -------------------
37;   key_mask = 1 if some points are masked
38;            = 0 if no masked points
39;
40key_mask = 0
41;
42;  1.5. Maximum iteration number for extrapolation
43;  -----------------------------------------------
44;
45nfil = 100
46;
47;  1.6. Frequency of drawing : every ndraw time iterations
48;  -------------------------
49;
50keydraw = 0 ; =0 if no drawing =1 else
51key_ps = 0  ; =0 if no Postscript file wanted =1 if PS wanted (implies keydraw=1)
52ndraw = 1
53nlevel = 33 ; every nlevel levels
54;
55; 2. Information about the data file
56; ==================================
57;
58;  2.1. Fields names
59;  -----------------
60; ... data
61IF keyword_set(nscal) THEN BEGIN
62   data_u_name = 'stress_x'
63   data_v_name = 'stress_y'
64ENDIF ELSE BEGIN
65;   data_name = 'cond_sed'
66   data_name = 'Br'
67
68ENDELSE
69; ... units
70units = "siemens"
71; ... input grid mask
72IF keyword_set(key_mask) THEN mask_name = 'tmask'
73; Input Latitude Axis
74IF keyword_set(nscal) THEN BEGIN
75   y_axis_u = 'nav_lat'
76   y_axis_v = 'nav_lat'
77ENDIF ELSE BEGIN
78   y_axis   = 'la'
79ENDELSE
80
81; ... input grid depth (3D field only)
82IF keyword_set(ndim) THEN BEGIN
83   datadept_name = 'deptht'
84;  ... location (ndep =1 if depth in data file, =0 if in mask file)
85   ndep = 1
86ENDIF
87; ... time
88time_name = 'lo'
89; ... output grid mask(s)
90IF keyword_set(nscal) THEN BEGIN
91   mask_u_name = 'umask'
92   mask_v_name = 'vmask'
93ENDIF ELSE BEGIN
94   mask_t_name = 'tmask'
95ENDELSE
96; ... output grid depth
97IF keyword_set(ndim) THEN outdept_name = 'gdept'
98; ... output grid coordinates
99IF keyword_set(nscal) THEN BEGIN
100   lon_u_name = 'glamu'
101   lat_u_name = 'gphiu'
102   lon_v_name = 'glamv'
103   lat_v_name = 'gphiv'
104   lon_f_name = 'glamf'
105   lat_f_name = 'gphif'
106ENDIF ELSE BEGIN
107   lon_name = 'nav_lon'
108   lat_name = 'nav_lat'
109ENDELSE
110; ... missing value
111;
112;     nmiss = 0 --> no missing value
113;     nmiss = 1 --> missing value of value missing_val
114;     CAUTION : missing_val stands for the ABSOLUTE VALUE of your
115;     input file missing value. Please enter missing_val LOWER THAN
116;     THE ABSOLUTE VALUE of the Missing value of your file.
117
118nmiss = 0
119missing_val = 85
120
121;
122;  2.2. Spatial resolution
123;  -----------------------
124;
125
126jpiatm = 360l      ; l for long integer PLEASE LEAVE IT
127jpjatm = 180l      ; l for long integer PLEASE LEAVE IT
128jpkatm = 1l       ; l for long integer PLEASE LEAVE IT
129dx = 1.            ; Grid size along x axis of the input regular grid
130south_lat = -89.5  ; Southernmost latitude of the input grid
131lon_shift= 180     ; Use lon_shift in order to have both input and output grid calculating longitudes the same way (-180 to 180, or, 0 to 360), this will avoid you a lot of problems
132west_lon = -179.5  ; Longitude at the left handside of the input grid, once lon_shift has been used
133north_pole = 1     ; Is the upper line of the domain at a latitude of +90 degrees, 1 = yes, 0 = no
134
135
136;
137;  2.3. Temporal resolution
138;  ------------------------
139;
140nit000 = 1                    ; first time step
141nitend = 1                   ; last time step
142nstep = nitend-nit000+1       ; number of steps
143;
144;  2.4. Pretreatment of input variables
145;  ------------------------------------
146;   data = data*scale_factor + add_offset
147;   when handling multiple files with scale_factor and
148;   add_offset defined, put key_vari=1 in case they change
149;   from one file to another
150;
151key_vari = 0
152scale_factor = 1.
153add_offset = 0.
154;
155;   if mask equal -1 on unmasked point --> negmask = 1
156;   if mask equal +1 on unmasked point --> negmask = 0
157;
158negmask = 0
159;
160;   latitudes from south to north  -->  reverse = 0
161;   latitudes from north to south  -->  reverse = 1
162;
163nreverse = 1
164;
165;   mask = 1 on OCEAN points  -->  invmask = 0
166;   mask = 1 on LAND  points  -->  invmask = 1
167;
168invmask = 0
169;
170;   No change on mask extension                 --> extend = 0
171;   Extend mask over one point on ocean points  --> extend = 1
172;   NB: ONLY 2D FIELDS ALLOWED
173;
174extend = 0
175;
176; 3. Information about the output grid
177; ====================================
178;
179; ... coordinates names
180;
181;   jpioce : number of longitude points
182;   jpjoce : number of latitude points
183;   jpkoce : number of vertical levels
184;
185jpioce = 182l ; l for long integer PLEASE LEAVE IT
186jpjoce = 149l ; l for long integer PLEASE LEAVE IT
187jpkoce = 1l  ; l for long integer PLEASE LEAVE IT
188pres_x=2.     ; Precision of the output grid along x axis
189pres_y=2.     ; Precision of the output grid along y axis
190ext_x=40      ; Number of extension point on the output grid to treat for E/W boundary conditions
191ext_y=40      ; Number of extension point on the output grid to treat for North fold boundary conditions;
192;   modlam --> 0 if all longitudes are lower than 360 degrees
193;          --> 1 if some longitudes are greater than 360 degrees
194;
195modlam = 0
196;
197; 4. Title(s) of output file(s)
198; =============================
199;
200IF keyword_set(nscal) THEN BEGIN
201   long_x_name = 'Zonal wind stress'
202   title_x = "Daily interpolated OMIP stress x wind on ORCA2 grid"
203   long_y_name = 'Meridional wind stress'
204   title_y = "Daily interpolated OMIP stress y wind on ORCA2 grid"
205ENDIF ELSE BEGIN
206   long_name = 'Salinity'
207   title = "Monthly Levitus Sea Salinity corrected"
208ENDELSE
209;
210key_performance = 0
211;
212printf, 40, ''
213printf, 40, 'Field''s dimension :'
214IF keyword_set(ndim)  THEN printf, 40, ' --> 3D' ELSE printf, 40, ' --> 2D'
215;
216IF keyword_set(nscal) THEN BEGIN
217   printf, 40, 'Interpolation of the vector array : '
218   printf, 40, ' --> ', '[', data_u_name, ',', data_v_name, ']'
219ENDIF ELSE BEGIN
220   printf, 40, 'Interpolation of the scalar array : '
221   printf, 40, ' --> ', data_name
222ENDELSE
223;
224printf, 40, 'Type of the interpolation :'
225IF keyword_set(ninterp) THEN printf, 40, ' --> bicubic' $
226                        ELSE printf, 40, ' --> bilinear'
227;
Note: See TracBrowser for help on using the repository browser.