source: trunk/naminterp.pro @ 2

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

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

File size: 6.7 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;
56; 2. Information about the data file
57; ==================================
58;
59;  2.1. Fields names
60;  -----------------
61; ... data
62IF keyword_set(nscal) THEN BEGIN
63   data_u_name = 'stress_x'
64   data_v_name = 'stress_y'
65ENDIF ELSE BEGIN
66;   data_name = 'cond_sed'
67   data_name = 'Br'
68
69ENDELSE
70; ... units
71units = "siemens"
72; ... input grid mask
73IF keyword_set(key_mask) THEN mask_name = 'tmask'
74; Input Latitude Axis
75IF keyword_set(nscal) THEN BEGIN
76   y_axis_u = 'nav_lat'
77   y_axis_v = 'nav_lat'
78ENDIF ELSE BEGIN
79   y_axis   = 'la'
80ENDELSE
81
82; ... input grid depth (3D field only)
83IF keyword_set(ndim) THEN BEGIN
84   datadept_name = 'deptht'
85;  ... location (ndep =1 if depth in data file, =0 if in mask file)
86   ndep = 1
87ENDIF
88; ... time
89time_name = 'lo'
90; ... output grid mask(s)
91IF keyword_set(nscal) THEN BEGIN
92   mask_u_name = 'umask'
93   mask_v_name = 'vmask'
94ENDIF ELSE BEGIN
95   mask_t_name = 'tmask'
96ENDELSE
97; ... output grid depth
98IF keyword_set(ndim) THEN outdept_name = 'gdept'
99; ... output grid coordinates
100IF keyword_set(nscal) THEN BEGIN
101   lon_u_name = 'glamu'
102   lat_u_name = 'gphiu'
103   lon_v_name = 'glamv'
104   lat_v_name = 'gphiv'
105   lon_f_name = 'glamf'
106   lat_f_name = 'gphif'
107ENDIF ELSE BEGIN
108   lon_name = 'nav_lon'
109   lat_name = 'nav_lat'
110ENDELSE
111; ... missing value
112;     
113;     nmiss = 0 --> no missing value
114;     nmiss = 1 --> missing value of value missing_val
115;     CAUTION : missing_val stands for the ABSOLUTE VALUE of your
116;     input file missing value. Please enter missing_val LOWER THAN
117;     THE ABSOLUTE VALUE of the Missing value of your file.
118
119nmiss = 0
120missing_val = 85
121
122;
123;  2.2. Spatial resolution
124;  -----------------------
125;
126
127jpiatm = 360l      ; l for long integer PLEASE LEAVE IT
128jpjatm = 180l      ; l for long integer PLEASE LEAVE IT
129jpkatm = 1l       ; l for long integer PLEASE LEAVE IT
130dx = 1.            ; Grid size along x axis of the input regular grid
131south_lat = -89.5  ; Southernmost latitude of the input grid
132lon_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
133west_lon = -179.5  ; Longitude at the left handside of the input grid, once lon_shift has been used
134north_pole = 1     ; Is the upper line of the domain at a latitude of +90 degrees, 1 = yes, 0 = no
135
136
137;
138;  2.3. Temporal resolution
139;  ------------------------
140;
141nit000 = 1                    ; first time step
142nitend = 1                   ; last time step
143nstep = nitend-nit000+1       ; number of steps
144;
145;  2.4. Pretreatment of input variables
146;  ------------------------------------
147;   data = data*scale_factor + add_offset
148;   when handling multiple files with scale_factor and
149;   add_offset defined, put key_vari=1 in case they change
150;   from one file to another
151;
152key_vari = 0
153scale_factor = 1.
154add_offset = 0.
155;
156;   if mask equal -1 on unmasked point --> negmask = 1
157;   if mask equal +1 on unmasked point --> negmask = 0
158;
159negmask = 0
160;
161;   latitudes from south to north  -->  reverse = 0
162;   latitudes from north to south  -->  reverse = 1
163;
164nreverse = 1
165;
166;   mask = 1 on OCEAN points  -->  invmask = 0
167;   mask = 1 on LAND  points  -->  invmask = 1
168;
169invmask = 0
170;
171;   No change on mask extension                 --> extend = 0
172;   Extend mask over one point on ocean points  --> extend = 1
173;   NB: ONLY 2D FIELDS ALLOWED
174;
175extend = 0
176;
177;
178; 3. Information about the output grid
179; ====================================
180;
181; ... coordinates names
182;
183;   jpioce : number of longitude points
184;   jpjoce : number of latitude points
185;   jpkoce : number of vertical levels
186;
187jpioce = 182l ; l for long integer PLEASE LEAVE IT
188jpjoce = 149l ; l for long integer PLEASE LEAVE IT
189jpkoce = 1l  ; l for long integer PLEASE LEAVE IT
190pres_x=2.     ; Precision of the output grid along x axis
191pres_y=2.     ; Precision of the output grid along y axis
192ext_x=40      ; Number of extension point on the output grid to treat for E/W boundary conditions
193ext_y=40      ; Number of extension point on the output grid to treat for North fold boundary conditions;   
194;   modlam --> 0 if all longitudes are lower than 360 degrees
195;          --> 1 if some longitudes are greater than 360 degrees
196;     
197modlam = 0
198;
199;
200; 4. Title(s) of output file(s)
201; =============================
202;
203IF keyword_set(nscal) THEN BEGIN
204   long_x_name = 'Zonal wind stress'
205   title_x = "Daily interpolated OMIP stress x wind on ORCA2 grid"
206   long_y_name = 'Meridional wind stress'
207   title_y = "Daily interpolated OMIP stress y wind on ORCA2 grid"
208ENDIF ELSE BEGIN
209   long_name = 'Salinity'
210   title = "Monthly Levitus Sea Salinity corrected"
211ENDELSE
212;
213key_performance = 0
214;
215printf, 40, ''
216printf, 40, 'Field''s dimension :'
217IF keyword_set(ndim)  THEN printf, 40, ' --> 3D' ELSE printf, 40, ' --> 2D'
218;
219IF keyword_set(nscal) THEN  BEGIN
220   printf, 40, 'Interpolation of the vector array : '
221   printf, 40, ' --> ', '[', data_u_name, ',', data_v_name, ']'
222ENDIF ELSE BEGIN
223   printf, 40, 'Interpolation of the scalar array : '
224   printf, 40, ' --> ', data_name
225ENDELSE
226;
227printf, 40, 'Type of the interpolation :'
228IF keyword_set(ninterp) THEN printf, 40, ' --> bicubic' $
229                        ELSE printf, 40, ' --> bilinear'
230;
Note: See TracBrowser for help on using the repository browser.