[2] | 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 |
---|
| 13 | ndim = 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 |
---|
| 19 | key_2d = 1 |
---|
| 20 | ; |
---|
| 21 | ; 1.2. Nature of the field being interpolated (scalar ou vector) |
---|
| 22 | ; -------------------------------------------------------------- |
---|
| 23 | ; scalar --> nscal = 0 |
---|
| 24 | ; vector --> nscal = 1 |
---|
| 25 | nscal = 0 |
---|
| 26 | ;nscal = 1 |
---|
| 27 | ; |
---|
| 28 | ; 1.3. Type of interpolation needed (bilinear ou bicubic) |
---|
| 29 | ; ------------------------------------------------------- |
---|
| 30 | ; bilinear --> ninterp = 0 |
---|
| 31 | ; bicubic --> ninterp = 1 |
---|
| 32 | ninterp = 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 | ; |
---|
| 40 | key_mask = 0 |
---|
| 41 | ; |
---|
| 42 | ; 1.5. Maximum iteration number for extrapolation |
---|
| 43 | ; ----------------------------------------------- |
---|
| 44 | ; |
---|
| 45 | nfil = 100 |
---|
| 46 | ; |
---|
| 47 | ; 1.6. Frequency of drawing : every ndraw time iterations |
---|
| 48 | ; ------------------------- |
---|
| 49 | ; |
---|
| 50 | keydraw = 0 ; =0 if no drawing =1 else |
---|
| 51 | key_ps = 0 ; =0 if no Postscript file wanted =1 if PS wanted (implies keydraw=1) |
---|
| 52 | ndraw = 1 |
---|
| 53 | nlevel = 33 ; every nlevel levels |
---|
| 54 | ; |
---|
| 55 | ; |
---|
| 56 | ; 2. Information about the data file |
---|
| 57 | ; ================================== |
---|
| 58 | ; |
---|
| 59 | ; 2.1. Fields names |
---|
| 60 | ; ----------------- |
---|
| 61 | ; ... data |
---|
| 62 | IF keyword_set(nscal) THEN BEGIN |
---|
| 63 | data_u_name = 'stress_x' |
---|
| 64 | data_v_name = 'stress_y' |
---|
| 65 | ENDIF ELSE BEGIN |
---|
| 66 | ; data_name = 'cond_sed' |
---|
| 67 | data_name = 'Br' |
---|
| 68 | |
---|
| 69 | ENDELSE |
---|
| 70 | ; ... units |
---|
| 71 | units = "siemens" |
---|
| 72 | ; ... input grid mask |
---|
| 73 | IF keyword_set(key_mask) THEN mask_name = 'tmask' |
---|
| 74 | ; Input Latitude Axis |
---|
| 75 | IF keyword_set(nscal) THEN BEGIN |
---|
| 76 | y_axis_u = 'nav_lat' |
---|
| 77 | y_axis_v = 'nav_lat' |
---|
| 78 | ENDIF ELSE BEGIN |
---|
| 79 | y_axis = 'la' |
---|
| 80 | ENDELSE |
---|
| 81 | |
---|
| 82 | ; ... input grid depth (3D field only) |
---|
| 83 | IF 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 |
---|
| 87 | ENDIF |
---|
| 88 | ; ... time |
---|
| 89 | time_name = 'lo' |
---|
| 90 | ; ... output grid mask(s) |
---|
| 91 | IF keyword_set(nscal) THEN BEGIN |
---|
| 92 | mask_u_name = 'umask' |
---|
| 93 | mask_v_name = 'vmask' |
---|
| 94 | ENDIF ELSE BEGIN |
---|
| 95 | mask_t_name = 'tmask' |
---|
| 96 | ENDELSE |
---|
| 97 | ; ... output grid depth |
---|
| 98 | IF keyword_set(ndim) THEN outdept_name = 'gdept' |
---|
| 99 | ; ... output grid coordinates |
---|
| 100 | IF 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' |
---|
| 107 | ENDIF ELSE BEGIN |
---|
| 108 | lon_name = 'nav_lon' |
---|
| 109 | lat_name = 'nav_lat' |
---|
| 110 | ENDELSE |
---|
| 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 | |
---|
| 119 | nmiss = 0 |
---|
| 120 | missing_val = 85 |
---|
| 121 | |
---|
| 122 | ; |
---|
| 123 | ; 2.2. Spatial resolution |
---|
| 124 | ; ----------------------- |
---|
| 125 | ; |
---|
| 126 | |
---|
| 127 | jpiatm = 360l ; l for long integer PLEASE LEAVE IT |
---|
| 128 | jpjatm = 180l ; l for long integer PLEASE LEAVE IT |
---|
| 129 | jpkatm = 1l ; l for long integer PLEASE LEAVE IT |
---|
| 130 | dx = 1. ; Grid size along x axis of the input regular grid |
---|
| 131 | south_lat = -89.5 ; Southernmost latitude of the input grid |
---|
| 132 | lon_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 |
---|
| 133 | west_lon = -179.5 ; Longitude at the left handside of the input grid, once lon_shift has been used |
---|
| 134 | north_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 | ; |
---|
| 141 | nit000 = 1 ; first time step |
---|
| 142 | nitend = 1 ; last time step |
---|
| 143 | nstep = 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 | ; |
---|
| 152 | key_vari = 0 |
---|
| 153 | scale_factor = 1. |
---|
| 154 | add_offset = 0. |
---|
| 155 | ; |
---|
| 156 | ; if mask equal -1 on unmasked point --> negmask = 1 |
---|
| 157 | ; if mask equal +1 on unmasked point --> negmask = 0 |
---|
| 158 | ; |
---|
| 159 | negmask = 0 |
---|
| 160 | ; |
---|
| 161 | ; latitudes from south to north --> reverse = 0 |
---|
| 162 | ; latitudes from north to south --> reverse = 1 |
---|
| 163 | ; |
---|
| 164 | nreverse = 1 |
---|
| 165 | ; |
---|
| 166 | ; mask = 1 on OCEAN points --> invmask = 0 |
---|
| 167 | ; mask = 1 on LAND points --> invmask = 1 |
---|
| 168 | ; |
---|
| 169 | invmask = 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 | ; |
---|
| 175 | extend = 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 | ; |
---|
| 187 | jpioce = 182l ; l for long integer PLEASE LEAVE IT |
---|
| 188 | jpjoce = 149l ; l for long integer PLEASE LEAVE IT |
---|
| 189 | jpkoce = 1l ; l for long integer PLEASE LEAVE IT |
---|
| 190 | pres_x=2. ; Precision of the output grid along x axis |
---|
| 191 | pres_y=2. ; Precision of the output grid along y axis |
---|
| 192 | ext_x=40 ; Number of extension point on the output grid to treat for E/W boundary conditions |
---|
| 193 | ext_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 | ; |
---|
| 197 | modlam = 0 |
---|
| 198 | ; |
---|
| 199 | ; |
---|
| 200 | ; 4. Title(s) of output file(s) |
---|
| 201 | ; ============================= |
---|
| 202 | ; |
---|
| 203 | IF 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" |
---|
| 208 | ENDIF ELSE BEGIN |
---|
| 209 | long_name = 'Salinity' |
---|
| 210 | title = "Monthly Levitus Sea Salinity corrected" |
---|
| 211 | ENDELSE |
---|
| 212 | ; |
---|
| 213 | key_performance = 0 |
---|
| 214 | ; |
---|
| 215 | printf, 40, '' |
---|
| 216 | printf, 40, 'Field''s dimension :' |
---|
| 217 | IF keyword_set(ndim) THEN printf, 40, ' --> 3D' ELSE printf, 40, ' --> 2D' |
---|
| 218 | ; |
---|
| 219 | IF keyword_set(nscal) THEN BEGIN |
---|
| 220 | printf, 40, 'Interpolation of the vector array : ' |
---|
| 221 | printf, 40, ' --> ', '[', data_u_name, ',', data_v_name, ']' |
---|
| 222 | ENDIF ELSE BEGIN |
---|
| 223 | printf, 40, 'Interpolation of the scalar array : ' |
---|
| 224 | printf, 40, ' --> ', data_name |
---|
| 225 | ENDELSE |
---|
| 226 | ; |
---|
| 227 | printf, 40, 'Type of the interpolation :' |
---|
| 228 | IF keyword_set(ninterp) THEN printf, 40, ' --> bicubic' $ |
---|
| 229 | ELSE printf, 40, ' --> bilinear' |
---|
| 230 | ; |
---|